From 10585d93c75c8a038a241dc99a8dc6deefe8ffdd Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sun, 22 Sep 2024 00:09:30 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.401.2 --- .speakeasy/gen.lock | 135 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 2 +- README.md | 2 +- RELEASES.md | 12 +- Sources/Plexswift/Plexswift.docc/Plexswift.md | 11 + .../ActiveDirection+Serialization.swift | 14 + .../DefaultDirection+Serialization.swift | 14 + .../models/FlattenSeasons+Serialization.swift | 14 + ...emsLibraryResponseType+Serialization.swift | 14 + ...GetLibraryItemsRequest+Serialization.swift | 2 +- .../GetLibraryItemsType+Serialization.swift | 14 + .../models/HasThumbnail+Serialization.swift | 14 + .../models/ShowOrdering+Serialization.swift | 14 + .../Plexswift/models/operations/Action.swift | 26 + .../models/operations/ActiveDirection.swift | 11 + .../models/operations/Collection.swift | 23 + .../models/operations/DefaultDirection.swift | 11 + .../Plexswift/models/operations/Feature.swift | 24 +- .../models/operations/FlattenSeasons.swift | 9 + .../operations/GetLibraryItemsImage.swift | 29 + .../GetLibraryItemsLibraryResponseType.swift | 11 + .../GetLibraryItemsLibraryType.swift | 41 + .../operations/GetLibraryItemsMedia.swift | 102 +- .../GetLibraryItemsMediaContainer.swift | 20 +- .../operations/GetLibraryItemsMetadata.swift | 142 +- .../operations/GetLibraryItemsPart.swift | 29 +- .../operations/GetLibraryItemsRequest.swift | 26 +- .../operations/GetLibraryItemsSort.swift | 18 +- .../operations/GetLibraryItemsType.swift | 42 +- .../GetPlaylistContentsQueryParamType.swift | 2 +- .../GetTokenDetailsUserPlexAccount.swift | 7 +- .../GetTopWatchedContentQueryParamType.swift | 2 +- .../models/operations/HasThumbnail.swift | 9 + .../Plexswift/models/operations/Meta.swift | 4 +- .../PostUsersSignInDataUserPlexAccount.swift | 7 +- .../models/operations/QueryParamType.swift | 2 +- .../models/operations/ShowOrdering.swift | 19 + .../models/operations/TypeModel.swift | 2 +- .../models/operations/UltraBlurColors.swift | 32 + .../internal/client/URLRequestBuilder.swift | 2 +- codeSamples.yaml | 2126 ++++++++--------- 42 files changed, 1808 insertions(+), 1234 deletions(-) create mode 100644 Sources/Plexswift/internal/models/ActiveDirection+Serialization.swift create mode 100644 Sources/Plexswift/internal/models/DefaultDirection+Serialization.swift create mode 100644 Sources/Plexswift/internal/models/FlattenSeasons+Serialization.swift create mode 100644 Sources/Plexswift/internal/models/GetLibraryItemsLibraryResponseType+Serialization.swift create mode 100644 Sources/Plexswift/internal/models/GetLibraryItemsType+Serialization.swift create mode 100644 Sources/Plexswift/internal/models/HasThumbnail+Serialization.swift create mode 100644 Sources/Plexswift/internal/models/ShowOrdering+Serialization.swift create mode 100644 Sources/Plexswift/models/operations/Action.swift create mode 100644 Sources/Plexswift/models/operations/ActiveDirection.swift create mode 100644 Sources/Plexswift/models/operations/Collection.swift create mode 100644 Sources/Plexswift/models/operations/DefaultDirection.swift create mode 100644 Sources/Plexswift/models/operations/FlattenSeasons.swift create mode 100644 Sources/Plexswift/models/operations/GetLibraryItemsImage.swift create mode 100644 Sources/Plexswift/models/operations/GetLibraryItemsLibraryResponseType.swift create mode 100644 Sources/Plexswift/models/operations/GetLibraryItemsLibraryType.swift create mode 100644 Sources/Plexswift/models/operations/HasThumbnail.swift create mode 100644 Sources/Plexswift/models/operations/ShowOrdering.swift create mode 100644 Sources/Plexswift/models/operations/UltraBlurColors.swift diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 783a876..6c6b2bf 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: 1b63d7c28734a44b0339f405b186b290 + docChecksum: 82a4a9784fb0e66e1c64f130701cdd08 docVersion: 0.0.3 speakeasyVersion: 1.401.2 generationVersion: 2.421.3 - releaseVersion: 0.7.0 - configChecksum: 328d2e540df29d38d8fd33e39ea9a7bc + releaseVersion: 0.7.1 + configChecksum: a70babc1988451efc03d40b9ae2d9385 repoURL: https://github.com/LukeHagar/plexswift.git features: swift: @@ -43,6 +43,7 @@ generatedFiles: - Sources/Plexswift/internal/api/_UpdaterAPI.swift - Sources/Plexswift/internal/api/_VideoAPI.swift - Sources/Plexswift/internal/api/_WatchlistAPI.swift + - Sources/Plexswift/internal/models/ActiveDirection+Serialization.swift - Sources/Plexswift/internal/models/AddPlaylistContentsRequest+Serialization.swift - Sources/Plexswift/internal/models/ApplyUpdatesRequest+Serialization.swift - Sources/Plexswift/internal/models/AutoSelectSubtitle+Serialization.swift @@ -51,6 +52,7 @@ generatedFiles: - Sources/Plexswift/internal/models/ClearPlaylistContentsRequest+Serialization.swift - Sources/Plexswift/internal/models/CreatePlaylistQueryParamType+Serialization.swift - Sources/Plexswift/internal/models/CreatePlaylistRequest+Serialization.swift + - Sources/Plexswift/internal/models/DefaultDirection+Serialization.swift - Sources/Plexswift/internal/models/DefaultSubtitleAccessibility+Serialization.swift - Sources/Plexswift/internal/models/DefaultSubtitleForced+Serialization.swift - Sources/Plexswift/internal/models/DeleteLibraryRequest+Serialization.swift @@ -58,6 +60,7 @@ generatedFiles: - Sources/Plexswift/internal/models/Download+Serialization.swift - Sources/Plexswift/internal/models/Features+Serialization.swift - Sources/Plexswift/internal/models/Filter+Serialization.swift + - Sources/Plexswift/internal/models/FlattenSeasons+Serialization.swift - Sources/Plexswift/internal/models/Force+Serialization.swift - Sources/Plexswift/internal/models/GetBandwidthStatisticsRequest+Serialization.swift - Sources/Plexswift/internal/models/GetBannerImageRequest+Serialization.swift @@ -65,7 +68,9 @@ generatedFiles: - Sources/Plexswift/internal/models/GetGlobalHubsRequest+Serialization.swift - Sources/Plexswift/internal/models/GetLibraryDetailsRequest+Serialization.swift - Sources/Plexswift/internal/models/GetLibraryHubsRequest+Serialization.swift + - Sources/Plexswift/internal/models/GetLibraryItemsLibraryResponseType+Serialization.swift - Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift + - Sources/Plexswift/internal/models/GetLibraryItemsType+Serialization.swift - Sources/Plexswift/internal/models/GetMediaProvidersRequest+Serialization.swift - Sources/Plexswift/internal/models/GetMetaDataByRatingKeyRequest+Serialization.swift - Sources/Plexswift/internal/models/GetMetadataChildrenRequest+Serialization.swift @@ -96,6 +101,7 @@ generatedFiles: - Sources/Plexswift/internal/models/GetTransientTokenQueryParamType+Serialization.swift - Sources/Plexswift/internal/models/GetTransientTokenRequest+Serialization.swift - Sources/Plexswift/internal/models/GetWatchListRequest+Serialization.swift + - Sources/Plexswift/internal/models/HasThumbnail+Serialization.swift - Sources/Plexswift/internal/models/IncludeCollections+Serialization.swift - Sources/Plexswift/internal/models/IncludeDetails+Serialization.swift - Sources/Plexswift/internal/models/IncludeExternalMedia+Serialization.swift @@ -142,6 +148,7 @@ generatedFiles: - Sources/Plexswift/internal/models/Security+Serialization.swift - Sources/Plexswift/internal/models/SharedServers+Serialization.swift - Sources/Plexswift/internal/models/SharedSources+Serialization.swift + - Sources/Plexswift/internal/models/ShowOrdering+Serialization.swift - Sources/Plexswift/internal/models/Skip+Serialization.swift - Sources/Plexswift/internal/models/Smart+Serialization.swift - Sources/Plexswift/internal/models/StartTaskRequest+Serialization.swift @@ -162,6 +169,8 @@ generatedFiles: - Sources/Plexswift/internal/models/WatchedIndicator+Serialization.swift - Sources/Plexswift/models/ModelScopes.swift - Sources/Plexswift/models/operations/Account.swift + - Sources/Plexswift/models/operations/Action.swift + - Sources/Plexswift/models/operations/ActiveDirection.swift - Sources/Plexswift/models/operations/Activity.swift - Sources/Plexswift/models/operations/AddPlaylistContentsBadRequest.swift - Sources/Plexswift/models/operations/AddPlaylistContentsErrors.swift @@ -200,6 +209,7 @@ generatedFiles: - Sources/Plexswift/models/operations/ClearPlaylistContentsRequest.swift - Sources/Plexswift/models/operations/ClearPlaylistContentsResponse.swift - Sources/Plexswift/models/operations/ClearPlaylistContentsUnauthorized.swift + - Sources/Plexswift/models/operations/Collection.swift - Sources/Plexswift/models/operations/Connections.swift - Sources/Plexswift/models/operations/Context.swift - Sources/Plexswift/models/operations/Country.swift @@ -213,6 +223,7 @@ generatedFiles: - Sources/Plexswift/models/operations/CreatePlaylistResponse.swift - Sources/Plexswift/models/operations/CreatePlaylistResponseBody.swift - Sources/Plexswift/models/operations/CreatePlaylistUnauthorized.swift + - Sources/Plexswift/models/operations/DefaultDirection.swift - Sources/Plexswift/models/operations/DefaultSubtitleAccessibility.swift - Sources/Plexswift/models/operations/DefaultSubtitleForced.swift - Sources/Plexswift/models/operations/DeleteLibraryBadRequest.swift @@ -242,6 +253,7 @@ generatedFiles: - Sources/Plexswift/models/operations/Field.swift - Sources/Plexswift/models/operations/FieldType.swift - Sources/Plexswift/models/operations/Filter.swift + - Sources/Plexswift/models/operations/FlattenSeasons.swift - Sources/Plexswift/models/operations/Force.swift - Sources/Plexswift/models/operations/Friend.swift - Sources/Plexswift/models/operations/Genre.swift @@ -358,7 +370,10 @@ generatedFiles: - Sources/Plexswift/models/operations/GetLibraryItemsFieldType.swift - Sources/Plexswift/models/operations/GetLibraryItemsFilter.swift - Sources/Plexswift/models/operations/GetLibraryItemsGenre.swift + - Sources/Plexswift/models/operations/GetLibraryItemsImage.swift - Sources/Plexswift/models/operations/GetLibraryItemsLibraryErrors.swift + - Sources/Plexswift/models/operations/GetLibraryItemsLibraryResponseType.swift + - Sources/Plexswift/models/operations/GetLibraryItemsLibraryType.swift - Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift - Sources/Plexswift/models/operations/GetLibraryItemsMediaContainer.swift - Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift @@ -671,6 +686,7 @@ generatedFiles: - Sources/Plexswift/models/operations/GetWatchListUnauthorized.swift - Sources/Plexswift/models/operations/GetWatchListWatchlistErrors.swift - Sources/Plexswift/models/operations/Guids.swift + - Sources/Plexswift/models/operations/HasThumbnail.swift - Sources/Plexswift/models/operations/Hub.swift - Sources/Plexswift/models/operations/Image.swift - Sources/Plexswift/models/operations/IncludeCollections.swift @@ -782,6 +798,7 @@ generatedFiles: - Sources/Plexswift/models/operations/Setting.swift - Sources/Plexswift/models/operations/SharedServers.swift - Sources/Plexswift/models/operations/SharedSources.swift + - Sources/Plexswift/models/operations/ShowOrdering.swift - Sources/Plexswift/models/operations/Skip.swift - Sources/Plexswift/models/operations/Smart.swift - Sources/Plexswift/models/operations/Sort.swift @@ -832,6 +849,7 @@ generatedFiles: - Sources/Plexswift/models/operations/TranscodeSession.swift - Sources/Plexswift/models/operations/Trials.swift - Sources/Plexswift/models/operations/TypeModel.swift + - Sources/Plexswift/models/operations/UltraBlurColors.swift - Sources/Plexswift/models/operations/UpdatePlayProgressBadRequest.swift - Sources/Plexswift/models/operations/UpdatePlayProgressErrors.swift - Sources/Plexswift/models/operations/UpdatePlayProgressMediaErrors.swift @@ -1189,7 +1207,9 @@ examples: title: TV Shows type: show Metadata: - - Country: + - Collection: + - tag: Working NL Subs + Country: - tag: United States of America - tag: United States of America Director: @@ -1201,35 +1221,53 @@ examples: - tag: Adventure Guid: - id: imdb://tt13015952 + Image: + - alt: Episode 1 + type: background + url: /library/metadata/45521/thumb/1644710589 + - alt: Episode 1 + type: background + url: /library/metadata/45521/thumb/1644710589 Media: - Part: - - container: mkv + - audioProfile: dts + container: 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 + hasThumbnail: "1" id: 119542 + indexes: sd key: /library/parts/119542/1680457526/file.mkv size: 36158371307 videoProfile: main 10 - - container: mkv + - audioProfile: dts + container: 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 + hasThumbnail: "1" id: 119542 + indexes: sd key: /library/parts/119542/1680457526/file.mkv size: 36158371307 videoProfile: main 10 - - container: mkv + - audioProfile: dts + container: 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 + hasThumbnail: "1" id: 119542 + indexes: sd key: /library/parts/119542/1680457526/file.mkv size: 36158371307 videoProfile: main 10 aspectRatio: 1.85 audioChannels: 6 audioCodec: eac3 + audioProfile: dts bitrate: 25025 container: mkv duration: 11558112 + hasVoiceActivity: false height: 2072 id: 119534 videoCodec: hevc @@ -1241,20 +1279,28 @@ examples: - tag: Sigourney Weaver - tag: Sigourney Weaver - tag: Sigourney Weaver + UltraBlurColors: + bottomLeft: 1f5066 + bottomRight: "73958" + topLeft: 11333b + topRight: 0a232d Writer: - tag: James Cameron - addedAt: 1680457607 + addedAt: 1556281940 art: /library/metadata/58683/art/1703239236 audienceRating: 9.2 audienceRatingImage: rottentomatoes://image.rating.upright + banner: /library/metadata/58683/banner/1703239236 chapterSource: media childCount: 1 contentRating: PG-13 duration: 11558112 + flattenSeasons: "1" grandparentArt: /library/metadata/66/art/1705716261 grandparentGuid: plex://show/5d9c081b170e24001f2a7be4 grandparentKey: /library/metadata/66 grandparentRatingKey: "66" + grandparentSlug: alice-in-borderland-2020 grandparentTheme: /library/metadata/66/theme/1705716261 grandparentThumb: /library/metadata/66/thumb/1705716261 grandparentTitle: Caprica @@ -1280,7 +1326,11 @@ examples: rating: 7.6 ratingImage: rottentomatoes://image.rating.ripe ratingKey: "58683" + seasonCount: 2022 + showOrdering: dvd + skipChildren: false skipCount: 1 + slug: 4-for-texas studio: 20th Century Studios 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. tagline: Return to Pandora. @@ -1289,12 +1339,15 @@ examples: title: 'Avatar: The Way of Water' titleSort: Whale type: movie - updatedAt: 1703239236 + updatedAt: 1556281940 viewCount: 1 viewOffset: 5222500 viewedLeafCount: 0 year: 2022 - - Country: + - Collection: + - tag: Working NL Subs + - tag: Working NL Subs + Country: - tag: United States of America Director: - tag: James Cameron @@ -1303,21 +1356,30 @@ examples: Genre: [] Guid: - id: imdb://tt13015952 + Image: + - alt: Episode 1 + type: background + url: /library/metadata/45521/thumb/1644710589 Media: - Part: - - container: mkv + - audioProfile: dts + container: 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 + hasThumbnail: "1" id: 119542 + indexes: sd key: /library/parts/119542/1680457526/file.mkv size: 36158371307 videoProfile: main 10 aspectRatio: 1.85 audioChannels: 6 audioCodec: eac3 + audioProfile: dts bitrate: 25025 container: mkv duration: 11558112 + hasVoiceActivity: false height: 2072 id: 119534 videoCodec: hevc @@ -1329,20 +1391,28 @@ examples: - tag: Sigourney Weaver - tag: Sigourney Weaver - tag: Sigourney Weaver + UltraBlurColors: + bottomLeft: 1f5066 + bottomRight: "73958" + topLeft: 11333b + topRight: 0a232d Writer: - tag: James Cameron - addedAt: 1680457607 + addedAt: 1556281940 art: /library/metadata/58683/art/1703239236 audienceRating: 9.2 audienceRatingImage: rottentomatoes://image.rating.upright + banner: /library/metadata/58683/banner/1703239236 chapterSource: media childCount: 1 contentRating: PG-13 duration: 11558112 + flattenSeasons: "1" grandparentArt: /library/metadata/66/art/1705716261 grandparentGuid: plex://show/5d9c081b170e24001f2a7be4 grandparentKey: /library/metadata/66 grandparentRatingKey: "66" + grandparentSlug: alice-in-borderland-2020 grandparentTheme: /library/metadata/66/theme/1705716261 grandparentThumb: /library/metadata/66/thumb/1705716261 grandparentTitle: Caprica @@ -1368,7 +1438,11 @@ examples: rating: 7.6 ratingImage: rottentomatoes://image.rating.ripe ratingKey: "58683" + seasonCount: 2022 + showOrdering: dvd + skipChildren: false skipCount: 1 + slug: 4-for-texas studio: 20th Century Studios 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. tagline: Return to Pandora. @@ -1377,13 +1451,14 @@ examples: title: 'Avatar: The Way of Water' titleSort: Whale type: movie - updatedAt: 1703239236 + updatedAt: 1556281940 viewCount: 1 viewOffset: 5222500 viewedLeafCount: 0 year: 2022 allowSync: true art: /:/resources/movie-fanart.jpg + content: secondary identifier: com.plexapp.plugins.library librarySectionID: librarySectionTitle: Movies @@ -1391,10 +1466,13 @@ examples: mediaTagPrefix: /system/bundle/media/flags/ mediaTagVersion: 1701731894 mixedParents: true + nocache: true + offset: 0 size: 70 thumb: /:/resources/movie.png title1: Movies title2: Recently Released + totalSize: 170 viewGroup: movie viewMode: 65592 "400": @@ -1415,7 +1493,34 @@ examples: query: X-Plex-Token: CV5xoxjTpFKUzBTShsaf responses: - "200": {} + "200": + application/json: + MediaContainer: + MediaProvider: + - Feature: + - Action: [] + flavor: global + scrobbleKey: /:/scrobble/new + type: + unscrobbleKey: /:/unscrobble/new + - Action: + - id: addToContinueWatching + key: /actions/addToContinueWatching + - id: addToContinueWatching + key: /actions/addToContinueWatching + flavor: global + scrobbleKey: /:/scrobble/new + type: + unscrobbleKey: /:/unscrobble/new + - Action: + - id: addToContinueWatching + key: /actions/addToContinueWatching + - id: addToContinueWatching + key: /actions/addToContinueWatching + flavor: global + scrobbleKey: /:/scrobble/new + type: + unscrobbleKey: /:/unscrobble/new "400": application/json: errors: [] @@ -2330,6 +2435,7 @@ examples: adsConsentReminderAt: "2019-08-24T14:15:22Z" adsConsentSetAt: "2019-08-24T14:15:22Z" anonymous: false + attributionPartner: null authToken: CxoUzBTSV5hsxjTpFKaf backupCodesCreated: false confirmed: false @@ -2633,6 +2739,7 @@ examples: adsConsentReminderAt: "2019-08-24T14:15:22Z" adsConsentSetAt: "2019-08-24T14:15:22Z" anonymous: false + attributionPartner: null authToken: CxoUzBTSV5hsxjTpFKaf backupCodesCreated: false confirmed: false diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1cef274..3d563d2 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true swift: - version: 0.7.0 + version: 0.7.1 author: LukeHagar description: Swift Client SDK Generated by Speakeasy imports: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 19e4329..52b81ee 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -11,7 +11,7 @@ targets: plexswift: source: plexapi codeSamplesNamespace: code-samples-swift-plexswift - codeSamplesRevisionDigest: sha256:ae889ea6513310dba019f6f3b58474bf9316e90eeeb12b21d36a878aee527f44 + codeSamplesRevisionDigest: sha256:081dbbfcbb03dd8d8e2b445350d208744d66cdc36fdb53150bd80caee4ae12ad outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/README.md b/README.md index a2f4189..e1c0aa2 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,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.7.0")) + .package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.7.1")) ] ``` diff --git a/RELEASES.md b/RELEASES.md index a204959..23185b8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -632,4 +632,14 @@ Based on: ### Generated - [swift v0.7.0] . ### Releases -- [Swift Package Manager v0.7.0] https://github.com/LukeHagar/plexswift/releases/tag/v0.7.0 - . \ No newline at end of file +- [Swift Package Manager v0.7.0] https://github.com/LukeHagar/plexswift/releases/tag/v0.7.0 - . + +## 2024-09-22 00:08:38 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.401.2 (2.421.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [swift v0.7.1] . +### Releases +- [Swift Package Manager v0.7.1] https://github.com/LukeHagar/plexswift/releases/tag/v0.7.1 - . \ No newline at end of file diff --git a/Sources/Plexswift/Plexswift.docc/Plexswift.md b/Sources/Plexswift/Plexswift.docc/Plexswift.md index 987d082..88f98ce 100644 --- a/Sources/Plexswift/Plexswift.docc/Plexswift.md +++ b/Sources/Plexswift/Plexswift.docc/Plexswift.md @@ -237,6 +237,8 @@ case .empty: ### Other models - ``Operations/Account`` +- ``Operations/Action`` +- ``Operations/ActiveDirection`` - ``Operations/Activity`` - ``Operations/AddPlaylistContentsErrors`` - ``Operations/AddPlaylistContentsMediaContainer`` @@ -265,6 +267,7 @@ case .empty: - ``Operations/ClearPlaylistContentsPlaylistsErrors`` - ``Operations/ClearPlaylistContentsRequest`` - ``Operations/ClearPlaylistContentsUnauthorized`` +- ``Operations/Collection`` - ``Operations/Connections`` - ``Operations/Context`` - ``Operations/Country`` @@ -276,6 +279,7 @@ case .empty: - ``Operations/CreatePlaylistRequest`` - ``Operations/CreatePlaylistResponseBody`` - ``Operations/CreatePlaylistUnauthorized`` +- ``Operations/DefaultDirection`` - ``Operations/DefaultSubtitleAccessibility`` - ``Operations/DefaultSubtitleForced`` - ``Operations/DeleteLibraryErrors`` @@ -299,6 +303,7 @@ case .empty: - ``Operations/Field`` - ``Operations/FieldType`` - ``Operations/Filter`` +- ``Operations/FlattenSeasons`` - ``Operations/Force`` - ``Operations/Friend`` - ``Operations/Genre`` @@ -329,7 +334,10 @@ case .empty: - ``Operations/GetLibraryItemsFieldType`` - ``Operations/GetLibraryItemsFilter`` - ``Operations/GetLibraryItemsGenre`` +- ``Operations/GetLibraryItemsImage`` - ``Operations/GetLibraryItemsLibraryErrors`` +- ``Operations/GetLibraryItemsLibraryResponseType`` +- ``Operations/GetLibraryItemsLibraryType`` - ``Operations/GetLibraryItemsMedia`` - ``Operations/GetLibraryItemsMediaContainer`` - ``Operations/GetLibraryItemsMetadata`` @@ -631,6 +639,7 @@ case .empty: - ``Operations/GetUserFriendsPlexErrors`` - ``Operations/GetUserFriendsUnauthorized`` - ``Operations/Guids`` +- ``Operations/HasThumbnail`` - ``Operations/Hub`` - ``Operations/Image`` - ``Operations/IncludeCollections`` @@ -728,6 +737,7 @@ case .empty: - ``Operations/Setting`` - ``Operations/SharedServers`` - ``Operations/SharedSources`` +- ``Operations/ShowOrdering`` - ``Operations/Skip`` - ``Operations/Smart`` - ``Operations/Sort`` @@ -766,6 +776,7 @@ case .empty: - ``Operations/TranscodeSession`` - ``Operations/Trials`` - ``Operations/TypeModel`` +- ``Operations/UltraBlurColors`` - ``Operations/UpdatePlaylistErrors`` - ``Operations/UpdatePlaylistPlaylistsErrors`` - ``Operations/UpdatePlaylistRequest`` diff --git a/Sources/Plexswift/internal/models/ActiveDirection+Serialization.swift b/Sources/Plexswift/internal/models/ActiveDirection+Serialization.swift new file mode 100644 index 0000000..4d84207 --- /dev/null +++ b/Sources/Plexswift/internal/models/ActiveDirection+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.ActiveDirection: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/DefaultDirection+Serialization.swift b/Sources/Plexswift/internal/models/DefaultDirection+Serialization.swift new file mode 100644 index 0000000..67ee3a4 --- /dev/null +++ b/Sources/Plexswift/internal/models/DefaultDirection+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.DefaultDirection: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/FlattenSeasons+Serialization.swift b/Sources/Plexswift/internal/models/FlattenSeasons+Serialization.swift new file mode 100644 index 0000000..5f10a49 --- /dev/null +++ b/Sources/Plexswift/internal/models/FlattenSeasons+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.FlattenSeasons: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/GetLibraryItemsLibraryResponseType+Serialization.swift b/Sources/Plexswift/internal/models/GetLibraryItemsLibraryResponseType+Serialization.swift new file mode 100644 index 0000000..84b94a8 --- /dev/null +++ b/Sources/Plexswift/internal/models/GetLibraryItemsLibraryResponseType+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.GetLibraryItemsLibraryResponseType: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift index 8150712..f324f22 100644 --- a/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift +++ b/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift @@ -32,9 +32,9 @@ extension Operations.GetLibraryItemsRequest: PathParameterSerializable { extension Operations.GetLibraryItemsRequest: QueryParameterSerializable { func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] { let builder = QueryParameterBuilder() - try builder.addQueryParameters(from: type, named: "type", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: includeGuids, named: "includeGuids", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: includeMeta, named: "includeMeta", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) + try builder.addQueryParameters(from: type, named: "type", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: xPlexContainerSize, named: "X-Plex-Container-Size", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) try builder.addQueryParameters(from: xPlexContainerStart, named: "X-Plex-Container-Start", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults) return builder.build() diff --git a/Sources/Plexswift/internal/models/GetLibraryItemsType+Serialization.swift b/Sources/Plexswift/internal/models/GetLibraryItemsType+Serialization.swift new file mode 100644 index 0000000..ad0abcd --- /dev/null +++ b/Sources/Plexswift/internal/models/GetLibraryItemsType+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.GetLibraryItemsType: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/HasThumbnail+Serialization.swift b/Sources/Plexswift/internal/models/HasThumbnail+Serialization.swift new file mode 100644 index 0000000..9f95876 --- /dev/null +++ b/Sources/Plexswift/internal/models/HasThumbnail+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.HasThumbnail: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/internal/models/ShowOrdering+Serialization.swift b/Sources/Plexswift/internal/models/ShowOrdering+Serialization.swift new file mode 100644 index 0000000..986e051 --- /dev/null +++ b/Sources/Plexswift/internal/models/ShowOrdering+Serialization.swift @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + + +import Foundation + +extension Operations.ShowOrdering: Serializable { + func serialize(with format: SerializableFormat) throws -> String { + return try rawValue.serialize(with: format) + } + + func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] { + return [QueryParameter(key: [], serialized: try serialize(with: format))] + } +} diff --git a/Sources/Plexswift/models/operations/Action.swift b/Sources/Plexswift/models/operations/Action.swift new file mode 100644 index 0000000..6aa1c63 --- /dev/null +++ b/Sources/Plexswift/models/operations/Action.swift @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct Action { + public let id: String + public let key: String + + /// Creates an object with the specified parameters + /// + /// + public init(id: String, key: String) { + self.id = id + self.key = key + } + }} + +extension Operations.Action: Codable { + enum CodingKeys: String, CodingKey { + case id + case key + } +} + diff --git a/Sources/Plexswift/models/operations/ActiveDirection.swift b/Sources/Plexswift/models/operations/ActiveDirection.swift new file mode 100644 index 0000000..8690bfa --- /dev/null +++ b/Sources/Plexswift/models/operations/ActiveDirection.swift @@ -0,0 +1,11 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// The direction of the sort. Can be either `asc` or `desc`. + /// + public enum ActiveDirection: String, Codable, APIValue { + case ascending = "asc" + case descending = "desc" + }} diff --git a/Sources/Plexswift/models/operations/Collection.swift b/Sources/Plexswift/models/operations/Collection.swift new file mode 100644 index 0000000..78ed0c1 --- /dev/null +++ b/Sources/Plexswift/models/operations/Collection.swift @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct Collection { + public let tag: String? + + /// Creates an object with the specified parameters + /// + /// + public init(tag: String? = nil) { + self.tag = tag + } + }} + +extension Operations.Collection: Codable { + enum CodingKeys: String, CodingKey { + case tag + } +} + diff --git a/Sources/Plexswift/models/operations/DefaultDirection.swift b/Sources/Plexswift/models/operations/DefaultDirection.swift new file mode 100644 index 0000000..8aece42 --- /dev/null +++ b/Sources/Plexswift/models/operations/DefaultDirection.swift @@ -0,0 +1,11 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// The direction of the sort. Can be either `asc` or `desc`. + /// + public enum DefaultDirection: String, Codable, APIValue { + case ascending = "asc" + case descending = "desc" + }} diff --git a/Sources/Plexswift/models/operations/Feature.swift b/Sources/Plexswift/models/operations/Feature.swift index c889529..3fba9ff 100644 --- a/Sources/Plexswift/models/operations/Feature.swift +++ b/Sources/Plexswift/models/operations/Feature.swift @@ -5,25 +5,37 @@ import Foundation extension Operations { /// A model object public struct Feature { + public let type: String + public let action: [Operations.Action]? public let directory: [Operations.GetMediaProvidersDirectory]? + public let flavor: String? public let key: String? - public let type: String? + public let scrobbleKey: String? + public let unscrobbleKey: String? /// Creates an object with the specified parameters /// /// - public init(directory: [Operations.GetMediaProvidersDirectory]? = nil, key: String? = nil, type: String? = nil) { - self.directory = directory - self.key = key + public init(type: String, action: [Operations.Action]? = nil, directory: [Operations.GetMediaProvidersDirectory]? = nil, flavor: String? = nil, key: String? = nil, scrobbleKey: String? = nil, unscrobbleKey: String? = nil) { self.type = type + self.action = action + self.directory = directory + self.flavor = flavor + self.key = key + self.scrobbleKey = scrobbleKey + self.unscrobbleKey = unscrobbleKey } }} extension Operations.Feature: Codable { enum CodingKeys: String, CodingKey { - case directory = "Directory" - case key case type + case action = "Action" + case directory = "Directory" + case flavor + case key + case scrobbleKey + case unscrobbleKey } } diff --git a/Sources/Plexswift/models/operations/FlattenSeasons.swift b/Sources/Plexswift/models/operations/FlattenSeasons.swift new file mode 100644 index 0000000..2cb9964 --- /dev/null +++ b/Sources/Plexswift/models/operations/FlattenSeasons.swift @@ -0,0 +1,9 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + public enum FlattenSeasons: String, Codable, APIValue { + case `false` = "0" + case `true` = "1" + }} diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsImage.swift b/Sources/Plexswift/models/operations/GetLibraryItemsImage.swift new file mode 100644 index 0000000..162d60b --- /dev/null +++ b/Sources/Plexswift/models/operations/GetLibraryItemsImage.swift @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetLibraryItemsImage { + public let alt: String + public let type: Operations.GetLibraryItemsLibraryResponseType + public let url: String + + /// Creates an object with the specified parameters + /// + /// + public init(alt: String, type: Operations.GetLibraryItemsLibraryResponseType, url: String) { + self.alt = alt + self.type = type + self.url = url + } + }} + +extension Operations.GetLibraryItemsImage: Codable { + enum CodingKeys: String, CodingKey { + case alt + case type + case url + } +} + diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsLibraryResponseType.swift b/Sources/Plexswift/models/operations/GetLibraryItemsLibraryResponseType.swift new file mode 100644 index 0000000..0588433 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetLibraryItemsLibraryResponseType.swift @@ -0,0 +1,11 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + public enum GetLibraryItemsLibraryResponseType: String, Codable, APIValue { + case coverPoster = "coverPoster" + case background = "background" + case snapshot = "snapshot" + case clearLogo = "clearLogo" + }} diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsLibraryType.swift b/Sources/Plexswift/models/operations/GetLibraryItemsLibraryType.swift new file mode 100644 index 0000000..13187e7 --- /dev/null +++ b/Sources/Plexswift/models/operations/GetLibraryItemsLibraryType.swift @@ -0,0 +1,41 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct GetLibraryItemsLibraryType { + public let active: Bool + public let key: String + public let title: String + public let type: String + public let field: [Operations.GetLibraryItemsField]? + public let filter: [Operations.GetLibraryItemsFilter]? + public let sort: [Operations.GetLibraryItemsSort]? + + /// Creates an object with the specified parameters + /// + /// + public init(active: Bool, key: String, title: String, type: String, field: [Operations.GetLibraryItemsField]? = nil, filter: [Operations.GetLibraryItemsFilter]? = nil, sort: [Operations.GetLibraryItemsSort]? = nil) { + self.active = active + self.key = key + self.title = title + self.type = type + self.field = field + self.filter = filter + self.sort = sort + } + }} + +extension Operations.GetLibraryItemsLibraryType: Codable { + enum CodingKeys: String, CodingKey { + case active + case key + case title + case type + case field = "Field" + case filter = "Filter" + case sort = "Sort" + } +} + diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift b/Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift index b15b2a8..ff1eec5 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift @@ -6,26 +6,28 @@ extension Operations { /// A model object public struct GetLibraryItemsMedia { @DecimalSerialized - public private(set) var aspectRatio: Double? - public let audioChannels: Int? - public let audioCodec: String? - public let bitrate: Int? - public let container: String? - public let duration: Int? - public let height: Int? - public let id: Int? - public let part: [Operations.GetLibraryItemsPart]? - public let videoCodec: String? - public let videoFrameRate: String? - public let videoProfile: String? - public let videoResolution: String? - public let width: Int? + public private(set) var aspectRatio: Double + public let audioChannels: Int + public let audioCodec: String + public let bitrate: Int + public let container: String + public let duration: Int + public let height: Int + public let id: Int + public let part: [Operations.GetLibraryItemsPart] + public let videoCodec: String + public let videoFrameRate: String + public let videoProfile: String + public let videoResolution: String + public let width: Int + public let audioProfile: String? + public let hasVoiceActivity: Bool? /// Creates an object with the specified parameters /// /// - public init(aspectRatio: Double? = nil, audioChannels: Int? = nil, audioCodec: String? = nil, bitrate: Int? = nil, container: String? = nil, duration: Int? = nil, height: Int? = nil, id: Int? = nil, part: [Operations.GetLibraryItemsPart]? = nil, videoCodec: String? = nil, videoFrameRate: String? = nil, videoProfile: String? = nil, videoResolution: String? = nil, width: Int? = nil) { - self._aspectRatio = DecimalSerialized(wrappedValue: aspectRatio) + public init(aspectRatio: Double, audioChannels: Int, audioCodec: String, bitrate: Int, container: String, duration: Int, height: Int, id: Int, part: [Operations.GetLibraryItemsPart], videoCodec: String, videoFrameRate: String, videoProfile: String, videoResolution: String, width: Int, audioProfile: String? = nil, hasVoiceActivity: Bool? = nil) { + self._aspectRatio = DecimalSerialized(wrappedValue: aspectRatio) self.audioChannels = audioChannels self.audioCodec = audioCodec self.bitrate = bitrate @@ -39,6 +41,8 @@ extension Operations { self.videoProfile = videoProfile self.videoResolution = videoResolution self.width = width + self.audioProfile = audioProfile + self.hasVoiceActivity = hasVoiceActivity } }} @@ -58,49 +62,53 @@ extension Operations.GetLibraryItemsMedia: Codable { case videoProfile case videoResolution case width + case audioProfile + case hasVoiceActivity } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self._aspectRatio = try container.decodeIfPresent(DecimalSerialized.self, forKey: .aspectRatio) ?? DecimalSerialized(wrappedValue: nil) - self.audioChannels = try container.decodeIfPresent(Int.self, forKey: .audioChannels) - self.audioCodec = try container.decodeIfPresent(String.self, forKey: .audioCodec) - self.bitrate = try container.decodeIfPresent(Int.self, forKey: .bitrate) - self.container = try container.decodeIfPresent(String.self, forKey: .container) - self.duration = try container.decodeIfPresent(Int.self, forKey: .duration) - self.height = try container.decodeIfPresent(Int.self, forKey: .height) - self.id = try container.decodeIfPresent(Int.self, forKey: .id) - self.part = try container.decodeIfPresent([Operations.GetLibraryItemsPart].self, forKey: .part) - self.videoCodec = try container.decodeIfPresent(String.self, forKey: .videoCodec) - self.videoFrameRate = try container.decodeIfPresent(String.self, forKey: .videoFrameRate) - self.videoProfile = try container.decodeIfPresent(String.self, forKey: .videoProfile) - self.videoResolution = try container.decodeIfPresent(String.self, forKey: .videoResolution) - self.width = try container.decodeIfPresent(Int.self, forKey: .width) + self._aspectRatio = try container.decode(DecimalSerialized.self, forKey: .aspectRatio) + self.audioChannels = try container.decode(Int.self, forKey: .audioChannels) + self.audioCodec = try container.decode(String.self, forKey: .audioCodec) + self.bitrate = try container.decode(Int.self, forKey: .bitrate) + self.container = try container.decode(String.self, forKey: .container) + self.duration = try container.decode(Int.self, forKey: .duration) + self.height = try container.decode(Int.self, forKey: .height) + self.id = try container.decode(Int.self, forKey: .id) + self.part = try container.decode([Operations.GetLibraryItemsPart].self, forKey: .part) + self.videoCodec = try container.decode(String.self, forKey: .videoCodec) + self.videoFrameRate = try container.decode(String.self, forKey: .videoFrameRate) + self.videoProfile = try container.decode(String.self, forKey: .videoProfile) + self.videoResolution = try container.decode(String.self, forKey: .videoResolution) + self.width = try container.decode(Int.self, forKey: .width) + self.audioProfile = try container.decodeIfPresent(String.self, forKey: .audioProfile) + self.hasVoiceActivity = try container.decodeIfPresent(Bool.self, forKey: .hasVoiceActivity) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - if self.aspectRatio != nil { - try container.encode(self._aspectRatio, forKey: .aspectRatio) - } - try container.encodeIfPresent(self.audioChannels, forKey: .audioChannels) - try container.encodeIfPresent(self.audioCodec, forKey: .audioCodec) - try container.encodeIfPresent(self.bitrate, forKey: .bitrate) - try container.encodeIfPresent(self.container, forKey: .container) - try container.encodeIfPresent(self.duration, forKey: .duration) - try container.encodeIfPresent(self.height, forKey: .height) - try container.encodeIfPresent(self.id, forKey: .id) - try container.encodeIfPresent(self.part, forKey: .part) - try container.encodeIfPresent(self.videoCodec, forKey: .videoCodec) - try container.encodeIfPresent(self.videoFrameRate, forKey: .videoFrameRate) - try container.encodeIfPresent(self.videoProfile, forKey: .videoProfile) - try container.encodeIfPresent(self.videoResolution, forKey: .videoResolution) - try container.encodeIfPresent(self.width, forKey: .width) + try container.encode(self._aspectRatio, forKey: .aspectRatio) + try container.encode(self.audioChannels, forKey: .audioChannels) + try container.encode(self.audioCodec, forKey: .audioCodec) + try container.encode(self.bitrate, forKey: .bitrate) + try container.encode(self.container, forKey: .container) + try container.encode(self.duration, forKey: .duration) + try container.encode(self.height, forKey: .height) + try container.encode(self.id, forKey: .id) + try container.encode(self.part, forKey: .part) + try container.encode(self.videoCodec, forKey: .videoCodec) + try container.encode(self.videoFrameRate, forKey: .videoFrameRate) + try container.encode(self.videoProfile, forKey: .videoProfile) + try container.encode(self.videoResolution, forKey: .videoResolution) + try container.encode(self.width, forKey: .width) + try container.encodeIfPresent(self.audioProfile, forKey: .audioProfile) + try container.encodeIfPresent(self.hasVoiceActivity, forKey: .hasVoiceActivity) } } extension Operations.GetLibraryItemsMedia { - var aspectRatioWrapper: DecimalSerialized { + var aspectRatioWrapper: DecimalSerialized { return _aspectRatio } } diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsMediaContainer.swift b/Sources/Plexswift/models/operations/GetLibraryItemsMediaContainer.swift index 1ec391b..dcc3992 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsMediaContainer.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsMediaContainer.swift @@ -7,22 +7,26 @@ extension Operations { public struct GetLibraryItemsMediaContainer { public let allowSync: Bool public let art: String + public let content: String public let identifier: String public let librarySectionID: Operations.LibrarySectionID public let librarySectionTitle: String public let librarySectionUUID: String public let mediaTagPrefix: String public let mediaTagVersion: Int + public let metadata: [Operations.GetLibraryItemsMetadata] + public let offset: Int public let size: Int public let thumb: String public let title1: String public let title2: String + public let totalSize: Int public let viewGroup: String /// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. /// public let meta: Operations.Meta? - public let metadata: [Operations.GetLibraryItemsMetadata]? public let mixedParents: Bool? + public let nocache: Bool? public let viewMode: Int? /// Creates an object with the specified parameters @@ -30,23 +34,27 @@ extension Operations { /// - Parameter meta: The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. /// /// - public init(allowSync: Bool, art: String, identifier: String, librarySectionID: Operations.LibrarySectionID, librarySectionTitle: String, librarySectionUUID: String, mediaTagPrefix: String, mediaTagVersion: Int, size: Int, thumb: String, title1: String, title2: String, viewGroup: String, meta: Operations.Meta? = nil, metadata: [Operations.GetLibraryItemsMetadata]? = nil, mixedParents: Bool? = nil, viewMode: Int? = nil) { + public init(allowSync: Bool, art: String, content: String, identifier: String, librarySectionID: Operations.LibrarySectionID, librarySectionTitle: String, librarySectionUUID: String, mediaTagPrefix: String, mediaTagVersion: Int, metadata: [Operations.GetLibraryItemsMetadata], offset: Int, size: Int, thumb: String, title1: String, title2: String, totalSize: Int, viewGroup: String, meta: Operations.Meta? = nil, mixedParents: Bool? = nil, nocache: Bool? = nil, viewMode: Int? = nil) { self.allowSync = allowSync self.art = art + self.content = content self.identifier = identifier self.librarySectionID = librarySectionID self.librarySectionTitle = librarySectionTitle self.librarySectionUUID = librarySectionUUID self.mediaTagPrefix = mediaTagPrefix self.mediaTagVersion = mediaTagVersion + self.metadata = metadata + self.offset = offset self.size = size self.thumb = thumb self.title1 = title1 self.title2 = title2 + self.totalSize = totalSize self.viewGroup = viewGroup self.meta = meta - self.metadata = metadata self.mixedParents = mixedParents + self.nocache = nocache self.viewMode = viewMode } }} @@ -55,20 +63,24 @@ extension Operations.GetLibraryItemsMediaContainer: Codable { enum CodingKeys: String, CodingKey { case allowSync case art + case content case identifier case librarySectionID case librarySectionTitle case librarySectionUUID case mediaTagPrefix case mediaTagVersion + case metadata = "Metadata" + case offset case size case thumb case title1 case title2 + case totalSize case viewGroup case meta = "Meta" - case metadata = "Metadata" case mixedParents + case nocache case viewMode } } diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift b/Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift index 914ae59..0897492 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift @@ -5,37 +5,50 @@ import Foundation extension Operations { /// A model object public struct GetLibraryItemsMetadata { - public let duration: Int + /// Unix epoch datetime in seconds + public let addedAt: Int public let guid: String public let key: String - public let media: [Operations.GetLibraryItemsMedia] + /// The rating key (Media ID) of this media item. + /// Note: This is always an integer, but is represented as a string in the API. + /// public let ratingKey: String + public let summary: String public let title: String - public let type: String - public let year: Int - public let addedAt: Int? + /// The type of media content + /// + public let type: Operations.GetLibraryItemsType public let art: String? @DecimalSerialized public private(set) var audienceRating: Double? public let audienceRatingImage: String? + public let banner: String? public let chapterSource: String? public let childCount: Int? + public let collection: [Operations.Collection]? public let contentRating: String? public let country: [Operations.GetLibraryItemsCountry]? public let director: [Operations.GetLibraryItemsDirector]? + public let duration: Int? + public let flattenSeasons: Operations.FlattenSeasons? public let genre: [Operations.GetLibraryItemsGenre]? public let grandparentArt: String? public let grandparentGuid: String? public let grandparentKey: String? public let grandparentRatingKey: String? + public let grandparentSlug: String? public let grandparentTheme: String? public let grandparentThumb: String? public let grandparentTitle: String? public let hasPremiumExtras: String? public let hasPremiumPrimaryExtra: String? + public let image: [Operations.GetLibraryItemsImage]? public let index: Int? public let lastViewedAt: Int? public let leafCount: Int? + /// The Media object is only included when type query is `4` or higher. + /// + public let media: [Operations.GetLibraryItemsMedia]? /// The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. /// public let mediaGuid: [Operations.MediaGuid]? @@ -45,6 +58,8 @@ extension Operations { public let parentGuid: String? public let parentIndex: Int? public let parentKey: String? + /// The rating key of the parent item. + /// public let parentRatingKey: String? public let parentStudio: String? public let parentTheme: String? @@ -56,55 +71,91 @@ extension Operations { public private(set) var rating: Double? public let ratingImage: String? public let role: [Operations.GetLibraryItemsRole]? + public let seasonCount: Int? + /// Setting that indicates the episode ordering for the show + /// None = Library default, + /// tmdbAiring = The Movie Database (Aired), + /// aired = TheTVDB (Aired), + /// dvd = TheTVDB (DVD), + /// absolute = TheTVDB (Absolute)). + /// + public let showOrdering: Operations.ShowOrdering? + public let skipChildren: Bool? public let skipCount: Int? + public let slug: String? public let studio: String? - public let summary: String? public let tagline: String? public let theme: String? public let thumb: String? public let titleSort: String? + public let ultraBlurColors: Operations.UltraBlurColors? + /// Unix epoch datetime in seconds public let updatedAt: Int? public let viewCount: Int? public let viewedLeafCount: Int? public let viewOffset: Int? public let writer: [Operations.GetLibraryItemsWriter]? + public let year: Int? /// Creates an object with the specified parameters /// + /// - Parameter addedAt: Unix epoch datetime in seconds + /// - Parameter ratingKey: The rating key (Media ID) of this media item. + /// Note: This is always an integer, but is represented as a string in the API. + /// + /// - Parameter type: The type of media content + /// + /// - Parameter media: The Media object is only included when type query is `4` or higher. + /// /// - Parameter mediaGuid: The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. /// + /// - Parameter parentRatingKey: The rating key of the parent item. + /// + /// - Parameter showOrdering: Setting that indicates the episode ordering for the show + /// None = Library default, + /// tmdbAiring = The Movie Database (Aired), + /// aired = TheTVDB (Aired), + /// dvd = TheTVDB (DVD), + /// absolute = TheTVDB (Absolute)). + /// + /// - Parameter updatedAt: Unix epoch datetime in seconds /// - public init(duration: Int, guid: String, key: String, media: [Operations.GetLibraryItemsMedia], ratingKey: String, title: String, type: String, year: Int, addedAt: Int? = nil, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, chapterSource: String? = nil, childCount: Int? = nil, contentRating: String? = nil, country: [Operations.GetLibraryItemsCountry]? = nil, director: [Operations.GetLibraryItemsDirector]? = nil, genre: [Operations.GetLibraryItemsGenre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, hasPremiumExtras: String? = nil, hasPremiumPrimaryExtra: String? = nil, index: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, mediaGuid: [Operations.MediaGuid]? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentStudio: String? = nil, parentTheme: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, parentYear: Int? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, role: [Operations.GetLibraryItemsRole]? = nil, skipCount: Int? = nil, studio: String? = nil, summary: String? = nil, tagline: String? = nil, theme: String? = nil, thumb: String? = nil, titleSort: String? = nil, updatedAt: Int? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, viewOffset: Int? = nil, writer: [Operations.GetLibraryItemsWriter]? = nil) { - self.duration = duration + public init(addedAt: Int, guid: String, key: String, ratingKey: String, summary: String, title: String, type: Operations.GetLibraryItemsType, art: String? = nil, audienceRating: Double? = nil, audienceRatingImage: String? = nil, banner: String? = nil, chapterSource: String? = nil, childCount: Int? = nil, collection: [Operations.Collection]? = nil, contentRating: String? = nil, country: [Operations.GetLibraryItemsCountry]? = nil, director: [Operations.GetLibraryItemsDirector]? = nil, duration: Int? = nil, flattenSeasons: Operations.FlattenSeasons? = nil, genre: [Operations.GetLibraryItemsGenre]? = nil, grandparentArt: String? = nil, grandparentGuid: String? = nil, grandparentKey: String? = nil, grandparentRatingKey: String? = nil, grandparentSlug: String? = nil, grandparentTheme: String? = nil, grandparentThumb: String? = nil, grandparentTitle: String? = nil, hasPremiumExtras: String? = nil, hasPremiumPrimaryExtra: String? = nil, image: [Operations.GetLibraryItemsImage]? = nil, index: Int? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, media: [Operations.GetLibraryItemsMedia]? = nil, mediaGuid: [Operations.MediaGuid]? = nil, originallyAvailableAt: Date? = nil, originalTitle: String? = nil, parentGuid: String? = nil, parentIndex: Int? = nil, parentKey: String? = nil, parentRatingKey: String? = nil, parentStudio: String? = nil, parentTheme: String? = nil, parentThumb: String? = nil, parentTitle: String? = nil, parentYear: Int? = nil, primaryExtraKey: String? = nil, rating: Double? = nil, ratingImage: String? = nil, role: [Operations.GetLibraryItemsRole]? = nil, seasonCount: Int? = nil, showOrdering: Operations.ShowOrdering? = nil, skipChildren: Bool? = nil, skipCount: Int? = nil, slug: String? = nil, studio: String? = nil, tagline: String? = nil, theme: String? = nil, thumb: String? = nil, titleSort: String? = nil, ultraBlurColors: Operations.UltraBlurColors? = nil, updatedAt: Int? = nil, viewCount: Int? = nil, viewedLeafCount: Int? = nil, viewOffset: Int? = nil, writer: [Operations.GetLibraryItemsWriter]? = nil, year: Int? = nil) { + self.addedAt = addedAt self.guid = guid self.key = key - self.media = media self.ratingKey = ratingKey + self.summary = summary self.title = title self.type = type - self.year = year - self.addedAt = addedAt self.art = art self._audienceRating = DecimalSerialized(wrappedValue: audienceRating) self.audienceRatingImage = audienceRatingImage + self.banner = banner self.chapterSource = chapterSource self.childCount = childCount + self.collection = collection self.contentRating = contentRating self.country = country self.director = director + self.duration = duration + self.flattenSeasons = flattenSeasons self.genre = genre self.grandparentArt = grandparentArt self.grandparentGuid = grandparentGuid self.grandparentKey = grandparentKey self.grandparentRatingKey = grandparentRatingKey + self.grandparentSlug = grandparentSlug self.grandparentTheme = grandparentTheme self.grandparentThumb = grandparentThumb self.grandparentTitle = grandparentTitle self.hasPremiumExtras = hasPremiumExtras self.hasPremiumPrimaryExtra = hasPremiumPrimaryExtra + self.image = image self.index = index self.lastViewedAt = lastViewedAt self.leafCount = leafCount + self.media = media self.mediaGuid = mediaGuid self._originallyAvailableAt = DateOnly(wrappedValue: originallyAvailableAt) self.originalTitle = originalTitle @@ -121,53 +172,63 @@ extension Operations { self._rating = DecimalSerialized(wrappedValue: rating) self.ratingImage = ratingImage self.role = role + self.seasonCount = seasonCount + self.showOrdering = showOrdering + self.skipChildren = skipChildren self.skipCount = skipCount + self.slug = slug self.studio = studio - self.summary = summary self.tagline = tagline self.theme = theme self.thumb = thumb self.titleSort = titleSort + self.ultraBlurColors = ultraBlurColors self.updatedAt = updatedAt self.viewCount = viewCount self.viewedLeafCount = viewedLeafCount self.viewOffset = viewOffset self.writer = writer + self.year = year } }} extension Operations.GetLibraryItemsMetadata: Codable { enum CodingKeys: String, CodingKey { - case duration + case addedAt case guid case key - case media = "Media" case ratingKey + case summary case title case type - case year - case addedAt case art case audienceRating case audienceRatingImage + case banner case chapterSource case childCount + case collection = "Collection" case contentRating case country = "Country" case director = "Director" + case duration + case flattenSeasons case genre = "Genre" case grandparentArt case grandparentGuid case grandparentKey case grandparentRatingKey + case grandparentSlug case grandparentTheme case grandparentThumb case grandparentTitle case hasPremiumExtras case hasPremiumPrimaryExtra + case image = "Image" case index case lastViewedAt case leafCount + case media = "Media" case mediaGuid = "Guid" case originallyAvailableAt case originalTitle @@ -184,52 +245,62 @@ extension Operations.GetLibraryItemsMetadata: Codable { case rating case ratingImage case role = "Role" + case seasonCount + case showOrdering + case skipChildren case skipCount + case slug case studio - case summary case tagline case theme case thumb case titleSort + case ultraBlurColors = "UltraBlurColors" case updatedAt case viewCount case viewedLeafCount case viewOffset case writer = "Writer" + case year } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.duration = try container.decode(Int.self, forKey: .duration) + self.addedAt = try container.decode(Int.self, forKey: .addedAt) self.guid = try container.decode(String.self, forKey: .guid) self.key = try container.decode(String.self, forKey: .key) - self.media = try container.decode([Operations.GetLibraryItemsMedia].self, forKey: .media) self.ratingKey = try container.decode(String.self, forKey: .ratingKey) + self.summary = try container.decode(String.self, forKey: .summary) self.title = try container.decode(String.self, forKey: .title) - self.type = try container.decode(String.self, forKey: .type) - self.year = try container.decode(Int.self, forKey: .year) - self.addedAt = try container.decodeIfPresent(Int.self, forKey: .addedAt) + self.type = try container.decode(Operations.GetLibraryItemsType.self, forKey: .type) self.art = try container.decodeIfPresent(String.self, forKey: .art) self._audienceRating = try container.decodeIfPresent(DecimalSerialized.self, forKey: .audienceRating) ?? DecimalSerialized(wrappedValue: nil) self.audienceRatingImage = try container.decodeIfPresent(String.self, forKey: .audienceRatingImage) + self.banner = try container.decodeIfPresent(String.self, forKey: .banner) self.chapterSource = try container.decodeIfPresent(String.self, forKey: .chapterSource) self.childCount = try container.decodeIfPresent(Int.self, forKey: .childCount) + self.collection = try container.decodeIfPresent([Operations.Collection].self, forKey: .collection) self.contentRating = try container.decodeIfPresent(String.self, forKey: .contentRating) self.country = try container.decodeIfPresent([Operations.GetLibraryItemsCountry].self, forKey: .country) self.director = try container.decodeIfPresent([Operations.GetLibraryItemsDirector].self, forKey: .director) + self.duration = try container.decodeIfPresent(Int.self, forKey: .duration) + self.flattenSeasons = try container.decodeIfPresent(Operations.FlattenSeasons.self, forKey: .flattenSeasons) self.genre = try container.decodeIfPresent([Operations.GetLibraryItemsGenre].self, forKey: .genre) self.grandparentArt = try container.decodeIfPresent(String.self, forKey: .grandparentArt) self.grandparentGuid = try container.decodeIfPresent(String.self, forKey: .grandparentGuid) self.grandparentKey = try container.decodeIfPresent(String.self, forKey: .grandparentKey) self.grandparentRatingKey = try container.decodeIfPresent(String.self, forKey: .grandparentRatingKey) + self.grandparentSlug = try container.decodeIfPresent(String.self, forKey: .grandparentSlug) self.grandparentTheme = try container.decodeIfPresent(String.self, forKey: .grandparentTheme) self.grandparentThumb = try container.decodeIfPresent(String.self, forKey: .grandparentThumb) self.grandparentTitle = try container.decodeIfPresent(String.self, forKey: .grandparentTitle) self.hasPremiumExtras = try container.decodeIfPresent(String.self, forKey: .hasPremiumExtras) self.hasPremiumPrimaryExtra = try container.decodeIfPresent(String.self, forKey: .hasPremiumPrimaryExtra) + self.image = try container.decodeIfPresent([Operations.GetLibraryItemsImage].self, forKey: .image) self.index = try container.decodeIfPresent(Int.self, forKey: .index) self.lastViewedAt = try container.decodeIfPresent(Int.self, forKey: .lastViewedAt) self.leafCount = try container.decodeIfPresent(Int.self, forKey: .leafCount) + self.media = try container.decodeIfPresent([Operations.GetLibraryItemsMedia].self, forKey: .media) self.mediaGuid = try container.decodeIfPresent([Operations.MediaGuid].self, forKey: .mediaGuid) self._originallyAvailableAt = try container.decodeIfPresent(DateOnly.self, forKey: .originallyAvailableAt) ?? DateOnly(wrappedValue: nil) self.originalTitle = try container.decodeIfPresent(String.self, forKey: .originalTitle) @@ -246,54 +317,64 @@ extension Operations.GetLibraryItemsMetadata: Codable { self._rating = try container.decodeIfPresent(DecimalSerialized.self, forKey: .rating) ?? DecimalSerialized(wrappedValue: nil) self.ratingImage = try container.decodeIfPresent(String.self, forKey: .ratingImage) self.role = try container.decodeIfPresent([Operations.GetLibraryItemsRole].self, forKey: .role) + self.seasonCount = try container.decodeIfPresent(Int.self, forKey: .seasonCount) + self.showOrdering = try container.decodeIfPresent(Operations.ShowOrdering.self, forKey: .showOrdering) + self.skipChildren = try container.decodeIfPresent(Bool.self, forKey: .skipChildren) self.skipCount = try container.decodeIfPresent(Int.self, forKey: .skipCount) + self.slug = try container.decodeIfPresent(String.self, forKey: .slug) self.studio = try container.decodeIfPresent(String.self, forKey: .studio) - self.summary = try container.decodeIfPresent(String.self, forKey: .summary) self.tagline = try container.decodeIfPresent(String.self, forKey: .tagline) self.theme = try container.decodeIfPresent(String.self, forKey: .theme) self.thumb = try container.decodeIfPresent(String.self, forKey: .thumb) self.titleSort = try container.decodeIfPresent(String.self, forKey: .titleSort) + self.ultraBlurColors = try container.decodeIfPresent(Operations.UltraBlurColors.self, forKey: .ultraBlurColors) self.updatedAt = try container.decodeIfPresent(Int.self, forKey: .updatedAt) self.viewCount = try container.decodeIfPresent(Int.self, forKey: .viewCount) self.viewedLeafCount = try container.decodeIfPresent(Int.self, forKey: .viewedLeafCount) self.viewOffset = try container.decodeIfPresent(Int.self, forKey: .viewOffset) self.writer = try container.decodeIfPresent([Operations.GetLibraryItemsWriter].self, forKey: .writer) + self.year = try container.decodeIfPresent(Int.self, forKey: .year) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(self.duration, forKey: .duration) + try container.encode(self.addedAt, forKey: .addedAt) try container.encode(self.guid, forKey: .guid) try container.encode(self.key, forKey: .key) - try container.encode(self.media, forKey: .media) try container.encode(self.ratingKey, forKey: .ratingKey) + try container.encode(self.summary, forKey: .summary) try container.encode(self.title, forKey: .title) try container.encode(self.type, forKey: .type) - try container.encode(self.year, forKey: .year) - try container.encodeIfPresent(self.addedAt, forKey: .addedAt) try container.encodeIfPresent(self.art, forKey: .art) if self.audienceRating != nil { try container.encode(self._audienceRating, forKey: .audienceRating) } try container.encodeIfPresent(self.audienceRatingImage, forKey: .audienceRatingImage) + try container.encodeIfPresent(self.banner, forKey: .banner) try container.encodeIfPresent(self.chapterSource, forKey: .chapterSource) try container.encodeIfPresent(self.childCount, forKey: .childCount) + try container.encodeIfPresent(self.collection, forKey: .collection) try container.encodeIfPresent(self.contentRating, forKey: .contentRating) try container.encodeIfPresent(self.country, forKey: .country) try container.encodeIfPresent(self.director, forKey: .director) + try container.encodeIfPresent(self.duration, forKey: .duration) + try container.encodeIfPresent(self.flattenSeasons, forKey: .flattenSeasons) try container.encodeIfPresent(self.genre, forKey: .genre) try container.encodeIfPresent(self.grandparentArt, forKey: .grandparentArt) try container.encodeIfPresent(self.grandparentGuid, forKey: .grandparentGuid) try container.encodeIfPresent(self.grandparentKey, forKey: .grandparentKey) try container.encodeIfPresent(self.grandparentRatingKey, forKey: .grandparentRatingKey) + try container.encodeIfPresent(self.grandparentSlug, forKey: .grandparentSlug) try container.encodeIfPresent(self.grandparentTheme, forKey: .grandparentTheme) try container.encodeIfPresent(self.grandparentThumb, forKey: .grandparentThumb) try container.encodeIfPresent(self.grandparentTitle, forKey: .grandparentTitle) try container.encodeIfPresent(self.hasPremiumExtras, forKey: .hasPremiumExtras) try container.encodeIfPresent(self.hasPremiumPrimaryExtra, forKey: .hasPremiumPrimaryExtra) + try container.encodeIfPresent(self.image, forKey: .image) try container.encodeIfPresent(self.index, forKey: .index) try container.encodeIfPresent(self.lastViewedAt, forKey: .lastViewedAt) try container.encodeIfPresent(self.leafCount, forKey: .leafCount) + try container.encodeIfPresent(self.media, forKey: .media) try container.encodeIfPresent(self.mediaGuid, forKey: .mediaGuid) if self.originallyAvailableAt != nil { try container.encode(self._originallyAvailableAt, forKey: .originallyAvailableAt) @@ -314,18 +395,23 @@ extension Operations.GetLibraryItemsMetadata: Codable { } try container.encodeIfPresent(self.ratingImage, forKey: .ratingImage) try container.encodeIfPresent(self.role, forKey: .role) + try container.encodeIfPresent(self.seasonCount, forKey: .seasonCount) + try container.encodeIfPresent(self.showOrdering, forKey: .showOrdering) + try container.encodeIfPresent(self.skipChildren, forKey: .skipChildren) try container.encodeIfPresent(self.skipCount, forKey: .skipCount) + try container.encodeIfPresent(self.slug, forKey: .slug) try container.encodeIfPresent(self.studio, forKey: .studio) - try container.encodeIfPresent(self.summary, forKey: .summary) try container.encodeIfPresent(self.tagline, forKey: .tagline) try container.encodeIfPresent(self.theme, forKey: .theme) try container.encodeIfPresent(self.thumb, forKey: .thumb) try container.encodeIfPresent(self.titleSort, forKey: .titleSort) + try container.encodeIfPresent(self.ultraBlurColors, forKey: .ultraBlurColors) try container.encodeIfPresent(self.updatedAt, forKey: .updatedAt) try container.encodeIfPresent(self.viewCount, forKey: .viewCount) try container.encodeIfPresent(self.viewedLeafCount, forKey: .viewedLeafCount) try container.encodeIfPresent(self.viewOffset, forKey: .viewOffset) try container.encodeIfPresent(self.writer, forKey: .writer) + try container.encodeIfPresent(self.year, forKey: .year) } } diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsPart.swift b/Sources/Plexswift/models/operations/GetLibraryItemsPart.swift index f20683f..caeb7a6 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsPart.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsPart.swift @@ -5,18 +5,25 @@ import Foundation extension Operations { /// A model object public struct GetLibraryItemsPart { - public let container: String? - public let duration: Int? - public let file: String? - public let id: Int? - public let key: String? - public let size: Int? - public let videoProfile: String? + /// The container format of the media file. + /// + public let container: String + public let duration: Int + public let file: String + public let id: Int + public let key: String + public let size: Int + public let videoProfile: String + public let audioProfile: String? + public let hasThumbnail: Operations.HasThumbnail? + public let indexes: String? /// Creates an object with the specified parameters /// + /// - Parameter container: The container format of the media file. + /// /// - public init(container: String? = nil, duration: Int? = nil, file: String? = nil, id: Int? = nil, key: String? = nil, size: Int? = nil, videoProfile: String? = nil) { + public init(container: String, duration: Int, file: String, id: Int, key: String, size: Int, videoProfile: String, audioProfile: String? = nil, hasThumbnail: Operations.HasThumbnail? = nil, indexes: String? = nil) { self.container = container self.duration = duration self.file = file @@ -24,6 +31,9 @@ extension Operations { self.key = key self.size = size self.videoProfile = videoProfile + self.audioProfile = audioProfile + self.hasThumbnail = hasThumbnail + self.indexes = indexes } }} @@ -36,6 +46,9 @@ extension Operations.GetLibraryItemsPart: Codable { case key case size case videoProfile + case audioProfile + case hasThumbnail + case indexes } } diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsRequest.swift b/Sources/Plexswift/models/operations/GetLibraryItemsRequest.swift index 09a19b3..7ff7f74 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsRequest.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsRequest.swift @@ -11,6 +11,12 @@ extension Operations { public let sectionKey: Int /// A key representing a specific tag within the section. public let tag: Operations.Tag + /// Adds the Guids object to the response + /// + public let includeGuids: Operations.IncludeGuids? + /// Adds the Meta object to the response + /// + public let includeMeta: Operations.IncludeMeta? /// The type of media to retrieve. /// 1 = movie /// 2 = show @@ -18,13 +24,7 @@ extension Operations { /// 4 = episode /// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries /// - public let type: Operations.TypeModel - /// Adds the Guids object to the response - /// - public let includeGuids: Operations.IncludeGuids? - /// Adds the Meta object to the response - /// - public let includeMeta: Operations.IncludeMeta? + public let type: Operations.TypeModel? /// The number of items to return. If not specified, all items will be returned. /// If the number of items exceeds the limit, the response will be paginated. /// By default this is 50 @@ -42,6 +42,10 @@ extension Operations { /// Note: This is unique in the context of the Plex server. /// /// - Parameter tag: A key representing a specific tag within the section. + /// - Parameter includeGuids: Adds the Guids object to the response + /// + /// - Parameter includeMeta: Adds the Meta object to the response + /// /// - Parameter type: The type of media to retrieve. /// 1 = movie /// 2 = show @@ -49,10 +53,6 @@ extension Operations { /// 4 = episode /// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries /// - /// - Parameter includeGuids: Adds the Guids object to the response - /// - /// - Parameter includeMeta: Adds the Meta object to the response - /// /// - Parameter xPlexContainerSize: The number of items to return. If not specified, all items will be returned. /// If the number of items exceeds the limit, the response will be paginated. /// By default this is 50 @@ -62,12 +62,12 @@ extension Operations { /// By default this is 0 /// /// - public init(sectionKey: Int, tag: Operations.Tag, type: Operations.TypeModel, includeGuids: Operations.IncludeGuids? = nil, includeMeta: Operations.IncludeMeta? = nil, xPlexContainerSize: Int? = nil, xPlexContainerStart: Int? = nil) { + public init(sectionKey: Int, tag: Operations.Tag, includeGuids: Operations.IncludeGuids? = nil, includeMeta: Operations.IncludeMeta? = nil, type: Operations.TypeModel? = nil, xPlexContainerSize: Int? = nil, xPlexContainerStart: Int? = nil) { self.sectionKey = sectionKey self.tag = tag - self.type = type self.includeGuids = includeGuids self.includeMeta = includeMeta + self.type = type self.xPlexContainerSize = xPlexContainerSize self.xPlexContainerStart = xPlexContainerStart } diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsSort.swift b/Sources/Plexswift/models/operations/GetLibraryItemsSort.swift index b12019f..2365cfb 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsSort.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsSort.swift @@ -5,20 +5,32 @@ import Foundation extension Operations { /// A model object public struct GetLibraryItemsSort { - public let defaultDirection: String + /// The direction of the sort. Can be either `asc` or `desc`. + /// + public let defaultDirection: Operations.DefaultDirection public let key: String public let title: String + public let active: Bool? + /// The direction of the sort. Can be either `asc` or `desc`. + /// + public let activeDirection: Operations.ActiveDirection? public let `default`: String? public let descKey: String? public let firstCharacterKey: String? /// Creates an object with the specified parameters /// + /// - Parameter defaultDirection: The direction of the sort. Can be either `asc` or `desc`. + /// + /// - Parameter activeDirection: The direction of the sort. Can be either `asc` or `desc`. + /// /// - public init(defaultDirection: String, key: String, title: String, `default`: String? = nil, descKey: String? = nil, firstCharacterKey: String? = nil) { + public init(defaultDirection: Operations.DefaultDirection, key: String, title: String, active: Bool? = nil, activeDirection: Operations.ActiveDirection? = nil, `default`: String? = nil, descKey: String? = nil, firstCharacterKey: String? = nil) { self.defaultDirection = defaultDirection self.key = key self.title = title + self.active = active + self.activeDirection = activeDirection self.`default` = `default` self.descKey = descKey self.firstCharacterKey = firstCharacterKey @@ -30,6 +42,8 @@ extension Operations.GetLibraryItemsSort: Codable { case defaultDirection case key case title + case active + case activeDirection case `default` = "default" case descKey case firstCharacterKey diff --git a/Sources/Plexswift/models/operations/GetLibraryItemsType.swift b/Sources/Plexswift/models/operations/GetLibraryItemsType.swift index bd5b9b8..087616d 100644 --- a/Sources/Plexswift/models/operations/GetLibraryItemsType.swift +++ b/Sources/Plexswift/models/operations/GetLibraryItemsType.swift @@ -3,39 +3,11 @@ import Foundation extension Operations { - /// A model object - public struct GetLibraryItemsType { - public let active: Bool - public let key: String - public let title: String - public let type: String - public let field: [Operations.GetLibraryItemsField]? - public let filter: [Operations.GetLibraryItemsFilter]? - public let sort: [Operations.GetLibraryItemsSort]? - - /// Creates an object with the specified parameters - /// - /// - public init(active: Bool, key: String, title: String, type: String, field: [Operations.GetLibraryItemsField]? = nil, filter: [Operations.GetLibraryItemsFilter]? = nil, sort: [Operations.GetLibraryItemsSort]? = nil) { - self.active = active - self.key = key - self.title = title - self.type = type - self.field = field - self.filter = filter - self.sort = sort - } + /// The type of media content + /// + public enum GetLibraryItemsType: String, Codable, APIValue { + case movie = "movie" + case tvShow = "show" + case season = "season" + case episode = "episode" }} - -extension Operations.GetLibraryItemsType: Codable { - enum CodingKeys: String, CodingKey { - case active - case key - case title - case type - case field = "Field" - case filter = "Filter" - case sort = "Sort" - } -} - diff --git a/Sources/Plexswift/models/operations/GetPlaylistContentsQueryParamType.swift b/Sources/Plexswift/models/operations/GetPlaylistContentsQueryParamType.swift index 70b7060..a495764 100644 --- a/Sources/Plexswift/models/operations/GetPlaylistContentsQueryParamType.swift +++ b/Sources/Plexswift/models/operations/GetPlaylistContentsQueryParamType.swift @@ -12,7 +12,7 @@ extension Operations { /// public enum GetPlaylistContentsQueryParamType: Int, Codable, APIValue { case movie = 1 - case show = 2 + case tvShow = 2 case season = 3 case episode = 4 }} diff --git a/Sources/Plexswift/models/operations/GetTokenDetailsUserPlexAccount.swift b/Sources/Plexswift/models/operations/GetTokenDetailsUserPlexAccount.swift index c7ea443..93223d3 100644 --- a/Sources/Plexswift/models/operations/GetTokenDetailsUserPlexAccount.swift +++ b/Sources/Plexswift/models/operations/GetTokenDetailsUserPlexAccount.swift @@ -15,6 +15,7 @@ extension Operations { public private(set) var adsConsentSetAt: Date /// Unknown public let anonymous: Bool + public let attributionPartner: String /// The account token public let authToken: String /// If the two-factor authentication backup codes have been created @@ -127,11 +128,12 @@ extension Operations { /// - Parameter roles: [Might be removed] List of account roles. Plexpass membership listed here /// @available(*, deprecated, message: "This initializer uses deprecated fields and will be removed in a future version.") - public init(adsConsent: Bool, adsConsentReminderAt: Date, adsConsentSetAt: Date, anonymous: Bool, authToken: String, backupCodesCreated: Bool, confirmed: Bool, country: String, email: String, emailOnlyAuth: Bool, entitlements: [String], experimentalFeatures: Bool, friendlyName: String, guest: Bool, hasPassword: Bool, home: Bool, homeAdmin: Bool, homeSize: Int, id: Int, joinedAt: Int, locale: String, mailingListActive: Bool, mailingListStatus: Operations.MailingListStatus, maxHomeSize: Int, profile: Operations.UserProfile, protected: Bool, rememberExpiresAt: Int, restricted: Bool, scrobbleTypes: String, services: [Operations.Services], subscription: Operations.Subscription, subscriptionDescription: String, subscriptions: [Operations.GetTokenDetailsSubscription], thumb: String, title: String, twoFactorEnabled: Bool, username: String, uuid: String, pin: String? = nil, roles: [String]? = nil) { + public init(adsConsent: Bool, adsConsentReminderAt: Date, adsConsentSetAt: Date, anonymous: Bool, attributionPartner: String, authToken: String, backupCodesCreated: Bool, confirmed: Bool, country: String, email: String, emailOnlyAuth: Bool, entitlements: [String], experimentalFeatures: Bool, friendlyName: String, guest: Bool, hasPassword: Bool, home: Bool, homeAdmin: Bool, homeSize: Int, id: Int, joinedAt: Int, locale: String, mailingListActive: Bool, mailingListStatus: Operations.MailingListStatus, maxHomeSize: Int, profile: Operations.UserProfile, protected: Bool, rememberExpiresAt: Int, restricted: Bool, scrobbleTypes: String, services: [Operations.Services], subscription: Operations.Subscription, subscriptionDescription: String, subscriptions: [Operations.GetTokenDetailsSubscription], thumb: String, title: String, twoFactorEnabled: Bool, username: String, uuid: String, pin: String? = nil, roles: [String]? = nil) { self.adsConsent = adsConsent self._adsConsentReminderAt = DateTime(wrappedValue: adsConsentReminderAt) self._adsConsentSetAt = DateTime(wrappedValue: adsConsentSetAt) self.anonymous = anonymous + self.attributionPartner = attributionPartner self.authToken = authToken self.backupCodesCreated = backupCodesCreated self.confirmed = confirmed @@ -177,6 +179,7 @@ extension Operations.GetTokenDetailsUserPlexAccount: Codable { case adsConsentReminderAt case adsConsentSetAt case anonymous + case attributionPartner case authToken case backupCodesCreated case confirmed @@ -221,6 +224,7 @@ extension Operations.GetTokenDetailsUserPlexAccount: Codable { self._adsConsentReminderAt = try container.decode(DateTime.self, forKey: .adsConsentReminderAt) self._adsConsentSetAt = try container.decode(DateTime.self, forKey: .adsConsentSetAt) self.anonymous = try container.decode(Bool.self, forKey: .anonymous) + self.attributionPartner = try container.decode(String.self, forKey: .attributionPartner) self.authToken = try container.decode(String.self, forKey: .authToken) self.backupCodesCreated = try container.decode(Bool.self, forKey: .backupCodesCreated) self.confirmed = try container.decode(Bool.self, forKey: .confirmed) @@ -265,6 +269,7 @@ extension Operations.GetTokenDetailsUserPlexAccount: Codable { try container.encode(self._adsConsentReminderAt, forKey: .adsConsentReminderAt) try container.encode(self._adsConsentSetAt, forKey: .adsConsentSetAt) try container.encode(self.anonymous, forKey: .anonymous) + try container.encode(self.attributionPartner, forKey: .attributionPartner) try container.encode(self.authToken, forKey: .authToken) try container.encode(self.backupCodesCreated, forKey: .backupCodesCreated) try container.encode(self.confirmed, forKey: .confirmed) diff --git a/Sources/Plexswift/models/operations/GetTopWatchedContentQueryParamType.swift b/Sources/Plexswift/models/operations/GetTopWatchedContentQueryParamType.swift index 1fa2c6b..9bd3147 100644 --- a/Sources/Plexswift/models/operations/GetTopWatchedContentQueryParamType.swift +++ b/Sources/Plexswift/models/operations/GetTopWatchedContentQueryParamType.swift @@ -12,7 +12,7 @@ extension Operations { /// public enum GetTopWatchedContentQueryParamType: Int, Codable, APIValue { case movie = 1 - case show = 2 + case tvShow = 2 case season = 3 case episode = 4 }} diff --git a/Sources/Plexswift/models/operations/HasThumbnail.swift b/Sources/Plexswift/models/operations/HasThumbnail.swift new file mode 100644 index 0000000..3d79293 --- /dev/null +++ b/Sources/Plexswift/models/operations/HasThumbnail.swift @@ -0,0 +1,9 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + public enum HasThumbnail: String, Codable, APIValue { + case `false` = "0" + case `true` = "1" + }} diff --git a/Sources/Plexswift/models/operations/Meta.swift b/Sources/Plexswift/models/operations/Meta.swift index c600fb7..2ca9fd6 100644 --- a/Sources/Plexswift/models/operations/Meta.swift +++ b/Sources/Plexswift/models/operations/Meta.swift @@ -7,12 +7,12 @@ extension Operations { /// public struct Meta { public let fieldType: [Operations.GetLibraryItemsFieldType]? - public let type: [Operations.GetLibraryItemsType]? + public let type: [Operations.GetLibraryItemsLibraryType]? /// Creates an object with the specified parameters /// /// - public init(fieldType: [Operations.GetLibraryItemsFieldType]? = nil, type: [Operations.GetLibraryItemsType]? = nil) { + public init(fieldType: [Operations.GetLibraryItemsFieldType]? = nil, type: [Operations.GetLibraryItemsLibraryType]? = nil) { self.fieldType = fieldType self.type = type } diff --git a/Sources/Plexswift/models/operations/PostUsersSignInDataUserPlexAccount.swift b/Sources/Plexswift/models/operations/PostUsersSignInDataUserPlexAccount.swift index 92d3671..1d5657f 100644 --- a/Sources/Plexswift/models/operations/PostUsersSignInDataUserPlexAccount.swift +++ b/Sources/Plexswift/models/operations/PostUsersSignInDataUserPlexAccount.swift @@ -15,6 +15,7 @@ extension Operations { public private(set) var adsConsentSetAt: Date /// Unknown public let anonymous: Bool + public let attributionPartner: String /// The account token public let authToken: String /// If the two-factor authentication backup codes have been created @@ -129,11 +130,12 @@ extension Operations { /// - Parameter roles: [Might be removed] List of account roles. Plexpass membership listed here /// @available(*, deprecated, message: "This initializer uses deprecated fields and will be removed in a future version.") - public init(adsConsent: Bool, adsConsentReminderAt: Date, adsConsentSetAt: Date, anonymous: Bool, authToken: String, backupCodesCreated: Bool, confirmed: Bool, country: String, email: String, emailOnlyAuth: Bool, entitlements: [String], experimentalFeatures: Bool, friendlyName: String, guest: Bool, hasPassword: Bool, home: Bool, homeAdmin: Bool, homeSize: Int, id: Int, joinedAt: Int, locale: String, mailingListActive: Bool, mailingListStatus: Operations.PostUsersSignInDataMailingListStatus, maxHomeSize: Int, pastSubscriptions: [Operations.PastSubscription], profile: Operations.PostUsersSignInDataUserProfile, protected: Bool, rememberExpiresAt: Int, restricted: Bool, scrobbleTypes: String, services: [Operations.PostUsersSignInDataServices], subscription: Operations.PostUsersSignInDataSubscription, subscriptionDescription: String, subscriptions: [Operations.PostUsersSignInDataAuthenticationSubscription], thumb: String, title: String, trials: [Operations.Trials], twoFactorEnabled: Bool, username: String, uuid: String, pin: String? = nil, roles: [String]? = nil) { + public init(adsConsent: Bool, adsConsentReminderAt: Date, adsConsentSetAt: Date, anonymous: Bool, attributionPartner: String, authToken: String, backupCodesCreated: Bool, confirmed: Bool, country: String, email: String, emailOnlyAuth: Bool, entitlements: [String], experimentalFeatures: Bool, friendlyName: String, guest: Bool, hasPassword: Bool, home: Bool, homeAdmin: Bool, homeSize: Int, id: Int, joinedAt: Int, locale: String, mailingListActive: Bool, mailingListStatus: Operations.PostUsersSignInDataMailingListStatus, maxHomeSize: Int, pastSubscriptions: [Operations.PastSubscription], profile: Operations.PostUsersSignInDataUserProfile, protected: Bool, rememberExpiresAt: Int, restricted: Bool, scrobbleTypes: String, services: [Operations.PostUsersSignInDataServices], subscription: Operations.PostUsersSignInDataSubscription, subscriptionDescription: String, subscriptions: [Operations.PostUsersSignInDataAuthenticationSubscription], thumb: String, title: String, trials: [Operations.Trials], twoFactorEnabled: Bool, username: String, uuid: String, pin: String? = nil, roles: [String]? = nil) { self.adsConsent = adsConsent self._adsConsentReminderAt = DateTime(wrappedValue: adsConsentReminderAt) self._adsConsentSetAt = DateTime(wrappedValue: adsConsentSetAt) self.anonymous = anonymous + self.attributionPartner = attributionPartner self.authToken = authToken self.backupCodesCreated = backupCodesCreated self.confirmed = confirmed @@ -181,6 +183,7 @@ extension Operations.PostUsersSignInDataUserPlexAccount: Codable { case adsConsentReminderAt case adsConsentSetAt case anonymous + case attributionPartner case authToken case backupCodesCreated case confirmed @@ -227,6 +230,7 @@ extension Operations.PostUsersSignInDataUserPlexAccount: Codable { self._adsConsentReminderAt = try container.decode(DateTime.self, forKey: .adsConsentReminderAt) self._adsConsentSetAt = try container.decode(DateTime.self, forKey: .adsConsentSetAt) self.anonymous = try container.decode(Bool.self, forKey: .anonymous) + self.attributionPartner = try container.decode(String.self, forKey: .attributionPartner) self.authToken = try container.decode(String.self, forKey: .authToken) self.backupCodesCreated = try container.decode(Bool.self, forKey: .backupCodesCreated) self.confirmed = try container.decode(Bool.self, forKey: .confirmed) @@ -273,6 +277,7 @@ extension Operations.PostUsersSignInDataUserPlexAccount: Codable { try container.encode(self._adsConsentReminderAt, forKey: .adsConsentReminderAt) try container.encode(self._adsConsentSetAt, forKey: .adsConsentSetAt) try container.encode(self.anonymous, forKey: .anonymous) + try container.encode(self.attributionPartner, forKey: .attributionPartner) try container.encode(self.authToken, forKey: .authToken) try container.encode(self.backupCodesCreated, forKey: .backupCodesCreated) try container.encode(self.confirmed, forKey: .confirmed) diff --git a/Sources/Plexswift/models/operations/QueryParamType.swift b/Sources/Plexswift/models/operations/QueryParamType.swift index 4b96342..7cdf93c 100644 --- a/Sources/Plexswift/models/operations/QueryParamType.swift +++ b/Sources/Plexswift/models/operations/QueryParamType.swift @@ -12,7 +12,7 @@ extension Operations { /// public enum QueryParamType: Int, Codable, APIValue { case movie = 1 - case show = 2 + case tvShow = 2 case season = 3 case episode = 4 }} diff --git a/Sources/Plexswift/models/operations/ShowOrdering.swift b/Sources/Plexswift/models/operations/ShowOrdering.swift new file mode 100644 index 0000000..0a3cb2b --- /dev/null +++ b/Sources/Plexswift/models/operations/ShowOrdering.swift @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// Setting that indicates the episode ordering for the show + /// None = Library default, + /// tmdbAiring = The Movie Database (Aired), + /// aired = TheTVDB (Aired), + /// dvd = TheTVDB (DVD), + /// absolute = TheTVDB (Absolute)). + /// + public enum ShowOrdering: String, Codable, APIValue { + case `none` = "None" + case tmdbAiring = "tmdbAiring" + case aired = "aired" + case dvd = "dvd" + case absolute = "absolute" + }} diff --git a/Sources/Plexswift/models/operations/TypeModel.swift b/Sources/Plexswift/models/operations/TypeModel.swift index b196d61..dd6d0a7 100644 --- a/Sources/Plexswift/models/operations/TypeModel.swift +++ b/Sources/Plexswift/models/operations/TypeModel.swift @@ -12,7 +12,7 @@ extension Operations { /// public enum TypeModel: Int, Codable, APIValue { case movie = 1 - case show = 2 + case tvShow = 2 case season = 3 case episode = 4 }} diff --git a/Sources/Plexswift/models/operations/UltraBlurColors.swift b/Sources/Plexswift/models/operations/UltraBlurColors.swift new file mode 100644 index 0000000..6da0b3f --- /dev/null +++ b/Sources/Plexswift/models/operations/UltraBlurColors.swift @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +import Foundation + +extension Operations { + /// A model object + public struct UltraBlurColors { + public let bottomLeft: String + public let bottomRight: String + public let topLeft: String + public let topRight: String + + /// Creates an object with the specified parameters + /// + /// + public init(bottomLeft: String, bottomRight: String, topLeft: String, topRight: String) { + self.bottomLeft = bottomLeft + self.bottomRight = bottomRight + self.topLeft = topLeft + self.topRight = topRight + } + }} + +extension Operations.UltraBlurColors: Codable { + enum CodingKeys: String, CodingKey { + case bottomLeft + case bottomRight + case topLeft + case topRight + } +} + diff --git a/Sources/plexswift/internal/client/URLRequestBuilder.swift b/Sources/plexswift/internal/client/URLRequestBuilder.swift index aafc04b..a7f59e4 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.7.0 2.421.3 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName) + urlRequest.setValue("speakeasy-sdk/swift 0.7.1 2.421.3 0.0.3 plexswift", forHTTPHeaderField: telemetryHeader.headerName) addSecurityParameters(to: &urlRequest) diff --git a/codeSamples.yaml b/codeSamples.yaml index ea75271..ed069cc 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,6 +3,592 @@ info: title: CodeSamples overlay for swift target version: 0.0.0 actions: + - target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"] + update: + x-codeSamples: + - lang: swift + label: image + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.media.getBannerImage(\n request: Operations.GetBannerImageRequest(\n height: 396, \n minSize: 1, \n ratingKey: 9518, \n upscale: 1, \n width: 396, \n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\"\n )\n)\n\nswitch response.data {\ncase .bytes(let bytes):\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"]["/companions"]["get"] + update: + x-codeSamples: + - lang: swift + label: getCompanionsData + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.plex.getCompanionsData() + + switch response.data { + case .responseBodies(let responseBodies): + // 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"]["/pins"]["post"] + update: + x-codeSamples: + - lang: swift + label: getPin + source: |- + import Foundation + import Plexswift + + let client = Client() + + let response = try await client.plex.getPin( + request: Operations.GetPinRequest( + strong: false + ) + ) + + switch response.data { + case .authPinContainer(let authPinContainer): + // Handle response + break + case .badRequest(let badRequest): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/hubs/search"]["get"] + update: + x-codeSamples: + - lang: swift + label: performSearch + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.search.performSearch(\n request: Operations.PerformSearchRequest(\n query: \"dylan\", \n limit: 5, \n sectionId: 1516.53\n )\n)\n\nswitch response.data {\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}" + - target: $["paths"]["/library/sections"]["get"] + update: + x-codeSamples: + - lang: swift + label: libraries + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.library.getAllLibraries() + + 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}"]["get"] + update: + x-codeSamples: + - 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 includeDetails: .zero\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/watchlist/{filter}"]["get"] + update: + x-codeSamples: + - lang: swift + label: list + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.watchlist.getWatchList(\n request: Operations.GetWatchListRequest(\n filter: .available, \n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\", \n includeCollections: .zero, \n includeExternalMedia: .zero, \n libtype: .show, \n maxresults: 49173, \n sort: \"\", \n xPlexContainerSize: 50, \n xPlexContainerStart: 0\n )\n)\n\nswitch response.data {\ncase .object(let object):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}" + - target: $["paths"]["/status/sessions"]["get"] + update: + x-codeSamples: + - lang: swift + label: getSessions + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.sessions.getSessions() + + 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"]["/:/prefs"]["get"] + update: + x-codeSamples: + - lang: swift + label: getServerPreferences + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.server.getServerPreferences() + + 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}/search"]["get"] + update: + x-codeSamples: + - lang: swift + label: library + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getSearchLibrary(\n request: Operations.GetSearchLibraryRequest(\n sectionKey: 9518, \n type: .tvShow\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/metadata/{ratingKey}"]["get"] + update: + x-codeSamples: + - lang: swift + label: key + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.library.getMetaDataByRatingKey( + request: Operations.GetMetaDataByRatingKeyRequest( + ratingKey: 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"]["/playlists"]["get"] + update: + x-codeSamples: + - lang: swift + label: getPlaylists + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.getPlaylists(\n request: Operations.GetPlaylistsRequest(\n playlistType: .audio, \n smart: .zero\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"]["/playlists/{playlistID}/items"]["put"] + update: + x-codeSamples: + - lang: swift + label: addPlaylistContents + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.addPlaylistContents(\n request: Operations.AddPlaylistContentsRequest(\n playlistID: 8502.01, \n uri: \"server://12345/com.plexapp.plugins.library/library/metadata/1\", \n playQueueID: 123\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"]["/updater/check"]["put"] + update: + x-codeSamples: + - lang: swift + label: checkForUpdates + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.updater.checkForUpdates( + request: Operations.CheckForUpdatesRequest( + download: .one + ) + ) + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/myplex/account"]["get"] + update: + x-codeSamples: + - lang: swift + label: getMyPlexAccount + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.server.getMyPlexAccount() + + 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/metadata/{ratingKey}/thumb"]["get"] + update: + x-codeSamples: + - lang: swift + label: image + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.media.getThumbImage(\n request: Operations.GetThumbImageRequest(\n height: 396, \n minSize: 1, \n ratingKey: 9518, \n upscale: 1, \n width: 396, \n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\"\n )\n)\n\nswitch response.data {\ncase .bytes(let bytes):\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/hashes"]["get"] + update: + x-codeSamples: + - lang: swift + label: getFileHash + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getFileHash(\n request: Operations.GetFileHashRequest(\n url: \"file://C:\\Image.png&type=13\", \n type: 4462.17\n )\n)\n\nswitch response.data {\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"]["/log"]["post"] + update: + x-codeSamples: + - lang: swift + label: logMultiLine + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.log.logMultiLine() + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/transcode/sessions"]["get"] + update: + x-codeSamples: + - lang: swift + label: getTranscodeSessions + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.sessions.getTranscodeSessions() + + 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"]["/:/unscrobble"]["get"] + update: + x-codeSamples: + - lang: swift + label: markUnplayed + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.media.markUnplayed( + request: Operations.MarkUnplayedRequest( + key: 59398 + ) + ) + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/:/timeline"]["get"] + update: + x-codeSamples: + - lang: swift + label: getTimeline + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.video.getTimeline(\n request: Operations.GetTimelineRequest(\n context: \"home:hub.continueWatching\", \n duration: 10000, \n hasMDE: 1, \n key: \"/library/metadata/23409\", \n playBackTime: 2000, \n playQueueItemID: 1, \n ratingKey: 23409, \n row: 1, \n state: .playing, \n time: 2000\n )\n)\n\nswitch response.data {\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"]["/video/:/transcode/universal/start.mpd"]["get"] + update: + x-codeSamples: + - lang: swift + label: startUniversalTranscode + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.video.startUniversalTranscode(\n request: Operations.StartUniversalTranscodeRequest(\n hasMDE: 1, \n mediaIndex: 0, \n partIndex: 0, \n path: \"/library/metadata/23409\", \n `protocol`: \"hls\", \n addDebugOverlay: 0, \n audioBoost: 100, \n autoAdjustQuality: 0, \n directPlay: 0, \n directStream: 0, \n fastSeek: 0, \n location: \"lan\", \n mediaBufferSize: 102400, \n session: \"zvcage8b7rkioqcm8f4uns4c\", \n subtites: \"burn\", \n subtitleSize: 100\n )\n)\n\nswitch response.data {\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"]["/butler"]["delete"] + update: + x-codeSamples: + - lang: swift + label: stopAllTasks + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.butler.stopAllTasks() + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/security/resources"]["get"] + update: + x-codeSamples: + - lang: swift + label: getSourceConnectionInformation + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.authentication.getSourceConnectionInformation( + request: Operations.GetSourceConnectionInformationRequest( + source: "server://client-identifier" + ) + ) + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/user"]["get"] + update: + x-codeSamples: + - lang: swift + label: getTokenDetails + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.authentication.getTokenDetails() + + switch response.data { + case .userPlexAccount(let userPlexAccount): + // 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"]["/updater/status"]["get"] + update: + x-codeSamples: + - lang: swift + label: getUpdateStatus + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.updater.getUpdateStatus() + + 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"]["/identity"]["get"] + update: + x-codeSamples: + - lang: swift + label: identity + source: |- + import Foundation + import Plexswift + + let client = Client() + + let response = try await client.server.getServerIdentity() + + switch response.data { + case .object(let object): + // Handle response + break + case .requestTimeout(let requestTimeout): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/activities/{activityUUID}"]["delete"] + update: + x-codeSamples: + - lang: swift + label: cancelServerActivities + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.activities.cancelServerActivities( + request: Operations.CancelServerActivitiesRequest( + activityUUID: "25b71ed5-0f9d-461c-baa7-d404e9e10d3e" + ) + ) + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/statistics/resources"]["get"] + update: + x-codeSamples: + - lang: swift + label: getResourcesStatistics + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.statistics.getResourcesStatistics( + request: Operations.GetResourcesStatisticsRequest( + timespan: 4 + ) + ) + + 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"]["/status/sessions/history/all"]["get"] + update: + x-codeSamples: + - lang: swift + label: getSessionHistory + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.sessions.getSessionHistory(\n request: Operations.GetSessionHistoryRequest(\n accountId: 1, \n filter: Operations.QueryParamFilter(), \n librarySectionID: 12, \n sort: \"\"\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"]["/log/networked"]["get"] + update: + x-codeSamples: + - lang: swift + label: enablePaperTrail + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.log.enablePaperTrail() + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } - target: $["paths"]["/playlists/{playlistID}"]["get"] update: x-codeSamples: @@ -34,6 +620,432 @@ actions: // Handle empty response break } + - target: $["paths"]["/:/scrobble"]["get"] + update: + x-codeSamples: + - lang: swift + label: markPlayed + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.media.markPlayed( + request: Operations.MarkPlayedRequest( + key: 59398 + ) + ) + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/playlists/{playlistID}"]["put"] + update: + x-codeSamples: + - lang: swift + label: updatePlaylist + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.updatePlaylist(\n request: Operations.UpdatePlaylistRequest(\n playlistID: 3915, \n summary: \"\", \n title: \"\"\n )\n)\n\nswitch response.data {\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"]["/playlists/{playlistID}/items"]["delete"] + update: + x-codeSamples: + - lang: swift + label: clearPlaylistContents + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.playlists.clearPlaylistContents( + request: Operations.ClearPlaylistContentsRequest( + playlistID: 1893.18 + ) + ) + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/library/onDeck"]["get"] + update: + x-codeSamples: + - lang: swift + label: getOnDeck + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.library.getOnDeck() + + 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"]["/playlists/upload"]["post"] + update: + x-codeSamples: + - lang: swift + label: uploadPlaylist + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.uploadPlaylist(\n request: Operations.UploadPlaylistRequest(\n force: .zero, \n path: \"/home/barkley/playlist.m3u\", \n sectionID: 1\n )\n)\n\nswitch response.data {\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"]["/updater/apply"]["put"] + update: + x-codeSamples: + - lang: swift + label: applyUpdates + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.updater.applyUpdates(\n request: Operations.ApplyUpdatesRequest(\n skip: .one, \n tonight: .zero\n )\n)\n\nswitch response.data {\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"]["/"]["get"] + update: + x-codeSamples: + - lang: swift + label: getServerCapabilities + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.server.getServerCapabilities() + + 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"]["/devices"]["get"] + update: + x-codeSamples: + - lang: swift + label: getDevices + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.server.getDevices() + + 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"]["/media/providers"]["get"] + update: + x-codeSamples: + - lang: swift + label: providers + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.server.getMediaProviders( + request: Operations.GetMediaProvidersRequest( + xPlexToken: "CV5xoxjTpFKUzBTShsaf" + ) + ) + + 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"]["/servers"]["get"] + update: + x-codeSamples: + - lang: swift + label: getServerList + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.server.getServerList() + + 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"]["/pins/{pinID}"]["get"] + update: + x-codeSamples: + - lang: swift + label: getTokenByPinId + source: |- + import Foundation + import Plexswift + + let client = Client() + + let response = try await client.plex.getTokenByPinId( + request: Operations.GetTokenByPinIdRequest( + pinID: 408895 + ) + ) + + switch response.data { + case .authPinContainer(let authPinContainer): + // Handle response + break + case .badRequest(let badRequest): + // Handle response + break + case .object(let object): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/activities"]["get"] + update: + x-codeSamples: + - lang: swift + label: getServerActivities + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.activities.getServerActivities() + + 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"]["/:/progress"]["post"] + update: + x-codeSamples: + - lang: swift + label: updatePlayProgress + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.media.updatePlayProgress(\n request: Operations.UpdatePlayProgressRequest(\n key: \"\", \n state: \"played\", \n time: 90000\n )\n)\n\nswitch response.data {\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"]["/butler"]["post"] + update: + x-codeSamples: + - lang: swift + label: startAllTasks + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.butler.startAllTasks() + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] + update: + x-codeSamples: + - lang: swift + label: getMetadataChildren + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getMetadataChildren(\n request: Operations.GetMetadataChildrenRequest(\n ratingKey: 1539.14, \n includeElements: \"\"\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"]["/playlists/{playlistID}/items"]["get"] + update: + x-codeSamples: + - lang: swift + label: getPlaylistContents + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.getPlaylistContents(\n request: Operations.GetPlaylistContentsRequest(\n playlistID: 5004.46, \n type: .episode\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"]["/photo/:/transcode"]["get"] + update: + x-codeSamples: + - lang: swift + label: getResizedPhoto + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.server.getResizedPhoto(\n request: Operations.GetResizedPhotoRequest(\n blur: 20, \n height: 165, \n minSize: .one, \n opacity: 96541, \n upscale: .zero, \n url: \"/library/metadata/49564/thumb/1654258204\", \n width: 110\n )\n)\n\nswitch response.data {\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"]["/resources"]["get"] + update: + x-codeSamples: + - lang: swift + label: resources + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.plex.getServerResources(\n request: Operations.GetServerResourcesRequest(\n includeHttps: .disable, \n includeIPv6: .disable, \n includeRelay: .enable\n )\n)\n\nswitch response.data {\ncase .plexDevices(let plexDevices):\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"]["/hubs"]["get"] + update: + x-codeSamples: + - lang: swift + label: getGlobalHubs + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.hubs.getGlobalHubs(\n request: Operations.GetGlobalHubsRequest(\n count: 1262.49, \n onlyTransient: .one\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"]["/hubs/sections/{sectionId}"]["get"] + update: + x-codeSamples: + - lang: swift + label: getLibraryHubs + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.hubs.getLibraryHubs(\n request: Operations.GetLibraryHubsRequest(\n sectionId: 6728.76, \n count: 9010.22, \n onlyTransient: .zero\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/recentlyAdded"]["get"] + update: + x-codeSamples: + - lang: swift + label: getRecentlyAdded + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getRecentlyAdded(\n request: Operations.GetRecentlyAddedRequest(\n xPlexContainerSize: 50, \n xPlexContainerStart: 0\n )\n)\n\nswitch response.data {\ncase .object(let object):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}" + - target: $["paths"]["/library/sections/{sectionKey}"]["delete"] + update: + x-codeSamples: + - lang: swift + label: deleteLibrary + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.library.deleteLibrary( + request: Operations.DeleteLibraryRequest( + sectionKey: 9518 + ) + ) + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } + - target: $["paths"]["/clients"]["get"] + update: + x-codeSamples: + - lang: swift + label: getAvailableClients + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.server.getAvailableClients() + + 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"]["/butler/{taskName}"]["delete"] + update: + x-codeSamples: + - lang: swift + label: stopTask + source: |- + import Foundation + import Plexswift + + let client = Client(security: .accessToken("")) + + let response = try await client.butler.stopTask( + request: Operations.StopTaskRequest( + taskName: .backupDatabase + ) + ) + + switch response.data { + case .badRequest(let badRequest): + // Handle response + break + case .unauthorized(let unauthorized): + // Handle response + break + case .empty: + // Handle empty response + break + } - target: $["paths"]["/statistics/bandwidth"]["get"] update: x-codeSamples: @@ -93,54 +1105,23 @@ actions: // Handle empty response break } - - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] + - target: $["paths"]["/butler"]["get"] update: x-codeSamples: - lang: swift - label: startUniversalTranscode - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.video.startUniversalTranscode(\n request: Operations.StartUniversalTranscodeRequest(\n hasMDE: 1, \n mediaIndex: 0, \n partIndex: 0, \n path: \"/library/metadata/23409\", \n `protocol`: \"hls\", \n addDebugOverlay: 0, \n audioBoost: 100, \n autoAdjustQuality: 0, \n directPlay: 0, \n directStream: 0, \n fastSeek: 0, \n location: \"lan\", \n mediaBufferSize: 102400, \n session: \"zvcage8b7rkioqcm8f4uns4c\", \n subtites: \"burn\", \n subtitleSize: 100\n )\n)\n\nswitch response.data {\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"]["/hubs"]["get"] - update: - x-codeSamples: - - lang: swift - label: getGlobalHubs - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.hubs.getGlobalHubs(\n request: Operations.GetGlobalHubsRequest(\n count: 1262.49, \n onlyTransient: .one\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"]["/hubs/search/voice"]["get"] - update: - x-codeSamples: - - lang: swift - label: performVoiceSearch - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.search.performVoiceSearch(\n request: Operations.PerformVoiceSearchRequest(\n query: \"dead+poop\", \n limit: 5, \n sectionId: 4094.8\n )\n)\n\nswitch response.data {\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}"]["get"] - update: - x-codeSamples: - - 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 includeDetails: .zero\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"]["/log"]["get"] - update: - x-codeSamples: - - lang: swift - label: logLine - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.log.logLine(\n request: Operations.LogLineRequest(\n level: .three, \n message: \"Test log message\", \n source: \"Postman\"\n )\n)\n\nswitch response.data {\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"]["/updater/check"]["put"] - update: - x-codeSamples: - - lang: swift - label: checkForUpdates + label: getButlerTasks source: |- import Foundation import Plexswift let client = Client(security: .accessToken("")) - let response = try await client.updater.checkForUpdates( - request: Operations.CheckForUpdatesRequest( - download: .one - ) - ) + let response = try await client.butler.getButlerTasks() switch response.data { + case .object(let object): + // Handle response + break case .badRequest(let badRequest): // Handle response break @@ -151,6 +1132,12 @@ actions: // Handle empty response break } + - target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"] + update: + x-codeSamples: + - lang: swift + label: items + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getLibraryItems(\n request: Operations.GetLibraryItemsRequest(\n sectionKey: 9518, \n tag: .edition, \n includeGuids: .enable, \n includeMeta: .enable, \n type: .tvShow, \n xPlexContainerSize: 50, \n xPlexContainerStart: 0\n )\n)\n\nswitch response.data {\ncase .object(let object):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}" - target: $["paths"]["/butler/{taskName}"]["post"] update: x-codeSamples: @@ -179,21 +1166,21 @@ actions: // Handle empty response break } - - target: $["paths"]["/companions"]["get"] + - target: $["paths"]["/friends"]["get"] update: x-codeSamples: - lang: swift - label: getCompanionsData + label: getUserFriends source: |- import Foundation import Plexswift let client = Client(security: .accessToken("")) - let response = try await client.plex.getCompanionsData() + let response = try await client.plex.getUserFriends() switch response.data { - case .responseBodies(let responseBodies): + case .friends(let friends): // Handle response break case .badRequest(let badRequest): @@ -206,166 +1193,26 @@ actions: // Handle empty response break } - - target: $["paths"]["/pins"]["post"] + - target: $["paths"]["/hubs/search/voice"]["get"] update: x-codeSamples: - lang: swift - label: getPin - source: |- - import Foundation - import Plexswift - - let client = Client() - - let response = try await client.plex.getPin( - request: Operations.GetPinRequest( - strong: false - ) - ) - - switch response.data { - case .authPinContainer(let authPinContainer): - // Handle response - break - case .badRequest(let badRequest): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/log/networked"]["get"] + label: performVoiceSearch + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.search.performVoiceSearch(\n request: Operations.PerformVoiceSearchRequest(\n query: \"dead+poop\", \n limit: 5, \n sectionId: 4094.8\n )\n)\n\nswitch response.data {\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"]["/search"]["get"] update: x-codeSamples: - lang: swift - label: enablePaperTrail + label: getSearchResults source: |- import Foundation import Plexswift let client = Client(security: .accessToken("")) - let response = try await client.log.enablePaperTrail() - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/updater/status"]["get"] - update: - x-codeSamples: - - lang: swift - label: getUpdateStatus - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.updater.getUpdateStatus() - - 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"]["/photo/:/transcode"]["get"] - update: - x-codeSamples: - - lang: swift - label: getResizedPhoto - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.server.getResizedPhoto(\n request: Operations.GetResizedPhotoRequest(\n blur: 20, \n height: 165, \n minSize: .one, \n opacity: 96541, \n upscale: .zero, \n url: \"/library/metadata/49564/thumb/1654258204\", \n width: 110\n )\n)\n\nswitch response.data {\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"]["/servers"]["get"] - update: - x-codeSamples: - - lang: swift - label: getServerList - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.server.getServerList() - - 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"]["/butler/{taskName}"]["delete"] - update: - x-codeSamples: - - lang: swift - label: stopTask - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.butler.stopTask( - request: Operations.StopTaskRequest( - taskName: .backupDatabase - ) - ) - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/playlists/upload"]["post"] - update: - x-codeSamples: - - lang: swift - label: uploadPlaylist - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.uploadPlaylist(\n request: Operations.UploadPlaylistRequest(\n force: .zero, \n path: \"/home/barkley/playlist.m3u\", \n sectionID: 1\n )\n)\n\nswitch response.data {\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"]["/statistics/media"]["get"] - update: - x-codeSamples: - - lang: swift - label: getStatistics - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.statistics.getStatistics( - request: Operations.GetStatisticsRequest( - timespan: 4 + let response = try await client.search.getSearchResults( + request: Operations.GetSearchResultsRequest( + query: "110" ) ) @@ -383,339 +1230,18 @@ actions: // Handle empty response break } - - target: $["paths"]["/identity"]["get"] + - target: $["paths"]["/log"]["get"] update: x-codeSamples: - lang: swift - label: identity - source: |- - import Foundation - import Plexswift - - let client = Client() - - let response = try await client.server.getServerIdentity() - - switch response.data { - case .object(let object): - // Handle response - break - case .requestTimeout(let requestTimeout): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/myplex/account"]["get"] + label: logLine + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.log.logLine(\n request: Operations.LogLineRequest(\n level: .three, \n message: \"Test log message\", \n source: \"Postman\"\n )\n)\n\nswitch response.data {\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"]["/playlists"]["post"] update: x-codeSamples: - lang: swift - label: getMyPlexAccount - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.server.getMyPlexAccount() - - 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"]["/butler"]["delete"] - update: - x-codeSamples: - - lang: swift - label: stopAllTasks - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.butler.stopAllTasks() - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/security/token"]["get"] - update: - x-codeSamples: - - lang: swift - label: getTransientToken - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.authentication.getTransientToken(\n request: Operations.GetTransientTokenRequest(\n scope: .all, \n type: .delegation\n )\n)\n\nswitch response.data {\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"]["/security/resources"]["get"] - update: - x-codeSamples: - - lang: swift - label: getSourceConnectionInformation - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.authentication.getSourceConnectionInformation( - request: Operations.GetSourceConnectionInformationRequest( - source: "server://client-identifier" - ) - ) - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/"]["get"] - update: - x-codeSamples: - - lang: swift - label: getServerCapabilities - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.server.getServerCapabilities() - - 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"]["/hubs/search"]["get"] - update: - x-codeSamples: - - lang: swift - label: performSearch - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.search.performSearch(\n request: Operations.PerformSearchRequest(\n query: \"dylan\", \n limit: 5, \n sectionId: 1516.53\n )\n)\n\nswitch response.data {\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"]["/status/sessions"]["get"] - update: - x-codeSamples: - - lang: swift - label: getSessions - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.sessions.getSessions() - - 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"]["/:/progress"]["post"] - update: - x-codeSamples: - - lang: swift - label: updatePlayProgress - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.media.updatePlayProgress(\n request: Operations.UpdatePlayProgressRequest(\n key: \"\", \n state: \"played\", \n time: 90000\n )\n)\n\nswitch response.data {\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/metadata/{ratingKey}"]["get"] - update: - x-codeSamples: - - lang: swift - label: key - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.library.getMetaDataByRatingKey( - request: Operations.GetMetaDataByRatingKeyRequest( - ratingKey: 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"]["/transcode/sessions"]["get"] - update: - x-codeSamples: - - lang: swift - label: getTranscodeSessions - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.sessions.getTranscodeSessions() - - 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"]["/clients"]["get"] - update: - x-codeSamples: - - lang: swift - label: getAvailableClients - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.server.getAvailableClients() - - 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/onDeck"]["get"] - update: - x-codeSamples: - - lang: swift - label: getOnDeck - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.library.getOnDeck() - - 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/watchlist/{filter}"]["get"] - update: - x-codeSamples: - - lang: swift - label: list - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.watchlist.getWatchList(\n request: Operations.GetWatchListRequest(\n filter: .available, \n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\", \n includeCollections: .zero, \n includeExternalMedia: .zero, \n libtype: .show, \n maxresults: 49173, \n sort: \"\", \n xPlexContainerSize: 50, \n xPlexContainerStart: 0\n )\n)\n\nswitch response.data {\ncase .object(let object):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}" - - target: $["paths"]["/playlists/{playlistID}/items"]["put"] - update: - x-codeSamples: - - lang: swift - label: addPlaylistContents - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.addPlaylistContents(\n request: Operations.AddPlaylistContentsRequest(\n playlistID: 8502.01, \n uri: \"server://12345/com.plexapp.plugins.library/library/metadata/1\", \n playQueueID: 123\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"]["/:/scrobble"]["get"] - update: - x-codeSamples: - - lang: swift - label: markPlayed - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.media.markPlayed( - request: Operations.MarkPlayedRequest( - key: 59398 - ) - ) - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"] - update: - x-codeSamples: - - lang: swift - label: image - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.media.getBannerImage(\n request: Operations.GetBannerImageRequest(\n height: 396, \n minSize: 1, \n ratingKey: 9518, \n upscale: 1, \n width: 396, \n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\"\n )\n)\n\nswitch response.data {\ncase .bytes(let bytes):\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}" + label: createPlaylist + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.createPlaylist(\n request: Operations.CreatePlaylistRequest(\n smart: .one, \n title: \"\", \n type: .photo, \n uri: \"https://inborn-brochure.biz\", \n playQueueID: 3686.33\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"]["/playlists/{playlistID}"]["delete"] update: x-codeSamples: @@ -744,126 +1270,33 @@ actions: // Handle empty response break } - - target: $["paths"]["/pins/{pinID}"]["get"] + - target: $["paths"]["/security/token"]["get"] update: x-codeSamples: - lang: swift - label: getTokenByPinId + label: getTransientToken + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.authentication.getTransientToken(\n request: Operations.GetTransientTokenRequest(\n scope: .all, \n type: .delegation\n )\n)\n\nswitch response.data {\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"]["/statistics/media"]["get"] + update: + x-codeSamples: + - lang: swift + label: getStatistics source: |- import Foundation import Plexswift - let client = Client() + let client = Client(security: .accessToken("")) - let response = try await client.plex.getTokenByPinId( - request: Operations.GetTokenByPinIdRequest( - pinID: 408895 + let response = try await client.statistics.getStatistics( + request: Operations.GetStatisticsRequest( + timespan: 4 ) ) switch response.data { - case .authPinContainer(let authPinContainer): - // Handle response - break - case .badRequest(let badRequest): - // Handle response - break case .object(let object): // Handle response break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/library/recentlyAdded"]["get"] - update: - x-codeSamples: - - lang: swift - label: getRecentlyAdded - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getRecentlyAdded(\n request: Operations.GetRecentlyAddedRequest(\n xPlexContainerSize: 50, \n xPlexContainerStart: 0\n )\n)\n\nswitch response.data {\ncase .object(let object):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}" - - target: $["paths"]["/users/signin"]["post"] - update: - x-codeSamples: - - lang: swift - label: data - source: "import Foundation\nimport Plexswift\n\nlet client = Client()\n\nlet response = try await client.authentication.postUsersSignInData(\n request: Operations.PostUsersSignInDataRequestBody(\n login: \"username@email.com\", \n password: \"password123\", \n rememberMe: false, \n verificationCode: \"123456\"\n )\n)\n\nswitch response.data {\ncase .userPlexAccount(let userPlexAccount):\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"]["/:/prefs"]["get"] - update: - x-codeSamples: - - lang: swift - label: getServerPreferences - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.server.getServerPreferences() - - 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/metadata/{ratingKey}/thumb"]["get"] - update: - x-codeSamples: - - lang: swift - label: image - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.media.getThumbImage(\n request: Operations.GetThumbImageRequest(\n height: 396, \n minSize: 1, \n ratingKey: 9518, \n upscale: 1, \n width: 396, \n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\"\n )\n)\n\nswitch response.data {\ncase .bytes(let bytes):\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"]["/butler"]["get"] - update: - x-codeSamples: - - lang: swift - label: getButlerTasks - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.butler.getButlerTasks() - - 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"]["/friends"]["get"] - update: - x-codeSamples: - - lang: swift - label: getUserFriends - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.plex.getUserFriends() - - switch response.data { - case .friends(let friends): - // Handle response - break case .badRequest(let badRequest): // Handle response break @@ -901,235 +1334,6 @@ actions: // Handle empty response break } - - target: $["paths"]["/statistics/resources"]["get"] - update: - x-codeSamples: - - lang: swift - label: getResourcesStatistics - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.statistics.getResourcesStatistics( - request: Operations.GetResourcesStatisticsRequest( - timespan: 4 - ) - ) - - 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"]["/media/providers"]["get"] - update: - x-codeSamples: - - lang: swift - label: providers - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.server.getMediaProviders( - request: Operations.GetMediaProvidersRequest( - xPlexToken: "CV5xoxjTpFKUzBTShsaf" - ) - ) - - 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}"]["delete"] - update: - x-codeSamples: - - lang: swift - label: deleteLibrary - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.library.deleteLibrary( - request: Operations.DeleteLibraryRequest( - sectionKey: 9518 - ) - ) - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/library/all/top"]["get"] - update: - x-codeSamples: - - lang: swift - label: getTopWatchedContent - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getTopWatchedContent(\n request: Operations.GetTopWatchedContentRequest(\n type: .season, \n includeGuids: 1\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"]["/playlists/{playlistID}"]["put"] - update: - x-codeSamples: - - lang: swift - label: updatePlaylist - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.updatePlaylist(\n request: Operations.UpdatePlaylistRequest(\n playlistID: 3915, \n summary: \"\", \n title: \"\"\n )\n)\n\nswitch response.data {\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"]["/activities/{activityUUID}"]["delete"] - update: - x-codeSamples: - - lang: swift - label: cancelServerActivities - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.activities.cancelServerActivities( - request: Operations.CancelServerActivitiesRequest( - activityUUID: "25b71ed5-0f9d-461c-baa7-d404e9e10d3e" - ) - ) - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/butler"]["post"] - update: - x-codeSamples: - - lang: swift - label: startAllTasks - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.butler.startAllTasks() - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/updater/apply"]["put"] - update: - x-codeSamples: - - lang: swift - label: applyUpdates - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.updater.applyUpdates(\n request: Operations.ApplyUpdatesRequest(\n skip: .one, \n tonight: .zero\n )\n)\n\nswitch response.data {\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"]["/hubs/sections/{sectionId}"]["get"] - update: - x-codeSamples: - - lang: swift - label: getLibraryHubs - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.hubs.getLibraryHubs(\n request: Operations.GetLibraryHubsRequest(\n sectionId: 6728.76, \n count: 9010.22, \n onlyTransient: .zero\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}/refresh"]["get"] - update: - x-codeSamples: - - lang: swift - label: metadata - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getRefreshLibraryMetadata(\n request: Operations.GetRefreshLibraryMetadataRequest(\n sectionKey: 9518, \n force: .one\n )\n)\n\nswitch response.data {\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"]["/log"]["post"] - update: - x-codeSamples: - - lang: swift - label: logMultiLine - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.log.logMultiLine() - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/playlists/{playlistID}/items"]["get"] - update: - x-codeSamples: - - lang: swift - label: getPlaylistContents - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.getPlaylistContents(\n request: Operations.GetPlaylistContentsRequest(\n playlistID: 5004.46, \n type: .episode\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"]["/devices"]["get"] - update: - x-codeSamples: - - lang: swift - label: getDevices - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.server.getDevices() - - 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"]["/home"]["get"] update: x-codeSamples: @@ -1157,225 +1361,21 @@ actions: // Handle empty response break } - - target: $["paths"]["/library/sections"]["get"] + - target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"] update: x-codeSamples: - lang: swift - label: libraries - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.library.getAllLibraries() - - 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}/search"]["get"] + label: metadata + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getRefreshLibraryMetadata(\n request: Operations.GetRefreshLibraryMetadataRequest(\n sectionKey: 9518, \n force: .one\n )\n)\n\nswitch response.data {\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/all/top"]["get"] update: x-codeSamples: - lang: swift - label: library - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getSearchLibrary(\n request: Operations.GetSearchLibraryRequest(\n sectionKey: 9518, \n type: .show\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"]["/playlists/{playlistID}/items"]["delete"] + label: getTopWatchedContent + source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getTopWatchedContent(\n request: Operations.GetTopWatchedContentRequest(\n type: .season, \n includeGuids: 1\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"]["/users/signin"]["post"] update: x-codeSamples: - lang: swift - label: clearPlaylistContents - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.playlists.clearPlaylistContents( - request: Operations.ClearPlaylistContentsRequest( - playlistID: 1893.18 - ) - ) - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/:/timeline"]["get"] - update: - x-codeSamples: - - lang: swift - label: getTimeline - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.video.getTimeline(\n request: Operations.GetTimelineRequest(\n context: \"home:hub.continueWatching\", \n duration: 10000, \n hasMDE: 1, \n key: \"/library/metadata/23409\", \n playBackTime: 2000, \n playQueueItemID: 1, \n ratingKey: 23409, \n row: 1, \n state: .playing, \n time: 2000\n )\n)\n\nswitch response.data {\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/hashes"]["get"] - update: - x-codeSamples: - - lang: swift - label: getFileHash - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getFileHash(\n request: Operations.GetFileHashRequest(\n url: \"file://C:\\Image.png&type=13\", \n type: 4462.17\n )\n)\n\nswitch response.data {\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/metadata/{ratingKey}/children"]["get"] - update: - x-codeSamples: - - lang: swift - label: getMetadataChildren - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getMetadataChildren(\n request: Operations.GetMetadataChildrenRequest(\n ratingKey: 1539.14, \n includeElements: \"\"\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"]["/playlists"]["post"] - update: - x-codeSamples: - - lang: swift - label: createPlaylist - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.createPlaylist(\n request: Operations.CreatePlaylistRequest(\n smart: .one, \n title: \"\", \n type: .photo, \n uri: \"https://inborn-brochure.biz\", \n playQueueID: 3686.33\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"]["/playlists"]["get"] - update: - x-codeSamples: - - lang: swift - label: getPlaylists - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.playlists.getPlaylists(\n request: Operations.GetPlaylistsRequest(\n playlistType: .audio, \n smart: .zero\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"]["/:/unscrobble"]["get"] - update: - x-codeSamples: - - lang: swift - label: markUnplayed - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.media.markUnplayed( - request: Operations.MarkUnplayedRequest( - key: 59398 - ) - ) - - switch response.data { - case .badRequest(let badRequest): - // Handle response - break - case .unauthorized(let unauthorized): - // Handle response - break - case .empty: - // Handle empty response - break - } - - target: $["paths"]["/resources"]["get"] - update: - x-codeSamples: - - lang: swift - label: resources - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.plex.getServerResources(\n request: Operations.GetServerResourcesRequest(\n includeHttps: .disable, \n includeIPv6: .disable, \n includeRelay: .enable\n )\n)\n\nswitch response.data {\ncase .plexDevices(let plexDevices):\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"]["/activities"]["get"] - update: - x-codeSamples: - - lang: swift - label: getServerActivities - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.activities.getServerActivities() - - 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"]["/search"]["get"] - update: - x-codeSamples: - - lang: swift - label: getSearchResults - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.search.getSearchResults( - request: Operations.GetSearchResultsRequest( - query: "110" - ) - ) - - 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}/{tag}"]["get"] - update: - x-codeSamples: - - lang: swift - label: items - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.library.getLibraryItems(\n request: Operations.GetLibraryItemsRequest(\n sectionKey: 9518, \n tag: .edition, \n type: .season, \n includeGuids: .enable, \n includeMeta: .disable, \n xPlexContainerSize: 50, \n xPlexContainerStart: 0\n )\n)\n\nswitch response.data {\ncase .object(let object):\n // Handle response\n break\ncase .badRequest(let badRequest):\n // Handle response\n break\ncase .unauthorized(let unauthorized):\n // Handle response\n break\ncase .empty:\n // Handle empty response\n break\n}" - - target: $["paths"]["/user"]["get"] - update: - x-codeSamples: - - lang: swift - label: getTokenDetails - source: |- - import Foundation - import Plexswift - - let client = Client(security: .accessToken("")) - - let response = try await client.authentication.getTokenDetails() - - switch response.data { - case .userPlexAccount(let userPlexAccount): - // 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"]["/status/sessions/history/all"]["get"] - update: - x-codeSamples: - - lang: swift - label: getSessionHistory - source: "import Foundation\nimport Plexswift\n\nlet client = Client(security: .accessToken(\"\"))\n\nlet response = try await client.sessions.getSessionHistory(\n request: Operations.GetSessionHistoryRequest(\n accountId: 1, \n filter: Operations.QueryParamFilter(), \n librarySectionID: 12, \n sort: \"\"\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}" + label: data + source: "import Foundation\nimport Plexswift\n\nlet client = Client()\n\nlet response = try await client.authentication.postUsersSignInData(\n request: Operations.PostUsersSignInDataRequestBody(\n login: \"username@email.com\", \n password: \"password123\", \n rememberMe: false, \n verificationCode: \"123456\"\n )\n)\n\nswitch response.data {\ncase .userPlexAccount(let userPlexAccount):\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}"