diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index de64010..d23a204 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: a643a64d282d705e3e24f61ed6f068c6 + docChecksum: 14b35829d4be91a88269761c3ed01426 docVersion: 0.0.3 speakeasyVersion: 1.405.6 generationVersion: 2.428.1 - releaseVersion: 0.9.7 - configChecksum: 0eebcb4854af9a486b831a89eb1d017a + releaseVersion: 0.9.9 + configChecksum: 9200bd9ee8c67e5072d90d0fc2cea504 repoURL: https://github.com/LukeHagar/plexswift.git features: swift: @@ -61,7 +61,9 @@ generatedFiles: - Sources/Plexswift/internal/models/Force+Serialization.swift - Sources/Plexswift/internal/models/GetBandwidthStatisticsRequest+Serialization.swift - Sources/Plexswift/internal/models/GetBannerImageRequest+Serialization.swift + - Sources/Plexswift/internal/models/GetCountriesLibraryRequest+Serialization.swift - Sources/Plexswift/internal/models/GetFileHashRequest+Serialization.swift + - Sources/Plexswift/internal/models/GetGenresLibraryRequest+Serialization.swift - Sources/Plexswift/internal/models/GetGlobalHubsRequest+Serialization.swift - Sources/Plexswift/internal/models/GetLibraryDetailsRequest+Serialization.swift - Sources/Plexswift/internal/models/GetLibraryHubsRequest+Serialization.swift @@ -328,6 +330,15 @@ generatedFiles: - Sources/Plexswift/models/operations/GetCompanionsDataPlexErrors.swift - Sources/Plexswift/models/operations/GetCompanionsDataResponse.swift - Sources/Plexswift/models/operations/GetCompanionsDataUnauthorized.swift + - Sources/Plexswift/models/operations/GetCountriesLibraryBadRequest.swift + - Sources/Plexswift/models/operations/GetCountriesLibraryDirectory.swift + - Sources/Plexswift/models/operations/GetCountriesLibraryErrors.swift + - Sources/Plexswift/models/operations/GetCountriesLibraryLibraryErrors.swift + - Sources/Plexswift/models/operations/GetCountriesLibraryMediaContainer.swift + - Sources/Plexswift/models/operations/GetCountriesLibraryRequest.swift + - Sources/Plexswift/models/operations/GetCountriesLibraryResponse.swift + - Sources/Plexswift/models/operations/GetCountriesLibraryResponseBody.swift + - Sources/Plexswift/models/operations/GetCountriesLibraryUnauthorized.swift - Sources/Plexswift/models/operations/GetDevicesBadRequest.swift - Sources/Plexswift/models/operations/GetDevicesErrors.swift - Sources/Plexswift/models/operations/GetDevicesMediaContainer.swift @@ -341,6 +352,15 @@ generatedFiles: - Sources/Plexswift/models/operations/GetFileHashRequest.swift - Sources/Plexswift/models/operations/GetFileHashResponse.swift - Sources/Plexswift/models/operations/GetFileHashUnauthorized.swift + - Sources/Plexswift/models/operations/GetGenresLibraryBadRequest.swift + - Sources/Plexswift/models/operations/GetGenresLibraryDirectory.swift + - Sources/Plexswift/models/operations/GetGenresLibraryErrors.swift + - Sources/Plexswift/models/operations/GetGenresLibraryLibraryErrors.swift + - Sources/Plexswift/models/operations/GetGenresLibraryMediaContainer.swift + - Sources/Plexswift/models/operations/GetGenresLibraryRequest.swift + - Sources/Plexswift/models/operations/GetGenresLibraryResponse.swift + - Sources/Plexswift/models/operations/GetGenresLibraryResponseBody.swift + - Sources/Plexswift/models/operations/GetGenresLibraryUnauthorized.swift - Sources/Plexswift/models/operations/GetGeoDataBadRequest.swift - Sources/Plexswift/models/operations/GetGeoDataErrors.swift - Sources/Plexswift/models/operations/GetGeoDataGeoData.swift @@ -1381,7 +1401,7 @@ examples: X-Plex-Container-Size: 50 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"}, {"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", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "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": 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"}], "Country": [{"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"}, {"path": "/TV Shows/House"}, {"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": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "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"}, {"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", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "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": 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}]}, {"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": 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}]}]}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"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"}], "Location": [{"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"}, {"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", "allowSync": false, "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"}, {"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", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "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": 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"}], "Country": [{"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"}, {"path": "/TV Shows/House"}, {"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": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "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"}, {"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", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "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": 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}]}, {"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": 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}]}]}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"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"}], "Location": [{"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"}, {"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"}]}} getLibraryHubs: speakeasy-default-get-library-hubs: parameters: @@ -1997,5 +2017,29 @@ examples: 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-genres-library: + speakeasy-default-get-genres-library: + parameters: + path: + sectionKey: 9518 + responses: + "200": + application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "allowSync": false, "art": "/:/resources/show-fanart.jpg", "content": "secondary", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "nocache": true, "thumb": "/:/resources/show.png", "title1": "TV Shows (Reality)", "title2": "By Genre", "viewGroup": "secondary", "Directory": [{"fastKey": "/library/sections/10/all?genre=89", "key": "89", "title": "Action", "type": "genre"}]}} + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + "401": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]} + get-countries-library: + speakeasy-default-get-countries-library: + parameters: + path: + sectionKey: 9518 + responses: + "200": + application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "allowSync": false, "art": "/:/resources/show-fanart.jpg", "content": "secondary", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "nocache": true, "thumb": "/:/resources/show.png", "title1": "TV Series", "title2": "By Country", "viewGroup": "secondary", "Directory": [{"fastKey": "/library/sections/2/all?country=15491", "key": "15491", "title": "Japan"}]}} + "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}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]} examplesVersion: 1.0.0 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 53b2346..9c44ccd 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true swift: - version: 0.9.7 + version: 0.9.9 author: LukeHagar description: Swift Client SDK Generated by Speakeasy imports: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 8c7e2ff..fb3f7f0 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -9,8 +9,8 @@ sources: - main plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c - sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696 + sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10 + sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55 tags: - latest - main @@ -18,10 +18,10 @@ targets: plexswift: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:e73707dfae50d22dab2166b1661938446b9831bcee252ecd696a1172dfd6ae2c - sourceBlobDigest: sha256:e06caa091ad527fd21714fc0d43e7ea385e181fbad8c4f60296457a89a23c696 + sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10 + sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55 codeSamplesNamespace: code-samples-swift-plexswift - codeSamplesRevisionDigest: sha256:f64657a7788b54285ad429cbc4056f8385046ba90198d8047e09de18094609ba + codeSamplesRevisionDigest: sha256:a5941e7dd8124eb7deca3b089dbb00bdd37dfacb849675cd1acd0888538742d0 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index fe4620a..baa7499 100644 --- a/README.md +++ b/README.md @@ -62,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.9.7")) + .package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.9.9")) ] ``` @@ -140,6 +140,8 @@ 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 +* [getGenresLibrary](docs/sdks/library/README.md#getgenreslibrary) - Get Genres of library media +* [getCountriesLibrary](docs/sdks/library/README.md#getcountrieslibrary) - Get Countries of library media * [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 diff --git a/RELEASES.md b/RELEASES.md index 1a89f8e..a664ebc 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -812,4 +812,14 @@ Based on: ### Generated - [swift v0.9.7] . ### Releases -- [Swift Package Manager v0.9.7] https://github.com/LukeHagar/plexswift/releases/tag/v0.9.7 - . \ No newline at end of file +- [Swift Package Manager v0.9.7] https://github.com/LukeHagar/plexswift/releases/tag/v0.9.7 - . + +## 2025-02-06 00:08:04 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.405.6 (2.428.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [swift v0.9.9] . +### Releases +- [Swift Package Manager v0.9.9] https://github.com/LukeHagar/plexswift/releases/tag/v0.9.9 - . \ No newline at end of file diff --git a/Sources/Plexswift/Plexswift.docc/Plexswift.md b/Sources/Plexswift/Plexswift.docc/Plexswift.md index a741eaa..de8b700 100644 --- a/Sources/Plexswift/Plexswift.docc/Plexswift.md +++ b/Sources/Plexswift/Plexswift.docc/Plexswift.md @@ -118,6 +118,8 @@ case .empty: - ``Operations/EnablePaperTrailBadRequest`` - ``Operations/GetAllLibrariesBadRequest`` - ``Operations/GetBannerImageBadRequest`` +- ``Operations/GetCountriesLibraryBadRequest`` +- ``Operations/GetGenresLibraryBadRequest`` - ``Operations/GetLibraryDetailsBadRequest`` - ``Operations/GetLibraryItemsBadRequest`` - ``Operations/GetMediaProvidersBadRequest`` @@ -194,6 +196,8 @@ case .empty: - ``Operations/EnablePaperTrailResponse`` - ``Operations/GetAllLibrariesResponse`` - ``Operations/GetBannerImageResponse`` +- ``Operations/GetCountriesLibraryResponse`` +- ``Operations/GetGenresLibraryResponse`` - ``Operations/GetLibraryDetailsResponse`` - ``Operations/GetLibraryItemsResponse`` - ``Operations/GetMediaProvidersResponse`` @@ -345,6 +349,20 @@ case .empty: - ``Operations/GetBannerImageMediaErrors`` - ``Operations/GetBannerImageRequest`` - ``Operations/GetBannerImageUnauthorized`` +- ``Operations/GetCountriesLibraryDirectory`` +- ``Operations/GetCountriesLibraryErrors`` +- ``Operations/GetCountriesLibraryLibraryErrors`` +- ``Operations/GetCountriesLibraryMediaContainer`` +- ``Operations/GetCountriesLibraryRequest`` +- ``Operations/GetCountriesLibraryResponseBody`` +- ``Operations/GetCountriesLibraryUnauthorized`` +- ``Operations/GetGenresLibraryDirectory`` +- ``Operations/GetGenresLibraryErrors`` +- ``Operations/GetGenresLibraryLibraryErrors`` +- ``Operations/GetGenresLibraryMediaContainer`` +- ``Operations/GetGenresLibraryRequest`` +- ``Operations/GetGenresLibraryResponseBody`` +- ``Operations/GetGenresLibraryUnauthorized`` - ``Operations/GetLibraryDetailsDirectory`` - ``Operations/GetLibraryDetailsErrors`` - ``Operations/GetLibraryDetailsField`` diff --git a/Sources/Plexswift/internal/api/_LibraryAPI.swift b/Sources/Plexswift/internal/api/_LibraryAPI.swift index df8663e..f646fa4 100644 --- a/Sources/Plexswift/internal/api/_LibraryAPI.swift +++ b/Sources/Plexswift/internal/api/_LibraryAPI.swift @@ -82,6 +82,24 @@ class _LibraryAPI: LibraryAPI { ) } + public func getGenresLibrary(request: Operations.GetGenresLibraryRequest) async throws -> Response { + return try await client.makeRequest( + configureRequest: { configuration in + try configureGetGenresLibraryRequest(with: configuration, request: request) + }, + handleResponse: handleGetGenresLibraryResponse + ) + } + + public func getCountriesLibrary(request: Operations.GetCountriesLibraryRequest) async throws -> Response { + return try await client.makeRequest( + configureRequest: { configuration in + try configureGetCountriesLibraryRequest(with: configuration, request: request) + }, + handleResponse: handleGetCountriesLibraryResponse + ) + } + public func getSearchAllLibraries(request: Operations.GetSearchAllLibrariesRequest) async throws -> Response { return try await client.makeRequest( configureRequest: { configuration in @@ -190,6 +208,20 @@ private func configureGetSearchLibraryRequest(with configuration: URLRequestConf configuration.telemetryHeader = .userAgent } +private func configureGetGenresLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.GetGenresLibraryRequest) throws { + configuration.path = "/library/sections/{sectionKey}/genre" + configuration.method = .get + configuration.pathParameterSerializable = request + configuration.telemetryHeader = .userAgent +} + +private func configureGetCountriesLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.GetCountriesLibraryRequest) throws { + configuration.path = "/library/sections/{sectionKey}/country" + configuration.method = .get + configuration.pathParameterSerializable = request + configuration.telemetryHeader = .userAgent +} + private func configureGetSearchAllLibrariesRequest(with configuration: URLRequestConfiguration, request: Operations.GetSearchAllLibrariesRequest) throws { configuration.path = "/library/search" configuration.method = .get @@ -466,6 +498,74 @@ private func handleGetSearchLibraryResponse(response: Client.APIResponse) throws return .empty } +private func handleGetGenresLibraryResponse(response: Client.APIResponse) throws -> Operations.GetGenresLibraryResponse { + 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.GetGenresLibraryResponseBody.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.GetGenresLibraryBadRequest.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.GetGenresLibraryUnauthorized.self, from: data)) + } catch { + throw ResponseHandlerError.failedToDecodeJSON(error) + } + } + } else if httpResponse.statusCode == 404 { + return .empty + } + + return .empty +} + +private func handleGetCountriesLibraryResponse(response: Client.APIResponse) throws -> Operations.GetCountriesLibraryResponse { + 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.GetCountriesLibraryResponseBody.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.GetCountriesLibraryBadRequest.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.GetCountriesLibraryUnauthorized.self, from: data)) + } catch { + throw ResponseHandlerError.failedToDecodeJSON(error) + } + } + } else if httpResponse.statusCode == 404 { + return .empty + } + + return .empty +} + private func handleGetSearchAllLibrariesResponse(response: Client.APIResponse) throws -> Operations.GetSearchAllLibrariesResponse { let httpResponse = response.httpResponse diff --git a/Sources/Plexswift/internal/models/GetCountriesLibraryRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetCountriesLibraryRequest+Serialization.swift new file mode 100644 index 0000000..fb28601 --- /dev/null +++ b/Sources/Plexswift/internal/models/GetCountriesLibraryRequest+Serialization.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.GetCountriesLibraryRequest: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + switch format { + case .path: + return try serializePathParameterSerializable(self, with: format) + case .query, .header, .multipart, .form: + throw SerializationError.invalidSerializationParameter(type: "Operations.GetCountriesLibraryRequest", format: format.formatDescription) + } + } +} + +extension Operations.GetCountriesLibraryRequest: PathParameterSerializable { + func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] { + return [ + "sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)), + ].compactMapValues { $0 } + } +} diff --git a/Sources/Plexswift/internal/models/GetGenresLibraryRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetGenresLibraryRequest+Serialization.swift new file mode 100644 index 0000000..2d336d6 --- /dev/null +++ b/Sources/Plexswift/internal/models/GetGenresLibraryRequest+Serialization.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.GetGenresLibraryRequest: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + switch format { + case .path: + return try serializePathParameterSerializable(self, with: format) + case .query, .header, .multipart, .form: + throw SerializationError.invalidSerializationParameter(type: "Operations.GetGenresLibraryRequest", format: format.formatDescription) + } + } +} + +extension Operations.GetGenresLibraryRequest: PathParameterSerializable { + func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] { + return [ + "sectionKey": try sectionKey.serialize(with: formatOverride ?? .path(explode: false)), + ].compactMapValues { $0 } + } +} diff --git a/Sources/Plexswift/models/operations/GetCountriesLibraryBadRequest.swift b/Sources/Plexswift/models/operations/GetCountriesLibraryBadRequest.swift new file mode 100644 index 0000000..0788eea --- /dev/null +++ b/Sources/Plexswift/models/operations/GetCountriesLibraryBadRequest.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 GetCountriesLibraryBadRequest { + public let errors: [Operations.GetCountriesLibraryErrors]? + + /// Creates a request model with the specified parameters + /// + /// + public init(errors: [Operations.GetCountriesLibraryErrors]? = nil) { + self.errors = errors + } + }} + +extension Operations.GetCountriesLibraryBadRequest: Codable { + enum CodingKeys: String, CodingKey { + case errors + } +} + diff --git a/Sources/Plexswift/models/operations/GetCountriesLibraryDirectory.swift b/Sources/Plexswift/models/operations/GetCountriesLibraryDirectory.swift new file mode 100644 index 0000000..290950f --- /dev/null +++ b/Sources/Plexswift/models/operations/GetCountriesLibraryDirectory.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetCountriesLibraryDirectory { + public let fastKey: String + public let key: String + public let title: String + + /// Creates an object with the specified parameters + /// + /// + public init(fastKey: String, key: String, title: String) { + self.fastKey = fastKey + self.key = key + self.title = title + } + }} + +extension Operations.GetCountriesLibraryDirectory: Codable { + enum CodingKeys: String, CodingKey { + case fastKey + case key + case title + } +} + diff --git a/Sources/Plexswift/models/operations/GetCountriesLibraryErrors.swift b/Sources/Plexswift/models/operations/GetCountriesLibraryErrors.swift new file mode 100644 index 0000000..52b4603 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetCountriesLibraryErrors.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetCountriesLibraryErrors { + 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.GetCountriesLibraryErrors: Codable { + enum CodingKeys: String, CodingKey { + case code + case message + case status + } +} + diff --git a/Sources/Plexswift/models/operations/GetCountriesLibraryLibraryErrors.swift b/Sources/Plexswift/models/operations/GetCountriesLibraryLibraryErrors.swift new file mode 100644 index 0000000..524f04e --- /dev/null +++ b/Sources/Plexswift/models/operations/GetCountriesLibraryLibraryErrors.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetCountriesLibraryLibraryErrors { + 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.GetCountriesLibraryLibraryErrors: Codable { + enum CodingKeys: String, CodingKey { + case code + case message + case status + } +} + diff --git a/Sources/Plexswift/models/operations/GetCountriesLibraryMediaContainer.swift b/Sources/Plexswift/models/operations/GetCountriesLibraryMediaContainer.swift new file mode 100644 index 0000000..9b265a0 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetCountriesLibraryMediaContainer.swift @@ -0,0 +1,109 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetCountriesLibraryMediaContainer { + public let allowSync: Bool + public let art: String + public let content: String + public let identifier: String + public let mediaTagPrefix: String + public let mediaTagVersion: Int + public let nocache: Bool + @DecimalSerialized + public private(set) var size: Double + public let thumb: String + public let title1: String + public let title2: String + public let viewGroup: String + public let directory: [Operations.GetCountriesLibraryDirectory]? + public let offset: Int? + public let totalSize: Int? + + /// Creates an object with the specified parameters + /// + /// + public init(allowSync: Bool, art: String, content: String, identifier: String, mediaTagPrefix: String, mediaTagVersion: Int, nocache: Bool, size: Double, thumb: String, title1: String, title2: String, viewGroup: String, directory: [Operations.GetCountriesLibraryDirectory]? = nil, offset: Int? = nil, totalSize: Int? = nil) { + self.allowSync = allowSync + self.art = art + self.content = content + self.identifier = identifier + self.mediaTagPrefix = mediaTagPrefix + self.mediaTagVersion = mediaTagVersion + self.nocache = nocache + self._size = DecimalSerialized(wrappedValue: size) + self.thumb = thumb + self.title1 = title1 + self.title2 = title2 + self.viewGroup = viewGroup + self.directory = directory + self.offset = offset + self.totalSize = totalSize + } + }} + +extension Operations.GetCountriesLibraryMediaContainer: Codable { + enum CodingKeys: String, CodingKey { + case allowSync + case art + case content + case identifier + case mediaTagPrefix + case mediaTagVersion + case nocache + case size + case thumb + case title1 + case title2 + case viewGroup + case directory = "Directory" + case offset + case totalSize + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.allowSync = try container.decode(Bool.self, forKey: .allowSync) + self.art = try container.decode(String.self, forKey: .art) + self.content = try container.decode(String.self, forKey: .content) + self.identifier = try container.decode(String.self, forKey: .identifier) + self.mediaTagPrefix = try container.decode(String.self, forKey: .mediaTagPrefix) + self.mediaTagVersion = try container.decode(Int.self, forKey: .mediaTagVersion) + self.nocache = try container.decode(Bool.self, forKey: .nocache) + self._size = try container.decode(DecimalSerialized.self, forKey: .size) + self.thumb = try container.decode(String.self, forKey: .thumb) + self.title1 = try container.decode(String.self, forKey: .title1) + self.title2 = try container.decode(String.self, forKey: .title2) + self.viewGroup = try container.decode(String.self, forKey: .viewGroup) + self.directory = try container.decodeIfPresent([Operations.GetCountriesLibraryDirectory].self, forKey: .directory) + self.offset = try container.decodeIfPresent(Int.self, forKey: .offset) + self.totalSize = try container.decodeIfPresent(Int.self, forKey: .totalSize) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(self.allowSync, forKey: .allowSync) + try container.encode(self.art, forKey: .art) + try container.encode(self.content, forKey: .content) + try container.encode(self.identifier, forKey: .identifier) + try container.encode(self.mediaTagPrefix, forKey: .mediaTagPrefix) + try container.encode(self.mediaTagVersion, forKey: .mediaTagVersion) + try container.encode(self.nocache, forKey: .nocache) + try container.encode(self._size, forKey: .size) + try container.encode(self.thumb, forKey: .thumb) + try container.encode(self.title1, forKey: .title1) + try container.encode(self.title2, forKey: .title2) + try container.encode(self.viewGroup, forKey: .viewGroup) + try container.encodeIfPresent(self.directory, forKey: .directory) + try container.encodeIfPresent(self.offset, forKey: .offset) + try container.encodeIfPresent(self.totalSize, forKey: .totalSize) + } +} + +extension Operations.GetCountriesLibraryMediaContainer { + var sizeWrapper: DecimalSerialized { + return _size + } +} diff --git a/Sources/Plexswift/models/operations/GetCountriesLibraryRequest.swift b/Sources/Plexswift/models/operations/GetCountriesLibraryRequest.swift new file mode 100644 index 0000000..c637eee --- /dev/null +++ b/Sources/Plexswift/models/operations/GetCountriesLibraryRequest.swift @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetCountriesLibraryRequest: APIValue { + /// The unique key of the Plex library. + /// Note: This is unique in the context of the Plex server. + /// + public let sectionKey: Int + + /// Creates an object with the specified parameters + /// + /// - Parameter sectionKey: The unique key of the Plex library. + /// Note: This is unique in the context of the Plex server. + /// + /// + public init(sectionKey: Int) { + self.sectionKey = sectionKey + } + }} diff --git a/Sources/Plexswift/models/operations/GetCountriesLibraryResponse.swift b/Sources/Plexswift/models/operations/GetCountriesLibraryResponse.swift new file mode 100644 index 0000000..0265dbd --- /dev/null +++ b/Sources/Plexswift/models/operations/GetCountriesLibraryResponse.swift @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A response model + public enum GetCountriesLibraryResponse { + case empty + case badRequest(Operations.GetCountriesLibraryBadRequest) + case object(Operations.GetCountriesLibraryResponseBody) + case unauthorized(Operations.GetCountriesLibraryUnauthorized) + + var isEmpty: Bool { + if case .empty = self { + return true + } else { + return false + } + } + + public func badRequest() throws -> Operations.GetCountriesLibraryBadRequest { + guard case .badRequest(let value) = self else { + throw PlexswiftError.missingResponseData + } + return value + } + + public func object() throws -> Operations.GetCountriesLibraryResponseBody { + guard case .object(let value) = self else { + throw PlexswiftError.missingResponseData + } + return value + } + + public func unauthorized() throws -> Operations.GetCountriesLibraryUnauthorized { + guard case .unauthorized(let value) = self else { + throw PlexswiftError.missingResponseData + } + return value + } + }} diff --git a/Sources/Plexswift/models/operations/GetCountriesLibraryResponseBody.swift b/Sources/Plexswift/models/operations/GetCountriesLibraryResponseBody.swift new file mode 100644 index 0000000..14059b2 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetCountriesLibraryResponseBody.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// Successful response containing media container data. + public struct GetCountriesLibraryResponseBody { + public let mediaContainer: Operations.GetCountriesLibraryMediaContainer? + + /// Creates an object with the specified parameters + /// + /// + public init(mediaContainer: Operations.GetCountriesLibraryMediaContainer? = nil) { + self.mediaContainer = mediaContainer + } + }} + +extension Operations.GetCountriesLibraryResponseBody: Codable { + enum CodingKeys: String, CodingKey { + case mediaContainer = "MediaContainer" + } +} + diff --git a/Sources/Plexswift/models/operations/GetCountriesLibraryUnauthorized.swift b/Sources/Plexswift/models/operations/GetCountriesLibraryUnauthorized.swift new file mode 100644 index 0000000..12224b8 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetCountriesLibraryUnauthorized.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 GetCountriesLibraryUnauthorized { + public let errors: [Operations.GetCountriesLibraryLibraryErrors]? + + /// Creates an object with the specified parameters + /// + /// + public init(errors: [Operations.GetCountriesLibraryLibraryErrors]? = nil) { + self.errors = errors + } + }} + +extension Operations.GetCountriesLibraryUnauthorized: Codable { + enum CodingKeys: String, CodingKey { + case errors + } +} + diff --git a/Sources/Plexswift/models/operations/GetGenresLibraryBadRequest.swift b/Sources/Plexswift/models/operations/GetGenresLibraryBadRequest.swift new file mode 100644 index 0000000..eb59443 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetGenresLibraryBadRequest.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 GetGenresLibraryBadRequest { + public let errors: [Operations.GetGenresLibraryErrors]? + + /// Creates a request model with the specified parameters + /// + /// + public init(errors: [Operations.GetGenresLibraryErrors]? = nil) { + self.errors = errors + } + }} + +extension Operations.GetGenresLibraryBadRequest: Codable { + enum CodingKeys: String, CodingKey { + case errors + } +} + diff --git a/Sources/Plexswift/models/operations/GetGenresLibraryDirectory.swift b/Sources/Plexswift/models/operations/GetGenresLibraryDirectory.swift new file mode 100644 index 0000000..16b40b0 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetGenresLibraryDirectory.swift @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetGenresLibraryDirectory { + public let fastKey: String + public let key: String + public let title: String + public let type: String + + /// Creates an object with the specified parameters + /// + /// + public init(fastKey: String, key: String, title: String, type: String) { + self.fastKey = fastKey + self.key = key + self.title = title + self.type = type + } + }} + +extension Operations.GetGenresLibraryDirectory: Codable { + enum CodingKeys: String, CodingKey { + case fastKey + case key + case title + case type + } +} + diff --git a/Sources/Plexswift/models/operations/GetGenresLibraryErrors.swift b/Sources/Plexswift/models/operations/GetGenresLibraryErrors.swift new file mode 100644 index 0000000..7bd676e --- /dev/null +++ b/Sources/Plexswift/models/operations/GetGenresLibraryErrors.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetGenresLibraryErrors { + 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.GetGenresLibraryErrors: Codable { + enum CodingKeys: String, CodingKey { + case code + case message + case status + } +} + diff --git a/Sources/Plexswift/models/operations/GetGenresLibraryLibraryErrors.swift b/Sources/Plexswift/models/operations/GetGenresLibraryLibraryErrors.swift new file mode 100644 index 0000000..964bbc1 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetGenresLibraryLibraryErrors.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetGenresLibraryLibraryErrors { + 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.GetGenresLibraryLibraryErrors: Codable { + enum CodingKeys: String, CodingKey { + case code + case message + case status + } +} + diff --git a/Sources/Plexswift/models/operations/GetGenresLibraryMediaContainer.swift b/Sources/Plexswift/models/operations/GetGenresLibraryMediaContainer.swift new file mode 100644 index 0000000..a2b83c9 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetGenresLibraryMediaContainer.swift @@ -0,0 +1,109 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetGenresLibraryMediaContainer { + public let allowSync: Bool + public let art: String + public let content: String + public let identifier: String + public let mediaTagPrefix: String + public let mediaTagVersion: Int + public let nocache: Bool + @DecimalSerialized + public private(set) var size: Double + public let thumb: String + public let title1: String + public let title2: String + public let viewGroup: String + public let directory: [Operations.GetGenresLibraryDirectory]? + public let offset: Int? + public let totalSize: Int? + + /// Creates an object with the specified parameters + /// + /// + public init(allowSync: Bool, art: String, content: String, identifier: String, mediaTagPrefix: String, mediaTagVersion: Int, nocache: Bool, size: Double, thumb: String, title1: String, title2: String, viewGroup: String, directory: [Operations.GetGenresLibraryDirectory]? = nil, offset: Int? = nil, totalSize: Int? = nil) { + self.allowSync = allowSync + self.art = art + self.content = content + self.identifier = identifier + self.mediaTagPrefix = mediaTagPrefix + self.mediaTagVersion = mediaTagVersion + self.nocache = nocache + self._size = DecimalSerialized(wrappedValue: size) + self.thumb = thumb + self.title1 = title1 + self.title2 = title2 + self.viewGroup = viewGroup + self.directory = directory + self.offset = offset + self.totalSize = totalSize + } + }} + +extension Operations.GetGenresLibraryMediaContainer: Codable { + enum CodingKeys: String, CodingKey { + case allowSync + case art + case content + case identifier + case mediaTagPrefix + case mediaTagVersion + case nocache + case size + case thumb + case title1 + case title2 + case viewGroup + case directory = "Directory" + case offset + case totalSize + } + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.allowSync = try container.decode(Bool.self, forKey: .allowSync) + self.art = try container.decode(String.self, forKey: .art) + self.content = try container.decode(String.self, forKey: .content) + self.identifier = try container.decode(String.self, forKey: .identifier) + self.mediaTagPrefix = try container.decode(String.self, forKey: .mediaTagPrefix) + self.mediaTagVersion = try container.decode(Int.self, forKey: .mediaTagVersion) + self.nocache = try container.decode(Bool.self, forKey: .nocache) + self._size = try container.decode(DecimalSerialized.self, forKey: .size) + self.thumb = try container.decode(String.self, forKey: .thumb) + self.title1 = try container.decode(String.self, forKey: .title1) + self.title2 = try container.decode(String.self, forKey: .title2) + self.viewGroup = try container.decode(String.self, forKey: .viewGroup) + self.directory = try container.decodeIfPresent([Operations.GetGenresLibraryDirectory].self, forKey: .directory) + self.offset = try container.decodeIfPresent(Int.self, forKey: .offset) + self.totalSize = try container.decodeIfPresent(Int.self, forKey: .totalSize) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(self.allowSync, forKey: .allowSync) + try container.encode(self.art, forKey: .art) + try container.encode(self.content, forKey: .content) + try container.encode(self.identifier, forKey: .identifier) + try container.encode(self.mediaTagPrefix, forKey: .mediaTagPrefix) + try container.encode(self.mediaTagVersion, forKey: .mediaTagVersion) + try container.encode(self.nocache, forKey: .nocache) + try container.encode(self._size, forKey: .size) + try container.encode(self.thumb, forKey: .thumb) + try container.encode(self.title1, forKey: .title1) + try container.encode(self.title2, forKey: .title2) + try container.encode(self.viewGroup, forKey: .viewGroup) + try container.encodeIfPresent(self.directory, forKey: .directory) + try container.encodeIfPresent(self.offset, forKey: .offset) + try container.encodeIfPresent(self.totalSize, forKey: .totalSize) + } +} + +extension Operations.GetGenresLibraryMediaContainer { + var sizeWrapper: DecimalSerialized { + return _size + } +} diff --git a/Sources/Plexswift/models/operations/GetGenresLibraryRequest.swift b/Sources/Plexswift/models/operations/GetGenresLibraryRequest.swift new file mode 100644 index 0000000..3ace3a3 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetGenresLibraryRequest.swift @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetGenresLibraryRequest: APIValue { + /// The unique key of the Plex library. + /// Note: This is unique in the context of the Plex server. + /// + public let sectionKey: Int + + /// Creates an object with the specified parameters + /// + /// - Parameter sectionKey: The unique key of the Plex library. + /// Note: This is unique in the context of the Plex server. + /// + /// + public init(sectionKey: Int) { + self.sectionKey = sectionKey + } + }} diff --git a/Sources/Plexswift/models/operations/GetGenresLibraryResponse.swift b/Sources/Plexswift/models/operations/GetGenresLibraryResponse.swift new file mode 100644 index 0000000..26ea986 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetGenresLibraryResponse.swift @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A response model + public enum GetGenresLibraryResponse { + case empty + case badRequest(Operations.GetGenresLibraryBadRequest) + case object(Operations.GetGenresLibraryResponseBody) + case unauthorized(Operations.GetGenresLibraryUnauthorized) + + var isEmpty: Bool { + if case .empty = self { + return true + } else { + return false + } + } + + public func badRequest() throws -> Operations.GetGenresLibraryBadRequest { + guard case .badRequest(let value) = self else { + throw PlexswiftError.missingResponseData + } + return value + } + + public func object() throws -> Operations.GetGenresLibraryResponseBody { + guard case .object(let value) = self else { + throw PlexswiftError.missingResponseData + } + return value + } + + public func unauthorized() throws -> Operations.GetGenresLibraryUnauthorized { + guard case .unauthorized(let value) = self else { + throw PlexswiftError.missingResponseData + } + return value + } + }} diff --git a/Sources/Plexswift/models/operations/GetGenresLibraryResponseBody.swift b/Sources/Plexswift/models/operations/GetGenresLibraryResponseBody.swift new file mode 100644 index 0000000..af0f32e --- /dev/null +++ b/Sources/Plexswift/models/operations/GetGenresLibraryResponseBody.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// Successful response containing media container data. + public struct GetGenresLibraryResponseBody { + public let mediaContainer: Operations.GetGenresLibraryMediaContainer? + + /// Creates an object with the specified parameters + /// + /// + public init(mediaContainer: Operations.GetGenresLibraryMediaContainer? = nil) { + self.mediaContainer = mediaContainer + } + }} + +extension Operations.GetGenresLibraryResponseBody: Codable { + enum CodingKeys: String, CodingKey { + case mediaContainer = "MediaContainer" + } +} + diff --git a/Sources/Plexswift/models/operations/GetGenresLibraryUnauthorized.swift b/Sources/Plexswift/models/operations/GetGenresLibraryUnauthorized.swift new file mode 100644 index 0000000..63dc651 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetGenresLibraryUnauthorized.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 GetGenresLibraryUnauthorized { + public let errors: [Operations.GetGenresLibraryLibraryErrors]? + + /// Creates an object with the specified parameters + /// + /// + public init(errors: [Operations.GetGenresLibraryLibraryErrors]? = nil) { + self.errors = errors + } + }} + +extension Operations.GetGenresLibraryUnauthorized: Codable { + enum CodingKeys: String, CodingKey { + case errors + } +} + diff --git a/Sources/plexswift/PlexswiftAPI.swift b/Sources/plexswift/PlexswiftAPI.swift index e85860c..13f7124 100644 --- a/Sources/plexswift/PlexswiftAPI.swift +++ b/Sources/plexswift/PlexswiftAPI.swift @@ -739,6 +739,8 @@ public protocol SearchAPI { /// - ``getLibraryItems(request:)`` /// - ``getRefreshLibraryMetadata(request:)`` /// - ``getSearchLibrary(request:)`` +/// - ``getGenresLibrary(request:)`` +/// - ``getCountriesLibrary(request:)`` /// - ``getSearchAllLibraries(request:)`` /// - ``getMetaDataByRatingKey(request:)`` /// - ``getMetadataChildren(request:)`` @@ -887,6 +889,22 @@ public protocol LibraryAPI { /// - Throws: An error of type ``PlexswiftError`` func getSearchLibrary(request: Operations.GetSearchLibraryRequest) async throws -> Response + /// Retrieves a list of all the genres that are found for the media in this library. + /// + /// + /// - Parameter request: A ``Operations/GetGenresLibraryRequest`` object describing the input to the API operation + /// - Returns: A ``Operations/GetGenresLibraryResponse`` object describing the result of the API operation + /// - Throws: An error of type ``PlexswiftError`` + func getGenresLibrary(request: Operations.GetGenresLibraryRequest) async throws -> Response + + /// Retrieves a list of all the countries that are found for the media in this library. + /// + /// + /// - Parameter request: A ``Operations/GetCountriesLibraryRequest`` object describing the input to the API operation + /// - Returns: A ``Operations/GetCountriesLibraryResponse`` object describing the result of the API operation + /// - Throws: An error of type ``PlexswiftError`` + func getCountriesLibrary(request: Operations.GetCountriesLibraryRequest) async throws -> Response + /// Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. /// /// diff --git a/Sources/plexswift/internal/client/URLRequestBuilder.swift b/Sources/plexswift/internal/client/URLRequestBuilder.swift index b4f0a2a..1a698a9 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.9.7 2.428.1 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName) + urlRequest.setValue("speakeasy-sdk/swift 0.9.9 2.428.1 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName) addSecurityParameters(to: &urlRequest) diff --git a/codeSamples.yaml b/codeSamples.yaml index 292ecf2..785b49f 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -717,6 +717,68 @@ actions: - lang: swift label: details source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getLibraryDetails(\n request: Operations.GetLibraryDetailsRequest(\n sectionKey: 9518, \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/{sectionKey}/country"]["get"] + update: + x-codeSamples: + - lang: swift + label: library + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.library.getCountriesLibrary( + request: Operations.GetCountriesLibraryRequest( + sectionKey: 9518 + ) + ) + + switch response.data { + case .object(let object): + // Handle response + break + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/library/sections/{sectionKey}/genre"]["get"] + update: + x-codeSamples: + - lang: swift + label: library + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.library.getGenresLibrary( + request: Operations.GetGenresLibraryRequest( + sectionKey: 9518 + ) + ) + + switch response.data { + case .object(let object): + // Handle response + break + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } - target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"] update: x-codeSamples: