diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2f1136e..d552ccf 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 5d77204e-e413-4fd0-a14a-bad3aee2247a management: - docChecksum: f12b653820ae77ca3b2820bc9459d866 + docChecksum: 1ee2e5413af07e886e33659b9b269dd5 docVersion: 0.0.3 speakeasyVersion: 1.405.6 generationVersion: 2.428.1 - releaseVersion: 0.8.5 - configChecksum: 0397a0c86e22912a57dc87924c64e768 + releaseVersion: 0.8.7 + configChecksum: e3cfda518d4246ba14b723e905211ba5 repoURL: https://github.com/LukeHagar/plexswift.git features: swift: @@ -57,7 +57,6 @@ generatedFiles: - Sources/Plexswift/internal/models/DeleteLibraryRequest+Serialization.swift - Sources/Plexswift/internal/models/DeletePlaylistRequest+Serialization.swift - Sources/Plexswift/internal/models/Download+Serialization.swift - - Sources/Plexswift/internal/models/Features+Serialization.swift - Sources/Plexswift/internal/models/Filter+Serialization.swift - Sources/Plexswift/internal/models/FlattenSeasons+Serialization.swift - Sources/Plexswift/internal/models/Force+Serialization.swift @@ -97,6 +96,13 @@ generatedFiles: - Sources/Plexswift/internal/models/GetRefreshLibraryMetadataRequest+Serialization.swift - Sources/Plexswift/internal/models/GetResizedPhotoRequest+Serialization.swift - Sources/Plexswift/internal/models/GetResourcesStatisticsRequest+Serialization.swift + - Sources/Plexswift/internal/models/GetSearchAllLibrariesFlattenSeasons+Serialization.swift + - Sources/Plexswift/internal/models/GetSearchAllLibrariesHasThumbnail+Serialization.swift + - Sources/Plexswift/internal/models/GetSearchAllLibrariesLibraryType+Serialization.swift + - Sources/Plexswift/internal/models/GetSearchAllLibrariesOptimizedForStreaming+Serialization.swift + - Sources/Plexswift/internal/models/GetSearchAllLibrariesRequest+Serialization.swift + - Sources/Plexswift/internal/models/GetSearchAllLibrariesShowOrdering+Serialization.swift + - Sources/Plexswift/internal/models/GetSearchAllLibrariesType+Serialization.swift - Sources/Plexswift/internal/models/GetSearchLibraryQueryParamType+Serialization.swift - Sources/Plexswift/internal/models/GetSearchLibraryRequest+Serialization.swift - Sources/Plexswift/internal/models/GetSearchResultsRequest+Serialization.swift @@ -109,7 +115,6 @@ generatedFiles: - Sources/Plexswift/internal/models/GetTokenByPinIdRequest+Serialization.swift - Sources/Plexswift/internal/models/GetTokenDetailsAuthenticationResponseStatus+Serialization.swift - Sources/Plexswift/internal/models/GetTokenDetailsAuthenticationStatus+Serialization.swift - - Sources/Plexswift/internal/models/GetTokenDetailsFeatures+Serialization.swift - Sources/Plexswift/internal/models/GetTokenDetailsStatus+Serialization.swift - Sources/Plexswift/internal/models/GetTopWatchedContentQueryParamType+Serialization.swift - Sources/Plexswift/internal/models/GetTopWatchedContentRequest+Serialization.swift @@ -140,13 +145,11 @@ generatedFiles: - Sources/Plexswift/internal/models/PerformSearchRequest+Serialization.swift - Sources/Plexswift/internal/models/PerformVoiceSearchRequest+Serialization.swift - Sources/Plexswift/internal/models/PlaylistType+Serialization.swift - - Sources/Plexswift/internal/models/PostUsersSignInDataAuthenticationFeatures+Serialization.swift - Sources/Plexswift/internal/models/PostUsersSignInDataAuthenticationResponseStatus+Serialization.swift - Sources/Plexswift/internal/models/PostUsersSignInDataAuthenticationStatus+Serialization.swift - Sources/Plexswift/internal/models/PostUsersSignInDataAutoSelectSubtitle+Serialization.swift - Sources/Plexswift/internal/models/PostUsersSignInDataDefaultSubtitleAccessibility+Serialization.swift - Sources/Plexswift/internal/models/PostUsersSignInDataDefaultSubtitleForced+Serialization.swift - - Sources/Plexswift/internal/models/PostUsersSignInDataFeatures+Serialization.swift - Sources/Plexswift/internal/models/PostUsersSignInDataMailingListStatus+Serialization.swift - Sources/Plexswift/internal/models/PostUsersSignInDataMediaReviewsVisibility+Serialization.swift - Sources/Plexswift/internal/models/PostUsersSignInDataRequest+Serialization.swift @@ -157,11 +160,14 @@ generatedFiles: - Sources/Plexswift/internal/models/Protocol+Serialization.swift - Sources/Plexswift/internal/models/QueryParamFilter+Serialization.swift - Sources/Plexswift/internal/models/QueryParamForce+Serialization.swift + - Sources/Plexswift/internal/models/QueryParamIncludeCollections+Serialization.swift + - Sources/Plexswift/internal/models/QueryParamIncludeExternalMedia+Serialization.swift - Sources/Plexswift/internal/models/QueryParamIncludeMeta+Serialization.swift - Sources/Plexswift/internal/models/QueryParamOnlyTransient+Serialization.swift - Sources/Plexswift/internal/models/QueryParamSmart+Serialization.swift - Sources/Plexswift/internal/models/QueryParamType+Serialization.swift - Sources/Plexswift/internal/models/Scope+Serialization.swift + - Sources/Plexswift/internal/models/SearchTypes+Serialization.swift - Sources/Plexswift/internal/models/Security+Serialization.swift - Sources/Plexswift/internal/models/SharedServers+Serialization.swift - Sources/Plexswift/internal/models/SharedSources+Serialization.swift @@ -266,7 +272,6 @@ generatedFiles: - Sources/Plexswift/models/operations/EnablePaperTrailUnauthorized.swift - Sources/Plexswift/models/operations/Errors.swift - Sources/Plexswift/models/operations/Feature.swift - - Sources/Plexswift/models/operations/Features.swift - Sources/Plexswift/models/operations/Field.swift - Sources/Plexswift/models/operations/FieldType.swift - Sources/Plexswift/models/operations/Filter.swift @@ -279,6 +284,7 @@ generatedFiles: - Sources/Plexswift/models/operations/GetAllLibrariesDirectory.swift - Sources/Plexswift/models/operations/GetAllLibrariesErrors.swift - Sources/Plexswift/models/operations/GetAllLibrariesLibraryErrors.swift + - Sources/Plexswift/models/operations/GetAllLibrariesLocation.swift - Sources/Plexswift/models/operations/GetAllLibrariesMediaContainer.swift - Sources/Plexswift/models/operations/GetAllLibrariesResponse.swift - Sources/Plexswift/models/operations/GetAllLibrariesResponseBody.swift @@ -408,6 +414,7 @@ generatedFiles: - Sources/Plexswift/models/operations/GetLibraryItemsLibraryResponseType.swift - Sources/Plexswift/models/operations/GetLibraryItemsLibrarySort.swift - Sources/Plexswift/models/operations/GetLibraryItemsLibraryType.swift + - Sources/Plexswift/models/operations/GetLibraryItemsLocation.swift - Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift - Sources/Plexswift/models/operations/GetLibraryItemsMediaContainer.swift - Sources/Plexswift/models/operations/GetLibraryItemsMediaGuid.swift @@ -578,6 +585,35 @@ generatedFiles: - Sources/Plexswift/models/operations/GetResourcesStatisticsResponseBody.swift - Sources/Plexswift/models/operations/GetResourcesStatisticsStatisticsErrors.swift - Sources/Plexswift/models/operations/GetResourcesStatisticsUnauthorized.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesBadRequest.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesCollection.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesCountry.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesDirector.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesErrors.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesFlattenSeasons.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesGenre.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesHasThumbnail.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesImage.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesLibraryErrors.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesLibraryType.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesLocation.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesMedia.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesMediaContainer.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesMediaGuid.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesMetaDataRating.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesMetadata.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesOptimizedForStreaming.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesPart.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesRequest.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesResponse.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesResponseBody.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesRole.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesShowOrdering.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesStream.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesType.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesUltraBlurColors.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesUnauthorized.swift + - Sources/Plexswift/models/operations/GetSearchAllLibrariesWriter.swift - Sources/Plexswift/models/operations/GetSearchLibraryBadRequest.swift - Sources/Plexswift/models/operations/GetSearchLibraryErrors.swift - Sources/Plexswift/models/operations/GetSearchLibraryLibraryErrors.swift @@ -702,7 +738,6 @@ generatedFiles: - Sources/Plexswift/models/operations/GetTokenDetailsAuthenticationStatus.swift - Sources/Plexswift/models/operations/GetTokenDetailsBadRequest.swift - Sources/Plexswift/models/operations/GetTokenDetailsErrors.swift - - Sources/Plexswift/models/operations/GetTokenDetailsFeatures.swift - Sources/Plexswift/models/operations/GetTokenDetailsResponse.swift - Sources/Plexswift/models/operations/GetTokenDetailsStatus.swift - Sources/Plexswift/models/operations/GetTokenDetailsSubscription.swift @@ -828,7 +863,6 @@ generatedFiles: - Sources/Plexswift/models/operations/PlaylistType.swift - Sources/Plexswift/models/operations/PlexDevice.swift - Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationErrors.swift - - Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationFeatures.swift - Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationResponseStatus.swift - Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationStatus.swift - Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationSubscription.swift @@ -837,7 +871,6 @@ generatedFiles: - Sources/Plexswift/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.swift - Sources/Plexswift/models/operations/PostUsersSignInDataDefaultSubtitleForced.swift - Sources/Plexswift/models/operations/PostUsersSignInDataErrors.swift - - Sources/Plexswift/models/operations/PostUsersSignInDataFeatures.swift - Sources/Plexswift/models/operations/PostUsersSignInDataMailingListStatus.swift - Sources/Plexswift/models/operations/PostUsersSignInDataMediaReviewsVisibility.swift - Sources/Plexswift/models/operations/PostUsersSignInDataRequest.swift @@ -856,6 +889,8 @@ generatedFiles: - Sources/Plexswift/models/operations/Provider.swift - Sources/Plexswift/models/operations/QueryParamFilter.swift - Sources/Plexswift/models/operations/QueryParamForce.swift + - Sources/Plexswift/models/operations/QueryParamIncludeCollections.swift + - Sources/Plexswift/models/operations/QueryParamIncludeExternalMedia.swift - Sources/Plexswift/models/operations/QueryParamIncludeMeta.swift - Sources/Plexswift/models/operations/QueryParamOnlyTransient.swift - Sources/Plexswift/models/operations/QueryParamSmart.swift @@ -865,6 +900,8 @@ generatedFiles: - Sources/Plexswift/models/operations/ResponseBody.swift - Sources/Plexswift/models/operations/Role.swift - Sources/Plexswift/models/operations/Scope.swift + - Sources/Plexswift/models/operations/SearchResult.swift + - Sources/Plexswift/models/operations/SearchTypes.swift - Sources/Plexswift/models/operations/Server.swift - Sources/Plexswift/models/operations/Services.swift - Sources/Plexswift/models/operations/Session.swift @@ -1086,6 +1123,8 @@ examples: minSize: 1 upscale: 1 width: 396 + header: + X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" responses: "200": image/jpeg: "0xE5A1092305" @@ -1156,7 +1195,7 @@ examples: type: 2 responses: "200": - application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}], "size": 70, "totalSize": 170, "offset": 0, "content": "secondary", "allowSync": true, "nocache": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1701731894, "thumb": "/:/resources/movie.png", "title1": "Movies", "title2": "Recently Released", "viewGroup": "movie", "viewMode": 65592, "mixedParents": true, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}, {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}], "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [], "Sort": [], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}]}}} + application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}], "size": 70, "totalSize": 170, "offset": 0, "content": "secondary", "allowSync": true, "nocache": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1701731894, "thumb": "/:/resources/movie.png", "title1": "Movies", "title2": "Recently Released", "viewGroup": "movie", "viewMode": 65592, "mixedParents": true, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}, {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}], "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [], "Sort": [], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}]}}} "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": @@ -1166,6 +1205,8 @@ examples: parameters: query: X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" + header: + X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" responses: "200": application/json: {"MediaContainer": {"MediaProvider": [{"Feature": [{"type": "", "flavor": "global", "scrobbleKey": "/:/scrobble/new", "unscrobbleKey": "/:/unscrobble/new", "Action": []}, {"type": "", "flavor": "global", "scrobbleKey": "/:/scrobble/new", "unscrobbleKey": "/:/unscrobble/new", "Action": [{"id": "addToContinueWatching", "key": "/actions/addToContinueWatching"}, {"id": "addToContinueWatching", "key": "/actions/addToContinueWatching"}]}, {"type": "", "flavor": "global", "scrobbleKey": "/:/scrobble/new", "unscrobbleKey": "/:/unscrobble/new", "Action": [{"id": "addToContinueWatching", "key": "/actions/addToContinueWatching"}, {"id": "addToContinueWatching", "key": "/actions/addToContinueWatching"}]}]}]}} @@ -1197,7 +1238,7 @@ examples: type: 2 responses: "200": - application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}, {"type": "tag", "Operator": []}]}, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [], "Collection": [], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}]}} + application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}, {"type": "tag", "Operator": []}]}, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [], "Collection": [], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}]}} get-recently-added-library: speakeasy-default-get-recently-added-library: parameters: @@ -1264,6 +1305,21 @@ examples: application/json: {"errors": []} "401": application/json: {"errors": []} + "": + parameters: + query: + includeHttps: 1 + includeRelay: 1 + includeIPv6: 1 + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + responses: + "200": + application/json: [] + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + "401": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} get-thumb-image: speakeasy-default-get-thumb-image: parameters: @@ -1275,6 +1331,8 @@ examples: minSize: 1 upscale: 1 width: 396 + header: + X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" responses: "200": image/jpeg: "0x4f576BaCaA" @@ -1291,6 +1349,8 @@ examples: X-Plex-Container-Size: 50 X-Plex-Container-Start: 0 X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" + header: + X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" responses: "200": {} "400": @@ -1462,6 +1522,12 @@ examples: X-Plex-Platform: "Chrome" X-Plex-Product: "Plex Web" X-Plex-Version: "4.133.0" + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" responses: "200": application/json: @@ -1761,6 +1827,12 @@ examples: X-Plex-Platform: "Chrome" X-Plex-Product: "Plex Web" X-Plex-Version: "4.133.0" + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" responses: "404": application/json: {"errors": [{"code": 1020, "message": "Code not found or expired"}]} @@ -1896,6 +1968,12 @@ examples: X-Plex-Platform: "Chrome" X-Plex-Product: "Plex Web" X-Plex-Version: "4.133.0" + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" requestBody: application/x-www-form-urlencoded: {"login": "username@email.com", "password": "password123", "verificationCode": "123456"} responses: @@ -2116,3 +2194,20 @@ examples: application/json: {"errors": []} "401": application/json: {"errors": []} + get-search-all-libraries: + "": + parameters: + query: + query: "" + searchTypes: ["people"] + includeCollections: 1 + includeExternalMedia: 1 + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + responses: + "200": + application/json: {"MediaContainer": {"size": "9266.90", "SearchResult": [{"score": "2698.71", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}, {"score": "9681.40", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [], "Genre": [], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}, {"score": "1665.12", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}]}} + "400": + application/json: {"errors": []} + "401": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 4938988..d3190c6 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true swift: - version: 0.8.5 + version: 0.8.7 author: LukeHagar description: Swift Client SDK Generated by Speakeasy imports: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1a2e948..caba0da 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -9,8 +9,8 @@ sources: - main plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:c52cde0b8d51e160f7b9f1a3d3ea4dbb1aca6d5caad714e549201fb757fadd57 - sourceBlobDigest: sha256:f417b03ff71356808554313f24c3d06d670474bf51bc9a0631de1ad49c13a361 + sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e + sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b tags: - latest - main @@ -18,10 +18,10 @@ targets: plexswift: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:c52cde0b8d51e160f7b9f1a3d3ea4dbb1aca6d5caad714e549201fb757fadd57 - sourceBlobDigest: sha256:f417b03ff71356808554313f24c3d06d670474bf51bc9a0631de1ad49c13a361 + sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e + sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b codeSamplesNamespace: code-samples-swift-plexswift - codeSamplesRevisionDigest: sha256:e46cddd9caae008aee2ea7b63b667fea012731501716d7a7e36f646135ab9e20 + codeSamplesRevisionDigest: sha256:ceb91e4d90a11c0893bbeda90ab2c216f3d5575443f3ea243225243646ef2d9b workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index b1ae1a4..05c24d5 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,6 @@ The following SDKs are generated from the OpenAPI Specification. They are automa * [SDK Installation](#sdk-installation) * [SDK Example Usage](#sdk-example-usage) * [Available Resources and Operations](#available-resources-and-operations) -* [Global Parameters](#global-parameters) * [Authentication](#authentication) @@ -63,7 +62,7 @@ You can add `plexswift` to your project directly in Xcode `(File > Add Packages. ```bash dependencies: [ - .package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.8.5")) + .package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.8.7")) ] ``` @@ -141,6 +140,7 @@ case .empty: * [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items * [getRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library * [getSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library +* [getSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries * [getMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey * [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children * [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content @@ -271,61 +271,6 @@ case .empty: ``` - -## Global Parameters - -Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed. - -For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. - - -### Available Globals - -The following global parameters are available. - -| Name | Type | Required | Description | -| ---- | ---- |:--------:| ----------- | -| clientID | String | | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) | -| clientName | String | | The clientName parameter. | -| clientVersion | String | | The clientVersion parameter. | -| clientPlatform | String | | The clientPlatform parameter. | -| deviceName | String | | The deviceName parameter. | - - -### Example - -```swift -import Foundation -import Plexswift - -let client = Client(security: .accessToken("")) - -let response = try await client.plex.getServerResources( - request: Operations.GetServerResourcesRequest( - includeHttps: .enable, - includeIPv6: .enable, - includeRelay: .enable - ) -) - -switch response.data { -case .plexDevices(let plexDevices): - // Handle response - break -case .badRequest(let badRequest): - // Handle response - break -case .unauthorized(let unauthorized): - // Handle response - break -case .empty: - // Handle empty response - break -} - -``` - - # Development diff --git a/RELEASES.md b/RELEASES.md index 7b0cd09..cd899c9 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -732,4 +732,14 @@ Based on: ### Generated - [swift v0.8.5] . ### Releases -- [Swift Package Manager v0.8.5] https://github.com/LukeHagar/plexswift/releases/tag/v0.8.5 - . \ No newline at end of file +- [Swift Package Manager v0.8.5] https://github.com/LukeHagar/plexswift/releases/tag/v0.8.5 - . + +## 2024-10-03 00:08:00 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.406.0 (2.429.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [swift v0.8.7] . +### Releases +- [Swift Package Manager v0.8.7] https://github.com/LukeHagar/plexswift/releases/tag/v0.8.7 - . \ No newline at end of file diff --git a/Sources/Plexswift/Plexswift.docc/Plexswift.md b/Sources/Plexswift/Plexswift.docc/Plexswift.md index 63a5d22..86534f7 100644 --- a/Sources/Plexswift/Plexswift.docc/Plexswift.md +++ b/Sources/Plexswift/Plexswift.docc/Plexswift.md @@ -23,7 +23,7 @@ The following SDKs are generated from the OpenAPI Specification. They are automa | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | -| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - +| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - `plexswift` is a Swift library which provides functionality for making requests to the API using a modern, easy-to-use Swift API: @@ -125,6 +125,7 @@ case .empty: - ``Operations/GetMetaDataByRatingKeyBadRequest`` - ``Operations/GetRecentlyAddedLibraryBadRequest`` - ``Operations/GetRefreshLibraryMetadataBadRequest`` +- ``Operations/GetSearchAllLibrariesBadRequest`` - ``Operations/GetSearchLibraryBadRequest`` - ``Operations/GetServerResourcesBadRequest`` - ``Operations/GetThumbImageBadRequest`` @@ -201,6 +202,7 @@ case .empty: - ``Operations/GetRecentlyAddedResponse`` - ``Operations/GetRecentlyAddedLibraryResponse`` - ``Operations/GetRefreshLibraryMetadataResponse`` +- ``Operations/GetSearchAllLibrariesResponse`` - ``Operations/GetSearchLibraryResponse`` - ``Operations/GetServerIdentityResponse`` - ``Operations/GetServerResourcesResponse`` @@ -323,7 +325,6 @@ case .empty: - ``Operations/EnablePaperTrailUnauthorized`` - ``Operations/Errors`` - ``Operations/Feature`` -- ``Operations/Features`` - ``Operations/Field`` - ``Operations/FieldType`` - ``Operations/Filter`` @@ -335,6 +336,7 @@ case .empty: - ``Operations/GetAllLibrariesDirectory`` - ``Operations/GetAllLibrariesErrors`` - ``Operations/GetAllLibrariesLibraryErrors`` +- ``Operations/GetAllLibrariesLocation`` - ``Operations/GetAllLibrariesMediaContainer`` - ``Operations/GetAllLibrariesResponseBody`` - ``Operations/GetAllLibrariesUnauthorized`` @@ -379,6 +381,7 @@ case .empty: - ``Operations/GetLibraryItemsLibraryResponseType`` - ``Operations/GetLibraryItemsLibrarySort`` - ``Operations/GetLibraryItemsLibraryType`` +- ``Operations/GetLibraryItemsLocation`` - ``Operations/GetLibraryItemsMedia`` - ``Operations/GetLibraryItemsMediaContainer`` - ``Operations/GetLibraryItemsMediaGuid`` @@ -457,6 +460,33 @@ case .empty: - ``Operations/GetRefreshLibraryMetadataLibraryErrors`` - ``Operations/GetRefreshLibraryMetadataRequest`` - ``Operations/GetRefreshLibraryMetadataUnauthorized`` +- ``Operations/GetSearchAllLibrariesCollection`` +- ``Operations/GetSearchAllLibrariesCountry`` +- ``Operations/GetSearchAllLibrariesDirector`` +- ``Operations/GetSearchAllLibrariesErrors`` +- ``Operations/GetSearchAllLibrariesFlattenSeasons`` +- ``Operations/GetSearchAllLibrariesGenre`` +- ``Operations/GetSearchAllLibrariesHasThumbnail`` +- ``Operations/GetSearchAllLibrariesImage`` +- ``Operations/GetSearchAllLibrariesLibraryErrors`` +- ``Operations/GetSearchAllLibrariesLibraryType`` +- ``Operations/GetSearchAllLibrariesLocation`` +- ``Operations/GetSearchAllLibrariesMedia`` +- ``Operations/GetSearchAllLibrariesMediaContainer`` +- ``Operations/GetSearchAllLibrariesMediaGuid`` +- ``Operations/GetSearchAllLibrariesMetadata`` +- ``Operations/GetSearchAllLibrariesMetaDataRating`` +- ``Operations/GetSearchAllLibrariesOptimizedForStreaming`` +- ``Operations/GetSearchAllLibrariesPart`` +- ``Operations/GetSearchAllLibrariesRequest`` +- ``Operations/GetSearchAllLibrariesResponseBody`` +- ``Operations/GetSearchAllLibrariesRole`` +- ``Operations/GetSearchAllLibrariesShowOrdering`` +- ``Operations/GetSearchAllLibrariesStream`` +- ``Operations/GetSearchAllLibrariesType`` +- ``Operations/GetSearchAllLibrariesUltraBlurColors`` +- ``Operations/GetSearchAllLibrariesUnauthorized`` +- ``Operations/GetSearchAllLibrariesWriter`` - ``Operations/GetSearchLibraryErrors`` - ``Operations/GetSearchLibraryLibraryErrors`` - ``Operations/GetSearchLibraryMediaContainer`` @@ -679,7 +709,6 @@ case .empty: - ``Operations/GetTokenDetailsAuthenticationResponseStatus`` - ``Operations/GetTokenDetailsAuthenticationStatus`` - ``Operations/GetTokenDetailsErrors`` -- ``Operations/GetTokenDetailsFeatures`` - ``Operations/GetTokenDetailsStatus`` - ``Operations/GetTokenDetailsSubscription`` - ``Operations/GetTokenDetailsUnauthorized`` @@ -775,7 +804,6 @@ case .empty: - ``Operations/PlaylistType`` - ``Operations/PlexDevice`` - ``Operations/PostUsersSignInDataAuthenticationErrors`` -- ``Operations/PostUsersSignInDataAuthenticationFeatures`` - ``Operations/PostUsersSignInDataAuthenticationResponseStatus`` - ``Operations/PostUsersSignInDataAuthenticationStatus`` - ``Operations/PostUsersSignInDataAuthenticationSubscription`` @@ -783,7 +811,6 @@ case .empty: - ``Operations/PostUsersSignInDataDefaultSubtitleAccessibility`` - ``Operations/PostUsersSignInDataDefaultSubtitleForced`` - ``Operations/PostUsersSignInDataErrors`` -- ``Operations/PostUsersSignInDataFeatures`` - ``Operations/PostUsersSignInDataMailingListStatus`` - ``Operations/PostUsersSignInDataMediaReviewsVisibility`` - ``Operations/PostUsersSignInDataRequest`` @@ -801,6 +828,8 @@ case .empty: - ``Operations/Provider`` - ``Operations/QueryParamFilter`` - ``Operations/QueryParamForce`` +- ``Operations/QueryParamIncludeCollections`` +- ``Operations/QueryParamIncludeExternalMedia`` - ``Operations/QueryParamIncludeMeta`` - ``Operations/QueryParamOnlyTransient`` - ``Operations/QueryParamSmart`` @@ -810,6 +839,8 @@ case .empty: - ``Operations/ResponseBody`` - ``Operations/Role`` - ``Operations/Scope`` +- ``Operations/SearchResult`` +- ``Operations/SearchTypes`` - ``Operations/Server`` - ``Operations/Services`` - ``Operations/Session`` diff --git a/Sources/Plexswift/configuration/GlobalParameters.swift b/Sources/Plexswift/configuration/GlobalParameters.swift index 3764d1c..ba13bf9 100644 --- a/Sources/Plexswift/configuration/GlobalParameters.swift +++ b/Sources/Plexswift/configuration/GlobalParameters.swift @@ -9,25 +9,29 @@ public struct GlobalParameters { public let clientID: String? public let clientName: String? public let clientVersion: String? - public let clientPlatform: String? - public let deviceName: String? + public let platform: String? + public let deviceNickname: String? /// Creates an object with the given parameters /// - /// - Parameter clientID: The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + /// - Parameter clientID: An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + /// - Parameter clientName: The name of the client application. (Plex Web, Plex Media Server, etc.) + /// - Parameter clientVersion: The version of the client application. + /// - Parameter deviceNickname: A relatively friendly name for the client device + /// - Parameter platform: The platform of the client application. /// public init( clientID: String? = nil, clientName: String? = nil, clientVersion: String? = nil, - clientPlatform: String? = nil, - deviceName: String? = nil + platform: String? = nil, + deviceNickname: String? = nil ) { self.clientID = clientID self.clientName = clientName self.clientVersion = clientVersion - self.clientPlatform = clientPlatform - self.deviceName = deviceName + self.platform = platform + self.deviceNickname = deviceNickname } } @@ -40,11 +44,6 @@ extension GlobalParameters: ParameterDefaults { public func defaultQueryParameter(for key: String) -> AnyValue? { switch key { - case "ClientID": return clientID.map { AnyValue($0) } - case "ClientName": return clientName.map { AnyValue($0) } - case "ClientVersion": return clientVersion.map { AnyValue($0) } - case "ClientPlatform": return clientPlatform.map { AnyValue($0) } - case "DeviceName": return deviceName.map { AnyValue($0) } default: return nil } } diff --git a/Sources/Plexswift/internal/api/_AuthenticationAPI.swift b/Sources/Plexswift/internal/api/_AuthenticationAPI.swift index a04b2dc..d187e86 100644 --- a/Sources/Plexswift/internal/api/_AuthenticationAPI.swift +++ b/Sources/Plexswift/internal/api/_AuthenticationAPI.swift @@ -75,7 +75,7 @@ private func configureGetTokenDetailsRequest(with configuration: URLRequestConfi private func configurePostUsersSignInDataRequest(with configuration: URLRequestConfiguration, request: Operations.PostUsersSignInDataRequest) throws { configuration.path = "/users/signin" configuration.method = .post - configuration.queryParameterSerializable = request + configuration.headerParameterSerializable = request configuration.contentType = "application/x-www-form-urlencoded" configuration.body = try serializeFormData(with: request.requestBody) configuration.telemetryHeader = .userAgent diff --git a/Sources/Plexswift/internal/api/_LibraryAPI.swift b/Sources/Plexswift/internal/api/_LibraryAPI.swift index 4b715c9..df8663e 100644 --- a/Sources/Plexswift/internal/api/_LibraryAPI.swift +++ b/Sources/Plexswift/internal/api/_LibraryAPI.swift @@ -82,6 +82,15 @@ class _LibraryAPI: LibraryAPI { ) } + public func getSearchAllLibraries(request: Operations.GetSearchAllLibrariesRequest) async throws -> Response { + return try await client.makeRequest( + configureRequest: { configuration in + try configureGetSearchAllLibrariesRequest(with: configuration, request: request) + }, + handleResponse: handleGetSearchAllLibrariesResponse + ) + } + public func getMetaDataByRatingKey(request: Operations.GetMetaDataByRatingKeyRequest) async throws -> Response { return try await client.makeRequest( configureRequest: { configuration in @@ -181,6 +190,14 @@ private func configureGetSearchLibraryRequest(with configuration: URLRequestConf configuration.telemetryHeader = .userAgent } +private func configureGetSearchAllLibrariesRequest(with configuration: URLRequestConfiguration, request: Operations.GetSearchAllLibrariesRequest) throws { + configuration.path = "/library/search" + configuration.method = .get + configuration.queryParameterSerializable = request + configuration.headerParameterSerializable = request + configuration.telemetryHeader = .userAgent +} + private func configureGetMetaDataByRatingKeyRequest(with configuration: URLRequestConfiguration, request: Operations.GetMetaDataByRatingKeyRequest) throws { configuration.path = "/library/metadata/{ratingKey}" configuration.method = .get @@ -449,6 +466,38 @@ private func handleGetSearchLibraryResponse(response: Client.APIResponse) throws return .empty } +private func handleGetSearchAllLibrariesResponse(response: Client.APIResponse) throws -> Operations.GetSearchAllLibrariesResponse { + let httpResponse = response.httpResponse + + if httpResponse.statusCode == 200 { + if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data { + do { + return .object(try JSONDecoder().decode(Operations.GetSearchAllLibrariesResponseBody.self, from: data)) + } catch { + throw ResponseHandlerError.failedToDecodeJSON(error) + } + } + } else if httpResponse.statusCode == 400 { + if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data { + do { + return .badRequest(try JSONDecoder().decode(Operations.GetSearchAllLibrariesBadRequest.self, from: data)) + } catch { + throw ResponseHandlerError.failedToDecodeJSON(error) + } + } + } else if httpResponse.statusCode == 401 { + if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data { + do { + return .unauthorized(try JSONDecoder().decode(Operations.GetSearchAllLibrariesUnauthorized.self, from: data)) + } catch { + throw ResponseHandlerError.failedToDecodeJSON(error) + } + } + } + + return .empty +} + private func handleGetMetaDataByRatingKeyResponse(response: Client.APIResponse) throws -> Operations.GetMetaDataByRatingKeyResponse { let httpResponse = response.httpResponse diff --git a/Sources/Plexswift/internal/api/_MediaAPI.swift b/Sources/Plexswift/internal/api/_MediaAPI.swift index 9b34c29..ee6d89d 100644 --- a/Sources/Plexswift/internal/api/_MediaAPI.swift +++ b/Sources/Plexswift/internal/api/_MediaAPI.swift @@ -85,6 +85,7 @@ private func configureGetBannerImageRequest(with configuration: URLRequestConfig configuration.method = .get configuration.pathParameterSerializable = request configuration.queryParameterSerializable = request + configuration.headerParameterSerializable = request configuration.telemetryHeader = .userAgent } @@ -93,6 +94,7 @@ private func configureGetThumbImageRequest(with configuration: URLRequestConfigu configuration.method = .get configuration.pathParameterSerializable = request configuration.queryParameterSerializable = request + configuration.headerParameterSerializable = request configuration.telemetryHeader = .userAgent } diff --git a/Sources/Plexswift/internal/api/_PlexAPI.swift b/Sources/Plexswift/internal/api/_PlexAPI.swift index 40da6db..337ff30 100644 --- a/Sources/Plexswift/internal/api/_PlexAPI.swift +++ b/Sources/Plexswift/internal/api/_PlexAPI.swift @@ -111,6 +111,7 @@ private func configureGetServerResourcesRequest(with configuration: URLRequestCo configuration.path = "/resources" configuration.method = .get configuration.queryParameterSerializable = request + configuration.headerParameterSerializable = request configuration.telemetryHeader = .userAgent } @@ -118,6 +119,7 @@ private func configureGetPinRequest(with configuration: URLRequestConfiguration, configuration.path = "/pins" configuration.method = .post configuration.queryParameterSerializable = request + configuration.headerParameterSerializable = request configuration.telemetryHeader = .userAgent } @@ -125,7 +127,7 @@ private func configureGetTokenByPinIdRequest(with configuration: URLRequestConfi configuration.path = "/pins/{pinID}" configuration.method = .get configuration.pathParameterSerializable = request - configuration.queryParameterSerializable = request + configuration.headerParameterSerializable = request configuration.telemetryHeader = .userAgent } diff --git a/Sources/Plexswift/internal/api/_ServerAPI.swift b/Sources/Plexswift/internal/api/_ServerAPI.swift index 6640bf4..a3673de 100644 --- a/Sources/Plexswift/internal/api/_ServerAPI.swift +++ b/Sources/Plexswift/internal/api/_ServerAPI.swift @@ -141,7 +141,7 @@ private func configureGetResizedPhotoRequest(with configuration: URLRequestConfi private func configureGetMediaProvidersRequest(with configuration: URLRequestConfiguration, request: Operations.GetMediaProvidersRequest) throws { configuration.path = "/media/providers" configuration.method = .get - configuration.queryParameterSerializable = request + configuration.headerParameterSerializable = request configuration.telemetryHeader = .userAgent } diff --git a/Sources/Plexswift/internal/api/_WatchlistAPI.swift b/Sources/Plexswift/internal/api/_WatchlistAPI.swift index 8c469f0..043822f 100644 --- a/Sources/Plexswift/internal/api/_WatchlistAPI.swift +++ b/Sources/Plexswift/internal/api/_WatchlistAPI.swift @@ -29,6 +29,7 @@ private func configureGetWatchListRequest(with configuration: URLRequestConfigur configuration.method = .get configuration.pathParameterSerializable = request configuration.queryParameterSerializable = request + configuration.headerParameterSerializable = request configuration.telemetryHeader = .userAgent } diff --git a/Sources/Plexswift/internal/models/GetBannerImageRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetBannerImageRequest+Serialization.swift index b765a5f..75ac2e3 100644 --- a/Sources/Plexswift/internal/models/GetBannerImageRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetBannerImageRequest+Serialization.swift @@ -10,7 +10,9 @@ extension Operations.GetBannerImageRequest: Serializable { return try serializePathParameterSerializable(self, with: format) case .query: return try serializeQueryParameterSerializable(self, with: format) - case .header, .multipart, .form: + case .header: + return serializeModel(with: try serializedHeaderParameters(), format: format) + case .multipart, .form: throw SerializationError.invalidSerializationParameter(type: "Operations.GetBannerImageRequest", format: format.formatDescription) } } @@ -35,7 +37,14 @@ extension Operations.GetBannerImageRequest: QueryParameterSerializable { try builder.addQueryParameters(from: minSize, named: "minSize", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: upscale, named: "upscale", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: width, named: "width", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: xPlexToken, named: "X-Plex-Token", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) return builder.build() } } + +extension Operations.GetBannerImageRequest: HeaderParameterSerializable { + func serializedHeaderParameters() throws -> [SerializedParameter] { + return [ + SerializedParameter(name: "X-Plex-Token", serialized: try xPlexToken.serialize(with: .header(explode: false))) + ] + } +} diff --git a/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift index f324f22..c2119b3 100644 --- a/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift @@ -23,8 +23,8 @@ extension Operations.GetLibraryItemsRequest: Serializable { extension Operations.GetLibraryItemsRequest: PathParameterSerializable { func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] { return [ - "sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)), "tag": try tag.serialize(with: formatOverride ?? .path(explode: false)), + "sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)), ].compactMapValues { $0 } } } diff --git a/Sources/Plexswift/internal/models/GetMediaProvidersRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetMediaProvidersRequest+Serialization.swift index 47db293..62804f2 100644 --- a/Sources/Plexswift/internal/models/GetMediaProvidersRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetMediaProvidersRequest+Serialization.swift @@ -6,22 +6,18 @@ import Foundation extension Operations.GetMediaProvidersRequest: Serializable { func serialize(with format: SerializableFormat) throws -> String { switch format { - case .query: - return try serializeQueryParameterSerializable(self, with: format) - case .path, .header, .multipart, .form: + case .header: + return serializeModel(with: try serializedHeaderParameters(), format: format) + case .path, .query, .multipart, .form: throw SerializationError.invalidSerializationParameter(type: "Operations.GetMediaProvidersRequest", format: format.formatDescription) } } - - func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { - return try serializedQueryParameters(with: nil, formatOverride: format) - } } -extension Operations.GetMediaProvidersRequest: QueryParameterSerializable { - func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] { - let builder = QueryParameterBuilder() - try builder.addQueryParameters(from: xPlexToken, named: "X-Plex-Token", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - return builder.build() +extension Operations.GetMediaProvidersRequest: HeaderParameterSerializable { + func serializedHeaderParameters() throws -> [SerializedParameter] { + return [ + SerializedParameter(name: "X-Plex-Token", serialized: try xPlexToken.serialize(with: .header(explode: false))) + ] } } diff --git a/Sources/Plexswift/internal/models/GetPinRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetPinRequest+Serialization.swift index 7093e67..1f3cd99 100644 --- a/Sources/Plexswift/internal/models/GetPinRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetPinRequest+Serialization.swift @@ -8,7 +8,9 @@ extension Operations.GetPinRequest: Serializable { switch format { case .query: return try serializeQueryParameterSerializable(self, with: format) - case .path, .header, .multipart, .form: + case .header: + return serializeModel(with: try serializedHeaderParameters(), format: format) + case .path, .multipart, .form: throw SerializationError.invalidSerializationParameter(type: "Operations.GetPinRequest", format: format.formatDescription) } } @@ -21,12 +23,19 @@ extension Operations.GetPinRequest: Serializable { extension Operations.GetPinRequest: QueryParameterSerializable { func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] { let builder = QueryParameterBuilder() - try builder.addQueryParameters(from: clientID, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: clientName, named: "X-Plex-Product", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: clientPlatform, named: "X-Plex-Platform", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: clientVersion, named: "X-Plex-Version", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: deviceName, named: "X-Plex-Device", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: strong, named: "strong", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) return builder.build() } } + +extension Operations.GetPinRequest: HeaderParameterSerializable { + func serializedHeaderParameters() throws -> [SerializedParameter] { + return [ + SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try clientID?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Product", serialized: try clientName?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Version", serialized: try clientVersion?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Device", serialized: try deviceNickname?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Platform", serialized: try platform?.serialize(with: .header(explode: false))) + ] + } +} diff --git a/Sources/Plexswift/internal/models/PostUsersSignInDataAuthenticationFeatures+Serialization.swift b/Sources/Plexswift/internal/models/GetSearchAllLibrariesFlattenSeasons+Serialization.swift similarity index 83% rename from Sources/Plexswift/internal/models/PostUsersSignInDataAuthenticationFeatures+Serialization.swift rename to Sources/Plexswift/internal/models/GetSearchAllLibrariesFlattenSeasons+Serialization.swift index c1bd3c9..8e0f0a1 100644 --- a/Sources/Plexswift/internal/models/PostUsersSignInDataAuthenticationFeatures+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetSearchAllLibrariesFlattenSeasons+Serialization.swift @@ -3,7 +3,7 @@ import Foundation -extension Operations.PostUsersSignInDataAuthenticationFeatures: Serializable { +extension Operations.GetSearchAllLibrariesFlattenSeasons: Serializable { func serialize(with format: SerializableFormat) throws -> String { return try rawValue.serialize(with: format) } diff --git a/Sources/Plexswift/internal/models/GetSearchAllLibrariesHasThumbnail+Serialization.swift b/Sources/Plexswift/internal/models/GetSearchAllLibrariesHasThumbnail+Serialization.swift new file mode 100644 index 0000000..c7fb8c3 --- /dev/null +++ b/Sources/Plexswift/internal/models/GetSearchAllLibrariesHasThumbnail+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.GetSearchAllLibrariesHasThumbnail: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/GetSearchAllLibrariesLibraryType+Serialization.swift b/Sources/Plexswift/internal/models/GetSearchAllLibrariesLibraryType+Serialization.swift new file mode 100644 index 0000000..85f8ef8 --- /dev/null +++ b/Sources/Plexswift/internal/models/GetSearchAllLibrariesLibraryType+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.GetSearchAllLibrariesLibraryType: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/GetSearchAllLibrariesOptimizedForStreaming+Serialization.swift b/Sources/Plexswift/internal/models/GetSearchAllLibrariesOptimizedForStreaming+Serialization.swift new file mode 100644 index 0000000..c2ad6df --- /dev/null +++ b/Sources/Plexswift/internal/models/GetSearchAllLibrariesOptimizedForStreaming+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.GetSearchAllLibrariesOptimizedForStreaming: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/GetSearchAllLibrariesRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetSearchAllLibrariesRequest+Serialization.swift new file mode 100644 index 0000000..31c2705 --- /dev/null +++ b/Sources/Plexswift/internal/models/GetSearchAllLibrariesRequest+Serialization.swift @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.GetSearchAllLibrariesRequest: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + switch format { + case .query: + return try serializeQueryParameterSerializable(self, with: format) + case .header: + return serializeModel(with: try serializedHeaderParameters(), format: format) + case .path, .multipart, .form: + throw SerializationError.invalidSerializationParameter(type: "Operations.GetSearchAllLibrariesRequest", format: format.formatDescription) + } + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return try serializedQueryParameters(with: nil, formatOverride: format) + } +} + +extension Operations.GetSearchAllLibrariesRequest: QueryParameterSerializable { + func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] { + let builder = QueryParameterBuilder() + try builder.addQueryParameters(from: query, named: "query", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) + try builder.addQueryParameters(from: includeCollections, named: "includeCollections", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) + try builder.addQueryParameters(from: includeExternalMedia, named: "includeExternalMedia", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) + try builder.addQueryParameters(from: limit, named: "limit", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) + try builder.addQueryParameters(from: searchTypes, named: "searchTypes", format: formatOverride ?? .query(style: .form, explode: false), parameterDefaults: parameterDefaults) + return builder.build() + } +} + +extension Operations.GetSearchAllLibrariesRequest: HeaderParameterSerializable { + func serializedHeaderParameters() throws -> [SerializedParameter] { + return [ + SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try clientID?.serialize(with: .header(explode: false))) + ] + } +} diff --git a/Sources/Plexswift/internal/models/GetSearchAllLibrariesShowOrdering+Serialization.swift b/Sources/Plexswift/internal/models/GetSearchAllLibrariesShowOrdering+Serialization.swift new file mode 100644 index 0000000..5b85477 --- /dev/null +++ b/Sources/Plexswift/internal/models/GetSearchAllLibrariesShowOrdering+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.GetSearchAllLibrariesShowOrdering: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/GetTokenDetailsFeatures+Serialization.swift b/Sources/Plexswift/internal/models/GetSearchAllLibrariesType+Serialization.swift similarity index 86% rename from Sources/Plexswift/internal/models/GetTokenDetailsFeatures+Serialization.swift rename to Sources/Plexswift/internal/models/GetSearchAllLibrariesType+Serialization.swift index 056db80..12a77a3 100644 --- a/Sources/Plexswift/internal/models/GetTokenDetailsFeatures+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetSearchAllLibrariesType+Serialization.swift @@ -3,7 +3,7 @@ import Foundation -extension Operations.GetTokenDetailsFeatures: Serializable { +extension Operations.GetSearchAllLibrariesType: Serializable { func serialize(with format: SerializableFormat) throws -> String { return try rawValue.serialize(with: format) } diff --git a/Sources/Plexswift/internal/models/GetServerResourcesRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetServerResourcesRequest+Serialization.swift index ff15f5b..7cf2361 100644 --- a/Sources/Plexswift/internal/models/GetServerResourcesRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetServerResourcesRequest+Serialization.swift @@ -8,7 +8,9 @@ extension Operations.GetServerResourcesRequest: Serializable { switch format { case .query: return try serializeQueryParameterSerializable(self, with: format) - case .path, .header, .multipart, .form: + case .header: + return serializeModel(with: try serializedHeaderParameters(), format: format) + case .path, .multipart, .form: throw SerializationError.invalidSerializationParameter(type: "Operations.GetServerResourcesRequest", format: format.formatDescription) } } @@ -21,10 +23,17 @@ extension Operations.GetServerResourcesRequest: Serializable { extension Operations.GetServerResourcesRequest: QueryParameterSerializable { func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] { let builder = QueryParameterBuilder() - try builder.addQueryParameters(from: clientID, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: includeHttps, named: "includeHttps", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: includeIPv6, named: "includeIPv6", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: includeRelay, named: "includeRelay", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) return builder.build() } } + +extension Operations.GetServerResourcesRequest: HeaderParameterSerializable { + func serializedHeaderParameters() throws -> [SerializedParameter] { + return [ + SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try clientID?.serialize(with: .header(explode: false))) + ] + } +} diff --git a/Sources/Plexswift/internal/models/GetThumbImageRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetThumbImageRequest+Serialization.swift index e481f78..cdbfefa 100644 --- a/Sources/Plexswift/internal/models/GetThumbImageRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetThumbImageRequest+Serialization.swift @@ -10,7 +10,9 @@ extension Operations.GetThumbImageRequest: Serializable { return try serializePathParameterSerializable(self, with: format) case .query: return try serializeQueryParameterSerializable(self, with: format) - case .header, .multipart, .form: + case .header: + return serializeModel(with: try serializedHeaderParameters(), format: format) + case .multipart, .form: throw SerializationError.invalidSerializationParameter(type: "Operations.GetThumbImageRequest", format: format.formatDescription) } } @@ -35,7 +37,14 @@ extension Operations.GetThumbImageRequest: QueryParameterSerializable { try builder.addQueryParameters(from: minSize, named: "minSize", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: upscale, named: "upscale", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: width, named: "width", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: xPlexToken, named: "X-Plex-Token", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) return builder.build() } } + +extension Operations.GetThumbImageRequest: HeaderParameterSerializable { + func serializedHeaderParameters() throws -> [SerializedParameter] { + return [ + SerializedParameter(name: "X-Plex-Token", serialized: try xPlexToken.serialize(with: .header(explode: false))) + ] + } +} diff --git a/Sources/Plexswift/internal/models/GetTokenByPinIdRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetTokenByPinIdRequest+Serialization.swift index ef88adf..0cc4d94 100644 --- a/Sources/Plexswift/internal/models/GetTokenByPinIdRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetTokenByPinIdRequest+Serialization.swift @@ -8,16 +8,12 @@ extension Operations.GetTokenByPinIdRequest: Serializable { switch format { case .path: return try serializePathParameterSerializable(self, with: format) - case .query: - return try serializeQueryParameterSerializable(self, with: format) - case .header, .multipart, .form: + case .header: + return serializeModel(with: try serializedHeaderParameters(), format: format) + case .query, .multipart, .form: throw SerializationError.invalidSerializationParameter(type: "Operations.GetTokenByPinIdRequest", format: format.formatDescription) } } - - func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { - return try serializedQueryParameters(with: nil, formatOverride: format) - } } extension Operations.GetTokenByPinIdRequest: PathParameterSerializable { @@ -28,14 +24,14 @@ extension Operations.GetTokenByPinIdRequest: PathParameterSerializable { } } -extension Operations.GetTokenByPinIdRequest: QueryParameterSerializable { - func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] { - let builder = QueryParameterBuilder() - try builder.addQueryParameters(from: clientID, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: clientName, named: "X-Plex-Product", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: clientPlatform, named: "X-Plex-Platform", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: clientVersion, named: "X-Plex-Version", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: deviceName, named: "X-Plex-Device", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - return builder.build() +extension Operations.GetTokenByPinIdRequest: HeaderParameterSerializable { + func serializedHeaderParameters() throws -> [SerializedParameter] { + return [ + SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try clientID?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Product", serialized: try clientName?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Version", serialized: try clientVersion?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Device", serialized: try deviceNickname?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Platform", serialized: try platform?.serialize(with: .header(explode: false))) + ] } } diff --git a/Sources/Plexswift/internal/models/GetWatchListRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetWatchListRequest+Serialization.swift index 6abf1d9..5627880 100644 --- a/Sources/Plexswift/internal/models/GetWatchListRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetWatchListRequest+Serialization.swift @@ -10,7 +10,9 @@ extension Operations.GetWatchListRequest: Serializable { return try serializePathParameterSerializable(self, with: format) case .query: return try serializeQueryParameterSerializable(self, with: format) - case .header, .multipart, .form: + case .header: + return serializeModel(with: try serializedHeaderParameters(), format: format) + case .multipart, .form: throw SerializationError.invalidSerializationParameter(type: "Operations.GetWatchListRequest", format: format.formatDescription) } } @@ -31,7 +33,6 @@ extension Operations.GetWatchListRequest: PathParameterSerializable { extension Operations.GetWatchListRequest: QueryParameterSerializable { func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] { let builder = QueryParameterBuilder() - try builder.addQueryParameters(from: xPlexToken, named: "X-Plex-Token", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: includeCollections, named: "includeCollections", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: includeExternalMedia, named: "includeExternalMedia", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: libtype, named: "libtype", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) @@ -42,3 +43,11 @@ extension Operations.GetWatchListRequest: QueryParameterSerializable { return builder.build() } } + +extension Operations.GetWatchListRequest: HeaderParameterSerializable { + func serializedHeaderParameters() throws -> [SerializedParameter] { + return [ + SerializedParameter(name: "X-Plex-Token", serialized: try xPlexToken.serialize(with: .header(explode: false))) + ] + } +} diff --git a/Sources/Plexswift/internal/models/PostUsersSignInDataRequest+Serialization.swift b/Sources/Plexswift/internal/models/PostUsersSignInDataRequest+Serialization.swift index cbcb915..133d6dd 100644 --- a/Sources/Plexswift/internal/models/PostUsersSignInDataRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/PostUsersSignInDataRequest+Serialization.swift @@ -6,26 +6,22 @@ import Foundation extension Operations.PostUsersSignInDataRequest: Serializable { func serialize(with format: SerializableFormat) throws -> String { switch format { - case .query: - return try serializeQueryParameterSerializable(self, with: format) - case .path, .header, .multipart, .form: + case .header: + return serializeModel(with: try serializedHeaderParameters(), format: format) + case .path, .query, .multipart, .form: throw SerializationError.invalidSerializationParameter(type: "Operations.PostUsersSignInDataRequest", format: format.formatDescription) } } - - func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { - return try serializedQueryParameters(with: nil, formatOverride: format) - } } -extension Operations.PostUsersSignInDataRequest: QueryParameterSerializable { - func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] { - let builder = QueryParameterBuilder() - try builder.addQueryParameters(from: clientID, named: "X-Plex-Client-Identifier", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: clientName, named: "X-Plex-Product", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: clientPlatform, named: "X-Plex-Platform", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: clientVersion, named: "X-Plex-Version", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - try builder.addQueryParameters(from: deviceName, named: "X-Plex-Device", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) - return builder.build() +extension Operations.PostUsersSignInDataRequest: HeaderParameterSerializable { + func serializedHeaderParameters() throws -> [SerializedParameter] { + return [ + SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try clientID?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Product", serialized: try clientName?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Version", serialized: try clientVersion?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Device", serialized: try deviceNickname?.serialize(with: .header(explode: false))), + SerializedParameter(name: "X-Plex-Platform", serialized: try platform?.serialize(with: .header(explode: false))) + ] } } diff --git a/Sources/Plexswift/internal/models/PostUsersSignInDataFeatures+Serialization.swift b/Sources/Plexswift/internal/models/QueryParamIncludeCollections+Serialization.swift similarity index 86% rename from Sources/Plexswift/internal/models/PostUsersSignInDataFeatures+Serialization.swift rename to Sources/Plexswift/internal/models/QueryParamIncludeCollections+Serialization.swift index 27cd7e8..d7283b2 100644 --- a/Sources/Plexswift/internal/models/PostUsersSignInDataFeatures+Serialization.swift +++ b/Sources/Plexswift/internal/models/QueryParamIncludeCollections+Serialization.swift @@ -3,7 +3,7 @@ import Foundation -extension Operations.PostUsersSignInDataFeatures: Serializable { +extension Operations.QueryParamIncludeCollections: Serializable { func serialize(with format: SerializableFormat) throws -> String { return try rawValue.serialize(with: format) } diff --git a/Sources/Plexswift/internal/models/QueryParamIncludeExternalMedia+Serialization.swift b/Sources/Plexswift/internal/models/QueryParamIncludeExternalMedia+Serialization.swift new file mode 100644 index 0000000..8d4bbd7 --- /dev/null +++ b/Sources/Plexswift/internal/models/QueryParamIncludeExternalMedia+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.QueryParamIncludeExternalMedia: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/Features+Serialization.swift b/Sources/Plexswift/internal/models/SearchTypes+Serialization.swift similarity index 89% rename from Sources/Plexswift/internal/models/Features+Serialization.swift rename to Sources/Plexswift/internal/models/SearchTypes+Serialization.swift index 3605af2..5835820 100644 --- a/Sources/Plexswift/internal/models/Features+Serialization.swift +++ b/Sources/Plexswift/internal/models/SearchTypes+Serialization.swift @@ -3,7 +3,7 @@ import Foundation -extension Operations.Features: Serializable { +extension Operations.SearchTypes: Serializable { func serialize(with format: SerializableFormat) throws -> String { return try rawValue.serialize(with: format) } diff --git a/Sources/Plexswift/models/operations/Features.swift b/Sources/Plexswift/models/operations/Features.swift deleted file mode 100644 index 601a10d..0000000 --- a/Sources/Plexswift/models/operations/Features.swift +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -import Foundation - -extension Operations { - public enum Features: String, Codable, APIValue { - case androidDolbyVision = "Android - Dolby Vision" - case androidPiP = "Android - PiP" - case cuSunset = "CU Sunset" - case hrkEnableEur = "HRK_enable_EUR" - case trebleShowFeatures = "TREBLE-show-features" - case adCountdownTimer = "ad-countdown-timer" - case adaptiveBitrate = "adaptive_bitrate" - case albumTypes = "album-types" - case allowDvr = "allow_dvr" - case amazonLoopDebug = "amazon-loop-debug" - case avodAdAnalysis = "avod-ad-analysis" - case avodNewMedia = "avod-new-media" - case blacklistGetSignin = "blacklist_get_signin" - case boostVoices = "boost-voices" - case cameraUpload = "camera_upload" - case clientRadioStations = "client-radio-stations" - case cloudflareTurnstileRequired = "cloudflare-turnstile-required" - case cloudsync = "cloudsync" - case collections = "collections" - case commentsAndRepliesPushNotifications = "comments_and_replies_push_notifications" - case communityAccessPlexTv = "community_access_plex_tv" - case companionsSonos = "companions_sonos" - case contentFilter = "content_filter" - case customHomeRemoval = "custom-home-removal" - case disableHomeUserFriendships = "disable_home_user_friendships" - case disableSharingFriendships = "disable_sharing_friendships" - case downloadsGating = "downloads-gating" - case drmSupport = "drm_support" - case dvr = "dvr" - case dvrBlockUnsupportedCountries = "dvr-block-unsupported-countries" - case epgRecentChannels = "epg-recent-channels" - case excludeRestrictions = "exclude restrictions" - case federatedAuth = "federated-auth" - case friendRequestPushNotifications = "friend_request_push_notifications" - case grandfatherSync = "grandfather-sync" - case guidedUpgrade = "guided-upgrade" - case hardwareTranscoding = "hardware_transcoding" - case home = "home" - case hwtranscode = "hwtranscode" - case imaggaV2 = "imagga-v2" - case increasePasswordComplexity = "increase-password-complexity" - case ios14PrivacyBanner = "ios14-privacy-banner" - case iterableNotificationTokens = "iterable-notification-tokens" - case itemClusters = "item_clusters" - case keepPaymentMethod = "keep-payment-method" - case kevinBacon = "kevin-bacon" - case koreaConsent = "korea-consent" - case leIsrgRootX1 = "le_isrg_root_x1" - case letsEncrypt = "lets_encrypt" - case lightningDvrPivot = "lightning-dvr-pivot" - case liveTvSupportIncompleteSegments = "live-tv-support-incomplete-segments" - case livetv = "livetv" - case lyrics = "lyrics" - case metadataSearch = "metadata_search" - case musicAnalysis = "music-analysis" - case musicVideos = "music_videos" - case newPlexPassPrices = "new_plex_pass_prices" - case newsProviderSunsetModal = "news-provider-sunset-modal" - case nominatim = "nominatim" - case pass = "pass" - case photosFavorites = "photos-favorites" - case photosMetadataEdition = "photos-metadata-edition" - case photosV6Edit = "photosV6-edit" - case photosV6TvAlbums = "photosV6-tv-albums" - case pmsHealth = "pms_health" - case premiumDashboard = "premium-dashboard" - case premiumMusicMetadata = "premium_music_metadata" - case radio = "radio" - case rateLimitClientToken = "rate-limit-client-token" - case scrobblingServicePlexTv = "scrobbling-service-plex-tv" - case sessionBandwidthRestrictions = "session_bandwidth_restrictions" - case sessionKick = "session_kick" - case sharedServerNotification = "shared_server_notification" - case sharedSourceNotification = "shared_source_notification" - case signinNotification = "signin_notification" - case signinWithApple = "signin_with_apple" - case silenceRemoval = "silence-removal" - case sleepTimer = "sleep-timer" - case springServeAdProvider = "spring_serve_ad_provider" - case sync = "sync" - case sweetFades = "sweet-fades" - case transcoderCache = "transcoder_cache" - case trailers = "trailers" - case tunerSharing = "tuner-sharing" - case twoFactorAuthentication = "two-factor-authentication" - case unsupportedtuners = "unsupportedtuners" - case upgrade3Ds2 = "upgrade-3ds2" - case visualizers = "visualizers" - case vodSchema = "vod-schema" - case vodCloudflare = "vod_cloudflare" - case volumeLeveling = "volume-leveling" - case watchTogetherInvite = "watch-together-invite" - case watchlistRss = "watchlist-rss" - case webServerDashboard = "web_server_dashboard" - case webhooks = "webhooks" - }} diff --git a/Sources/Plexswift/models/operations/GetAllLibrariesDirectory.swift b/Sources/Plexswift/models/operations/GetAllLibrariesDirectory.swift index cf91845..fce6f2a 100644 --- a/Sources/Plexswift/models/operations/GetAllLibrariesDirectory.swift +++ b/Sources/Plexswift/models/operations/GetAllLibrariesDirectory.swift @@ -19,7 +19,7 @@ extension Operations { public let hidden: Int public let key: String public let language: String - public let location: [Operations.Location] + public let location: [Operations.GetAllLibrariesLocation] public let refreshing: Bool /// Unix epoch datetime in seconds public let scannedAt: Int @@ -38,7 +38,7 @@ extension Operations { /// - Parameter scannedAt: Unix epoch datetime in seconds /// - Parameter updatedAt: Unix epoch datetime in seconds /// - public init(agent: String, allowSync: Bool, art: String, composite: String, content: Bool, contentChangedAt: Int, createdAt: Int, directory: Bool, filters: Bool, hidden: Int, key: String, language: String, location: [Operations.Location], refreshing: Bool, scannedAt: Int, scanner: String, thumb: String, title: String, type: String, updatedAt: Int, uuid: String) { + public init(agent: String, allowSync: Bool, art: String, composite: String, content: Bool, contentChangedAt: Int, createdAt: Int, directory: Bool, filters: Bool, hidden: Int, key: String, language: String, location: [Operations.GetAllLibrariesLocation], refreshing: Bool, scannedAt: Int, scanner: String, thumb: String, title: String, type: String, updatedAt: Int, uuid: String) { self.agent = agent self.allowSync = allowSync self.art = art diff --git a/Sources/Plexswift/models/operations/GetAllLibrariesLocation.swift b/Sources/Plexswift/models/operations/GetAllLibrariesLocation.swift new file mode 100644 index 0000000..0e87b0c --- /dev/null +++ b/Sources/Plexswift/models/operations/GetAllLibrariesLocation.swift @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetAllLibrariesLocation { + public let id: Int + public let path: String + + /// Creates an object with the specified parameters + /// + /// + public init(id: Int, path: String) { + self.id = id + self.path = path + } + }} + +extension Operations.GetAllLibrariesLocation: Codable { + enum CodingKeys: String, CodingKey { + case id + case path + } +} + diff --git a/Sources/Plexswift/models/operations/GetBannerImageRequest.swift b/Sources/Plexswift/models/operations/GetBannerImageRequest.swift index 9067741..23f18ef 100644 --- a/Sources/Plexswift/models/operations/GetBannerImageRequest.swift +++ b/Sources/Plexswift/models/operations/GetBannerImageRequest.swift @@ -11,13 +11,13 @@ extension Operations { public let ratingKey: Int public let upscale: Int public let width: Int - /// Plex Authentication Token + /// An authentication token, obtained from plex.tv public let xPlexToken: String /// Creates an object with the specified parameters /// /// - Parameter ratingKey: the id of the library item to return the children of. - /// - Parameter xPlexToken: Plex Authentication Token + /// - Parameter xPlexToken: An authentication token, obtained from plex.tv /// public init(height: Int, minSize: Int, ratingKey: Int, upscale: Int, width: Int, xPlexToken: String) { self.height = height diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsLocation.swift b/Sources/Plexswift/models/operations/GetLibraryItemsLocation.swift new file mode 100644 index 0000000..9fe2165 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetLibraryItemsLocation.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetLibraryItemsLocation { + public let path: String? + + /// Creates an object with the specified parameters + /// + /// + public init(path: String? = nil) { + self.path = path + } + }} + +extension Operations.GetLibraryItemsLocation: Codable { + enum CodingKeys: String, CodingKey { + case path + } +} + diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift b/Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift index 5aed245..48962b5 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift @@ -5,120 +5,122 @@ import Foundation extension Operations { /// A model object public struct GetLibraryItemsMedia { - @DecimalSerialized - public private(set) var aspectRatio: Double - public let audioChannels: Int - public let audioCodec: String - public let bitrate: Int public let container: String - public let duration: Int - public let height: Int public let id: Int public let part: [Operations.GetLibraryItemsPart] - public let videoCodec: String - public let videoFrameRate: String - public let videoProfile: String - public let videoResolution: String - public let width: Int + @DecimalSerialized + public private(set) var aspectRatio: Double? + public let audioChannels: Int? + public let audioCodec: String? public let audioProfile: String? + public let bitrate: Int? + public let duration: Int? public let has64bitOffsets: Bool? public let hasVoiceActivity: Bool? + public let height: Int? public let optimizedForStreaming: Operations.GetLibraryItemsOptimizedForStreaming? + public let videoCodec: String? + public let videoFrameRate: String? + public let videoProfile: String? + public let videoResolution: String? + public let width: Int? /// Creates an object with the specified parameters /// /// - public init(aspectRatio: Double, audioChannels: Int, audioCodec: String, bitrate: Int, container: String, duration: Int, height: Int, id: Int, part: [Operations.GetLibraryItemsPart], videoCodec: String, videoFrameRate: String, videoProfile: String, videoResolution: String, width: Int, audioProfile: String? = nil, has64bitOffsets: Bool? = nil, hasVoiceActivity: Bool? = nil, optimizedForStreaming: Operations.GetLibraryItemsOptimizedForStreaming? = nil) { - self._aspectRatio = DecimalSerialized(wrappedValue: aspectRatio) - self.audioChannels = audioChannels - self.audioCodec = audioCodec - self.bitrate = bitrate + public init(container: String, id: Int, part: [Operations.GetLibraryItemsPart], aspectRatio: Double? = nil, audioChannels: Int? = nil, audioCodec: String? = nil, audioProfile: String? = nil, bitrate: Int? = nil, duration: Int? = nil, has64bitOffsets: Bool? = nil, hasVoiceActivity: Bool? = nil, height: Int? = nil, optimizedForStreaming: Operations.GetLibraryItemsOptimizedForStreaming? = nil, videoCodec: String? = nil, videoFrameRate: String? = nil, videoProfile: String? = nil, videoResolution: String? = nil, width: Int? = nil) { self.container = container - self.duration = duration - self.height = height self.id = id self.part = part + self._aspectRatio = DecimalSerialized(wrappedValue: aspectRatio) + self.audioChannels = audioChannels + self.audioCodec = audioCodec + self.audioProfile = audioProfile + self.bitrate = bitrate + self.duration = duration + self.has64bitOffsets = has64bitOffsets + self.hasVoiceActivity = hasVoiceActivity + self.height = height + self.optimizedForStreaming = optimizedForStreaming self.videoCodec = videoCodec self.videoFrameRate = videoFrameRate self.videoProfile = videoProfile self.videoResolution = videoResolution self.width = width - self.audioProfile = audioProfile - self.has64bitOffsets = has64bitOffsets - self.hasVoiceActivity = hasVoiceActivity - self.optimizedForStreaming = optimizedForStreaming } }} extension Operations.GetLibraryItemsMedia: Codable { enum CodingKeys: String, CodingKey { + case container + case id + case part = "Part" case aspectRatio case audioChannels case audioCodec + case audioProfile case bitrate - case container case duration + case has64bitOffsets + case hasVoiceActivity case height - case id - case part = "Part" + case optimizedForStreaming case videoCodec case videoFrameRate case videoProfile case videoResolution case width - case audioProfile - case has64bitOffsets - case hasVoiceActivity - case optimizedForStreaming } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self._aspectRatio = try container.decode(DecimalSerialized.self, forKey: .aspectRatio) - self.audioChannels = try container.decode(Int.self, forKey: .audioChannels) - self.audioCodec = try container.decode(String.self, forKey: .audioCodec) - self.bitrate = try container.decode(Int.self, forKey: .bitrate) self.container = try container.decode(String.self, forKey: .container) - self.duration = try container.decode(Int.self, forKey: .duration) - self.height = try container.decode(Int.self, forKey: .height) self.id = try container.decode(Int.self, forKey: .id) self.part = try container.decode([Operations.GetLibraryItemsPart].self, forKey: .part) - self.videoCodec = try container.decode(String.self, forKey: .videoCodec) - self.videoFrameRate = try container.decode(String.self, forKey: .videoFrameRate) - self.videoProfile = try container.decode(String.self, forKey: .videoProfile) - self.videoResolution = try container.decode(String.self, forKey: .videoResolution) - self.width = try container.decode(Int.self, forKey: .width) + self._aspectRatio = try container.decodeIfPresent(DecimalSerialized.self, forKey: .aspectRatio) ?? DecimalSerialized(wrappedValue: nil) + self.audioChannels = try container.decodeIfPresent(Int.self, forKey: .audioChannels) + self.audioCodec = try container.decodeIfPresent(String.self, forKey: .audioCodec) self.audioProfile = try container.decodeIfPresent(String.self, forKey: .audioProfile) + self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate) + self.duration = try container.decodeIfPresent(Int.self, forKey: .duration) self.has64bitOffsets = try container.decodeIfPresent(Bool.self, forKey: .has64bitOffsets) self.hasVoiceActivity = try container.decodeIfPresent(Bool.self, forKey: .hasVoiceActivity) + self.height = try container.decodeIfPresent(Int.self, forKey: .height) self.optimizedForStreaming = try container.decodeIfPresent(Operations.GetLibraryItemsOptimizedForStreaming.self, forKey: .optimizedForStreaming) + self.videoCodec = try container.decodeIfPresent(String.self, forKey: .videoCodec) + self.videoFrameRate = try container.decodeIfPresent(String.self, forKey: .videoFrameRate) + self.videoProfile = try container.decodeIfPresent(String.self, forKey: .videoProfile) + self.videoResolution = try container.decodeIfPresent(String.self, forKey: .videoResolution) + self.width = try container.decodeIfPresent(Int.self, forKey: .width) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(self._aspectRatio, forKey: .aspectRatio) - try container.encode(self.audioChannels, forKey: .audioChannels) - try container.encode(self.audioCodec, forKey: .audioCodec) - try container.encode(self.bitrate, forKey: .bitrate) try container.encode(self.container, forKey: .container) - try container.encode(self.duration, forKey: .duration) - try container.encode(self.height, forKey: .height) try container.encode(self.id, forKey: .id) try container.encode(self.part, forKey: .part) - try container.encode(self.videoCodec, forKey: .videoCodec) - try container.encode(self.videoFrameRate, forKey: .videoFrameRate) - try container.encode(self.videoProfile, forKey: .videoProfile) - try container.encode(self.videoResolution, forKey: .videoResolution) - try container.encode(self.width, forKey: .width) + if self.aspectRatio != nil { + try container.encode(self._aspectRatio, forKey: .aspectRatio) + } + try container.encodeIfPresent(self.audioChannels, forKey: .audioChannels) + try container.encodeIfPresent(self.audioCodec, forKey: .audioCodec) try container.encodeIfPresent(self.audioProfile, forKey: .audioProfile) + try container.encodeIfPresent(self.bitrate, forKey: .bitrate) + try container.encodeIfPresent(self.duration, forKey: .duration) try container.encodeIfPresent(self.has64bitOffsets, forKey: .has64bitOffsets) try container.encodeIfPresent(self.hasVoiceActivity, forKey: .hasVoiceActivity) + try container.encodeIfPresent(self.height, forKey: .height) try container.encodeIfPresent(self.optimizedForStreaming, forKey: .optimizedForStreaming) + try container.encodeIfPresent(self.videoCodec, forKey: .videoCodec) + try container.encodeIfPresent(self.videoFrameRate, forKey: .videoFrameRate) + try container.encodeIfPresent(self.videoProfile, forKey: .videoProfile) + try container.encodeIfPresent(self.videoResolution, forKey: .videoResolution) + try container.encodeIfPresent(self.width, forKey: .width) } } extension Operations.GetLibraryItemsMedia { - var aspectRatioWrapper: DecimalSerialized { + var aspectRatioWrapper: DecimalSerialized { return _aspectRatio } } diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift b/Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift index 98aa641..ed4626a 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift @@ -49,6 +49,7 @@ extension Operations { public let librarySectionID: Int? public let librarySectionKey: String? public let librarySectionTitle: String? + public let location: [Operations.GetLibraryItemsLocation]? /// The Media object is only included when type query is `4` or higher. /// public let media: [Operations.GetLibraryItemsMedia]? @@ -125,7 +126,7 @@ extension Operations { /// /// - Parameter updatedAt: Unix epoch datetime in seconds /// - public init(addedAt: Int, guid: String, key: String, ratingKey: String, summary: String, title: String, type: Operations.GetLibraryItemsLibraryType, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, banner: String? = nil, chapterSource: String? = nil, childCount: Int? = nil, collection: [Operations.GetLibraryItemsCollection]? = nil, contentRating: String? = nil, country: [Operations.GetLibraryItemsCountry]? = nil, director: [Operations.GetLibraryItemsDirector]? = nil, duration: Int? = nil, flattenSeasons: Operations.GetLibraryItemsFlattenSeasons? = nil, genre: [Operations.GetLibraryItemsGenre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentSlug: String? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, hasPremiumExtras: String? = nil, hasPremiumPrimaryExtra: String? = nil, image: [Operations.GetLibraryItemsImage]? = nil, index: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, librarySectionID: Int? = nil, librarySectionKey: String? = nil, librarySectionTitle: String? = nil, media: [Operations.GetLibraryItemsMedia]? = nil, mediaGuid: [Operations.GetLibraryItemsMediaGuid]? = nil, metaDataRating: [Operations.GetLibraryItemsMetaDataRating]? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentSlug: String? = nil, parentStudio: String? = nil, parentTheme: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, parentYear: Int? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, role: [Operations.GetLibraryItemsRole]? = nil, seasonCount: Int? = nil, showOrdering: Operations.GetLibraryItemsShowOrdering? = nil, skipChildren: Bool? = nil, skipCount: Int? = nil, slug: String? = nil, studio: String? = nil, tagline: String? = nil, theme: String? = nil, thumb: String? = nil, titleSort: String? = nil, ultraBlurColors: Operations.GetLibraryItemsUltraBlurColors? = nil, updatedAt: Int? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, viewOffset: Int? = nil, writer: [Operations.GetLibraryItemsWriter]? = nil, year: Int? = nil) { + public init(addedAt: Int, guid: String, key: String, ratingKey: String, summary: String, title: String, type: Operations.GetLibraryItemsLibraryType, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, banner: String? = nil, chapterSource: String? = nil, childCount: Int? = nil, collection: [Operations.GetLibraryItemsCollection]? = nil, contentRating: String? = nil, country: [Operations.GetLibraryItemsCountry]? = nil, director: [Operations.GetLibraryItemsDirector]? = nil, duration: Int? = nil, flattenSeasons: Operations.GetLibraryItemsFlattenSeasons? = nil, genre: [Operations.GetLibraryItemsGenre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentSlug: String? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, hasPremiumExtras: String? = nil, hasPremiumPrimaryExtra: String? = nil, image: [Operations.GetLibraryItemsImage]? = nil, index: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, librarySectionID: Int? = nil, librarySectionKey: String? = nil, librarySectionTitle: String? = nil, location: [Operations.GetLibraryItemsLocation]? = nil, media: [Operations.GetLibraryItemsMedia]? = nil, mediaGuid: [Operations.GetLibraryItemsMediaGuid]? = nil, metaDataRating: [Operations.GetLibraryItemsMetaDataRating]? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentSlug: String? = nil, parentStudio: String? = nil, parentTheme: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, parentYear: Int? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, role: [Operations.GetLibraryItemsRole]? = nil, seasonCount: Int? = nil, showOrdering: Operations.GetLibraryItemsShowOrdering? = nil, skipChildren: Bool? = nil, skipCount: Int? = nil, slug: String? = nil, studio: String? = nil, tagline: String? = nil, theme: String? = nil, thumb: String? = nil, titleSort: String? = nil, ultraBlurColors: Operations.GetLibraryItemsUltraBlurColors? = nil, updatedAt: Int? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, viewOffset: Int? = nil, writer: [Operations.GetLibraryItemsWriter]? = nil, year: Int? = nil) { self.addedAt = addedAt self.guid = guid self.key = key @@ -163,6 +164,7 @@ extension Operations { self.librarySectionID = librarySectionID self.librarySectionKey = librarySectionKey self.librarySectionTitle = librarySectionTitle + self.location = location self.media = media self.mediaGuid = mediaGuid self.metaDataRating = metaDataRating @@ -241,6 +243,7 @@ extension Operations.GetLibraryItemsMetadata: Codable { case librarySectionID case librarySectionKey case librarySectionTitle + case location = "Location" case media = "Media" case mediaGuid = "Guid" case metaDataRating = "Rating" @@ -318,6 +321,7 @@ extension Operations.GetLibraryItemsMetadata: Codable { self.librarySectionID = try container.decodeIfPresent(Int.self, forKey: .librarySectionID) self.librarySectionKey = try container.decodeIfPresent(String.self, forKey: .librarySectionKey) self.librarySectionTitle = try container.decodeIfPresent(String.self, forKey: .librarySectionTitle) + self.location = try container.decodeIfPresent([Operations.GetLibraryItemsLocation].self, forKey: .location) self.media = try container.decodeIfPresent([Operations.GetLibraryItemsMedia].self, forKey: .media) self.mediaGuid = try container.decodeIfPresent([Operations.GetLibraryItemsMediaGuid].self, forKey: .mediaGuid) self.metaDataRating = try container.decodeIfPresent([Operations.GetLibraryItemsMetaDataRating].self, forKey: .metaDataRating) @@ -397,6 +401,7 @@ extension Operations.GetLibraryItemsMetadata: Codable { try container.encodeIfPresent(self.librarySectionID, forKey: .librarySectionID) try container.encodeIfPresent(self.librarySectionKey, forKey: .librarySectionKey) try container.encodeIfPresent(self.librarySectionTitle, forKey: .librarySectionTitle) + try container.encodeIfPresent(self.location, forKey: .location) try container.encodeIfPresent(self.media, forKey: .media) try container.encodeIfPresent(self.mediaGuid, forKey: .mediaGuid) try container.encodeIfPresent(self.metaDataRating, forKey: .metaDataRating) diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsPart.swift b/Sources/Plexswift/models/operations/GetLibraryItemsPart.swift index 3a67ee1..58fdc88 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsPart.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsPart.swift @@ -8,56 +8,56 @@ extension Operations { /// The container format of the media file. /// public let container: String - public let duration: Int public let file: String public let id: Int public let key: String public let size: Int - public let videoProfile: String public let audioProfile: String? + public let duration: Int? public let has64bitOffsets: Bool? public let hasThumbnail: Operations.GetLibraryItemsHasThumbnail? public let indexes: String? public let optimizedForStreaming: Bool? public let stream: [Operations.GetLibraryItemsStream]? + public let videoProfile: String? /// Creates an object with the specified parameters /// /// - Parameter container: The container format of the media file. /// /// - public init(container: String, duration: Int, file: String, id: Int, key: String, size: Int, videoProfile: String, audioProfile: String? = nil, has64bitOffsets: Bool? = nil, hasThumbnail: Operations.GetLibraryItemsHasThumbnail? = nil, indexes: String? = nil, optimizedForStreaming: Bool? = nil, stream: [Operations.GetLibraryItemsStream]? = nil) { + public init(container: String, file: String, id: Int, key: String, size: Int, audioProfile: String? = nil, duration: Int? = nil, has64bitOffsets: Bool? = nil, hasThumbnail: Operations.GetLibraryItemsHasThumbnail? = nil, indexes: String? = nil, optimizedForStreaming: Bool? = nil, stream: [Operations.GetLibraryItemsStream]? = nil, videoProfile: String? = nil) { self.container = container - self.duration = duration self.file = file self.id = id self.key = key self.size = size - self.videoProfile = videoProfile self.audioProfile = audioProfile + self.duration = duration self.has64bitOffsets = has64bitOffsets self.hasThumbnail = hasThumbnail self.indexes = indexes self.optimizedForStreaming = optimizedForStreaming self.stream = stream + self.videoProfile = videoProfile } }} extension Operations.GetLibraryItemsPart: Codable { enum CodingKeys: String, CodingKey { case container - case duration case file case id case key case size - case videoProfile case audioProfile + case duration case has64bitOffsets case hasThumbnail case indexes case optimizedForStreaming case stream = "Stream" + case videoProfile } } diff --git a/Sources/Plexswift/models/operations/GetMediaProvidersRequest.swift b/Sources/Plexswift/models/operations/GetMediaProvidersRequest.swift index d361e73..0f16042 100644 --- a/Sources/Plexswift/models/operations/GetMediaProvidersRequest.swift +++ b/Sources/Plexswift/models/operations/GetMediaProvidersRequest.swift @@ -5,12 +5,12 @@ import Foundation extension Operations { /// A model object public struct GetMediaProvidersRequest: APIValue { - /// Plex Authentication Token + /// An authentication token, obtained from plex.tv public let xPlexToken: String /// Creates an object with the specified parameters /// - /// - Parameter xPlexToken: Plex Authentication Token + /// - Parameter xPlexToken: An authentication token, obtained from plex.tv /// public init(xPlexToken: String) { self.xPlexToken = xPlexToken diff --git a/Sources/Plexswift/models/operations/GetPinRequest.swift b/Sources/Plexswift/models/operations/GetPinRequest.swift index c59c390..5a4937c 100644 --- a/Sources/Plexswift/models/operations/GetPinRequest.swift +++ b/Sources/Plexswift/models/operations/GetPinRequest.swift @@ -5,12 +5,16 @@ import Foundation extension Operations { /// A model object public struct GetPinRequest: APIValue { - /// The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + /// An opaque identifier unique to the client (UUID, serial number, or other unique device ID) public let clientID: String? + /// The name of the client application. (Plex Web, Plex Media Server, etc.) public let clientName: String? - public let clientPlatform: String? + /// The version of the client application. public let clientVersion: String? - public let deviceName: String? + /// A relatively friendly name for the client device + public let deviceNickname: String? + /// The platform of the client application. + public let platform: String? /// Determines the kind of code returned by the API call /// Strong codes are used for Pin authentication flows /// Non-Strong codes are used for `Plex.tv/link` @@ -19,18 +23,22 @@ extension Operations { /// Creates an object with the specified parameters /// - /// - Parameter clientID: The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + /// - Parameter clientID: An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + /// - Parameter clientName: The name of the client application. (Plex Web, Plex Media Server, etc.) + /// - Parameter clientVersion: The version of the client application. + /// - Parameter deviceNickname: A relatively friendly name for the client device + /// - Parameter platform: The platform of the client application. /// - Parameter strong: Determines the kind of code returned by the API call /// Strong codes are used for Pin authentication flows /// Non-Strong codes are used for `Plex.tv/link` /// /// - public init(clientID: String? = nil, clientName: String? = nil, clientPlatform: String? = nil, clientVersion: String? = nil, deviceName: String? = nil, strong: Bool? = nil) { + public init(clientID: String? = nil, clientName: String? = nil, clientVersion: String? = nil, deviceNickname: String? = nil, platform: String? = nil, strong: Bool? = nil) { self.clientID = clientID self.clientName = clientName - self.clientPlatform = clientPlatform self.clientVersion = clientVersion - self.deviceName = deviceName + self.deviceNickname = deviceNickname + self.platform = platform self.strong = strong } }} diff --git a/Sources/Plexswift/models/operations/GetRecentlyAddedMetadata.swift b/Sources/Plexswift/models/operations/GetRecentlyAddedMetadata.swift index 0c99e66..20eb302 100644 --- a/Sources/Plexswift/models/operations/GetRecentlyAddedMetadata.swift +++ b/Sources/Plexswift/models/operations/GetRecentlyAddedMetadata.swift @@ -49,6 +49,7 @@ extension Operations { public let librarySectionID: Int? public let librarySectionKey: String? public let librarySectionTitle: String? + public let location: [Operations.Location]? /// The Media object is only included when type query is `4` or higher. /// public let media: [Operations.Media]? @@ -125,7 +126,7 @@ extension Operations { /// /// - Parameter updatedAt: Unix epoch datetime in seconds /// - public init(addedAt: Int, guid: String, key: String, ratingKey: String, summary: String, title: String, type: Operations.GetRecentlyAddedHubsType, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, banner: String? = nil, chapterSource: String? = nil, childCount: Int? = nil, collection: [Operations.Collection]? = nil, contentRating: String? = nil, country: [Operations.Country]? = nil, director: [Operations.Director]? = nil, duration: Int? = nil, flattenSeasons: Operations.FlattenSeasons? = nil, genre: [Operations.Genre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentSlug: String? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, hasPremiumExtras: String? = nil, hasPremiumPrimaryExtra: String? = nil, image: [Operations.GetRecentlyAddedImage]? = nil, index: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, librarySectionID: Int? = nil, librarySectionKey: String? = nil, librarySectionTitle: String? = nil, media: [Operations.Media]? = nil, mediaGuid: [Operations.MediaGuid]? = nil, metaDataRating: [Operations.MetaDataRating]? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentSlug: String? = nil, parentStudio: String? = nil, parentTheme: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, parentYear: Int? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, role: [Operations.Role]? = nil, seasonCount: Int? = nil, showOrdering: Operations.ShowOrdering? = nil, skipChildren: Bool? = nil, skipCount: Int? = nil, slug: String? = nil, studio: String? = nil, tagline: String? = nil, theme: String? = nil, thumb: String? = nil, titleSort: String? = nil, ultraBlurColors: Operations.UltraBlurColors? = nil, updatedAt: Int? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, viewOffset: Int? = nil, writer: [Operations.Writer]? = nil, year: Int? = nil) { + public init(addedAt: Int, guid: String, key: String, ratingKey: String, summary: String, title: String, type: Operations.GetRecentlyAddedHubsType, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, banner: String? = nil, chapterSource: String? = nil, childCount: Int? = nil, collection: [Operations.Collection]? = nil, contentRating: String? = nil, country: [Operations.Country]? = nil, director: [Operations.Director]? = nil, duration: Int? = nil, flattenSeasons: Operations.FlattenSeasons? = nil, genre: [Operations.Genre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentSlug: String? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, hasPremiumExtras: String? = nil, hasPremiumPrimaryExtra: String? = nil, image: [Operations.GetRecentlyAddedImage]? = nil, index: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, librarySectionID: Int? = nil, librarySectionKey: String? = nil, librarySectionTitle: String? = nil, location: [Operations.Location]? = nil, media: [Operations.Media]? = nil, mediaGuid: [Operations.MediaGuid]? = nil, metaDataRating: [Operations.MetaDataRating]? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentSlug: String? = nil, parentStudio: String? = nil, parentTheme: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, parentYear: Int? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, role: [Operations.Role]? = nil, seasonCount: Int? = nil, showOrdering: Operations.ShowOrdering? = nil, skipChildren: Bool? = nil, skipCount: Int? = nil, slug: String? = nil, studio: String? = nil, tagline: String? = nil, theme: String? = nil, thumb: String? = nil, titleSort: String? = nil, ultraBlurColors: Operations.UltraBlurColors? = nil, updatedAt: Int? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, viewOffset: Int? = nil, writer: [Operations.Writer]? = nil, year: Int? = nil) { self.addedAt = addedAt self.guid = guid self.key = key @@ -163,6 +164,7 @@ extension Operations { self.librarySectionID = librarySectionID self.librarySectionKey = librarySectionKey self.librarySectionTitle = librarySectionTitle + self.location = location self.media = media self.mediaGuid = mediaGuid self.metaDataRating = metaDataRating @@ -241,6 +243,7 @@ extension Operations.GetRecentlyAddedMetadata: Codable { case librarySectionID case librarySectionKey case librarySectionTitle + case location = "Location" case media = "Media" case mediaGuid = "Guid" case metaDataRating = "Rating" @@ -318,6 +321,7 @@ extension Operations.GetRecentlyAddedMetadata: Codable { self.librarySectionID = try container.decodeIfPresent(Int.self, forKey: .librarySectionID) self.librarySectionKey = try container.decodeIfPresent(String.self, forKey: .librarySectionKey) self.librarySectionTitle = try container.decodeIfPresent(String.self, forKey: .librarySectionTitle) + self.location = try container.decodeIfPresent([Operations.Location].self, forKey: .location) self.media = try container.decodeIfPresent([Operations.Media].self, forKey: .media) self.mediaGuid = try container.decodeIfPresent([Operations.MediaGuid].self, forKey: .mediaGuid) self.metaDataRating = try container.decodeIfPresent([Operations.MetaDataRating].self, forKey: .metaDataRating) @@ -397,6 +401,7 @@ extension Operations.GetRecentlyAddedMetadata: Codable { try container.encodeIfPresent(self.librarySectionID, forKey: .librarySectionID) try container.encodeIfPresent(self.librarySectionKey, forKey: .librarySectionKey) try container.encodeIfPresent(self.librarySectionTitle, forKey: .librarySectionTitle) + try container.encodeIfPresent(self.location, forKey: .location) try container.encodeIfPresent(self.media, forKey: .media) try container.encodeIfPresent(self.mediaGuid, forKey: .mediaGuid) try container.encodeIfPresent(self.metaDataRating, forKey: .metaDataRating) diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesBadRequest.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesBadRequest.swift new file mode 100644 index 0000000..75f413c --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesBadRequest.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// Bad Request - A parameter was not specified, or was specified incorrectly. + public struct GetSearchAllLibrariesBadRequest { + public let errors: [Operations.GetSearchAllLibrariesErrors]? + + /// Creates a request model with the specified parameters + /// + /// + public init(errors: [Operations.GetSearchAllLibrariesErrors]? = nil) { + self.errors = errors + } + }} + +extension Operations.GetSearchAllLibrariesBadRequest: Codable { + enum CodingKeys: String, CodingKey { + case errors + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesCollection.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesCollection.swift new file mode 100644 index 0000000..81b349d --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesCollection.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesCollection { + public let tag: String? + + /// Creates an object with the specified parameters + /// + /// + public init(tag: String? = nil) { + self.tag = tag + } + }} + +extension Operations.GetSearchAllLibrariesCollection: Codable { + enum CodingKeys: String, CodingKey { + case tag + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesCountry.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesCountry.swift new file mode 100644 index 0000000..cc3f4d2 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesCountry.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesCountry { + public let tag: String? + + /// Creates an object with the specified parameters + /// + /// + public init(tag: String? = nil) { + self.tag = tag + } + }} + +extension Operations.GetSearchAllLibrariesCountry: Codable { + enum CodingKeys: String, CodingKey { + case tag + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesDirector.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesDirector.swift new file mode 100644 index 0000000..1c2771a --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesDirector.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesDirector { + public let tag: String? + + /// Creates an object with the specified parameters + /// + /// + public init(tag: String? = nil) { + self.tag = tag + } + }} + +extension Operations.GetSearchAllLibrariesDirector: Codable { + enum CodingKeys: String, CodingKey { + case tag + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesErrors.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesErrors.swift new file mode 100644 index 0000000..6f588aa --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesErrors.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesErrors { + public let code: Int? + public let message: String? + public let status: Int? + + /// Creates an object with the specified parameters + /// + /// + public init(code: Int? = nil, message: String? = nil, status: Int? = nil) { + self.code = code + self.message = message + self.status = status + } + }} + +extension Operations.GetSearchAllLibrariesErrors: Codable { + enum CodingKeys: String, CodingKey { + case code + case message + case status + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesFlattenSeasons.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesFlattenSeasons.swift new file mode 100644 index 0000000..43ebb33 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesFlattenSeasons.swift @@ -0,0 +1,9 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + public enum GetSearchAllLibrariesFlattenSeasons: String, Codable, APIValue { + case `false` = "0" + case `true` = "1" + }} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesGenre.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesGenre.swift new file mode 100644 index 0000000..35177db --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesGenre.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesGenre { + public let tag: String? + + /// Creates an object with the specified parameters + /// + /// + public init(tag: String? = nil) { + self.tag = tag + } + }} + +extension Operations.GetSearchAllLibrariesGenre: Codable { + enum CodingKeys: String, CodingKey { + case tag + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesHasThumbnail.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesHasThumbnail.swift new file mode 100644 index 0000000..6463e65 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesHasThumbnail.swift @@ -0,0 +1,9 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + public enum GetSearchAllLibrariesHasThumbnail: String, Codable, APIValue { + case `false` = "0" + case `true` = "1" + }} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesImage.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesImage.swift new file mode 100644 index 0000000..f5b35c7 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesImage.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesImage { + public let alt: String + public let type: Operations.GetSearchAllLibrariesLibraryType + public let url: String + + /// Creates an object with the specified parameters + /// + /// + public init(alt: String, type: Operations.GetSearchAllLibrariesLibraryType, url: String) { + self.alt = alt + self.type = type + self.url = url + } + }} + +extension Operations.GetSearchAllLibrariesImage: Codable { + enum CodingKeys: String, CodingKey { + case alt + case type + case url + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesLibraryErrors.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesLibraryErrors.swift new file mode 100644 index 0000000..7d6001b --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesLibraryErrors.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesLibraryErrors { + public let code: Int? + public let message: String? + public let status: Int? + + /// Creates an object with the specified parameters + /// + /// + public init(code: Int? = nil, message: String? = nil, status: Int? = nil) { + self.code = code + self.message = message + self.status = status + } + }} + +extension Operations.GetSearchAllLibrariesLibraryErrors: Codable { + enum CodingKeys: String, CodingKey { + case code + case message + case status + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesLibraryType.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesLibraryType.swift new file mode 100644 index 0000000..2459b5d --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesLibraryType.swift @@ -0,0 +1,11 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + public enum GetSearchAllLibrariesLibraryType: String, Codable, APIValue { + case coverPoster = "coverPoster" + case background = "background" + case snapshot = "snapshot" + case clearLogo = "clearLogo" + }} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesLocation.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesLocation.swift new file mode 100644 index 0000000..cb4ca4f --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesLocation.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesLocation { + public let path: String? + + /// Creates an object with the specified parameters + /// + /// + public init(path: String? = nil) { + self.path = path + } + }} + +extension Operations.GetSearchAllLibrariesLocation: Codable { + enum CodingKeys: String, CodingKey { + case path + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesMedia.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMedia.swift new file mode 100644 index 0000000..21e6e8a --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMedia.swift @@ -0,0 +1,126 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesMedia { + public let container: String + public let id: Int + public let part: [Operations.GetSearchAllLibrariesPart] + @DecimalSerialized + public private(set) var aspectRatio: Double? + public let audioChannels: Int? + public let audioCodec: String? + public let audioProfile: String? + public let bitrate: Int? + public let duration: Int? + public let has64bitOffsets: Bool? + public let hasVoiceActivity: Bool? + public let height: Int? + public let optimizedForStreaming: Operations.GetSearchAllLibrariesOptimizedForStreaming? + public let videoCodec: String? + public let videoFrameRate: String? + public let videoProfile: String? + public let videoResolution: String? + public let width: Int? + + /// Creates an object with the specified parameters + /// + /// + public init(container: String, id: Int, part: [Operations.GetSearchAllLibrariesPart], aspectRatio: Double? = nil, audioChannels: Int? = nil, audioCodec: String? = nil, audioProfile: String? = nil, bitrate: Int? = nil, duration: Int? = nil, has64bitOffsets: Bool? = nil, hasVoiceActivity: Bool? = nil, height: Int? = nil, optimizedForStreaming: Operations.GetSearchAllLibrariesOptimizedForStreaming? = nil, videoCodec: String? = nil, videoFrameRate: String? = nil, videoProfile: String? = nil, videoResolution: String? = nil, width: Int? = nil) { + self.container = container + self.id = id + self.part = part + self._aspectRatio = DecimalSerialized(wrappedValue: aspectRatio) + self.audioChannels = audioChannels + self.audioCodec = audioCodec + self.audioProfile = audioProfile + self.bitrate = bitrate + self.duration = duration + self.has64bitOffsets = has64bitOffsets + self.hasVoiceActivity = hasVoiceActivity + self.height = height + self.optimizedForStreaming = optimizedForStreaming + self.videoCodec = videoCodec + self.videoFrameRate = videoFrameRate + self.videoProfile = videoProfile + self.videoResolution = videoResolution + self.width = width + } + }} + +extension Operations.GetSearchAllLibrariesMedia: Codable { + enum CodingKeys: String, CodingKey { + case container + case id + case part = "Part" + case aspectRatio + case audioChannels + case audioCodec + case audioProfile + case bitrate + case duration + case has64bitOffsets + case hasVoiceActivity + case height + case optimizedForStreaming + case videoCodec + case videoFrameRate + case videoProfile + case videoResolution + case width + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.container = try container.decode(String.self, forKey: .container) + self.id = try container.decode(Int.self, forKey: .id) + self.part = try container.decode([Operations.GetSearchAllLibrariesPart].self, forKey: .part) + self._aspectRatio = try container.decodeIfPresent(DecimalSerialized.self, forKey: .aspectRatio) ?? DecimalSerialized(wrappedValue: nil) + self.audioChannels = try container.decodeIfPresent(Int.self, forKey: .audioChannels) + self.audioCodec = try container.decodeIfPresent(String.self, forKey: .audioCodec) + self.audioProfile = try container.decodeIfPresent(String.self, forKey: .audioProfile) + self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate) + self.duration = try container.decodeIfPresent(Int.self, forKey: .duration) + self.has64bitOffsets = try container.decodeIfPresent(Bool.self, forKey: .has64bitOffsets) + self.hasVoiceActivity = try container.decodeIfPresent(Bool.self, forKey: .hasVoiceActivity) + self.height = try container.decodeIfPresent(Int.self, forKey: .height) + self.optimizedForStreaming = try container.decodeIfPresent(Operations.GetSearchAllLibrariesOptimizedForStreaming.self, forKey: .optimizedForStreaming) + self.videoCodec = try container.decodeIfPresent(String.self, forKey: .videoCodec) + self.videoFrameRate = try container.decodeIfPresent(String.self, forKey: .videoFrameRate) + self.videoProfile = try container.decodeIfPresent(String.self, forKey: .videoProfile) + self.videoResolution = try container.decodeIfPresent(String.self, forKey: .videoResolution) + self.width = try container.decodeIfPresent(Int.self, forKey: .width) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(self.container, forKey: .container) + try container.encode(self.id, forKey: .id) + try container.encode(self.part, forKey: .part) + if self.aspectRatio != nil { + try container.encode(self._aspectRatio, forKey: .aspectRatio) + } + try container.encodeIfPresent(self.audioChannels, forKey: .audioChannels) + try container.encodeIfPresent(self.audioCodec, forKey: .audioCodec) + try container.encodeIfPresent(self.audioProfile, forKey: .audioProfile) + try container.encodeIfPresent(self.bitrate, forKey: .bitrate) + try container.encodeIfPresent(self.duration, forKey: .duration) + try container.encodeIfPresent(self.has64bitOffsets, forKey: .has64bitOffsets) + try container.encodeIfPresent(self.hasVoiceActivity, forKey: .hasVoiceActivity) + try container.encodeIfPresent(self.height, forKey: .height) + try container.encodeIfPresent(self.optimizedForStreaming, forKey: .optimizedForStreaming) + try container.encodeIfPresent(self.videoCodec, forKey: .videoCodec) + try container.encodeIfPresent(self.videoFrameRate, forKey: .videoFrameRate) + try container.encodeIfPresent(self.videoProfile, forKey: .videoProfile) + try container.encodeIfPresent(self.videoResolution, forKey: .videoResolution) + try container.encodeIfPresent(self.width, forKey: .width) + } +} + +extension Operations.GetSearchAllLibrariesMedia { + var aspectRatioWrapper: DecimalSerialized { + return _aspectRatio + } +} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesMediaContainer.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMediaContainer.swift new file mode 100644 index 0000000..0111df9 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMediaContainer.swift @@ -0,0 +1,44 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesMediaContainer { + public let searchResult: [Operations.SearchResult] + @DecimalSerialized + public private(set) var size: Double + + /// Creates an object with the specified parameters + /// + /// + public init(searchResult: [Operations.SearchResult], size: Double) { + self.searchResult = searchResult + self._size = DecimalSerialized(wrappedValue: size) + } + }} + +extension Operations.GetSearchAllLibrariesMediaContainer: Codable { + enum CodingKeys: String, CodingKey { + case searchResult = "SearchResult" + case size + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.searchResult = try container.decode([Operations.SearchResult].self, forKey: .searchResult) + self._size = try container.decode(DecimalSerialized.self, forKey: .size) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(self.searchResult, forKey: .searchResult) + try container.encode(self._size, forKey: .size) + } +} + +extension Operations.GetSearchAllLibrariesMediaContainer { + var sizeWrapper: DecimalSerialized { + return _size + } +} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesMediaGuid.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMediaGuid.swift new file mode 100644 index 0000000..7abd00a --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMediaGuid.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesMediaGuid { + /// Can be one of the following formats: + /// imdb://tt13015952, tmdb://2434012, tvdb://7945991 + /// + public let id: String + + /// Creates an object with the specified parameters + /// + /// - Parameter id: Can be one of the following formats: + /// imdb://tt13015952, tmdb://2434012, tvdb://7945991 + /// + /// + public init(id: String) { + self.id = id + } + }} + +extension Operations.GetSearchAllLibrariesMediaGuid: Codable { + enum CodingKeys: String, CodingKey { + case id + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesMetaDataRating.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMetaDataRating.swift new file mode 100644 index 0000000..715330a --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMetaDataRating.swift @@ -0,0 +1,55 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesMetaDataRating { + /// A URI or path to the rating image. + public let image: String + /// The type of rating (e.g., audience, critic). + public let type: String + /// The value of the rating. + @DecimalSerialized + public private(set) var value: Double + + /// Creates an object with the specified parameters + /// + /// - Parameter image: A URI or path to the rating image. + /// - Parameter type: The type of rating (e.g., audience, critic). + /// - Parameter value: The value of the rating. + /// + public init(image: String, type: String, value: Double) { + self.image = image + self.type = type + self._value = DecimalSerialized(wrappedValue: value) + } + }} + +extension Operations.GetSearchAllLibrariesMetaDataRating: Codable { + enum CodingKeys: String, CodingKey { + case image + case type + case value + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.image = try container.decode(String.self, forKey: .image) + self.type = try container.decode(String.self, forKey: .type) + self._value = try container.decode(DecimalSerialized.self, forKey: .value) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(self.image, forKey: .image) + try container.encode(self.type, forKey: .type) + try container.encode(self._value, forKey: .value) + } +} + +extension Operations.GetSearchAllLibrariesMetaDataRating { + var valueWrapper: DecimalSerialized { + return _value + } +} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesMetadata.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMetadata.swift new file mode 100644 index 0000000..3def2c4 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesMetadata.swift @@ -0,0 +1,458 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesMetadata { + /// Unix epoch datetime in seconds + public let addedAt: Int + public let guid: String + public let key: String + /// The rating key (Media ID) of this media item. + /// Note: This is always an integer, but is represented as a string in the API. + /// + public let ratingKey: String + public let summary: String + public let title: String + /// The type of media content + /// + public let type: Operations.GetSearchAllLibrariesType + public let art: String? + @DecimalSerialized + public private(set) var audienceRating: Double? + public let audienceRatingImage: String? + public let banner: String? + public let chapterSource: String? + public let childCount: Int? + public let collection: [Operations.GetSearchAllLibrariesCollection]? + public let contentRating: String? + public let country: [Operations.GetSearchAllLibrariesCountry]? + public let director: [Operations.GetSearchAllLibrariesDirector]? + public let duration: Int? + public let flattenSeasons: Operations.GetSearchAllLibrariesFlattenSeasons? + public let genre: [Operations.GetSearchAllLibrariesGenre]? + public let grandparentArt: String? + public let grandparentGuid: String? + public let grandparentKey: String? + public let grandparentRatingKey: String? + public let grandparentSlug: String? + public let grandparentTheme: String? + public let grandparentThumb: String? + public let grandparentTitle: String? + public let hasPremiumExtras: String? + public let hasPremiumPrimaryExtra: String? + public let image: [Operations.GetSearchAllLibrariesImage]? + public let index: Int? + public let lastViewedAt: Int? + public let leafCount: Int? + public let librarySectionID: Int? + public let librarySectionKey: String? + public let librarySectionTitle: String? + public let location: [Operations.GetSearchAllLibrariesLocation]? + /// The Media object is only included when type query is `4` or higher. + /// + public let media: [Operations.GetSearchAllLibrariesMedia]? + /// The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + /// + public let mediaGuid: [Operations.GetSearchAllLibrariesMediaGuid]? + public let metaDataRating: [Operations.GetSearchAllLibrariesMetaDataRating]? + @DateOnly + public private(set) var originallyAvailableAt: Date? + public let originalTitle: String? + public let parentGuid: String? + public let parentIndex: Int? + public let parentKey: String? + /// The rating key of the parent item. + /// + public let parentRatingKey: String? + public let parentSlug: String? + public let parentStudio: String? + public let parentTheme: String? + public let parentThumb: String? + public let parentTitle: String? + public let parentYear: Int? + public let primaryExtraKey: String? + @DecimalSerialized + public private(set) var rating: Double? + public let ratingImage: String? + public let role: [Operations.GetSearchAllLibrariesRole]? + public let seasonCount: Int? + /// Setting that indicates the episode ordering for the show + /// None = Library default, + /// tmdbAiring = The Movie Database (Aired), + /// aired = TheTVDB (Aired), + /// dvd = TheTVDB (DVD), + /// absolute = TheTVDB (Absolute)). + /// + public let showOrdering: Operations.GetSearchAllLibrariesShowOrdering? + public let skipChildren: Bool? + public let skipCount: Int? + public let slug: String? + public let studio: String? + public let tagline: String? + public let theme: String? + public let thumb: String? + public let titleSort: String? + public let ultraBlurColors: Operations.GetSearchAllLibrariesUltraBlurColors? + /// Unix epoch datetime in seconds + public let updatedAt: Int? + public let viewCount: Int? + public let viewedLeafCount: Int? + public let viewOffset: Int? + public let writer: [Operations.GetSearchAllLibrariesWriter]? + public let year: Int? + + /// Creates an object with the specified parameters + /// + /// - Parameter addedAt: Unix epoch datetime in seconds + /// - Parameter ratingKey: The rating key (Media ID) of this media item. + /// Note: This is always an integer, but is represented as a string in the API. + /// + /// - Parameter type: The type of media content + /// + /// - Parameter media: The Media object is only included when type query is `4` or higher. + /// + /// - Parameter mediaGuid: The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + /// + /// - Parameter parentRatingKey: The rating key of the parent item. + /// + /// - Parameter showOrdering: Setting that indicates the episode ordering for the show + /// None = Library default, + /// tmdbAiring = The Movie Database (Aired), + /// aired = TheTVDB (Aired), + /// dvd = TheTVDB (DVD), + /// absolute = TheTVDB (Absolute)). + /// + /// - Parameter updatedAt: Unix epoch datetime in seconds + /// + public init(addedAt: Int, guid: String, key: String, ratingKey: String, summary: String, title: String, type: Operations.GetSearchAllLibrariesType, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, banner: String? = nil, chapterSource: String? = nil, childCount: Int? = nil, collection: [Operations.GetSearchAllLibrariesCollection]? = nil, contentRating: String? = nil, country: [Operations.GetSearchAllLibrariesCountry]? = nil, director: [Operations.GetSearchAllLibrariesDirector]? = nil, duration: Int? = nil, flattenSeasons: Operations.GetSearchAllLibrariesFlattenSeasons? = nil, genre: [Operations.GetSearchAllLibrariesGenre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentSlug: String? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, hasPremiumExtras: String? = nil, hasPremiumPrimaryExtra: String? = nil, image: [Operations.GetSearchAllLibrariesImage]? = nil, index: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, librarySectionID: Int? = nil, librarySectionKey: String? = nil, librarySectionTitle: String? = nil, location: [Operations.GetSearchAllLibrariesLocation]? = nil, media: [Operations.GetSearchAllLibrariesMedia]? = nil, mediaGuid: [Operations.GetSearchAllLibrariesMediaGuid]? = nil, metaDataRating: [Operations.GetSearchAllLibrariesMetaDataRating]? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentSlug: String? = nil, parentStudio: String? = nil, parentTheme: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, parentYear: Int? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, role: [Operations.GetSearchAllLibrariesRole]? = nil, seasonCount: Int? = nil, showOrdering: Operations.GetSearchAllLibrariesShowOrdering? = nil, skipChildren: Bool? = nil, skipCount: Int? = nil, slug: String? = nil, studio: String? = nil, tagline: String? = nil, theme: String? = nil, thumb: String? = nil, titleSort: String? = nil, ultraBlurColors: Operations.GetSearchAllLibrariesUltraBlurColors? = nil, updatedAt: Int? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, viewOffset: Int? = nil, writer: [Operations.GetSearchAllLibrariesWriter]? = nil, year: Int? = nil) { + self.addedAt = addedAt + self.guid = guid + self.key = key + self.ratingKey = ratingKey + self.summary = summary + self.title = title + self.type = type + self.art = art + self._audienceRating = DecimalSerialized(wrappedValue: audienceRating) + self.audienceRatingImage = audienceRatingImage + self.banner = banner + self.chapterSource = chapterSource + self.childCount = childCount + self.collection = collection + self.contentRating = contentRating + self.country = country + self.director = director + self.duration = duration + self.flattenSeasons = flattenSeasons + self.genre = genre + self.grandparentArt = grandparentArt + self.grandparentGuid = grandparentGuid + self.grandparentKey = grandparentKey + self.grandparentRatingKey = grandparentRatingKey + self.grandparentSlug = grandparentSlug + self.grandparentTheme = grandparentTheme + self.grandparentThumb = grandparentThumb + self.grandparentTitle = grandparentTitle + self.hasPremiumExtras = hasPremiumExtras + self.hasPremiumPrimaryExtra = hasPremiumPrimaryExtra + self.image = image + self.index = index + self.lastViewedAt = lastViewedAt + self.leafCount = leafCount + self.librarySectionID = librarySectionID + self.librarySectionKey = librarySectionKey + self.librarySectionTitle = librarySectionTitle + self.location = location + self.media = media + self.mediaGuid = mediaGuid + self.metaDataRating = metaDataRating + self._originallyAvailableAt = DateOnly(wrappedValue: originallyAvailableAt) + self.originalTitle = originalTitle + self.parentGuid = parentGuid + self.parentIndex = parentIndex + self.parentKey = parentKey + self.parentRatingKey = parentRatingKey + self.parentSlug = parentSlug + self.parentStudio = parentStudio + self.parentTheme = parentTheme + self.parentThumb = parentThumb + self.parentTitle = parentTitle + self.parentYear = parentYear + self.primaryExtraKey = primaryExtraKey + self._rating = DecimalSerialized(wrappedValue: rating) + self.ratingImage = ratingImage + self.role = role + self.seasonCount = seasonCount + self.showOrdering = showOrdering + self.skipChildren = skipChildren + self.skipCount = skipCount + self.slug = slug + self.studio = studio + self.tagline = tagline + self.theme = theme + self.thumb = thumb + self.titleSort = titleSort + self.ultraBlurColors = ultraBlurColors + self.updatedAt = updatedAt + self.viewCount = viewCount + self.viewedLeafCount = viewedLeafCount + self.viewOffset = viewOffset + self.writer = writer + self.year = year + } + }} + +extension Operations.GetSearchAllLibrariesMetadata: Codable { + enum CodingKeys: String, CodingKey { + case addedAt + case guid + case key + case ratingKey + case summary + case title + case type + case art + case audienceRating + case audienceRatingImage + case banner + case chapterSource + case childCount + case collection = "Collection" + case contentRating + case country = "Country" + case director = "Director" + case duration + case flattenSeasons + case genre = "Genre" + case grandparentArt + case grandparentGuid + case grandparentKey + case grandparentRatingKey + case grandparentSlug + case grandparentTheme + case grandparentThumb + case grandparentTitle + case hasPremiumExtras + case hasPremiumPrimaryExtra + case image = "Image" + case index + case lastViewedAt + case leafCount + case librarySectionID + case librarySectionKey + case librarySectionTitle + case location = "Location" + case media = "Media" + case mediaGuid = "Guid" + case metaDataRating = "Rating" + case originallyAvailableAt + case originalTitle + case parentGuid + case parentIndex + case parentKey + case parentRatingKey + case parentSlug + case parentStudio + case parentTheme + case parentThumb + case parentTitle + case parentYear + case primaryExtraKey + case rating + case ratingImage + case role = "Role" + case seasonCount + case showOrdering + case skipChildren + case skipCount + case slug + case studio + case tagline + case theme + case thumb + case titleSort + case ultraBlurColors = "UltraBlurColors" + case updatedAt + case viewCount + case viewedLeafCount + case viewOffset + case writer = "Writer" + case year + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.addedAt = try container.decode(Int.self, forKey: .addedAt) + self.guid = try container.decode(String.self, forKey: .guid) + self.key = try container.decode(String.self, forKey: .key) + self.ratingKey = try container.decode(String.self, forKey: .ratingKey) + self.summary = try container.decode(String.self, forKey: .summary) + self.title = try container.decode(String.self, forKey: .title) + self.type = try container.decode(Operations.GetSearchAllLibrariesType.self, forKey: .type) + self.art = try container.decodeIfPresent(String.self, forKey: .art) + self._audienceRating = try container.decodeIfPresent(DecimalSerialized.self, forKey: .audienceRating) ?? DecimalSerialized(wrappedValue: nil) + self.audienceRatingImage = try container.decodeIfPresent(String.self, forKey: .audienceRatingImage) + self.banner = try container.decodeIfPresent(String.self, forKey: .banner) + self.chapterSource = try container.decodeIfPresent(String.self, forKey: .chapterSource) + self.childCount = try container.decodeIfPresent(Int.self, forKey: .childCount) + self.collection = try container.decodeIfPresent([Operations.GetSearchAllLibrariesCollection].self, forKey: .collection) + self.contentRating = try container.decodeIfPresent(String.self, forKey: .contentRating) + self.country = try container.decodeIfPresent([Operations.GetSearchAllLibrariesCountry].self, forKey: .country) + self.director = try container.decodeIfPresent([Operations.GetSearchAllLibrariesDirector].self, forKey: .director) + self.duration = try container.decodeIfPresent(Int.self, forKey: .duration) + self.flattenSeasons = try container.decodeIfPresent(Operations.GetSearchAllLibrariesFlattenSeasons.self, forKey: .flattenSeasons) + self.genre = try container.decodeIfPresent([Operations.GetSearchAllLibrariesGenre].self, forKey: .genre) + self.grandparentArt = try container.decodeIfPresent(String.self, forKey: .grandparentArt) + self.grandparentGuid = try container.decodeIfPresent(String.self, forKey: .grandparentGuid) + self.grandparentKey = try container.decodeIfPresent(String.self, forKey: .grandparentKey) + self.grandparentRatingKey = try container.decodeIfPresent(String.self, forKey: .grandparentRatingKey) + self.grandparentSlug = try container.decodeIfPresent(String.self, forKey: .grandparentSlug) + self.grandparentTheme = try container.decodeIfPresent(String.self, forKey: .grandparentTheme) + self.grandparentThumb = try container.decodeIfPresent(String.self, forKey: .grandparentThumb) + self.grandparentTitle = try container.decodeIfPresent(String.self, forKey: .grandparentTitle) + self.hasPremiumExtras = try container.decodeIfPresent(String.self, forKey: .hasPremiumExtras) + self.hasPremiumPrimaryExtra = try container.decodeIfPresent(String.self, forKey: .hasPremiumPrimaryExtra) + self.image = try container.decodeIfPresent([Operations.GetSearchAllLibrariesImage].self, forKey: .image) + self.index = try container.decodeIfPresent(Int.self, forKey: .index) + self.lastViewedAt = try container.decodeIfPresent(Int.self, forKey: .lastViewedAt) + self.leafCount = try container.decodeIfPresent(Int.self, forKey: .leafCount) + self.librarySectionID = try container.decodeIfPresent(Int.self, forKey: .librarySectionID) + self.librarySectionKey = try container.decodeIfPresent(String.self, forKey: .librarySectionKey) + self.librarySectionTitle = try container.decodeIfPresent(String.self, forKey: .librarySectionTitle) + self.location = try container.decodeIfPresent([Operations.GetSearchAllLibrariesLocation].self, forKey: .location) + self.media = try container.decodeIfPresent([Operations.GetSearchAllLibrariesMedia].self, forKey: .media) + self.mediaGuid = try container.decodeIfPresent([Operations.GetSearchAllLibrariesMediaGuid].self, forKey: .mediaGuid) + self.metaDataRating = try container.decodeIfPresent([Operations.GetSearchAllLibrariesMetaDataRating].self, forKey: .metaDataRating) + self._originallyAvailableAt = try container.decodeIfPresent(DateOnly.self, forKey: .originallyAvailableAt) ?? DateOnly(wrappedValue: nil) + self.originalTitle = try container.decodeIfPresent(String.self, forKey: .originalTitle) + self.parentGuid = try container.decodeIfPresent(String.self, forKey: .parentGuid) + self.parentIndex = try container.decodeIfPresent(Int.self, forKey: .parentIndex) + self.parentKey = try container.decodeIfPresent(String.self, forKey: .parentKey) + self.parentRatingKey = try container.decodeIfPresent(String.self, forKey: .parentRatingKey) + self.parentSlug = try container.decodeIfPresent(String.self, forKey: .parentSlug) + self.parentStudio = try container.decodeIfPresent(String.self, forKey: .parentStudio) + self.parentTheme = try container.decodeIfPresent(String.self, forKey: .parentTheme) + self.parentThumb = try container.decodeIfPresent(String.self, forKey: .parentThumb) + self.parentTitle = try container.decodeIfPresent(String.self, forKey: .parentTitle) + self.parentYear = try container.decodeIfPresent(Int.self, forKey: .parentYear) + self.primaryExtraKey = try container.decodeIfPresent(String.self, forKey: .primaryExtraKey) + self._rating = try container.decodeIfPresent(DecimalSerialized.self, forKey: .rating) ?? DecimalSerialized(wrappedValue: nil) + self.ratingImage = try container.decodeIfPresent(String.self, forKey: .ratingImage) + self.role = try container.decodeIfPresent([Operations.GetSearchAllLibrariesRole].self, forKey: .role) + self.seasonCount = try container.decodeIfPresent(Int.self, forKey: .seasonCount) + self.showOrdering = try container.decodeIfPresent(Operations.GetSearchAllLibrariesShowOrdering.self, forKey: .showOrdering) + self.skipChildren = try container.decodeIfPresent(Bool.self, forKey: .skipChildren) + self.skipCount = try container.decodeIfPresent(Int.self, forKey: .skipCount) + self.slug = try container.decodeIfPresent(String.self, forKey: .slug) + self.studio = try container.decodeIfPresent(String.self, forKey: .studio) + self.tagline = try container.decodeIfPresent(String.self, forKey: .tagline) + self.theme = try container.decodeIfPresent(String.self, forKey: .theme) + self.thumb = try container.decodeIfPresent(String.self, forKey: .thumb) + self.titleSort = try container.decodeIfPresent(String.self, forKey: .titleSort) + self.ultraBlurColors = try container.decodeIfPresent(Operations.GetSearchAllLibrariesUltraBlurColors.self, forKey: .ultraBlurColors) + self.updatedAt = try container.decodeIfPresent(Int.self, forKey: .updatedAt) + self.viewCount = try container.decodeIfPresent(Int.self, forKey: .viewCount) + self.viewedLeafCount = try container.decodeIfPresent(Int.self, forKey: .viewedLeafCount) + self.viewOffset = try container.decodeIfPresent(Int.self, forKey: .viewOffset) + self.writer = try container.decodeIfPresent([Operations.GetSearchAllLibrariesWriter].self, forKey: .writer) + self.year = try container.decodeIfPresent(Int.self, forKey: .year) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(self.addedAt, forKey: .addedAt) + try container.encode(self.guid, forKey: .guid) + try container.encode(self.key, forKey: .key) + try container.encode(self.ratingKey, forKey: .ratingKey) + try container.encode(self.summary, forKey: .summary) + try container.encode(self.title, forKey: .title) + try container.encode(self.type, forKey: .type) + try container.encodeIfPresent(self.art, forKey: .art) + if self.audienceRating != nil { + try container.encode(self._audienceRating, forKey: .audienceRating) + } + try container.encodeIfPresent(self.audienceRatingImage, forKey: .audienceRatingImage) + try container.encodeIfPresent(self.banner, forKey: .banner) + try container.encodeIfPresent(self.chapterSource, forKey: .chapterSource) + try container.encodeIfPresent(self.childCount, forKey: .childCount) + try container.encodeIfPresent(self.collection, forKey: .collection) + try container.encodeIfPresent(self.contentRating, forKey: .contentRating) + try container.encodeIfPresent(self.country, forKey: .country) + try container.encodeIfPresent(self.director, forKey: .director) + try container.encodeIfPresent(self.duration, forKey: .duration) + try container.encodeIfPresent(self.flattenSeasons, forKey: .flattenSeasons) + try container.encodeIfPresent(self.genre, forKey: .genre) + try container.encodeIfPresent(self.grandparentArt, forKey: .grandparentArt) + try container.encodeIfPresent(self.grandparentGuid, forKey: .grandparentGuid) + try container.encodeIfPresent(self.grandparentKey, forKey: .grandparentKey) + try container.encodeIfPresent(self.grandparentRatingKey, forKey: .grandparentRatingKey) + try container.encodeIfPresent(self.grandparentSlug, forKey: .grandparentSlug) + try container.encodeIfPresent(self.grandparentTheme, forKey: .grandparentTheme) + try container.encodeIfPresent(self.grandparentThumb, forKey: .grandparentThumb) + try container.encodeIfPresent(self.grandparentTitle, forKey: .grandparentTitle) + try container.encodeIfPresent(self.hasPremiumExtras, forKey: .hasPremiumExtras) + try container.encodeIfPresent(self.hasPremiumPrimaryExtra, forKey: .hasPremiumPrimaryExtra) + try container.encodeIfPresent(self.image, forKey: .image) + try container.encodeIfPresent(self.index, forKey: .index) + try container.encodeIfPresent(self.lastViewedAt, forKey: .lastViewedAt) + try container.encodeIfPresent(self.leafCount, forKey: .leafCount) + try container.encodeIfPresent(self.librarySectionID, forKey: .librarySectionID) + try container.encodeIfPresent(self.librarySectionKey, forKey: .librarySectionKey) + try container.encodeIfPresent(self.librarySectionTitle, forKey: .librarySectionTitle) + try container.encodeIfPresent(self.location, forKey: .location) + try container.encodeIfPresent(self.media, forKey: .media) + try container.encodeIfPresent(self.mediaGuid, forKey: .mediaGuid) + try container.encodeIfPresent(self.metaDataRating, forKey: .metaDataRating) + if self.originallyAvailableAt != nil { + try container.encode(self._originallyAvailableAt, forKey: .originallyAvailableAt) + } + try container.encodeIfPresent(self.originalTitle, forKey: .originalTitle) + try container.encodeIfPresent(self.parentGuid, forKey: .parentGuid) + try container.encodeIfPresent(self.parentIndex, forKey: .parentIndex) + try container.encodeIfPresent(self.parentKey, forKey: .parentKey) + try container.encodeIfPresent(self.parentRatingKey, forKey: .parentRatingKey) + try container.encodeIfPresent(self.parentSlug, forKey: .parentSlug) + try container.encodeIfPresent(self.parentStudio, forKey: .parentStudio) + try container.encodeIfPresent(self.parentTheme, forKey: .parentTheme) + try container.encodeIfPresent(self.parentThumb, forKey: .parentThumb) + try container.encodeIfPresent(self.parentTitle, forKey: .parentTitle) + try container.encodeIfPresent(self.parentYear, forKey: .parentYear) + try container.encodeIfPresent(self.primaryExtraKey, forKey: .primaryExtraKey) + if self.rating != nil { + try container.encode(self._rating, forKey: .rating) + } + try container.encodeIfPresent(self.ratingImage, forKey: .ratingImage) + try container.encodeIfPresent(self.role, forKey: .role) + try container.encodeIfPresent(self.seasonCount, forKey: .seasonCount) + try container.encodeIfPresent(self.showOrdering, forKey: .showOrdering) + try container.encodeIfPresent(self.skipChildren, forKey: .skipChildren) + try container.encodeIfPresent(self.skipCount, forKey: .skipCount) + try container.encodeIfPresent(self.slug, forKey: .slug) + try container.encodeIfPresent(self.studio, forKey: .studio) + try container.encodeIfPresent(self.tagline, forKey: .tagline) + try container.encodeIfPresent(self.theme, forKey: .theme) + try container.encodeIfPresent(self.thumb, forKey: .thumb) + try container.encodeIfPresent(self.titleSort, forKey: .titleSort) + try container.encodeIfPresent(self.ultraBlurColors, forKey: .ultraBlurColors) + try container.encodeIfPresent(self.updatedAt, forKey: .updatedAt) + try container.encodeIfPresent(self.viewCount, forKey: .viewCount) + try container.encodeIfPresent(self.viewedLeafCount, forKey: .viewedLeafCount) + try container.encodeIfPresent(self.viewOffset, forKey: .viewOffset) + try container.encodeIfPresent(self.writer, forKey: .writer) + try container.encodeIfPresent(self.year, forKey: .year) + } +} + +extension Operations.GetSearchAllLibrariesMetadata { + var ratingWrapper: DecimalSerialized { + return _rating + } + var audienceRatingWrapper: DecimalSerialized { + return _audienceRating + } + var originallyAvailableAtWrapper: DateOnly { + return _originallyAvailableAt + } +} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesOptimizedForStreaming.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesOptimizedForStreaming.swift new file mode 100644 index 0000000..adbca4b --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesOptimizedForStreaming.swift @@ -0,0 +1,9 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + public enum GetSearchAllLibrariesOptimizedForStreaming: Int, Codable, APIValue { + case disable = 0 + case enable = 1 + }} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesPart.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesPart.swift new file mode 100644 index 0000000..359ef8b --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesPart.swift @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesPart { + /// The container format of the media file. + /// + public let container: String + public let file: String + public let id: Int + public let key: String + public let size: Int + public let audioProfile: String? + public let duration: Int? + public let has64bitOffsets: Bool? + public let hasThumbnail: Operations.GetSearchAllLibrariesHasThumbnail? + public let indexes: String? + public let optimizedForStreaming: Bool? + public let stream: [Operations.GetSearchAllLibrariesStream]? + public let videoProfile: String? + + /// Creates an object with the specified parameters + /// + /// - Parameter container: The container format of the media file. + /// + /// + public init(container: String, file: String, id: Int, key: String, size: Int, audioProfile: String? = nil, duration: Int? = nil, has64bitOffsets: Bool? = nil, hasThumbnail: Operations.GetSearchAllLibrariesHasThumbnail? = nil, indexes: String? = nil, optimizedForStreaming: Bool? = nil, stream: [Operations.GetSearchAllLibrariesStream]? = nil, videoProfile: String? = nil) { + self.container = container + self.file = file + self.id = id + self.key = key + self.size = size + self.audioProfile = audioProfile + self.duration = duration + self.has64bitOffsets = has64bitOffsets + self.hasThumbnail = hasThumbnail + self.indexes = indexes + self.optimizedForStreaming = optimizedForStreaming + self.stream = stream + self.videoProfile = videoProfile + } + }} + +extension Operations.GetSearchAllLibrariesPart: Codable { + enum CodingKeys: String, CodingKey { + case container + case file + case id + case key + case size + case audioProfile + case duration + case has64bitOffsets + case hasThumbnail + case indexes + case optimizedForStreaming + case stream = "Stream" + case videoProfile + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesRequest.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesRequest.swift new file mode 100644 index 0000000..9aa877e --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesRequest.swift @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesRequest: APIValue { + /// The search query term. + public let query: String + /// An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + public let clientID: String? + /// Whether to include collections in the search results. + public let includeCollections: Operations.QueryParamIncludeCollections? + /// Whether to include external media in the search results. + public let includeExternalMedia: Operations.QueryParamIncludeExternalMedia? + /// Limit the number of results returned. + public let limit: Int? + /// A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. + /// + public let searchTypes: [Operations.SearchTypes]? + + /// Creates an object with the specified parameters + /// + /// - Parameter query: The search query term. + /// - Parameter clientID: An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + /// - Parameter includeCollections: Whether to include collections in the search results. + /// - Parameter includeExternalMedia: Whether to include external media in the search results. + /// - Parameter limit: Limit the number of results returned. + /// - Parameter searchTypes: A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. + /// + /// + public init(query: String, clientID: String? = nil, includeCollections: Operations.QueryParamIncludeCollections? = nil, includeExternalMedia: Operations.QueryParamIncludeExternalMedia? = nil, limit: Int? = nil, searchTypes: [Operations.SearchTypes]? = nil) { + self.query = query + self.clientID = clientID + self.includeCollections = includeCollections + self.includeExternalMedia = includeExternalMedia + self.limit = limit + self.searchTypes = searchTypes + } + }} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesResponse.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesResponse.swift new file mode 100644 index 0000000..46eab1c --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesResponse.swift @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A response model + public enum GetSearchAllLibrariesResponse { + case empty + case badRequest(Operations.GetSearchAllLibrariesBadRequest) + case object(Operations.GetSearchAllLibrariesResponseBody) + case unauthorized(Operations.GetSearchAllLibrariesUnauthorized) + + var isEmpty: Bool { + if case .empty = self { + return true + } else { + return false + } + } + + public func badRequest() throws -> Operations.GetSearchAllLibrariesBadRequest { + guard case .badRequest(let value) = self else { + throw PlexswiftError.missingResponseData + } + return value + } + + public func object() throws -> Operations.GetSearchAllLibrariesResponseBody { + guard case .object(let value) = self else { + throw PlexswiftError.missingResponseData + } + return value + } + + public func unauthorized() throws -> Operations.GetSearchAllLibrariesUnauthorized { + guard case .unauthorized(let value) = self else { + throw PlexswiftError.missingResponseData + } + return value + } + }} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesResponseBody.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesResponseBody.swift new file mode 100644 index 0000000..5d08f69 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesResponseBody.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// The libraries available on the Server + public struct GetSearchAllLibrariesResponseBody { + public let mediaContainer: Operations.GetSearchAllLibrariesMediaContainer + + /// Creates an object with the specified parameters + /// + /// + public init(mediaContainer: Operations.GetSearchAllLibrariesMediaContainer) { + self.mediaContainer = mediaContainer + } + }} + +extension Operations.GetSearchAllLibrariesResponseBody: Codable { + enum CodingKeys: String, CodingKey { + case mediaContainer = "MediaContainer" + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesRole.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesRole.swift new file mode 100644 index 0000000..6484fe7 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesRole.swift @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesRole { + /// The filter used to find the actor or tag. + public let filter: String? + /// The ID of the tag or actor. + public let id: Int? + /// The role of the actor or tag in the media. + public let role: String? + /// The name of the tag or actor. + public let tag: String? + /// Unique identifier for the tag. + public let tagKey: String? + /// The thumbnail of the actor + public let thumb: String? + + /// Creates an object with the specified parameters + /// + /// - Parameter filter: The filter used to find the actor or tag. + /// - Parameter id: The ID of the tag or actor. + /// - Parameter role: The role of the actor or tag in the media. + /// - Parameter tag: The name of the tag or actor. + /// - Parameter tagKey: Unique identifier for the tag. + /// - Parameter thumb: The thumbnail of the actor + /// + public init(filter: String? = nil, id: Int? = nil, role: String? = nil, tag: String? = nil, tagKey: String? = nil, thumb: String? = nil) { + self.filter = filter + self.id = id + self.role = role + self.tag = tag + self.tagKey = tagKey + self.thumb = thumb + } + }} + +extension Operations.GetSearchAllLibrariesRole: Codable { + enum CodingKeys: String, CodingKey { + case filter + case id + case role + case tag + case tagKey + case thumb + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesShowOrdering.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesShowOrdering.swift new file mode 100644 index 0000000..d6e211e --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesShowOrdering.swift @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// Setting that indicates the episode ordering for the show + /// None = Library default, + /// tmdbAiring = The Movie Database (Aired), + /// aired = TheTVDB (Aired), + /// dvd = TheTVDB (DVD), + /// absolute = TheTVDB (Absolute)). + /// + public enum GetSearchAllLibrariesShowOrdering: String, Codable, APIValue { + case `none` = "None" + case tmdbAiring = "tmdbAiring" + case aired = "aired" + case dvd = "dvd" + case absolute = "absolute" + }} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesStream.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesStream.swift new file mode 100644 index 0000000..c9315ba --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesStream.swift @@ -0,0 +1,294 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesStream { + /// Codec used by the stream + public let codec: String + public let id: Int + /// The index of the stream + public let index: Int + /// Type of stream (1 = video, 2 = audio, 3 = subtitle) + public let streamType: Int + /// The audio channel layout + public let audioChannelLayout: String? + /// The bit depth of the video stream + public let bitDepth: Int? + /// The bitrate of the stream in kbps + public let bitrate: Int? + /// Indicates if the subtitle stream can auto-sync + public let canAutoSync: Bool? + /// Number of audio channels (for audio streams) + public let channels: Int? + /// The chroma location of the video stream + public let chromaLocation: String? + /// The chroma subsampling format + public let chromaSubsampling: String? + public let closedCaptions: Bool? + /// The coded height of the video stream + public let codedHeight: Int? + /// The coded width of the video stream + public let codedWidth: Int? + /// The color primaries of the video stream + public let colorPrimaries: String? + /// The color range of the video stream + public let colorRange: String? + /// The color space of the video stream + public let colorSpace: String? + /// The transfer characteristics (TRC) of the video stream + public let colorTrc: String? + /// Indicates if this is the default stream + public let `default`: Bool? + /// Display title of the stream + public let displayTitle: String? + public let embeddedInVideo: String? + /// Extended display title of the stream + public let extendedDisplayTitle: String? + /// The frame rate of the video stream + @DecimalSerialized + public private(set) var frameRate: Double? + /// Indicates if the stream has a scaling matrix + public let hasScalingMatrix: Bool? + public let hearingImpaired: Bool? + /// The height of the video stream + public let height: Int? + /// The language of the stream (for audio/subtitle streams) + public let language: String? + /// Language code of the stream + public let languageCode: String? + /// Language tag of the stream + public let languageTag: String? + /// The level of the video codec + public let level: Int? + /// The profile of the video codec + public let profile: String? + /// Number of reference frames + public let refFrames: Int? + /// Sampling rate of the audio stream in Hz + public let samplingRate: Int? + /// The scan type (progressive or interlaced) + public let scanType: String? + /// Indicates if the stream is selected + public let selected: Bool? + /// The identifier of the video stream + public let streamIdentifier: String? + /// Title of the subtitle track (for subtitle streams) + public let title: String? + /// The width of the video stream + public let width: Int? + + /// Creates an object with the specified parameters + /// + /// - Parameter codec: Codec used by the stream + /// - Parameter index: The index of the stream + /// - Parameter streamType: Type of stream (1 = video, 2 = audio, 3 = subtitle) + /// - Parameter audioChannelLayout: The audio channel layout + /// - Parameter bitDepth: The bit depth of the video stream + /// - Parameter bitrate: The bitrate of the stream in kbps + /// - Parameter canAutoSync: Indicates if the subtitle stream can auto-sync + /// - Parameter channels: Number of audio channels (for audio streams) + /// - Parameter chromaLocation: The chroma location of the video stream + /// - Parameter chromaSubsampling: The chroma subsampling format + /// - Parameter codedHeight: The coded height of the video stream + /// - Parameter codedWidth: The coded width of the video stream + /// - Parameter colorPrimaries: The color primaries of the video stream + /// - Parameter colorRange: The color range of the video stream + /// - Parameter colorSpace: The color space of the video stream + /// - Parameter colorTrc: The transfer characteristics (TRC) of the video stream + /// - Parameter `default`: Indicates if this is the default stream + /// - Parameter displayTitle: Display title of the stream + /// - Parameter extendedDisplayTitle: Extended display title of the stream + /// - Parameter frameRate: The frame rate of the video stream + /// - Parameter hasScalingMatrix: Indicates if the stream has a scaling matrix + /// - Parameter height: The height of the video stream + /// - Parameter language: The language of the stream (for audio/subtitle streams) + /// - Parameter languageCode: Language code of the stream + /// - Parameter languageTag: Language tag of the stream + /// - Parameter level: The level of the video codec + /// - Parameter profile: The profile of the video codec + /// - Parameter refFrames: Number of reference frames + /// - Parameter samplingRate: Sampling rate of the audio stream in Hz + /// - Parameter scanType: The scan type (progressive or interlaced) + /// - Parameter selected: Indicates if the stream is selected + /// - Parameter streamIdentifier: The identifier of the video stream + /// - Parameter title: Title of the subtitle track (for subtitle streams) + /// - Parameter width: The width of the video stream + /// + public init(codec: String, id: Int, index: Int, streamType: Int, audioChannelLayout: String? = nil, bitDepth: Int? = nil, bitrate: Int? = nil, canAutoSync: Bool? = nil, channels: Int? = nil, chromaLocation: String? = nil, chromaSubsampling: String? = nil, closedCaptions: Bool? = nil, codedHeight: Int? = nil, codedWidth: Int? = nil, colorPrimaries: String? = nil, colorRange: String? = nil, colorSpace: String? = nil, colorTrc: String? = nil, `default`: Bool? = nil, displayTitle: String? = nil, embeddedInVideo: String? = nil, extendedDisplayTitle: String? = nil, frameRate: Double? = nil, hasScalingMatrix: Bool? = nil, hearingImpaired: Bool? = nil, height: Int? = nil, language: String? = nil, languageCode: String? = nil, languageTag: String? = nil, level: Int? = nil, profile: String? = nil, refFrames: Int? = nil, samplingRate: Int? = nil, scanType: String? = nil, selected: Bool? = nil, streamIdentifier: String? = nil, title: String? = nil, width: Int? = nil) { + self.codec = codec + self.id = id + self.index = index + self.streamType = streamType + self.audioChannelLayout = audioChannelLayout + self.bitDepth = bitDepth + self.bitrate = bitrate + self.canAutoSync = canAutoSync + self.channels = channels + self.chromaLocation = chromaLocation + self.chromaSubsampling = chromaSubsampling + self.closedCaptions = closedCaptions + self.codedHeight = codedHeight + self.codedWidth = codedWidth + self.colorPrimaries = colorPrimaries + self.colorRange = colorRange + self.colorSpace = colorSpace + self.colorTrc = colorTrc + self.`default` = `default` + self.displayTitle = displayTitle + self.embeddedInVideo = embeddedInVideo + self.extendedDisplayTitle = extendedDisplayTitle + self._frameRate = DecimalSerialized(wrappedValue: frameRate) + self.hasScalingMatrix = hasScalingMatrix + self.hearingImpaired = hearingImpaired + self.height = height + self.language = language + self.languageCode = languageCode + self.languageTag = languageTag + self.level = level + self.profile = profile + self.refFrames = refFrames + self.samplingRate = samplingRate + self.scanType = scanType + self.selected = selected + self.streamIdentifier = streamIdentifier + self.title = title + self.width = width + } + }} + +extension Operations.GetSearchAllLibrariesStream: Codable { + enum CodingKeys: String, CodingKey { + case codec + case id + case index + case streamType + case audioChannelLayout + case bitDepth + case bitrate + case canAutoSync + case channels + case chromaLocation + case chromaSubsampling + case closedCaptions + case codedHeight + case codedWidth + case colorPrimaries + case colorRange + case colorSpace + case colorTrc + case `default` = "default" + case displayTitle + case embeddedInVideo + case extendedDisplayTitle + case frameRate + case hasScalingMatrix + case hearingImpaired + case height + case language + case languageCode + case languageTag + case level + case profile + case refFrames + case samplingRate + case scanType + case selected + case streamIdentifier + case title + case width + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.codec = try container.decode(String.self, forKey: .codec) + self.id = try container.decode(Int.self, forKey: .id) + self.index = try container.decode(Int.self, forKey: .index) + self.streamType = try container.decode(Int.self, forKey: .streamType) + self.audioChannelLayout = try container.decodeIfPresent(String.self, forKey: .audioChannelLayout) + self.bitDepth = try container.decodeIfPresent(Int.self, forKey: .bitDepth) + self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate) + self.canAutoSync = try container.decodeIfPresent(Bool.self, forKey: .canAutoSync) + self.channels = try container.decodeIfPresent(Int.self, forKey: .channels) + self.chromaLocation = try container.decodeIfPresent(String.self, forKey: .chromaLocation) + self.chromaSubsampling = try container.decodeIfPresent(String.self, forKey: .chromaSubsampling) + self.closedCaptions = try container.decodeIfPresent(Bool.self, forKey: .closedCaptions) + self.codedHeight = try container.decodeIfPresent(Int.self, forKey: .codedHeight) + self.codedWidth = try container.decodeIfPresent(Int.self, forKey: .codedWidth) + self.colorPrimaries = try container.decodeIfPresent(String.self, forKey: .colorPrimaries) + self.colorRange = try container.decodeIfPresent(String.self, forKey: .colorRange) + self.colorSpace = try container.decodeIfPresent(String.self, forKey: .colorSpace) + self.colorTrc = try container.decodeIfPresent(String.self, forKey: .colorTrc) + self.`default` = try container.decodeIfPresent(Bool.self, forKey: .`default`) + self.displayTitle = try container.decodeIfPresent(String.self, forKey: .displayTitle) + self.embeddedInVideo = try container.decodeIfPresent(String.self, forKey: .embeddedInVideo) + self.extendedDisplayTitle = try container.decodeIfPresent(String.self, forKey: .extendedDisplayTitle) + self._frameRate = try container.decodeIfPresent(DecimalSerialized.self, forKey: .frameRate) ?? DecimalSerialized(wrappedValue: nil) + self.hasScalingMatrix = try container.decodeIfPresent(Bool.self, forKey: .hasScalingMatrix) + self.hearingImpaired = try container.decodeIfPresent(Bool.self, forKey: .hearingImpaired) + self.height = try container.decodeIfPresent(Int.self, forKey: .height) + self.language = try container.decodeIfPresent(String.self, forKey: .language) + self.languageCode = try container.decodeIfPresent(String.self, forKey: .languageCode) + self.languageTag = try container.decodeIfPresent(String.self, forKey: .languageTag) + self.level = try container.decodeIfPresent(Int.self, forKey: .level) + self.profile = try container.decodeIfPresent(String.self, forKey: .profile) + self.refFrames = try container.decodeIfPresent(Int.self, forKey: .refFrames) + self.samplingRate = try container.decodeIfPresent(Int.self, forKey: .samplingRate) + self.scanType = try container.decodeIfPresent(String.self, forKey: .scanType) + self.selected = try container.decodeIfPresent(Bool.self, forKey: .selected) + self.streamIdentifier = try container.decodeIfPresent(String.self, forKey: .streamIdentifier) + self.title = try container.decodeIfPresent(String.self, forKey: .title) + self.width = try container.decodeIfPresent(Int.self, forKey: .width) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(self.codec, forKey: .codec) + try container.encode(self.id, forKey: .id) + try container.encode(self.index, forKey: .index) + try container.encode(self.streamType, forKey: .streamType) + try container.encodeIfPresent(self.audioChannelLayout, forKey: .audioChannelLayout) + try container.encodeIfPresent(self.bitDepth, forKey: .bitDepth) + try container.encodeIfPresent(self.bitrate, forKey: .bitrate) + try container.encodeIfPresent(self.canAutoSync, forKey: .canAutoSync) + try container.encodeIfPresent(self.channels, forKey: .channels) + try container.encodeIfPresent(self.chromaLocation, forKey: .chromaLocation) + try container.encodeIfPresent(self.chromaSubsampling, forKey: .chromaSubsampling) + try container.encodeIfPresent(self.closedCaptions, forKey: .closedCaptions) + try container.encodeIfPresent(self.codedHeight, forKey: .codedHeight) + try container.encodeIfPresent(self.codedWidth, forKey: .codedWidth) + try container.encodeIfPresent(self.colorPrimaries, forKey: .colorPrimaries) + try container.encodeIfPresent(self.colorRange, forKey: .colorRange) + try container.encodeIfPresent(self.colorSpace, forKey: .colorSpace) + try container.encodeIfPresent(self.colorTrc, forKey: .colorTrc) + try container.encodeIfPresent(self.`default`, forKey: .`default`) + try container.encodeIfPresent(self.displayTitle, forKey: .displayTitle) + try container.encodeIfPresent(self.embeddedInVideo, forKey: .embeddedInVideo) + try container.encodeIfPresent(self.extendedDisplayTitle, forKey: .extendedDisplayTitle) + if self.frameRate != nil { + try container.encode(self._frameRate, forKey: .frameRate) + } + try container.encodeIfPresent(self.hasScalingMatrix, forKey: .hasScalingMatrix) + try container.encodeIfPresent(self.hearingImpaired, forKey: .hearingImpaired) + try container.encodeIfPresent(self.height, forKey: .height) + try container.encodeIfPresent(self.language, forKey: .language) + try container.encodeIfPresent(self.languageCode, forKey: .languageCode) + try container.encodeIfPresent(self.languageTag, forKey: .languageTag) + try container.encodeIfPresent(self.level, forKey: .level) + try container.encodeIfPresent(self.profile, forKey: .profile) + try container.encodeIfPresent(self.refFrames, forKey: .refFrames) + try container.encodeIfPresent(self.samplingRate, forKey: .samplingRate) + try container.encodeIfPresent(self.scanType, forKey: .scanType) + try container.encodeIfPresent(self.selected, forKey: .selected) + try container.encodeIfPresent(self.streamIdentifier, forKey: .streamIdentifier) + try container.encodeIfPresent(self.title, forKey: .title) + try container.encodeIfPresent(self.width, forKey: .width) + } +} + +extension Operations.GetSearchAllLibrariesStream { + var frameRateWrapper: DecimalSerialized { + return _frameRate + } +} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesType.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesType.swift new file mode 100644 index 0000000..a0ff700 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesType.swift @@ -0,0 +1,13 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// The type of media content + /// + public enum GetSearchAllLibrariesType: String, Codable, APIValue { + case movie = "movie" + case tvShow = "show" + case season = "season" + case episode = "episode" + }} diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesUltraBlurColors.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesUltraBlurColors.swift new file mode 100644 index 0000000..e32c79c --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesUltraBlurColors.swift @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesUltraBlurColors { + public let bottomLeft: String + public let bottomRight: String + public let topLeft: String + public let topRight: String + + /// Creates an object with the specified parameters + /// + /// + public init(bottomLeft: String, bottomRight: String, topLeft: String, topRight: String) { + self.bottomLeft = bottomLeft + self.bottomRight = bottomRight + self.topLeft = topLeft + self.topRight = topRight + } + }} + +extension Operations.GetSearchAllLibrariesUltraBlurColors: Codable { + enum CodingKeys: String, CodingKey { + case bottomLeft + case bottomRight + case topLeft + case topRight + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesUnauthorized.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesUnauthorized.swift new file mode 100644 index 0000000..474ff08 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesUnauthorized.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + public struct GetSearchAllLibrariesUnauthorized { + public let errors: [Operations.GetSearchAllLibrariesLibraryErrors]? + + /// Creates an object with the specified parameters + /// + /// + public init(errors: [Operations.GetSearchAllLibrariesLibraryErrors]? = nil) { + self.errors = errors + } + }} + +extension Operations.GetSearchAllLibrariesUnauthorized: Codable { + enum CodingKeys: String, CodingKey { + case errors + } +} + diff --git a/Sources/Plexswift/models/operations/GetSearchAllLibrariesWriter.swift b/Sources/Plexswift/models/operations/GetSearchAllLibrariesWriter.swift new file mode 100644 index 0000000..be21f86 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetSearchAllLibrariesWriter.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetSearchAllLibrariesWriter { + public let tag: String? + + /// Creates an object with the specified parameters + /// + /// + public init(tag: String? = nil) { + self.tag = tag + } + }} + +extension Operations.GetSearchAllLibrariesWriter: Codable { + enum CodingKeys: String, CodingKey { + case tag + } +} + diff --git a/Sources/Plexswift/models/operations/GetServerResourcesRequest.swift b/Sources/Plexswift/models/operations/GetServerResourcesRequest.swift index a00874c..214e3c9 100644 --- a/Sources/Plexswift/models/operations/GetServerResourcesRequest.swift +++ b/Sources/Plexswift/models/operations/GetServerResourcesRequest.swift @@ -5,7 +5,7 @@ import Foundation extension Operations { /// A model object public struct GetServerResourcesRequest: APIValue { - /// The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + /// An opaque identifier unique to the client (UUID, serial number, or other unique device ID) public let clientID: String? /// Include Https entries in the results public let includeHttps: Operations.IncludeHttps? @@ -18,7 +18,7 @@ extension Operations { /// Creates an object with the specified parameters /// - /// - Parameter clientID: The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + /// - Parameter clientID: An opaque identifier unique to the client (UUID, serial number, or other unique device ID) /// - Parameter includeHttps: Include Https entries in the results /// - Parameter includeIPv6: Include IPv6 entries in the results /// - Parameter includeRelay: Include Relay addresses in the results diff --git a/Sources/Plexswift/models/operations/GetThumbImageRequest.swift b/Sources/Plexswift/models/operations/GetThumbImageRequest.swift index ef6bf13..41aa6eb 100644 --- a/Sources/Plexswift/models/operations/GetThumbImageRequest.swift +++ b/Sources/Plexswift/models/operations/GetThumbImageRequest.swift @@ -11,13 +11,13 @@ extension Operations { public let ratingKey: Int public let upscale: Int public let width: Int - /// Plex Authentication Token + /// An authentication token, obtained from plex.tv public let xPlexToken: String /// Creates an object with the specified parameters /// /// - Parameter ratingKey: the id of the library item to return the children of. - /// - Parameter xPlexToken: Plex Authentication Token + /// - Parameter xPlexToken: An authentication token, obtained from plex.tv /// public init(height: Int, minSize: Int, ratingKey: Int, upscale: Int, width: Int, xPlexToken: String) { self.height = height diff --git a/Sources/Plexswift/models/operations/GetTokenByPinIdRequest.swift b/Sources/Plexswift/models/operations/GetTokenByPinIdRequest.swift index 7fdcb85..a468df7 100644 --- a/Sources/Plexswift/models/operations/GetTokenByPinIdRequest.swift +++ b/Sources/Plexswift/models/operations/GetTokenByPinIdRequest.swift @@ -7,24 +7,32 @@ extension Operations { public struct GetTokenByPinIdRequest: APIValue { /// The PinID to retrieve an access token for public let pinID: Int - /// The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + /// An opaque identifier unique to the client (UUID, serial number, or other unique device ID) public let clientID: String? + /// The name of the client application. (Plex Web, Plex Media Server, etc.) public let clientName: String? - public let clientPlatform: String? + /// The version of the client application. public let clientVersion: String? - public let deviceName: String? + /// A relatively friendly name for the client device + public let deviceNickname: String? + /// The platform of the client application. + public let platform: String? /// Creates an object with the specified parameters /// /// - Parameter pinID: The PinID to retrieve an access token for - /// - Parameter clientID: The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + /// - Parameter clientID: An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + /// - Parameter clientName: The name of the client application. (Plex Web, Plex Media Server, etc.) + /// - Parameter clientVersion: The version of the client application. + /// - Parameter deviceNickname: A relatively friendly name for the client device + /// - Parameter platform: The platform of the client application. /// - public init(pinID: Int, clientID: String? = nil, clientName: String? = nil, clientPlatform: String? = nil, clientVersion: String? = nil, deviceName: String? = nil) { + public init(pinID: Int, clientID: String? = nil, clientName: String? = nil, clientVersion: String? = nil, deviceNickname: String? = nil, platform: String? = nil) { self.pinID = pinID self.clientID = clientID self.clientName = clientName - self.clientPlatform = clientPlatform self.clientVersion = clientVersion - self.deviceName = deviceName + self.deviceNickname = deviceNickname + self.platform = platform } }} diff --git a/Sources/Plexswift/models/operations/GetTokenDetailsFeatures.swift b/Sources/Plexswift/models/operations/GetTokenDetailsFeatures.swift deleted file mode 100644 index 9287d12..0000000 --- a/Sources/Plexswift/models/operations/GetTokenDetailsFeatures.swift +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -import Foundation - -extension Operations { - public enum GetTokenDetailsFeatures: String, Codable, APIValue { - case androidDolbyVision = "Android - Dolby Vision" - case androidPiP = "Android - PiP" - case cuSunset = "CU Sunset" - case hrkEnableEur = "HRK_enable_EUR" - case trebleShowFeatures = "TREBLE-show-features" - case adCountdownTimer = "ad-countdown-timer" - case adaptiveBitrate = "adaptive_bitrate" - case albumTypes = "album-types" - case allowDvr = "allow_dvr" - case amazonLoopDebug = "amazon-loop-debug" - case avodAdAnalysis = "avod-ad-analysis" - case avodNewMedia = "avod-new-media" - case blacklistGetSignin = "blacklist_get_signin" - case boostVoices = "boost-voices" - case cameraUpload = "camera_upload" - case clientRadioStations = "client-radio-stations" - case cloudflareTurnstileRequired = "cloudflare-turnstile-required" - case cloudsync = "cloudsync" - case collections = "collections" - case commentsAndRepliesPushNotifications = "comments_and_replies_push_notifications" - case communityAccessPlexTv = "community_access_plex_tv" - case companionsSonos = "companions_sonos" - case contentFilter = "content_filter" - case customHomeRemoval = "custom-home-removal" - case disableHomeUserFriendships = "disable_home_user_friendships" - case disableSharingFriendships = "disable_sharing_friendships" - case downloadsGating = "downloads-gating" - case drmSupport = "drm_support" - case dvr = "dvr" - case dvrBlockUnsupportedCountries = "dvr-block-unsupported-countries" - case epgRecentChannels = "epg-recent-channels" - case excludeRestrictions = "exclude restrictions" - case federatedAuth = "federated-auth" - case friendRequestPushNotifications = "friend_request_push_notifications" - case grandfatherSync = "grandfather-sync" - case guidedUpgrade = "guided-upgrade" - case hardwareTranscoding = "hardware_transcoding" - case home = "home" - case hwtranscode = "hwtranscode" - case imaggaV2 = "imagga-v2" - case increasePasswordComplexity = "increase-password-complexity" - case ios14PrivacyBanner = "ios14-privacy-banner" - case iterableNotificationTokens = "iterable-notification-tokens" - case itemClusters = "item_clusters" - case keepPaymentMethod = "keep-payment-method" - case kevinBacon = "kevin-bacon" - case koreaConsent = "korea-consent" - case leIsrgRootX1 = "le_isrg_root_x1" - case letsEncrypt = "lets_encrypt" - case lightningDvrPivot = "lightning-dvr-pivot" - case liveTvSupportIncompleteSegments = "live-tv-support-incomplete-segments" - case livetv = "livetv" - case lyrics = "lyrics" - case metadataSearch = "metadata_search" - case musicAnalysis = "music-analysis" - case musicVideos = "music_videos" - case newPlexPassPrices = "new_plex_pass_prices" - case newsProviderSunsetModal = "news-provider-sunset-modal" - case nominatim = "nominatim" - case pass = "pass" - case photosFavorites = "photos-favorites" - case photosMetadataEdition = "photos-metadata-edition" - case photosV6Edit = "photosV6-edit" - case photosV6TvAlbums = "photosV6-tv-albums" - case pmsHealth = "pms_health" - case premiumDashboard = "premium-dashboard" - case premiumMusicMetadata = "premium_music_metadata" - case radio = "radio" - case rateLimitClientToken = "rate-limit-client-token" - case scrobblingServicePlexTv = "scrobbling-service-plex-tv" - case sessionBandwidthRestrictions = "session_bandwidth_restrictions" - case sessionKick = "session_kick" - case sharedServerNotification = "shared_server_notification" - case sharedSourceNotification = "shared_source_notification" - case signinNotification = "signin_notification" - case signinWithApple = "signin_with_apple" - case silenceRemoval = "silence-removal" - case sleepTimer = "sleep-timer" - case springServeAdProvider = "spring_serve_ad_provider" - case sync = "sync" - case sweetFades = "sweet-fades" - case transcoderCache = "transcoder_cache" - case trailers = "trailers" - case tunerSharing = "tuner-sharing" - case twoFactorAuthentication = "two-factor-authentication" - case unsupportedtuners = "unsupportedtuners" - case upgrade3Ds2 = "upgrade-3ds2" - case visualizers = "visualizers" - case vodSchema = "vod-schema" - case vodCloudflare = "vod_cloudflare" - case volumeLeveling = "volume-leveling" - case watchTogetherInvite = "watch-together-invite" - case watchlistRss = "watchlist-rss" - case webServerDashboard = "web_server_dashboard" - case webhooks = "webhooks" - }} diff --git a/Sources/Plexswift/models/operations/GetTokenDetailsSubscription.swift b/Sources/Plexswift/models/operations/GetTokenDetailsSubscription.swift index b40274c..d0888e1 100644 --- a/Sources/Plexswift/models/operations/GetTokenDetailsSubscription.swift +++ b/Sources/Plexswift/models/operations/GetTokenDetailsSubscription.swift @@ -8,7 +8,7 @@ extension Operations { /// If the account's Plex Pass subscription is active public let active: Bool? /// List of features allowed on your Plex Pass subscription - public let features: [Operations.GetTokenDetailsFeatures]? + public let features: [String]? /// Payment service used for your Plex Pass subscription public let paymentService: String? /// Name of Plex Pass subscription plan @@ -27,7 +27,7 @@ extension Operations { /// - Parameter status: String representation of subscriptionActive /// - Parameter subscribedAt: Date the account subscribed to Plex Pass /// - public init(active: Bool? = nil, features: [Operations.GetTokenDetailsFeatures]? = nil, paymentService: String? = nil, plan: String? = nil, status: Operations.GetTokenDetailsAuthenticationResponseStatus? = nil, subscribedAt: String? = nil) { + public init(active: Bool? = nil, features: [String]? = nil, paymentService: String? = nil, plan: String? = nil, status: Operations.GetTokenDetailsAuthenticationResponseStatus? = nil, subscribedAt: String? = nil) { self.active = active self.features = features self.paymentService = paymentService diff --git a/Sources/Plexswift/models/operations/GetWatchListRequest.swift b/Sources/Plexswift/models/operations/GetWatchListRequest.swift index 7f83093..ba060d4 100644 --- a/Sources/Plexswift/models/operations/GetWatchListRequest.swift +++ b/Sources/Plexswift/models/operations/GetWatchListRequest.swift @@ -7,7 +7,7 @@ extension Operations { public struct GetWatchListRequest: APIValue { /// Filter public let filter: Operations.Filter - /// Plex Authentication Token + /// An authentication token, obtained from plex.tv public let xPlexToken: String /// include collections in the results /// @@ -41,7 +41,7 @@ extension Operations { /// Creates an object with the specified parameters /// /// - Parameter filter: Filter - /// - Parameter xPlexToken: Plex Authentication Token + /// - Parameter xPlexToken: An authentication token, obtained from plex.tv /// - Parameter includeCollections: include collections in the results /// /// - Parameter includeExternalMedia: include external media in the results diff --git a/Sources/Plexswift/models/operations/Location.swift b/Sources/Plexswift/models/operations/Location.swift index 4df97aa..519f6f9 100644 --- a/Sources/Plexswift/models/operations/Location.swift +++ b/Sources/Plexswift/models/operations/Location.swift @@ -5,21 +5,18 @@ import Foundation extension Operations { /// A model object public struct Location { - public let id: Int - public let path: String + public let path: String? /// Creates an object with the specified parameters /// /// - public init(id: Int, path: String) { - self.id = id + public init(path: String? = nil) { self.path = path } }} extension Operations.Location: Codable { enum CodingKeys: String, CodingKey { - case id case path } } diff --git a/Sources/Plexswift/models/operations/Media.swift b/Sources/Plexswift/models/operations/Media.swift index ddc0b74..e364df9 100644 --- a/Sources/Plexswift/models/operations/Media.swift +++ b/Sources/Plexswift/models/operations/Media.swift @@ -5,120 +5,122 @@ import Foundation extension Operations { /// A model object public struct Media { - @DecimalSerialized - public private(set) var aspectRatio: Double - public let audioChannels: Int - public let audioCodec: String - public let bitrate: Int public let container: String - public let duration: Int - public let height: Int public let id: Int public let part: [Operations.Part] - public let videoCodec: String - public let videoFrameRate: String - public let videoProfile: String - public let videoResolution: String - public let width: Int + @DecimalSerialized + public private(set) var aspectRatio: Double? + public let audioChannels: Int? + public let audioCodec: String? public let audioProfile: String? + public let bitrate: Int? + public let duration: Int? public let has64bitOffsets: Bool? public let hasVoiceActivity: Bool? + public let height: Int? public let optimizedForStreaming: Operations.OptimizedForStreaming? + public let videoCodec: String? + public let videoFrameRate: String? + public let videoProfile: String? + public let videoResolution: String? + public let width: Int? /// Creates an object with the specified parameters /// /// - public init(aspectRatio: Double, audioChannels: Int, audioCodec: String, bitrate: Int, container: String, duration: Int, height: Int, id: Int, part: [Operations.Part], videoCodec: String, videoFrameRate: String, videoProfile: String, videoResolution: String, width: Int, audioProfile: String? = nil, has64bitOffsets: Bool? = nil, hasVoiceActivity: Bool? = nil, optimizedForStreaming: Operations.OptimizedForStreaming? = nil) { - self._aspectRatio = DecimalSerialized(wrappedValue: aspectRatio) - self.audioChannels = audioChannels - self.audioCodec = audioCodec - self.bitrate = bitrate + public init(container: String, id: Int, part: [Operations.Part], aspectRatio: Double? = nil, audioChannels: Int? = nil, audioCodec: String? = nil, audioProfile: String? = nil, bitrate: Int? = nil, duration: Int? = nil, has64bitOffsets: Bool? = nil, hasVoiceActivity: Bool? = nil, height: Int? = nil, optimizedForStreaming: Operations.OptimizedForStreaming? = nil, videoCodec: String? = nil, videoFrameRate: String? = nil, videoProfile: String? = nil, videoResolution: String? = nil, width: Int? = nil) { self.container = container - self.duration = duration - self.height = height self.id = id self.part = part + self._aspectRatio = DecimalSerialized(wrappedValue: aspectRatio) + self.audioChannels = audioChannels + self.audioCodec = audioCodec + self.audioProfile = audioProfile + self.bitrate = bitrate + self.duration = duration + self.has64bitOffsets = has64bitOffsets + self.hasVoiceActivity = hasVoiceActivity + self.height = height + self.optimizedForStreaming = optimizedForStreaming self.videoCodec = videoCodec self.videoFrameRate = videoFrameRate self.videoProfile = videoProfile self.videoResolution = videoResolution self.width = width - self.audioProfile = audioProfile - self.has64bitOffsets = has64bitOffsets - self.hasVoiceActivity = hasVoiceActivity - self.optimizedForStreaming = optimizedForStreaming } }} extension Operations.Media: Codable { enum CodingKeys: String, CodingKey { + case container + case id + case part = "Part" case aspectRatio case audioChannels case audioCodec + case audioProfile case bitrate - case container case duration + case has64bitOffsets + case hasVoiceActivity case height - case id - case part = "Part" + case optimizedForStreaming case videoCodec case videoFrameRate case videoProfile case videoResolution case width - case audioProfile - case has64bitOffsets - case hasVoiceActivity - case optimizedForStreaming } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self._aspectRatio = try container.decode(DecimalSerialized.self, forKey: .aspectRatio) - self.audioChannels = try container.decode(Int.self, forKey: .audioChannels) - self.audioCodec = try container.decode(String.self, forKey: .audioCodec) - self.bitrate = try container.decode(Int.self, forKey: .bitrate) self.container = try container.decode(String.self, forKey: .container) - self.duration = try container.decode(Int.self, forKey: .duration) - self.height = try container.decode(Int.self, forKey: .height) self.id = try container.decode(Int.self, forKey: .id) self.part = try container.decode([Operations.Part].self, forKey: .part) - self.videoCodec = try container.decode(String.self, forKey: .videoCodec) - self.videoFrameRate = try container.decode(String.self, forKey: .videoFrameRate) - self.videoProfile = try container.decode(String.self, forKey: .videoProfile) - self.videoResolution = try container.decode(String.self, forKey: .videoResolution) - self.width = try container.decode(Int.self, forKey: .width) + self._aspectRatio = try container.decodeIfPresent(DecimalSerialized.self, forKey: .aspectRatio) ?? DecimalSerialized(wrappedValue: nil) + self.audioChannels = try container.decodeIfPresent(Int.self, forKey: .audioChannels) + self.audioCodec = try container.decodeIfPresent(String.self, forKey: .audioCodec) self.audioProfile = try container.decodeIfPresent(String.self, forKey: .audioProfile) + self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate) + self.duration = try container.decodeIfPresent(Int.self, forKey: .duration) self.has64bitOffsets = try container.decodeIfPresent(Bool.self, forKey: .has64bitOffsets) self.hasVoiceActivity = try container.decodeIfPresent(Bool.self, forKey: .hasVoiceActivity) + self.height = try container.decodeIfPresent(Int.self, forKey: .height) self.optimizedForStreaming = try container.decodeIfPresent(Operations.OptimizedForStreaming.self, forKey: .optimizedForStreaming) + self.videoCodec = try container.decodeIfPresent(String.self, forKey: .videoCodec) + self.videoFrameRate = try container.decodeIfPresent(String.self, forKey: .videoFrameRate) + self.videoProfile = try container.decodeIfPresent(String.self, forKey: .videoProfile) + self.videoResolution = try container.decodeIfPresent(String.self, forKey: .videoResolution) + self.width = try container.decodeIfPresent(Int.self, forKey: .width) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(self._aspectRatio, forKey: .aspectRatio) - try container.encode(self.audioChannels, forKey: .audioChannels) - try container.encode(self.audioCodec, forKey: .audioCodec) - try container.encode(self.bitrate, forKey: .bitrate) try container.encode(self.container, forKey: .container) - try container.encode(self.duration, forKey: .duration) - try container.encode(self.height, forKey: .height) try container.encode(self.id, forKey: .id) try container.encode(self.part, forKey: .part) - try container.encode(self.videoCodec, forKey: .videoCodec) - try container.encode(self.videoFrameRate, forKey: .videoFrameRate) - try container.encode(self.videoProfile, forKey: .videoProfile) - try container.encode(self.videoResolution, forKey: .videoResolution) - try container.encode(self.width, forKey: .width) + if self.aspectRatio != nil { + try container.encode(self._aspectRatio, forKey: .aspectRatio) + } + try container.encodeIfPresent(self.audioChannels, forKey: .audioChannels) + try container.encodeIfPresent(self.audioCodec, forKey: .audioCodec) try container.encodeIfPresent(self.audioProfile, forKey: .audioProfile) + try container.encodeIfPresent(self.bitrate, forKey: .bitrate) + try container.encodeIfPresent(self.duration, forKey: .duration) try container.encodeIfPresent(self.has64bitOffsets, forKey: .has64bitOffsets) try container.encodeIfPresent(self.hasVoiceActivity, forKey: .hasVoiceActivity) + try container.encodeIfPresent(self.height, forKey: .height) try container.encodeIfPresent(self.optimizedForStreaming, forKey: .optimizedForStreaming) + try container.encodeIfPresent(self.videoCodec, forKey: .videoCodec) + try container.encodeIfPresent(self.videoFrameRate, forKey: .videoFrameRate) + try container.encodeIfPresent(self.videoProfile, forKey: .videoProfile) + try container.encodeIfPresent(self.videoResolution, forKey: .videoResolution) + try container.encodeIfPresent(self.width, forKey: .width) } } extension Operations.Media { - var aspectRatioWrapper: DecimalSerialized { + var aspectRatioWrapper: DecimalSerialized { return _aspectRatio } } diff --git a/Sources/Plexswift/models/operations/Part.swift b/Sources/Plexswift/models/operations/Part.swift index bbc2d32..7a909a1 100644 --- a/Sources/Plexswift/models/operations/Part.swift +++ b/Sources/Plexswift/models/operations/Part.swift @@ -8,56 +8,56 @@ extension Operations { /// The container format of the media file. /// public let container: String - public let duration: Int public let file: String public let id: Int public let key: String public let size: Int - public let videoProfile: String public let audioProfile: String? + public let duration: Int? public let has64bitOffsets: Bool? public let hasThumbnail: Operations.HasThumbnail? public let indexes: String? public let optimizedForStreaming: Bool? public let stream: [Operations.Stream]? + public let videoProfile: String? /// Creates an object with the specified parameters /// /// - Parameter container: The container format of the media file. /// /// - public init(container: String, duration: Int, file: String, id: Int, key: String, size: Int, videoProfile: String, audioProfile: String? = nil, has64bitOffsets: Bool? = nil, hasThumbnail: Operations.HasThumbnail? = nil, indexes: String? = nil, optimizedForStreaming: Bool? = nil, stream: [Operations.Stream]? = nil) { + public init(container: String, file: String, id: Int, key: String, size: Int, audioProfile: String? = nil, duration: Int? = nil, has64bitOffsets: Bool? = nil, hasThumbnail: Operations.HasThumbnail? = nil, indexes: String? = nil, optimizedForStreaming: Bool? = nil, stream: [Operations.Stream]? = nil, videoProfile: String? = nil) { self.container = container - self.duration = duration self.file = file self.id = id self.key = key self.size = size - self.videoProfile = videoProfile self.audioProfile = audioProfile + self.duration = duration self.has64bitOffsets = has64bitOffsets self.hasThumbnail = hasThumbnail self.indexes = indexes self.optimizedForStreaming = optimizedForStreaming self.stream = stream + self.videoProfile = videoProfile } }} extension Operations.Part: Codable { enum CodingKeys: String, CodingKey { case container - case duration case file case id case key case size - case videoProfile case audioProfile + case duration case has64bitOffsets case hasThumbnail case indexes case optimizedForStreaming case stream = "Stream" + case videoProfile } } diff --git a/Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationFeatures.swift b/Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationFeatures.swift deleted file mode 100644 index 8f62fbf..0000000 --- a/Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationFeatures.swift +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -import Foundation - -extension Operations { - public enum PostUsersSignInDataAuthenticationFeatures: String, Codable, APIValue { - case androidDolbyVision = "Android - Dolby Vision" - case androidPiP = "Android - PiP" - case cuSunset = "CU Sunset" - case hrkEnableEur = "HRK_enable_EUR" - case trebleShowFeatures = "TREBLE-show-features" - case adCountdownTimer = "ad-countdown-timer" - case adaptiveBitrate = "adaptive_bitrate" - case albumTypes = "album-types" - case allowDvr = "allow_dvr" - case amazonLoopDebug = "amazon-loop-debug" - case avodAdAnalysis = "avod-ad-analysis" - case avodNewMedia = "avod-new-media" - case blacklistGetSignin = "blacklist_get_signin" - case boostVoices = "boost-voices" - case cameraUpload = "camera_upload" - case clientRadioStations = "client-radio-stations" - case cloudflareTurnstileRequired = "cloudflare-turnstile-required" - case cloudsync = "cloudsync" - case collections = "collections" - case commentsAndRepliesPushNotifications = "comments_and_replies_push_notifications" - case communityAccessPlexTv = "community_access_plex_tv" - case companionsSonos = "companions_sonos" - case contentFilter = "content_filter" - case customHomeRemoval = "custom-home-removal" - case disableHomeUserFriendships = "disable_home_user_friendships" - case disableSharingFriendships = "disable_sharing_friendships" - case downloadsGating = "downloads-gating" - case drmSupport = "drm_support" - case dvr = "dvr" - case dvrBlockUnsupportedCountries = "dvr-block-unsupported-countries" - case epgRecentChannels = "epg-recent-channels" - case excludeRestrictions = "exclude restrictions" - case federatedAuth = "federated-auth" - case friendRequestPushNotifications = "friend_request_push_notifications" - case grandfatherSync = "grandfather-sync" - case guidedUpgrade = "guided-upgrade" - case hardwareTranscoding = "hardware_transcoding" - case home = "home" - case hwtranscode = "hwtranscode" - case imaggaV2 = "imagga-v2" - case increasePasswordComplexity = "increase-password-complexity" - case ios14PrivacyBanner = "ios14-privacy-banner" - case iterableNotificationTokens = "iterable-notification-tokens" - case itemClusters = "item_clusters" - case keepPaymentMethod = "keep-payment-method" - case kevinBacon = "kevin-bacon" - case koreaConsent = "korea-consent" - case leIsrgRootX1 = "le_isrg_root_x1" - case letsEncrypt = "lets_encrypt" - case lightningDvrPivot = "lightning-dvr-pivot" - case liveTvSupportIncompleteSegments = "live-tv-support-incomplete-segments" - case livetv = "livetv" - case lyrics = "lyrics" - case metadataSearch = "metadata_search" - case musicAnalysis = "music-analysis" - case musicVideos = "music_videos" - case newPlexPassPrices = "new_plex_pass_prices" - case newsProviderSunsetModal = "news-provider-sunset-modal" - case nominatim = "nominatim" - case pass = "pass" - case photosFavorites = "photos-favorites" - case photosMetadataEdition = "photos-metadata-edition" - case photosV6Edit = "photosV6-edit" - case photosV6TvAlbums = "photosV6-tv-albums" - case pmsHealth = "pms_health" - case premiumDashboard = "premium-dashboard" - case premiumMusicMetadata = "premium_music_metadata" - case radio = "radio" - case rateLimitClientToken = "rate-limit-client-token" - case scrobblingServicePlexTv = "scrobbling-service-plex-tv" - case sessionBandwidthRestrictions = "session_bandwidth_restrictions" - case sessionKick = "session_kick" - case sharedServerNotification = "shared_server_notification" - case sharedSourceNotification = "shared_source_notification" - case signinNotification = "signin_notification" - case signinWithApple = "signin_with_apple" - case silenceRemoval = "silence-removal" - case sleepTimer = "sleep-timer" - case springServeAdProvider = "spring_serve_ad_provider" - case sync = "sync" - case sweetFades = "sweet-fades" - case transcoderCache = "transcoder_cache" - case trailers = "trailers" - case tunerSharing = "tuner-sharing" - case twoFactorAuthentication = "two-factor-authentication" - case unsupportedtuners = "unsupportedtuners" - case upgrade3Ds2 = "upgrade-3ds2" - case visualizers = "visualizers" - case vodSchema = "vod-schema" - case vodCloudflare = "vod_cloudflare" - case volumeLeveling = "volume-leveling" - case watchTogetherInvite = "watch-together-invite" - case watchlistRss = "watchlist-rss" - case webServerDashboard = "web_server_dashboard" - case webhooks = "webhooks" - }} diff --git a/Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationSubscription.swift b/Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationSubscription.swift index b7a603b..7fca41a 100644 --- a/Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationSubscription.swift +++ b/Sources/Plexswift/models/operations/PostUsersSignInDataAuthenticationSubscription.swift @@ -8,7 +8,7 @@ extension Operations { /// If the account's Plex Pass subscription is active public let active: Bool? /// List of features allowed on your Plex Pass subscription - public let features: [Operations.PostUsersSignInDataAuthenticationFeatures]? + public let features: [String]? /// Payment service used for your Plex Pass subscription public let paymentService: String? /// Name of Plex Pass subscription plan @@ -27,7 +27,7 @@ extension Operations { /// - Parameter status: String representation of subscriptionActive /// - Parameter subscribedAt: Date the account subscribed to Plex Pass /// - public init(active: Bool? = nil, features: [Operations.PostUsersSignInDataAuthenticationFeatures]? = nil, paymentService: String? = nil, plan: String? = nil, status: Operations.PostUsersSignInDataAuthenticationResponseStatus? = nil, subscribedAt: String? = nil) { + public init(active: Bool? = nil, features: [String]? = nil, paymentService: String? = nil, plan: String? = nil, status: Operations.PostUsersSignInDataAuthenticationResponseStatus? = nil, subscribedAt: String? = nil) { self.active = active self.features = features self.paymentService = paymentService diff --git a/Sources/Plexswift/models/operations/PostUsersSignInDataFeatures.swift b/Sources/Plexswift/models/operations/PostUsersSignInDataFeatures.swift deleted file mode 100644 index af00d89..0000000 --- a/Sources/Plexswift/models/operations/PostUsersSignInDataFeatures.swift +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -import Foundation - -extension Operations { - public enum PostUsersSignInDataFeatures: String, Codable, APIValue { - case androidDolbyVision = "Android - Dolby Vision" - case androidPiP = "Android - PiP" - case cuSunset = "CU Sunset" - case hrkEnableEur = "HRK_enable_EUR" - case trebleShowFeatures = "TREBLE-show-features" - case adCountdownTimer = "ad-countdown-timer" - case adaptiveBitrate = "adaptive_bitrate" - case albumTypes = "album-types" - case allowDvr = "allow_dvr" - case amazonLoopDebug = "amazon-loop-debug" - case avodAdAnalysis = "avod-ad-analysis" - case avodNewMedia = "avod-new-media" - case blacklistGetSignin = "blacklist_get_signin" - case boostVoices = "boost-voices" - case cameraUpload = "camera_upload" - case clientRadioStations = "client-radio-stations" - case cloudflareTurnstileRequired = "cloudflare-turnstile-required" - case cloudsync = "cloudsync" - case collections = "collections" - case commentsAndRepliesPushNotifications = "comments_and_replies_push_notifications" - case communityAccessPlexTv = "community_access_plex_tv" - case companionsSonos = "companions_sonos" - case contentFilter = "content_filter" - case customHomeRemoval = "custom-home-removal" - case disableHomeUserFriendships = "disable_home_user_friendships" - case disableSharingFriendships = "disable_sharing_friendships" - case downloadsGating = "downloads-gating" - case drmSupport = "drm_support" - case dvr = "dvr" - case dvrBlockUnsupportedCountries = "dvr-block-unsupported-countries" - case epgRecentChannels = "epg-recent-channels" - case excludeRestrictions = "exclude restrictions" - case federatedAuth = "federated-auth" - case friendRequestPushNotifications = "friend_request_push_notifications" - case grandfatherSync = "grandfather-sync" - case guidedUpgrade = "guided-upgrade" - case hardwareTranscoding = "hardware_transcoding" - case home = "home" - case hwtranscode = "hwtranscode" - case imaggaV2 = "imagga-v2" - case increasePasswordComplexity = "increase-password-complexity" - case ios14PrivacyBanner = "ios14-privacy-banner" - case iterableNotificationTokens = "iterable-notification-tokens" - case itemClusters = "item_clusters" - case keepPaymentMethod = "keep-payment-method" - case kevinBacon = "kevin-bacon" - case koreaConsent = "korea-consent" - case leIsrgRootX1 = "le_isrg_root_x1" - case letsEncrypt = "lets_encrypt" - case lightningDvrPivot = "lightning-dvr-pivot" - case liveTvSupportIncompleteSegments = "live-tv-support-incomplete-segments" - case livetv = "livetv" - case lyrics = "lyrics" - case metadataSearch = "metadata_search" - case musicAnalysis = "music-analysis" - case musicVideos = "music_videos" - case newPlexPassPrices = "new_plex_pass_prices" - case newsProviderSunsetModal = "news-provider-sunset-modal" - case nominatim = "nominatim" - case pass = "pass" - case photosFavorites = "photos-favorites" - case photosMetadataEdition = "photos-metadata-edition" - case photosV6Edit = "photosV6-edit" - case photosV6TvAlbums = "photosV6-tv-albums" - case pmsHealth = "pms_health" - case premiumDashboard = "premium-dashboard" - case premiumMusicMetadata = "premium_music_metadata" - case radio = "radio" - case rateLimitClientToken = "rate-limit-client-token" - case scrobblingServicePlexTv = "scrobbling-service-plex-tv" - case sessionBandwidthRestrictions = "session_bandwidth_restrictions" - case sessionKick = "session_kick" - case sharedServerNotification = "shared_server_notification" - case sharedSourceNotification = "shared_source_notification" - case signinNotification = "signin_notification" - case signinWithApple = "signin_with_apple" - case silenceRemoval = "silence-removal" - case sleepTimer = "sleep-timer" - case springServeAdProvider = "spring_serve_ad_provider" - case sync = "sync" - case sweetFades = "sweet-fades" - case transcoderCache = "transcoder_cache" - case trailers = "trailers" - case tunerSharing = "tuner-sharing" - case twoFactorAuthentication = "two-factor-authentication" - case unsupportedtuners = "unsupportedtuners" - case upgrade3Ds2 = "upgrade-3ds2" - case visualizers = "visualizers" - case vodSchema = "vod-schema" - case vodCloudflare = "vod_cloudflare" - case volumeLeveling = "volume-leveling" - case watchTogetherInvite = "watch-together-invite" - case watchlistRss = "watchlist-rss" - case webServerDashboard = "web_server_dashboard" - case webhooks = "webhooks" - }} diff --git a/Sources/Plexswift/models/operations/PostUsersSignInDataRequest.swift b/Sources/Plexswift/models/operations/PostUsersSignInDataRequest.swift index 71395ea..3d12c6f 100644 --- a/Sources/Plexswift/models/operations/PostUsersSignInDataRequest.swift +++ b/Sources/Plexswift/models/operations/PostUsersSignInDataRequest.swift @@ -5,26 +5,34 @@ import Foundation extension Operations { /// A model object public struct PostUsersSignInDataRequest: APIValue { - /// The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + /// An opaque identifier unique to the client (UUID, serial number, or other unique device ID) public let clientID: String? + /// The name of the client application. (Plex Web, Plex Media Server, etc.) public let clientName: String? - public let clientPlatform: String? + /// The version of the client application. public let clientVersion: String? - public let deviceName: String? + /// A relatively friendly name for the client device + public let deviceNickname: String? + /// The platform of the client application. + public let platform: String? /// Login credentials public let requestBody: Operations.PostUsersSignInDataRequestBody? /// Creates an object with the specified parameters /// - /// - Parameter clientID: The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) + /// - Parameter clientID: An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + /// - Parameter clientName: The name of the client application. (Plex Web, Plex Media Server, etc.) + /// - Parameter clientVersion: The version of the client application. + /// - Parameter deviceNickname: A relatively friendly name for the client device + /// - Parameter platform: The platform of the client application. /// - Parameter requestBody: Login credentials /// - public init(clientID: String? = nil, clientName: String? = nil, clientPlatform: String? = nil, clientVersion: String? = nil, deviceName: String? = nil, requestBody: Operations.PostUsersSignInDataRequestBody? = nil) { + public init(clientID: String? = nil, clientName: String? = nil, clientVersion: String? = nil, deviceNickname: String? = nil, platform: String? = nil, requestBody: Operations.PostUsersSignInDataRequestBody? = nil) { self.clientID = clientID self.clientName = clientName - self.clientPlatform = clientPlatform self.clientVersion = clientVersion - self.deviceName = deviceName + self.deviceNickname = deviceNickname + self.platform = platform self.requestBody = requestBody } }} diff --git a/Sources/Plexswift/models/operations/PostUsersSignInDataSubscription.swift b/Sources/Plexswift/models/operations/PostUsersSignInDataSubscription.swift index ab5bf42..12086d2 100644 --- a/Sources/Plexswift/models/operations/PostUsersSignInDataSubscription.swift +++ b/Sources/Plexswift/models/operations/PostUsersSignInDataSubscription.swift @@ -8,7 +8,7 @@ extension Operations { /// If the account's Plex Pass subscription is active public let active: Bool? /// List of features allowed on your Plex Pass subscription - public let features: [Operations.PostUsersSignInDataFeatures]? + public let features: [String]? /// Payment service used for your Plex Pass subscription public let paymentService: String? /// Name of Plex Pass subscription plan @@ -27,7 +27,7 @@ extension Operations { /// - Parameter status: String representation of subscriptionActive /// - Parameter subscribedAt: Date the account subscribed to Plex Pass /// - public init(active: Bool? = nil, features: [Operations.PostUsersSignInDataFeatures]? = nil, paymentService: String? = nil, plan: String? = nil, status: Operations.PostUsersSignInDataAuthenticationStatus? = nil, subscribedAt: String? = nil) { + public init(active: Bool? = nil, features: [String]? = nil, paymentService: String? = nil, plan: String? = nil, status: Operations.PostUsersSignInDataAuthenticationStatus? = nil, subscribedAt: String? = nil) { self.active = active self.features = features self.paymentService = paymentService diff --git a/Sources/Plexswift/models/operations/QueryParamIncludeCollections.swift b/Sources/Plexswift/models/operations/QueryParamIncludeCollections.swift new file mode 100644 index 0000000..cb6cb5e --- /dev/null +++ b/Sources/Plexswift/models/operations/QueryParamIncludeCollections.swift @@ -0,0 +1,10 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// Whether to include collections in the search results. + public enum QueryParamIncludeCollections: Int, Codable, APIValue { + case disable = 0 + case enable = 1 + }} diff --git a/Sources/Plexswift/models/operations/QueryParamIncludeExternalMedia.swift b/Sources/Plexswift/models/operations/QueryParamIncludeExternalMedia.swift new file mode 100644 index 0000000..9d83182 --- /dev/null +++ b/Sources/Plexswift/models/operations/QueryParamIncludeExternalMedia.swift @@ -0,0 +1,10 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// Whether to include external media in the search results. + public enum QueryParamIncludeExternalMedia: Int, Codable, APIValue { + case disable = 0 + case enable = 1 + }} diff --git a/Sources/Plexswift/models/operations/SearchResult.swift b/Sources/Plexswift/models/operations/SearchResult.swift new file mode 100644 index 0000000..e56a08b --- /dev/null +++ b/Sources/Plexswift/models/operations/SearchResult.swift @@ -0,0 +1,44 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct SearchResult { + public let metadata: Operations.GetSearchAllLibrariesMetadata + @DecimalSerialized + public private(set) var score: Double + + /// Creates an object with the specified parameters + /// + /// + public init(metadata: Operations.GetSearchAllLibrariesMetadata, score: Double) { + self.metadata = metadata + self._score = DecimalSerialized(wrappedValue: score) + } + }} + +extension Operations.SearchResult: Codable { + enum CodingKeys: String, CodingKey { + case metadata = "Metadata" + case score + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.metadata = try container.decode(Operations.GetSearchAllLibrariesMetadata.self, forKey: .metadata) + self._score = try container.decode(DecimalSerialized.self, forKey: .score) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(self.metadata, forKey: .metadata) + try container.encode(self._score, forKey: .score) + } +} + +extension Operations.SearchResult { + var scoreWrapper: DecimalSerialized { + return _score + } +} diff --git a/Sources/Plexswift/models/operations/SearchTypes.swift b/Sources/Plexswift/models/operations/SearchTypes.swift new file mode 100644 index 0000000..87abc4b --- /dev/null +++ b/Sources/Plexswift/models/operations/SearchTypes.swift @@ -0,0 +1,12 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + public enum SearchTypes: String, Codable, APIValue { + case movies = "movies" + case music = "music" + case otherVideos = "otherVideos" + case people = "people" + case tv = "tv" + }} diff --git a/Sources/Plexswift/models/operations/Subscription.swift b/Sources/Plexswift/models/operations/Subscription.swift index 693bdca..b681c2c 100644 --- a/Sources/Plexswift/models/operations/Subscription.swift +++ b/Sources/Plexswift/models/operations/Subscription.swift @@ -8,7 +8,7 @@ extension Operations { /// If the account's Plex Pass subscription is active public let active: Bool? /// List of features allowed on your Plex Pass subscription - public let features: [Operations.Features]? + public let features: [String]? /// Payment service used for your Plex Pass subscription public let paymentService: String? /// Name of Plex Pass subscription plan @@ -27,7 +27,7 @@ extension Operations { /// - Parameter status: String representation of subscriptionActive /// - Parameter subscribedAt: Date the account subscribed to Plex Pass /// - public init(active: Bool? = nil, features: [Operations.Features]? = nil, paymentService: String? = nil, plan: String? = nil, status: Operations.GetTokenDetailsAuthenticationStatus? = nil, subscribedAt: String? = nil) { + public init(active: Bool? = nil, features: [String]? = nil, paymentService: String? = nil, plan: String? = nil, status: Operations.GetTokenDetailsAuthenticationStatus? = nil, subscribedAt: String? = nil) { self.active = active self.features = features self.paymentService = paymentService diff --git a/Sources/plexswift/PlexswiftAPI.swift b/Sources/plexswift/PlexswiftAPI.swift index d49201b..dc66f8e 100644 --- a/Sources/plexswift/PlexswiftAPI.swift +++ b/Sources/plexswift/PlexswiftAPI.swift @@ -739,6 +739,7 @@ public protocol SearchAPI { /// - ``getLibraryItems(request:)`` /// - ``getRefreshLibraryMetadata(request:)`` /// - ``getSearchLibrary(request:)`` +/// - ``getSearchAllLibraries(request:)`` /// - ``getMetaDataByRatingKey(request:)`` /// - ``getMetadataChildren(request:)`` /// - ``getTopWatchedContent(request:)`` @@ -885,6 +886,14 @@ public protocol LibraryAPI { /// - Throws: An error of type ``PlexswiftError`` func getSearchLibrary(request: Operations.GetSearchLibraryRequest) async throws -> Response + /// Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. + /// + /// + /// - Parameter request: A ``Operations/GetSearchAllLibrariesRequest`` object describing the input to the API operation + /// - Returns: A ``Operations/GetSearchAllLibrariesResponse`` object describing the result of the API operation + /// - Throws: An error of type ``PlexswiftError`` + func getSearchAllLibraries(request: Operations.GetSearchAllLibrariesRequest) async throws -> Response + /// This endpoint will return the metadata of a library item specified with the ratingKey. /// /// diff --git a/Sources/plexswift/internal/client/URLRequestBuilder.swift b/Sources/plexswift/internal/client/URLRequestBuilder.swift index ad58c90..c551ff9 100644 --- a/Sources/plexswift/internal/client/URLRequestBuilder.swift +++ b/Sources/plexswift/internal/client/URLRequestBuilder.swift @@ -62,7 +62,7 @@ final class URLRequestBuilder: URLRequestConfiguration { urlRequest.setValue(contentType, forHTTPHeaderField: "Content-Type") } - urlRequest.setValue("speakeasy-sdk/swift 0.8.5 2.428.1 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName) + urlRequest.setValue("speakeasy-sdk/swift 0.8.7 2.428.1 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName) addSecurityParameters(to: &urlRequest) diff --git a/codeSamples.yaml b/codeSamples.yaml index b9ca98f..5a41554 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -644,6 +644,12 @@ actions: - lang: swift label: library source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getRecentlyAddedLibrary(\n request: Operations.GetRecentlyAddedLibraryRequest(\n type: .tvShow, \n contentDirectoryID: 2, \n includeMeta: .enable, \n pinnedContentDirectoryID: [\n 3,\n 5,\n 7,\n 13,\n 12,\n 1,\n 6,\n 14,\n 2,\n 10,\n 16,\n 17,\n ], \n sectionID: 2, \n xPlexContainerSize: 50, \n xPlexContainerStart: 0\n )\n)\n\nswitch response.data {\ncase .object(let object):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}" + - target: $["paths"]["/library/search"]["get"] + update: + x-codeSamples: + - lang: swift + label: libraries + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getSearchAllLibraries(\n request: Operations.GetSearchAllLibrariesRequest(\n query: \"\", \n includeCollections: .enable, \n includeExternalMedia: .enable, \n searchTypes: [\n .people,\n ]\n )\n)\n\nswitch response.data {\ncase .object(let object):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}" - target: $["paths"]["/library/sections"]["get"] update: x-codeSamples: