diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..7dfb4f1
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+# This allows generated code to be indexed correctly
+*.swift linguist-generated=false
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3b29812
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+.DS_Store
+/.build
+/Packages
+/*.xcodeproj
+xcuserdata/
+DerivedData/
+.swiftpm/config/registries.json
+.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
+.netrc
diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
new file mode 100755
index 0000000..d0d5940
--- /dev/null
+++ b/.speakeasy/gen.lock
@@ -0,0 +1,521 @@
+lockVersion: 2.0.0
+id: 73b3ef9b-7ef7-4158-b18e-677b3fd55c9e
+management:
+ docChecksum: e34dac84738ebf2d447ea2b9055a6eeb
+ docVersion: 0.0.3
+ speakeasyVersion: 1.209.3
+ generationVersion: 2.281.2
+ releaseVersion: 0.0.1
+ configChecksum: b1ec644cb39ebdb23044adf16e6d5e0f
+ repoURL: https://github.com/LukeHagar/plexswift.git
+ repoSubDirectory: .
+ published: true
+features:
+ swift:
+ core: 3.2.2
+ globalSecurity: 2.81.4
+ globalServerURLs: 2.82.1
+ methodServerURLs: 3.0.1
+ nameOverrides: 2.81.1
+generatedFiles:
+ - Sources/Plexswift/internal/api/_ServerAPI.swift
+ - Sources/Plexswift/internal/api/_MediaAPI.swift
+ - Sources/Plexswift/internal/api/_VideoAPI.swift
+ - Sources/Plexswift/internal/api/_ActivitiesAPI.swift
+ - Sources/Plexswift/internal/api/_ButlerAPI.swift
+ - Sources/Plexswift/internal/api/_HubsAPI.swift
+ - Sources/Plexswift/internal/api/_SearchAPI.swift
+ - Sources/Plexswift/internal/api/_LibraryAPI.swift
+ - Sources/Plexswift/internal/api/_LogAPI.swift
+ - Sources/Plexswift/internal/api/_PlexAPI.swift
+ - Sources/Plexswift/internal/api/_PlaylistsAPI.swift
+ - Sources/Plexswift/internal/api/_AuthenticationAPI.swift
+ - Sources/Plexswift/internal/api/_StatisticsAPI.swift
+ - Sources/Plexswift/internal/api/_SessionsAPI.swift
+ - Sources/Plexswift/internal/api/_UpdaterAPI.swift
+ - Sources/Plexswift/configuration/GlobalServer.swift
+ - Sources/Plexswift/Client.swift
+ - Package.swift
+ - Sources/plexswift/AnyValue.swift
+ - Sources/plexswift/internal/api/Client+PlexswiftAPI.swift
+ - Sources/plexswift/internal/client/Response.swift
+ - Sources/plexswift/internal/client/Servers.swift
+ - Sources/plexswift/internal/client/URLRequestBuilder.swift
+ - Sources/plexswift/internal/client/URLRequestConfiguration.swift
+ - Sources/plexswift/internal/extensions/HTTPURLResponse+ContentType.swift
+ - Sources/plexswift/internal/extensions/String+ContentType.swift
+ - Sources/plexswift/internal/extensions/String+ParameterSubstitution.swift
+ - Sources/plexswift/internal/serialization/Form.swift
+ - Sources/plexswift/internal/serialization/JSON.swift
+ - Sources/plexswift/internal/serialization/Maps.swift
+ - Sources/plexswift/internal/serialization/Parameters.swift
+ - Sources/plexswift/internal/serialization/PropertyWrappers.swift
+ - Sources/plexswift/internal/serialization/QueryParameters.swift
+ - Sources/plexswift/internal/serialization/SecurityParameters.swift
+ - Sources/plexswift/internal/serialization/Serializable.swift
+ - Sources/plexswift/PlexswiftError.swift
+ - Sources/plexswift/PlexswiftAPI.swift
+ - Sources/Plexswift/models/ModelScopes.swift
+ - Sources/Plexswift/models/operations/Account.swift
+ - Sources/Plexswift/models/operations/Activity.swift
+ - Sources/Plexswift/models/operations/AddPlaylistContentsErrors.swift
+ - Sources/Plexswift/models/operations/AddPlaylistContentsMediaContainer.swift
+ - Sources/Plexswift/models/operations/AddPlaylistContentsMetadata.swift
+ - Sources/Plexswift/models/operations/AddPlaylistContentsPlaylistsResponseBody.swift
+ - Sources/Plexswift/models/operations/AddPlaylistContentsRequest.swift
+ - Sources/Plexswift/internal/models/AddPlaylistContentsRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/AddPlaylistContentsResponse.swift
+ - Sources/Plexswift/models/operations/AddPlaylistContentsResponseBody.swift
+ - Sources/Plexswift/models/operations/ApplyUpdatesErrors.swift
+ - Sources/Plexswift/models/operations/ApplyUpdatesRequest.swift
+ - Sources/Plexswift/internal/models/ApplyUpdatesRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/ApplyUpdatesResponse.swift
+ - Sources/Plexswift/models/operations/ApplyUpdatesResponseBody.swift
+ - Sources/Plexswift/models/operations/ButlerTask.swift
+ - Sources/Plexswift/models/operations/ButlerTasks.swift
+ - Sources/Plexswift/models/operations/CancelServerActivitiesErrors.swift
+ - Sources/Plexswift/models/operations/CancelServerActivitiesRequest.swift
+ - Sources/Plexswift/internal/models/CancelServerActivitiesRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/CancelServerActivitiesResponse.swift
+ - Sources/Plexswift/models/operations/CancelServerActivitiesResponseBody.swift
+ - Sources/Plexswift/models/operations/CheckForUpdatesErrors.swift
+ - Sources/Plexswift/models/operations/CheckForUpdatesRequest.swift
+ - Sources/Plexswift/internal/models/CheckForUpdatesRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/CheckForUpdatesResponse.swift
+ - Sources/Plexswift/models/operations/CheckForUpdatesResponseBody.swift
+ - Sources/Plexswift/models/operations/ClearPlaylistContentsErrors.swift
+ - Sources/Plexswift/models/operations/ClearPlaylistContentsRequest.swift
+ - Sources/Plexswift/internal/models/ClearPlaylistContentsRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/ClearPlaylistContentsResponse.swift
+ - Sources/Plexswift/models/operations/ClearPlaylistContentsResponseBody.swift
+ - Sources/Plexswift/models/operations/Context.swift
+ - Sources/Plexswift/models/operations/Country.swift
+ - Sources/Plexswift/models/operations/CreatePlaylistErrors.swift
+ - Sources/Plexswift/models/operations/CreatePlaylistMediaContainer.swift
+ - Sources/Plexswift/models/operations/CreatePlaylistMetadata.swift
+ - Sources/Plexswift/models/operations/CreatePlaylistPlaylistsResponseBody.swift
+ - Sources/Plexswift/models/operations/CreatePlaylistRequest.swift
+ - Sources/Plexswift/internal/models/CreatePlaylistRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/CreatePlaylistResponse.swift
+ - Sources/Plexswift/models/operations/CreatePlaylistResponseBody.swift
+ - Sources/Plexswift/models/operations/DeleteLibraryErrors.swift
+ - Sources/Plexswift/models/operations/DeleteLibraryRequest.swift
+ - Sources/Plexswift/internal/models/DeleteLibraryRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/DeleteLibraryResponse.swift
+ - Sources/Plexswift/models/operations/DeleteLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/DeletePlaylistErrors.swift
+ - Sources/Plexswift/models/operations/DeletePlaylistRequest.swift
+ - Sources/Plexswift/internal/models/DeletePlaylistRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/DeletePlaylistResponse.swift
+ - Sources/Plexswift/models/operations/DeletePlaylistResponseBody.swift
+ - Sources/Plexswift/models/operations/Device.swift
+ - Sources/Plexswift/models/operations/Director.swift
+ - Sources/Plexswift/models/operations/Directory.swift
+ - Sources/Plexswift/models/operations/Download.swift
+ - Sources/Plexswift/internal/models/Download+Serialization.swift
+ - Sources/Plexswift/models/operations/EnablePaperTrailErrors.swift
+ - Sources/Plexswift/models/operations/EnablePaperTrailResponse.swift
+ - Sources/Plexswift/models/operations/EnablePaperTrailResponseBody.swift
+ - Sources/Plexswift/models/operations/Errors.swift
+ - Sources/Plexswift/models/operations/Field.swift
+ - Sources/Plexswift/models/operations/FieldType.swift
+ - Sources/Plexswift/models/operations/Filter.swift
+ - Sources/Plexswift/models/operations/Force.swift
+ - Sources/Plexswift/internal/models/Force+Serialization.swift
+ - Sources/Plexswift/models/operations/Genre.swift
+ - Sources/Plexswift/models/operations/GetAvailableClientsErrors.swift
+ - Sources/Plexswift/models/operations/GetAvailableClientsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetAvailableClientsResponse.swift
+ - Sources/Plexswift/models/operations/GetAvailableClientsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetAvailableClientsServerResponseBody.swift
+ - Sources/Plexswift/models/operations/GetButlerTasksButlerResponseBody.swift
+ - Sources/Plexswift/models/operations/GetButlerTasksErrors.swift
+ - Sources/Plexswift/models/operations/GetButlerTasksResponse.swift
+ - Sources/Plexswift/models/operations/GetButlerTasksResponseBody.swift
+ - Sources/Plexswift/models/operations/GetDevicesErrors.swift
+ - Sources/Plexswift/models/operations/GetDevicesMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetDevicesResponse.swift
+ - Sources/Plexswift/models/operations/GetDevicesResponseBody.swift
+ - Sources/Plexswift/models/operations/GetDevicesServerResponseBody.swift
+ - Sources/Plexswift/models/operations/GetFileHashErrors.swift
+ - Sources/Plexswift/models/operations/GetFileHashRequest.swift
+ - Sources/Plexswift/internal/models/GetFileHashRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetFileHashResponse.swift
+ - Sources/Plexswift/models/operations/GetFileHashResponseBody.swift
+ - Sources/Plexswift/models/operations/GetGlobalHubsErrors.swift
+ - Sources/Plexswift/models/operations/GetGlobalHubsHubsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetGlobalHubsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetGlobalHubsMetadata.swift
+ - Sources/Plexswift/models/operations/GetGlobalHubsRequest.swift
+ - Sources/Plexswift/internal/models/GetGlobalHubsRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetGlobalHubsResponse.swift
+ - Sources/Plexswift/models/operations/GetGlobalHubsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetLibrariesDirectory.swift
+ - Sources/Plexswift/models/operations/GetLibrariesErrors.swift
+ - Sources/Plexswift/models/operations/GetLibrariesLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/GetLibrariesLocation.swift
+ - Sources/Plexswift/models/operations/GetLibrariesMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetLibrariesResponse.swift
+ - Sources/Plexswift/models/operations/GetLibrariesResponseBody.swift
+ - Sources/Plexswift/models/operations/GetLibraryDirectory.swift
+ - Sources/Plexswift/models/operations/GetLibraryErrors.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsCountry.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsDirector.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsErrors.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsGenre.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsHub.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsHubsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsMedia.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsMetadata.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsPart.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsRequest.swift
+ - Sources/Plexswift/internal/models/GetLibraryHubsRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsResponse.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsRole.swift
+ - Sources/Plexswift/models/operations/GetLibraryHubsWriter.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsCountry.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsDirector.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsGenre.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsMedia.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsMetadata.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsPart.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsRequest.swift
+ - Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsResponse.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsRole.swift
+ - Sources/Plexswift/models/operations/GetLibraryItemsWriter.swift
+ - Sources/Plexswift/models/operations/GetLibraryLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/GetLibraryMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetLibraryRequest.swift
+ - Sources/Plexswift/internal/models/GetLibraryRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetLibraryResponse.swift
+ - Sources/Plexswift/models/operations/GetLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/GetLibraryType.swift
+ - Sources/Plexswift/models/operations/GetMetadataChildrenDirectory.swift
+ - Sources/Plexswift/models/operations/GetMetadataChildrenErrors.swift
+ - Sources/Plexswift/models/operations/GetMetadataChildrenLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/GetMetadataChildrenMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetMetadataChildrenMetadata.swift
+ - Sources/Plexswift/models/operations/GetMetadataChildrenRequest.swift
+ - Sources/Plexswift/internal/models/GetMetadataChildrenRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetMetadataChildrenResponse.swift
+ - Sources/Plexswift/models/operations/GetMetadataChildrenResponseBody.swift
+ - Sources/Plexswift/models/operations/GetMetadataCountry.swift
+ - Sources/Plexswift/models/operations/GetMetadataDirector.swift
+ - Sources/Plexswift/models/operations/GetMetadataErrors.swift
+ - Sources/Plexswift/models/operations/GetMetadataGenre.swift
+ - Sources/Plexswift/models/operations/GetMetadataLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/GetMetadataMedia.swift
+ - Sources/Plexswift/models/operations/GetMetadataMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetMetadataMetadata.swift
+ - Sources/Plexswift/models/operations/GetMetadataPart.swift
+ - Sources/Plexswift/models/operations/GetMetadataRequest.swift
+ - Sources/Plexswift/internal/models/GetMetadataRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetMetadataResponse.swift
+ - Sources/Plexswift/models/operations/GetMetadataResponseBody.swift
+ - Sources/Plexswift/models/operations/GetMetadataRole.swift
+ - Sources/Plexswift/models/operations/GetMetadataWriter.swift
+ - Sources/Plexswift/models/operations/GetMyPlexAccountErrors.swift
+ - Sources/Plexswift/models/operations/GetMyPlexAccountResponse.swift
+ - Sources/Plexswift/models/operations/GetMyPlexAccountResponseBody.swift
+ - Sources/Plexswift/models/operations/GetMyPlexAccountServerResponseBody.swift
+ - Sources/Plexswift/models/operations/GetOnDeckErrors.swift
+ - Sources/Plexswift/models/operations/GetOnDeckGuids.swift
+ - Sources/Plexswift/models/operations/GetOnDeckLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/GetOnDeckMedia.swift
+ - Sources/Plexswift/models/operations/GetOnDeckMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetOnDeckMetadata.swift
+ - Sources/Plexswift/models/operations/GetOnDeckPart.swift
+ - Sources/Plexswift/models/operations/GetOnDeckResponse.swift
+ - Sources/Plexswift/models/operations/GetOnDeckResponseBody.swift
+ - Sources/Plexswift/models/operations/GetOnDeckStream.swift
+ - Sources/Plexswift/models/operations/GetPinErrors.swift
+ - Sources/Plexswift/models/operations/GetPinPlexResponseBody.swift
+ - Sources/Plexswift/models/operations/GetPinRequest.swift
+ - Sources/Plexswift/internal/models/GetPinRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetPinResponse.swift
+ - Sources/Plexswift/models/operations/GetPinResponseBody.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsCountry.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsDirector.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsErrors.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsGenre.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsMedia.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsMetadata.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsPart.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsPlaylistsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsRequest.swift
+ - Sources/Plexswift/internal/models/GetPlaylistContentsRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsResponse.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsRole.swift
+ - Sources/Plexswift/models/operations/GetPlaylistContentsWriter.swift
+ - Sources/Plexswift/models/operations/GetPlaylistErrors.swift
+ - Sources/Plexswift/models/operations/GetPlaylistMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetPlaylistMetadata.swift
+ - Sources/Plexswift/models/operations/GetPlaylistPlaylistsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetPlaylistRequest.swift
+ - Sources/Plexswift/internal/models/GetPlaylistRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetPlaylistResponse.swift
+ - Sources/Plexswift/models/operations/GetPlaylistResponseBody.swift
+ - Sources/Plexswift/models/operations/GetPlaylistsErrors.swift
+ - Sources/Plexswift/models/operations/GetPlaylistsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetPlaylistsMetadata.swift
+ - Sources/Plexswift/models/operations/GetPlaylistsPlaylistsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetPlaylistsRequest.swift
+ - Sources/Plexswift/internal/models/GetPlaylistsRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetPlaylistsResponse.swift
+ - Sources/Plexswift/models/operations/GetPlaylistsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetRecentlyAddedErrors.swift
+ - Sources/Plexswift/models/operations/GetRecentlyAddedLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/GetRecentlyAddedMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetRecentlyAddedResponse.swift
+ - Sources/Plexswift/models/operations/GetRecentlyAddedResponseBody.swift
+ - Sources/Plexswift/models/operations/GetResizedPhotoErrors.swift
+ - Sources/Plexswift/models/operations/GetResizedPhotoRequest.swift
+ - Sources/Plexswift/internal/models/GetResizedPhotoRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetResizedPhotoResponse.swift
+ - Sources/Plexswift/models/operations/GetResizedPhotoResponseBody.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsCountry.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsDirector.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsErrors.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsGenre.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsMedia.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsMetadata.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsPart.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsRequest.swift
+ - Sources/Plexswift/internal/models/GetSearchResultsRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsResponse.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsRole.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsSearchResponseBody.swift
+ - Sources/Plexswift/models/operations/GetSearchResultsWriter.swift
+ - Sources/Plexswift/models/operations/GetServerActivitiesActivitiesResponseBody.swift
+ - Sources/Plexswift/models/operations/GetServerActivitiesErrors.swift
+ - Sources/Plexswift/models/operations/GetServerActivitiesMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetServerActivitiesResponse.swift
+ - Sources/Plexswift/models/operations/GetServerActivitiesResponseBody.swift
+ - Sources/Plexswift/models/operations/GetServerCapabilitiesResponse.swift
+ - Sources/Plexswift/models/operations/GetServerCapabilitiesResponseBody.swift
+ - Sources/Plexswift/models/operations/GetServerCapabilitiesServerResponseBody.swift
+ - Sources/Plexswift/models/operations/GetServerIdentityErrors.swift
+ - Sources/Plexswift/models/operations/GetServerIdentityMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetServerIdentityResponse.swift
+ - Sources/Plexswift/models/operations/GetServerIdentityResponseBody.swift
+ - Sources/Plexswift/models/operations/GetServerIdentityServerResponseBody.swift
+ - Sources/Plexswift/models/operations/GetServerListErrors.swift
+ - Sources/Plexswift/models/operations/GetServerListMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetServerListResponse.swift
+ - Sources/Plexswift/models/operations/GetServerListResponseBody.swift
+ - Sources/Plexswift/models/operations/GetServerListServer.swift
+ - Sources/Plexswift/models/operations/GetServerListServerResponseBody.swift
+ - Sources/Plexswift/models/operations/GetServerPreferencesErrors.swift
+ - Sources/Plexswift/models/operations/GetServerPreferencesMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetServerPreferencesResponse.swift
+ - Sources/Plexswift/models/operations/GetServerPreferencesResponseBody.swift
+ - Sources/Plexswift/models/operations/GetServerPreferencesServerResponseBody.swift
+ - Sources/Plexswift/models/operations/GetSessionHistoryErrors.swift
+ - Sources/Plexswift/models/operations/GetSessionHistoryMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetSessionHistoryMetadata.swift
+ - Sources/Plexswift/models/operations/GetSessionHistoryResponse.swift
+ - Sources/Plexswift/models/operations/GetSessionHistoryResponseBody.swift
+ - Sources/Plexswift/models/operations/GetSessionHistorySessionsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetSessionsErrors.swift
+ - Sources/Plexswift/models/operations/GetSessionsMedia.swift
+ - Sources/Plexswift/models/operations/GetSessionsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetSessionsMetadata.swift
+ - Sources/Plexswift/models/operations/GetSessionsPart.swift
+ - Sources/Plexswift/models/operations/GetSessionsResponse.swift
+ - Sources/Plexswift/models/operations/GetSessionsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetSessionsSessionsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetSessionsStream.swift
+ - Sources/Plexswift/models/operations/GetSourceConnectionInformationErrors.swift
+ - Sources/Plexswift/models/operations/GetSourceConnectionInformationRequest.swift
+ - Sources/Plexswift/internal/models/GetSourceConnectionInformationRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetSourceConnectionInformationResponse.swift
+ - Sources/Plexswift/models/operations/GetSourceConnectionInformationResponseBody.swift
+ - Sources/Plexswift/models/operations/GetStatisticsDevice.swift
+ - Sources/Plexswift/models/operations/GetStatisticsErrors.swift
+ - Sources/Plexswift/models/operations/GetStatisticsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetStatisticsRequest.swift
+ - Sources/Plexswift/internal/models/GetStatisticsRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetStatisticsResponse.swift
+ - Sources/Plexswift/models/operations/GetStatisticsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetStatisticsStatisticsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetTimelineErrors.swift
+ - Sources/Plexswift/models/operations/GetTimelineRequest.swift
+ - Sources/Plexswift/internal/models/GetTimelineRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetTimelineResponse.swift
+ - Sources/Plexswift/models/operations/GetTimelineResponseBody.swift
+ - Sources/Plexswift/models/operations/GetTokenErrors.swift
+ - Sources/Plexswift/models/operations/GetTokenRequest.swift
+ - Sources/Plexswift/internal/models/GetTokenRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetTokenResponse.swift
+ - Sources/Plexswift/models/operations/GetTokenResponseBody.swift
+ - Sources/Plexswift/models/operations/GetTranscodeSessionsErrors.swift
+ - Sources/Plexswift/models/operations/GetTranscodeSessionsMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetTranscodeSessionsResponse.swift
+ - Sources/Plexswift/models/operations/GetTranscodeSessionsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetTranscodeSessionsSessionsResponseBody.swift
+ - Sources/Plexswift/models/operations/GetTransientTokenErrors.swift
+ - Sources/Plexswift/models/operations/GetTransientTokenQueryParamType.swift
+ - Sources/Plexswift/internal/models/GetTransientTokenQueryParamType+Serialization.swift
+ - Sources/Plexswift/models/operations/GetTransientTokenRequest.swift
+ - Sources/Plexswift/internal/models/GetTransientTokenRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/GetTransientTokenResponse.swift
+ - Sources/Plexswift/models/operations/GetTransientTokenResponseBody.swift
+ - Sources/Plexswift/models/operations/GetUpdateStatusErrors.swift
+ - Sources/Plexswift/models/operations/GetUpdateStatusMediaContainer.swift
+ - Sources/Plexswift/models/operations/GetUpdateStatusResponse.swift
+ - Sources/Plexswift/models/operations/GetUpdateStatusResponseBody.swift
+ - Sources/Plexswift/models/operations/GetUpdateStatusUpdaterResponseBody.swift
+ - Sources/Plexswift/models/operations/Guids.swift
+ - Sources/Plexswift/models/operations/Hub.swift
+ - Sources/Plexswift/models/operations/IncludeDetails.swift
+ - Sources/Plexswift/internal/models/IncludeDetails+Serialization.swift
+ - Sources/Plexswift/models/operations/Level.swift
+ - Sources/Plexswift/internal/models/Level+Serialization.swift
+ - Sources/Plexswift/models/operations/Location.swift
+ - Sources/Plexswift/models/operations/LogLineErrors.swift
+ - Sources/Plexswift/models/operations/LogLineRequest.swift
+ - Sources/Plexswift/internal/models/LogLineRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/LogLineResponse.swift
+ - Sources/Plexswift/models/operations/LogLineResponseBody.swift
+ - Sources/Plexswift/models/operations/LogMultiLineErrors.swift
+ - Sources/Plexswift/models/operations/LogMultiLineResponse.swift
+ - Sources/Plexswift/models/operations/LogMultiLineResponseBody.swift
+ - Sources/Plexswift/models/operations/MarkPlayedErrors.swift
+ - Sources/Plexswift/models/operations/MarkPlayedRequest.swift
+ - Sources/Plexswift/internal/models/MarkPlayedRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/MarkPlayedResponse.swift
+ - Sources/Plexswift/models/operations/MarkPlayedResponseBody.swift
+ - Sources/Plexswift/models/operations/MarkUnplayedErrors.swift
+ - Sources/Plexswift/models/operations/MarkUnplayedRequest.swift
+ - Sources/Plexswift/internal/models/MarkUnplayedRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/MarkUnplayedResponse.swift
+ - Sources/Plexswift/models/operations/MarkUnplayedResponseBody.swift
+ - Sources/Plexswift/models/operations/Media.swift
+ - Sources/Plexswift/models/operations/MediaContainer.swift
+ - Sources/Plexswift/models/operations/Metadata.swift
+ - Sources/Plexswift/models/operations/MinSize.swift
+ - Sources/Plexswift/internal/models/MinSize+Serialization.swift
+ - Sources/Plexswift/models/operations/MyPlex.swift
+ - Sources/Plexswift/models/operations/OnlyTransient.swift
+ - Sources/Plexswift/internal/models/OnlyTransient+Serialization.swift
+ - Sources/Plexswift/models/operations/Operator.swift
+ - Sources/Plexswift/models/operations/Part.swift
+ - Sources/Plexswift/models/operations/PathParamTaskName.swift
+ - Sources/Plexswift/internal/models/PathParamTaskName+Serialization.swift
+ - Sources/Plexswift/models/operations/PerformSearchErrors.swift
+ - Sources/Plexswift/models/operations/PerformSearchRequest.swift
+ - Sources/Plexswift/internal/models/PerformSearchRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/PerformSearchResponse.swift
+ - Sources/Plexswift/models/operations/PerformSearchResponseBody.swift
+ - Sources/Plexswift/models/operations/PerformVoiceSearchErrors.swift
+ - Sources/Plexswift/models/operations/PerformVoiceSearchRequest.swift
+ - Sources/Plexswift/internal/models/PerformVoiceSearchRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/PerformVoiceSearchResponse.swift
+ - Sources/Plexswift/models/operations/PerformVoiceSearchResponseBody.swift
+ - Sources/Plexswift/models/operations/Player.swift
+ - Sources/Plexswift/models/operations/PlaylistType.swift
+ - Sources/Plexswift/internal/models/PlaylistType+Serialization.swift
+ - Sources/Plexswift/models/operations/Producer.swift
+ - Sources/Plexswift/models/operations/Provider.swift
+ - Sources/Plexswift/models/operations/QueryParamOnlyTransient.swift
+ - Sources/Plexswift/internal/models/QueryParamOnlyTransient+Serialization.swift
+ - Sources/Plexswift/models/operations/QueryParamSmart.swift
+ - Sources/Plexswift/internal/models/QueryParamSmart+Serialization.swift
+ - Sources/Plexswift/models/operations/QueryParamType.swift
+ - Sources/Plexswift/internal/models/QueryParamType+Serialization.swift
+ - Sources/Plexswift/models/operations/Ratings.swift
+ - Sources/Plexswift/models/operations/RefreshLibraryErrors.swift
+ - Sources/Plexswift/models/operations/RefreshLibraryRequest.swift
+ - Sources/Plexswift/internal/models/RefreshLibraryRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/RefreshLibraryResponse.swift
+ - Sources/Plexswift/models/operations/RefreshLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/Release.swift
+ - Sources/Plexswift/models/operations/Role.swift
+ - Sources/Plexswift/models/operations/Scope.swift
+ - Sources/Plexswift/internal/models/Scope+Serialization.swift
+ - Sources/Plexswift/models/operations/SearchLibraryMediaContainer.swift
+ - Sources/Plexswift/models/operations/SearchLibraryMetadata.swift
+ - Sources/Plexswift/models/operations/SearchLibraryRequest.swift
+ - Sources/Plexswift/internal/models/SearchLibraryRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/SearchLibraryResponse.swift
+ - Sources/Plexswift/models/operations/SearchLibraryResponseBody.swift
+ - Sources/Plexswift/models/operations/Server.swift
+ - Sources/Plexswift/models/operations/Session.swift
+ - Sources/Plexswift/models/operations/Setting.swift
+ - Sources/Plexswift/models/operations/Skip.swift
+ - Sources/Plexswift/internal/models/Skip+Serialization.swift
+ - Sources/Plexswift/models/operations/Smart.swift
+ - Sources/Plexswift/internal/models/Smart+Serialization.swift
+ - Sources/Plexswift/models/operations/Sort.swift
+ - Sources/Plexswift/models/operations/StartAllTasksErrors.swift
+ - Sources/Plexswift/models/operations/StartAllTasksResponse.swift
+ - Sources/Plexswift/models/operations/StartAllTasksResponseBody.swift
+ - Sources/Plexswift/models/operations/StartTaskErrors.swift
+ - Sources/Plexswift/models/operations/StartTaskRequest.swift
+ - Sources/Plexswift/internal/models/StartTaskRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/StartTaskResponse.swift
+ - Sources/Plexswift/models/operations/StartTaskResponseBody.swift
+ - Sources/Plexswift/models/operations/StartUniversalTranscodeErrors.swift
+ - Sources/Plexswift/models/operations/StartUniversalTranscodeRequest.swift
+ - Sources/Plexswift/internal/models/StartUniversalTranscodeRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/StartUniversalTranscodeResponse.swift
+ - Sources/Plexswift/models/operations/StartUniversalTranscodeResponseBody.swift
+ - Sources/Plexswift/models/operations/State.swift
+ - Sources/Plexswift/internal/models/State+Serialization.swift
+ - Sources/Plexswift/models/operations/StatisticsMedia.swift
+ - Sources/Plexswift/models/operations/StopAllTasksErrors.swift
+ - Sources/Plexswift/models/operations/StopAllTasksResponse.swift
+ - Sources/Plexswift/models/operations/StopAllTasksResponseBody.swift
+ - Sources/Plexswift/models/operations/StopTaskErrors.swift
+ - Sources/Plexswift/models/operations/StopTaskRequest.swift
+ - Sources/Plexswift/internal/models/StopTaskRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/StopTaskResponse.swift
+ - Sources/Plexswift/models/operations/StopTaskResponseBody.swift
+ - Sources/Plexswift/models/operations/StopTranscodeSessionErrors.swift
+ - Sources/Plexswift/models/operations/StopTranscodeSessionRequest.swift
+ - Sources/Plexswift/internal/models/StopTranscodeSessionRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/StopTranscodeSessionResponse.swift
+ - Sources/Plexswift/models/operations/StopTranscodeSessionResponseBody.swift
+ - Sources/Plexswift/models/operations/Stream.swift
+ - Sources/Plexswift/models/operations/Tag.swift
+ - Sources/Plexswift/internal/models/Tag+Serialization.swift
+ - Sources/Plexswift/models/operations/TaskName.swift
+ - Sources/Plexswift/internal/models/TaskName+Serialization.swift
+ - Sources/Plexswift/models/operations/Tonight.swift
+ - Sources/Plexswift/internal/models/Tonight+Serialization.swift
+ - Sources/Plexswift/models/operations/TranscodeSession.swift
+ - Sources/Plexswift/models/operations/TypeModel.swift
+ - Sources/Plexswift/internal/models/TypeModel+Serialization.swift
+ - Sources/Plexswift/models/operations/UpdatePlayProgressErrors.swift
+ - Sources/Plexswift/models/operations/UpdatePlayProgressRequest.swift
+ - Sources/Plexswift/internal/models/UpdatePlayProgressRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/UpdatePlayProgressResponse.swift
+ - Sources/Plexswift/models/operations/UpdatePlayProgressResponseBody.swift
+ - Sources/Plexswift/models/operations/UpdatePlaylistErrors.swift
+ - Sources/Plexswift/models/operations/UpdatePlaylistRequest.swift
+ - Sources/Plexswift/internal/models/UpdatePlaylistRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/UpdatePlaylistResponse.swift
+ - Sources/Plexswift/models/operations/UpdatePlaylistResponseBody.swift
+ - Sources/Plexswift/models/operations/UploadPlaylistErrors.swift
+ - Sources/Plexswift/models/operations/UploadPlaylistRequest.swift
+ - Sources/Plexswift/internal/models/UploadPlaylistRequest+Serialization.swift
+ - Sources/Plexswift/models/operations/UploadPlaylistResponse.swift
+ - Sources/Plexswift/models/operations/UploadPlaylistResponseBody.swift
+ - Sources/Plexswift/models/operations/Upscale.swift
+ - Sources/Plexswift/internal/models/Upscale+Serialization.swift
+ - Sources/Plexswift/models/operations/User.swift
+ - Sources/Plexswift/models/operations/Writer.swift
+ - Sources/Plexswift/models/shared/Security.swift
+ - Sources/Plexswift/internal/models/Security+Serialization.swift
+ - USAGE.md
+ - Sources/Plexswift/Plexswift.docc/Plexswift.md
+ - .gitattributes
diff --git a/Package.swift b/Package.swift
new file mode 100644
index 0000000..4b3e669
--- /dev/null
+++ b/Package.swift
@@ -0,0 +1,22 @@
+// swift-tools-version: 5.6
+import PackageDescription
+
+let package = Package(
+ name: "Plexswift",
+ platforms: [
+ .iOS(.v13)
+ ],
+ products: [
+ .library(
+ name: "Plexswift",
+ targets: ["Plexswift"]
+ )
+ ],
+ dependencies: [],
+ targets: [
+ .target(
+ name: "Plexswift",
+ dependencies: []
+ )
+ ]
+)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..2eb5767
--- /dev/null
+++ b/README.md
@@ -0,0 +1,124 @@
+# plexswift
+
+
+
+
+
+
+
+
+An Open API Spec for interacting with Plex.tv and Plex Servers
+
+## Requirements
+
+The SDK supports iOS 13 and later.
+
+
+## 🏗 **Welcome to your new SDK!** 🏗
+
+It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:
+- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks)
+- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy)
+- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks)
+- [ ] ✨ When ready to productionize, delete this section from the README
+
+
+## SDK Installation
+
+### Swift Package Manager
+
+You can add `plexswift` to your project directly in Xcode `(File > Add Packages...)` or by adding it to your project's Package.swift file:
+
+```bash
+dependencies: [
+ .package(url: "https://github.com/LukeHagar/plexswift.git", .upToNextMajor(from: "0.0.1"))
+]
+```
+
+
+
+## SDK Example Usage
+
+### Example
+
+```swift
+import Foundation
+import Plexswift
+
+let client = Client(security: .accessToken(""))
+
+let response = try await client.server.getServerCapabilities()
+
+switch response.data {
+case .twoHundredApplicationJsonObject(let twoHundredApplicationJsonObject):
+ // Handle response
+ break
+case .fourHundredAndOneApplicationJsonObject(let fourHundredAndOneApplicationJsonObject):
+ // Handle response
+ break
+case .empty:
+ // Handle empty response
+ break
+}
+
+```
+
+
+
+## Available Resources and Operations
+
+
+
+
+
+## Authentication
+
+### Global Security Schemes
+
+The SDK supports the following security scheme globally through the `Shared.Security` type:
+
+| Name | Type | Scheme |
+| -------------- | -------------- | -------------- |
+| `.accessToken` | apiKey | API key |
+
+You can set the appropriate security parameters by passing a `Shared.Security` value for the `security` parameter when initializing the `Client` instance. For example:
+
+```swift
+import Foundation
+import Plexswift
+
+let client = Client(security: .accessToken(""))
+
+let response = try await client.server.getServerCapabilities()
+
+switch response.data {
+case .twoHundredApplicationJsonObject(let twoHundredApplicationJsonObject):
+ // Handle response
+ break
+case .fourHundredAndOneApplicationJsonObject(let fourHundredAndOneApplicationJsonObject):
+ // Handle response
+ break
+case .empty:
+ // Handle empty response
+ break
+}
+
+```
+
+
+
+
+# Development
+
+## Maturity
+
+This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
+to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
+looking for the latest version.
+
+## Contributions
+
+While we value open-source contributions to this SDK, this library is generated programmatically.
+Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!
+
+### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
diff --git a/RELEASES.md b/RELEASES.md
new file mode 100644
index 0000000..6dd8694
--- /dev/null
+++ b/RELEASES.md
@@ -0,0 +1,11 @@
+
+
+## 2024-03-18 00:54:24
+### Changes
+Based on:
+- OpenAPI Doc 0.0.3
+- Speakeasy CLI 1.209.3 (2.281.2) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [swift v0.0.1] .
+### Releases
+- [Swift Package Manager v0.0.1] https://github.com/LukeHagar/plexswift/releases/tag/v0.0.1 - .
\ No newline at end of file
diff --git a/Sources/Plexswift/Client.swift b/Sources/Plexswift/Client.swift
new file mode 100644
index 0000000..02ada6d
--- /dev/null
+++ b/Sources/Plexswift/Client.swift
@@ -0,0 +1,211 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+#if os(Linux)
+import FoundationNetworking
+#endif
+
+/// An object used to make API calls.
+///
+/// ``Client`` is the main object that you interact with to communicate with the API, and is responsible for making the underlying HTTP requests for each API operation and handling the resulting responses. It implements the ``PlexswiftAPI`` protocol to support the available API operations.
+///
+/// ### API calls
+///
+/// Each API endpoint (or *operation*) is exposed as a method. For instance, the 'getResizedPhoto' operation is exposed as:
+///
+/// ```swift
+/// func getResizedPhoto(request: Operations.GetResizedPhotoRequest) async throws -> Response
+/// ```
+///
+/// ### Request and response objects
+///
+/// If an API operation has input parameters, the corresponding API method takes a `request` object, describing these parameters. The request object can either be a primitive value like a `String` or `[String]`, or a Swift `struct` describing the parameters.
+///
+/// Each API method also returns a ``Response`` object, which provides information about the result of making the API request. It is generic and parameterised by the resulting data — stored in the ``Response/data`` property — which is determined by each API operation.
+///
+/// The ``Response/data`` property defined by each API operation is an enum, and you can `switch` on this value to extract the corresponding value from the response. For example, the 'getResizedPhoto' operation returns a ``Operations/GetResizedPhotoResponse`` value:
+///
+/// ```swift
+/// let response: Response = ... // Response from API call
+/// switch response.data {
+/// case .object(let object):
+/// // Handle response
+/// case .empty:
+/// // Handle empty response
+/// }
+/// ```
+///
+/// In addition to any data returned by a given API operation, each ``Response`` value contains information about the network request, including:
+/// - The `contentType` returned by the server.
+/// - The `statusCode` representing the HTTP status code returned by making the request
+/// - A `httpResponse` value which is the raw [HTTPURLResponse](https://developer.apple.com/documentation/foundation/httpurlresponse) returned from making the underlying network request.
+///
+/// These values can be used to debug and/or react to responses returned from executing a given API operation.
+///
+/// ### Authentication
+///
+/// Calls to the API must be authenticated, and ``Client`` must be initialized with a configured ``Shared/Security`` object to authenticate requests.
+///
+/// ## Topics
+///
+/// ### Initializers
+///
+/// - ``init(security:)``
+///
+/// ### API calls
+///
+/// These methods allow you to make requests to the API.
+///
+///
+/// ### Scoped API calls
+///
+/// These properties logically group other parts of the API.
+///
+/// - ``server``
+/// - ``media``
+/// - ``video``
+/// - ``activities``
+/// - ``butler``
+/// - ``hubs``
+/// - ``search``
+/// - ``library``
+/// - ``log``
+/// - ``plex``
+/// - ``playlists``
+/// - ``authentication``
+/// - ``statistics``
+/// - ``sessions``
+/// - ``updater``
+///
+public final class Client {
+ internal struct APIResponse {
+ let httpResponse: HTTPURLResponse
+ let data: Data?
+ }
+
+ internal typealias ConfigureURLRequest = (_ configuration: URLRequestConfiguration) throws -> Void
+ internal typealias ResponseHandler = (_ apiResponse: APIResponse) throws -> ResponseObject
+
+ // Underscore-prefix properties so these do not potentially conflict with any operation namespaces.
+ private lazy var _session = URLSession(configuration: .default)
+ private var _security: Shared.Security
+
+ private var _selectedServer: GlobalServers?
+
+ /// Creates an API client object with the specified parameters.
+ public init(security: Shared.Security) {
+ self._security = security
+ }
+
+ // MARK: - Internal
+
+ internal func makeRequest(
+ with server: Server? = nil,
+ configureRequest: @escaping ConfigureURLRequest,
+ handleResponse responseHandler: @escaping ResponseHandler
+ ) async throws -> ResponseType where ResponseType.T == ResponseObject {
+ return try await withCheckedThrowingContinuation { continuation in
+ _makeRequest(with: server, configureRequest: configureRequest) { result in
+ do {
+ let apiResponse = try result.get()
+ let responseObject = try responseHandler(apiResponse)
+ continuation.resume(returning: ResponseType(httpResponse: apiResponse.httpResponse, data: responseObject))
+ } catch let error as ServerConversionError {
+ switch error {
+ case .internal:
+ continuation.resume(throwing: PlexswiftError.internalError(error: nil))
+ case .missingDefaultServer(let serverType):
+ continuation.resume(throwing: PlexswiftError.failedToConstructRequestURL(.missingDefaultServer(serverType: serverType)))
+ case .invalidServerIndex(let serverType, let index):
+ continuation.resume(throwing: PlexswiftError.failedToConstructRequestURL(.invalidServerIndex(serverType: serverType, index: index)))
+ case .missingServerParameterSubstitutionKey(let key, let serverString):
+ continuation.resume(throwing: PlexswiftError.failedToSerializeRequestParameters(.missingServerParameterSubstitutionKey(key, serverString: serverString)))
+ }
+ } catch let error as URLRequestBuilderError {
+ switch error {
+ case .internalError:
+ continuation.resume(throwing: PlexswiftError.internalError(error: nil))
+ case .invalidURL(let urlString):
+ continuation.resume(throwing: PlexswiftError.failedToConstructRequestURL(.invalidRequestURL(string: urlString)))
+ case .missingPathParameterSubstitutionKey(let key, let path):
+ continuation.resume(throwing: PlexswiftError.failedToSerializeRequestParameters(.missingPathParameterSubstitutionKey(key, path: path)))
+ }
+ } catch let error as SerializationError {
+ switch error {
+ case .failedToSerializeData:
+ continuation.resume(throwing: PlexswiftError.failedToSerializeRequestParameters(.failedToSerializeData))
+ case .missingRequiredRequestBody:
+ continuation.resume(throwing: PlexswiftError.failedToConstructRequest(.missingRequiredRequestBody))
+ case .invalidSerializationParameter(let type, let format):
+ continuation.resume(throwing: PlexswiftError.failedToSerializeRequestParameters(.invalidSerializationParameter(type: type, format: format)))
+ }
+ } catch let error as ResponseHandlerError {
+ switch error {
+ case .failedToDecodeResponse:
+ continuation.resume(throwing: PlexswiftError.failedToHandleResponse(.failedToDecodeResponse))
+ case .failedToDecodeJSON(let error):
+ continuation.resume(throwing: PlexswiftError.failedToHandleResponse(.failedToDeserializeJSON(error)))
+ }
+ } catch let error as PlexswiftError {
+ continuation.resume(throwing: error)
+ } catch {
+ continuation.resume(throwing: PlexswiftError.internalError(error: error))
+ }
+ }
+ }
+ }
+
+ internal func _makeRequest(
+ with server: Server? = nil,
+ configureRequest: ConfigureURLRequest,
+ completion: @escaping (Result) -> Void
+ ) {
+ do {
+ let builder = URLRequestBuilder(
+ baseURL: try baseURL(serverOverride: server),
+ parameterDefaults: nil,
+ defaultSecurityParameterProviding: _security
+ )
+ try configureRequest(builder)
+ return makeDataRequest(with: try builder.build(), completion: completion)
+ } catch {
+ completion(.failure(error))
+ }
+ }
+
+ // MARK: - Private
+
+ private func baseURL(serverOverride: Server? = nil) throws -> URL {
+ let server: Server
+ if let serverOverride {
+ server = serverOverride
+ } else if let selectedServer = _selectedServer {
+ server = try selectedServer.server()
+ } else {
+ server = try GlobalServers.default()
+ }
+
+ guard let url = URL(string: server.urlString) else {
+ throw PlexswiftError.failedToConstructRequestURL(.invalidServerURL(string: server.urlString))
+ }
+ return url
+ }
+
+ private func makeDataRequest(with urlRequest: URLRequest, completion: @escaping (Result) -> Void) {
+ let task = _session.dataTask(with: urlRequest) { data, response, error in
+ if let error {
+ completion(.failure(PlexswiftError.failedToMakeNetworkRequest(error: error)))
+ } else if let httpResponse = response as? HTTPURLResponse {
+ completion(.success(APIResponse(httpResponse: httpResponse, data: data)))
+ } else {
+ completion(.failure(PlexswiftError.internalError(error: nil)))
+ }
+ }
+ task.resume()
+ }
+}
+
+enum ResponseHandlerError: Swift.Error {
+ case failedToDecodeJSON(_ error: Swift.Error)
+ case failedToDecodeResponse
+}
diff --git a/Sources/Plexswift/Plexswift.docc/Plexswift.md b/Sources/Plexswift/Plexswift.docc/Plexswift.md
new file mode 100644
index 0000000..a849ddc
--- /dev/null
+++ b/Sources/Plexswift/Plexswift.docc/Plexswift.md
@@ -0,0 +1,493 @@
+# ``plexswift``
+
+An Open API Spec for interacting with Plex.tv and Plex Servers
+
+`plexswift` is a Swift library which provides functionality for making requests to the API using a modern, easy-to-use Swift API:
+
+### SDK Example Usage
+
+```swift
+import Foundation
+import Plexswift
+
+let client = Client(security: .accessToken(""))
+
+let response = try await client.server.getServerCapabilities()
+
+switch response.data {
+case .twoHundredApplicationJsonObject(let twoHundredApplicationJsonObject):
+ // Handle response
+ break
+case .fourHundredAndOneApplicationJsonObject(let fourHundredAndOneApplicationJsonObject):
+ // Handle response
+ break
+case .empty:
+ // Handle empty response
+ break
+}
+
+```
+
+### Getting started
+- ``PlexswiftAPI`` defines the available API operations, including operations which are logically grouped by name (for example under ``PlexswiftAPI/server``).
+- ``Client`` is the main object used when making requests to the API, and implements ``PlexswiftAPI`` to provide this functionality. Each available API method is exposed as an `async` function, which you can call and `await` its response and handle any errors that are thrown.
+- API methods that require input data take a *request object* describing these parameters, and each method returns a *response object* containing information about the response. You can read more about these in .
+- Requests to the API must be authenticated. You can provide authentication credentials by initializing ``Client`` with a ``Shared/Security`` value.
+- If an error occurs when making a request to the API, a ``PlexswiftError`` error is thrown with more information about what went wrong.
+
+## Topics
+
+### Connecting to the API
+
+- ``Client``
+- ``Shared/Security``
+- ``Response``
+- ``ResponseWithHeaders``
+- ``ResponseFields``
+- ``ResponseHeaders``
+- ``PlexswiftError``
+
+### API operations
+
+- ``plexswift/PlexswiftAPI``
+- ``ServerAPI``
+- ``MediaAPI``
+- ``VideoAPI``
+- ``ActivitiesAPI``
+- ``ButlerAPI``
+- ``HubsAPI``
+- ``SearchAPI``
+- ``LibraryAPI``
+- ``LogAPI``
+- ``PlexAPI``
+- ``PlaylistsAPI``
+- ``AuthenticationAPI``
+- ``StatisticsAPI``
+- ``SessionsAPI``
+- ``UpdaterAPI``
+
+### Server configuration
+- ``PlexServers/GetPin``
+- ``PlexServers/GetToken``
+
+### Shared models
+
+### Request objects
+
+### Response objects
+- ``Operations/AddPlaylistContentsResponse``
+- ``Operations/ApplyUpdatesResponse``
+- ``Operations/CancelServerActivitiesResponse``
+- ``Operations/CheckForUpdatesResponse``
+- ``Operations/ClearPlaylistContentsResponse``
+- ``Operations/CreatePlaylistResponse``
+- ``Operations/DeleteLibraryResponse``
+- ``Operations/DeletePlaylistResponse``
+- ``Operations/EnablePaperTrailResponse``
+- ``Operations/GetAvailableClientsResponse``
+- ``Operations/GetButlerTasksResponse``
+- ``Operations/GetDevicesResponse``
+- ``Operations/GetFileHashResponse``
+- ``Operations/GetGlobalHubsResponse``
+- ``Operations/GetLibrariesResponse``
+- ``Operations/GetLibraryResponse``
+- ``Operations/GetLibraryHubsResponse``
+- ``Operations/GetLibraryItemsResponse``
+- ``Operations/GetMetadataResponse``
+- ``Operations/GetMetadataChildrenResponse``
+- ``Operations/GetMyPlexAccountResponse``
+- ``Operations/GetOnDeckResponse``
+- ``Operations/GetPinResponse``
+- ``Operations/GetPlaylistResponse``
+- ``Operations/GetPlaylistContentsResponse``
+- ``Operations/GetPlaylistsResponse``
+- ``Operations/GetRecentlyAddedResponse``
+- ``Operations/GetResizedPhotoResponse``
+- ``Operations/GetSearchResultsResponse``
+- ``Operations/GetServerActivitiesResponse``
+- ``Operations/GetServerCapabilitiesResponse``
+- ``Operations/GetServerIdentityResponse``
+- ``Operations/GetServerListResponse``
+- ``Operations/GetServerPreferencesResponse``
+- ``Operations/GetSessionHistoryResponse``
+- ``Operations/GetSessionsResponse``
+- ``Operations/GetSourceConnectionInformationResponse``
+- ``Operations/GetStatisticsResponse``
+- ``Operations/GetTimelineResponse``
+- ``Operations/GetTokenResponse``
+- ``Operations/GetTranscodeSessionsResponse``
+- ``Operations/GetTransientTokenResponse``
+- ``Operations/GetUpdateStatusResponse``
+- ``Operations/LogLineResponse``
+- ``Operations/LogMultiLineResponse``
+- ``Operations/MarkPlayedResponse``
+- ``Operations/MarkUnplayedResponse``
+- ``Operations/PerformSearchResponse``
+- ``Operations/PerformVoiceSearchResponse``
+- ``Operations/RefreshLibraryResponse``
+- ``Operations/SearchLibraryResponse``
+- ``Operations/StartAllTasksResponse``
+- ``Operations/StartTaskResponse``
+- ``Operations/StartUniversalTranscodeResponse``
+- ``Operations/StopAllTasksResponse``
+- ``Operations/StopTaskResponse``
+- ``Operations/StopTranscodeSessionResponse``
+- ``Operations/UpdatePlaylistResponse``
+- ``Operations/UpdatePlayProgressResponse``
+- ``Operations/UploadPlaylistResponse``
+
+### Other models
+- ``Operations/Account``
+- ``Operations/Activity``
+- ``Operations/AddPlaylistContentsErrors``
+- ``Operations/AddPlaylistContentsMediaContainer``
+- ``Operations/AddPlaylistContentsMetadata``
+- ``Operations/AddPlaylistContentsPlaylistsResponseBody``
+- ``Operations/AddPlaylistContentsRequest``
+- ``Operations/AddPlaylistContentsResponseBody``
+- ``Operations/ApplyUpdatesErrors``
+- ``Operations/ApplyUpdatesRequest``
+- ``Operations/ApplyUpdatesResponseBody``
+- ``Operations/ButlerTask``
+- ``Operations/ButlerTasks``
+- ``Operations/CancelServerActivitiesErrors``
+- ``Operations/CancelServerActivitiesRequest``
+- ``Operations/CancelServerActivitiesResponseBody``
+- ``Operations/CheckForUpdatesErrors``
+- ``Operations/CheckForUpdatesRequest``
+- ``Operations/CheckForUpdatesResponseBody``
+- ``Operations/ClearPlaylistContentsErrors``
+- ``Operations/ClearPlaylistContentsRequest``
+- ``Operations/ClearPlaylistContentsResponseBody``
+- ``Operations/Context``
+- ``Operations/Country``
+- ``Operations/CreatePlaylistErrors``
+- ``Operations/CreatePlaylistMediaContainer``
+- ``Operations/CreatePlaylistMetadata``
+- ``Operations/CreatePlaylistPlaylistsResponseBody``
+- ``Operations/CreatePlaylistRequest``
+- ``Operations/CreatePlaylistResponseBody``
+- ``Operations/DeleteLibraryErrors``
+- ``Operations/DeleteLibraryRequest``
+- ``Operations/DeleteLibraryResponseBody``
+- ``Operations/DeletePlaylistErrors``
+- ``Operations/DeletePlaylistRequest``
+- ``Operations/DeletePlaylistResponseBody``
+- ``Operations/Device``
+- ``Operations/Director``
+- ``Operations/Directory``
+- ``Operations/Download``
+- ``Operations/EnablePaperTrailErrors``
+- ``Operations/EnablePaperTrailResponseBody``
+- ``Operations/Errors``
+- ``Operations/Field``
+- ``Operations/FieldType``
+- ``Operations/Filter``
+- ``Operations/Force``
+- ``Operations/Genre``
+- ``Operations/GetAvailableClientsErrors``
+- ``Operations/GetAvailableClientsMediaContainer``
+- ``Operations/GetAvailableClientsResponseBody``
+- ``Operations/GetAvailableClientsServerResponseBody``
+- ``Operations/GetButlerTasksButlerResponseBody``
+- ``Operations/GetButlerTasksErrors``
+- ``Operations/GetButlerTasksResponseBody``
+- ``Operations/GetDevicesErrors``
+- ``Operations/GetDevicesMediaContainer``
+- ``Operations/GetDevicesResponseBody``
+- ``Operations/GetDevicesServerResponseBody``
+- ``Operations/GetFileHashErrors``
+- ``Operations/GetFileHashRequest``
+- ``Operations/GetFileHashResponseBody``
+- ``Operations/GetGlobalHubsErrors``
+- ``Operations/GetGlobalHubsHubsResponseBody``
+- ``Operations/GetGlobalHubsMediaContainer``
+- ``Operations/GetGlobalHubsMetadata``
+- ``Operations/GetGlobalHubsRequest``
+- ``Operations/GetGlobalHubsResponseBody``
+- ``Operations/GetLibrariesDirectory``
+- ``Operations/GetLibrariesErrors``
+- ``Operations/GetLibrariesLibraryResponseBody``
+- ``Operations/GetLibrariesLocation``
+- ``Operations/GetLibrariesMediaContainer``
+- ``Operations/GetLibrariesResponseBody``
+- ``Operations/GetLibraryDirectory``
+- ``Operations/GetLibraryErrors``
+- ``Operations/GetLibraryLibraryResponseBody``
+- ``Operations/GetLibraryMediaContainer``
+- ``Operations/GetLibraryRequest``
+- ``Operations/GetLibraryResponseBody``
+- ``Operations/GetLibraryType``
+- ``Operations/GetLibraryHubsCountry``
+- ``Operations/GetLibraryHubsDirector``
+- ``Operations/GetLibraryHubsErrors``
+- ``Operations/GetLibraryHubsGenre``
+- ``Operations/GetLibraryHubsHub``
+- ``Operations/GetLibraryHubsHubsResponseBody``
+- ``Operations/GetLibraryHubsMedia``
+- ``Operations/GetLibraryHubsMediaContainer``
+- ``Operations/GetLibraryHubsMetadata``
+- ``Operations/GetLibraryHubsPart``
+- ``Operations/GetLibraryHubsRequest``
+- ``Operations/GetLibraryHubsResponseBody``
+- ``Operations/GetLibraryHubsRole``
+- ``Operations/GetLibraryHubsWriter``
+- ``Operations/GetLibraryItemsCountry``
+- ``Operations/GetLibraryItemsDirector``
+- ``Operations/GetLibraryItemsGenre``
+- ``Operations/GetLibraryItemsMedia``
+- ``Operations/GetLibraryItemsMediaContainer``
+- ``Operations/GetLibraryItemsMetadata``
+- ``Operations/GetLibraryItemsPart``
+- ``Operations/GetLibraryItemsRequest``
+- ``Operations/GetLibraryItemsResponseBody``
+- ``Operations/GetLibraryItemsRole``
+- ``Operations/GetLibraryItemsWriter``
+- ``Operations/GetMetadataCountry``
+- ``Operations/GetMetadataDirector``
+- ``Operations/GetMetadataErrors``
+- ``Operations/GetMetadataGenre``
+- ``Operations/GetMetadataLibraryResponseBody``
+- ``Operations/GetMetadataMedia``
+- ``Operations/GetMetadataMediaContainer``
+- ``Operations/GetMetadataMetadata``
+- ``Operations/GetMetadataPart``
+- ``Operations/GetMetadataRequest``
+- ``Operations/GetMetadataResponseBody``
+- ``Operations/GetMetadataRole``
+- ``Operations/GetMetadataWriter``
+- ``Operations/GetMetadataChildrenDirectory``
+- ``Operations/GetMetadataChildrenErrors``
+- ``Operations/GetMetadataChildrenLibraryResponseBody``
+- ``Operations/GetMetadataChildrenMediaContainer``
+- ``Operations/GetMetadataChildrenMetadata``
+- ``Operations/GetMetadataChildrenRequest``
+- ``Operations/GetMetadataChildrenResponseBody``
+- ``Operations/GetMyPlexAccountErrors``
+- ``Operations/GetMyPlexAccountResponseBody``
+- ``Operations/GetMyPlexAccountServerResponseBody``
+- ``Operations/GetOnDeckErrors``
+- ``Operations/GetOnDeckGuids``
+- ``Operations/GetOnDeckLibraryResponseBody``
+- ``Operations/GetOnDeckMedia``
+- ``Operations/GetOnDeckMediaContainer``
+- ``Operations/GetOnDeckMetadata``
+- ``Operations/GetOnDeckPart``
+- ``Operations/GetOnDeckResponseBody``
+- ``Operations/GetOnDeckStream``
+- ``Operations/GetPinErrors``
+- ``Operations/GetPinPlexResponseBody``
+- ``Operations/GetPinRequest``
+- ``Operations/GetPinResponseBody``
+- ``Operations/GetPlaylistErrors``
+- ``Operations/GetPlaylistMediaContainer``
+- ``Operations/GetPlaylistMetadata``
+- ``Operations/GetPlaylistPlaylistsResponseBody``
+- ``Operations/GetPlaylistRequest``
+- ``Operations/GetPlaylistResponseBody``
+- ``Operations/GetPlaylistContentsCountry``
+- ``Operations/GetPlaylistContentsDirector``
+- ``Operations/GetPlaylistContentsErrors``
+- ``Operations/GetPlaylistContentsGenre``
+- ``Operations/GetPlaylistContentsMedia``
+- ``Operations/GetPlaylistContentsMediaContainer``
+- ``Operations/GetPlaylistContentsMetadata``
+- ``Operations/GetPlaylistContentsPart``
+- ``Operations/GetPlaylistContentsPlaylistsResponseBody``
+- ``Operations/GetPlaylistContentsRequest``
+- ``Operations/GetPlaylistContentsResponseBody``
+- ``Operations/GetPlaylistContentsRole``
+- ``Operations/GetPlaylistContentsWriter``
+- ``Operations/GetPlaylistsErrors``
+- ``Operations/GetPlaylistsMediaContainer``
+- ``Operations/GetPlaylistsMetadata``
+- ``Operations/GetPlaylistsPlaylistsResponseBody``
+- ``Operations/GetPlaylistsRequest``
+- ``Operations/GetPlaylistsResponseBody``
+- ``Operations/GetRecentlyAddedErrors``
+- ``Operations/GetRecentlyAddedLibraryResponseBody``
+- ``Operations/GetRecentlyAddedMediaContainer``
+- ``Operations/GetRecentlyAddedResponseBody``
+- ``Operations/GetResizedPhotoErrors``
+- ``Operations/GetResizedPhotoRequest``
+- ``Operations/GetResizedPhotoResponseBody``
+- ``Operations/GetSearchResultsCountry``
+- ``Operations/GetSearchResultsDirector``
+- ``Operations/GetSearchResultsErrors``
+- ``Operations/GetSearchResultsGenre``
+- ``Operations/GetSearchResultsMedia``
+- ``Operations/GetSearchResultsMediaContainer``
+- ``Operations/GetSearchResultsMetadata``
+- ``Operations/GetSearchResultsPart``
+- ``Operations/GetSearchResultsRequest``
+- ``Operations/GetSearchResultsResponseBody``
+- ``Operations/GetSearchResultsRole``
+- ``Operations/GetSearchResultsSearchResponseBody``
+- ``Operations/GetSearchResultsWriter``
+- ``Operations/GetServerActivitiesActivitiesResponseBody``
+- ``Operations/GetServerActivitiesErrors``
+- ``Operations/GetServerActivitiesMediaContainer``
+- ``Operations/GetServerActivitiesResponseBody``
+- ``Operations/GetServerCapabilitiesResponseBody``
+- ``Operations/GetServerCapabilitiesServerResponseBody``
+- ``Operations/GetServerIdentityErrors``
+- ``Operations/GetServerIdentityMediaContainer``
+- ``Operations/GetServerIdentityResponseBody``
+- ``Operations/GetServerIdentityServerResponseBody``
+- ``Operations/GetServerListErrors``
+- ``Operations/GetServerListMediaContainer``
+- ``Operations/GetServerListResponseBody``
+- ``Operations/GetServerListServer``
+- ``Operations/GetServerListServerResponseBody``
+- ``Operations/GetServerPreferencesErrors``
+- ``Operations/GetServerPreferencesMediaContainer``
+- ``Operations/GetServerPreferencesResponseBody``
+- ``Operations/GetServerPreferencesServerResponseBody``
+- ``Operations/GetSessionHistoryErrors``
+- ``Operations/GetSessionHistoryMediaContainer``
+- ``Operations/GetSessionHistoryMetadata``
+- ``Operations/GetSessionHistoryResponseBody``
+- ``Operations/GetSessionHistorySessionsResponseBody``
+- ``Operations/GetSessionsErrors``
+- ``Operations/GetSessionsMedia``
+- ``Operations/GetSessionsMediaContainer``
+- ``Operations/GetSessionsMetadata``
+- ``Operations/GetSessionsPart``
+- ``Operations/GetSessionsResponseBody``
+- ``Operations/GetSessionsSessionsResponseBody``
+- ``Operations/GetSessionsStream``
+- ``Operations/GetSourceConnectionInformationErrors``
+- ``Operations/GetSourceConnectionInformationRequest``
+- ``Operations/GetSourceConnectionInformationResponseBody``
+- ``Operations/GetStatisticsDevice``
+- ``Operations/GetStatisticsErrors``
+- ``Operations/GetStatisticsMediaContainer``
+- ``Operations/GetStatisticsRequest``
+- ``Operations/GetStatisticsResponseBody``
+- ``Operations/GetStatisticsStatisticsResponseBody``
+- ``Operations/GetTimelineErrors``
+- ``Operations/GetTimelineRequest``
+- ``Operations/GetTimelineResponseBody``
+- ``Operations/GetTokenErrors``
+- ``Operations/GetTokenRequest``
+- ``Operations/GetTokenResponseBody``
+- ``Operations/GetTranscodeSessionsErrors``
+- ``Operations/GetTranscodeSessionsMediaContainer``
+- ``Operations/GetTranscodeSessionsResponseBody``
+- ``Operations/GetTranscodeSessionsSessionsResponseBody``
+- ``Operations/GetTransientTokenErrors``
+- ``Operations/GetTransientTokenQueryParamType``
+- ``Operations/GetTransientTokenRequest``
+- ``Operations/GetTransientTokenResponseBody``
+- ``Operations/GetUpdateStatusErrors``
+- ``Operations/GetUpdateStatusMediaContainer``
+- ``Operations/GetUpdateStatusResponseBody``
+- ``Operations/GetUpdateStatusUpdaterResponseBody``
+- ``Operations/Guids``
+- ``Operations/Hub``
+- ``Operations/IncludeDetails``
+- ``Operations/Level``
+- ``Operations/Location``
+- ``Operations/LogLineErrors``
+- ``Operations/LogLineRequest``
+- ``Operations/LogLineResponseBody``
+- ``Operations/LogMultiLineErrors``
+- ``Operations/LogMultiLineResponseBody``
+- ``Operations/MarkPlayedErrors``
+- ``Operations/MarkPlayedRequest``
+- ``Operations/MarkPlayedResponseBody``
+- ``Operations/MarkUnplayedErrors``
+- ``Operations/MarkUnplayedRequest``
+- ``Operations/MarkUnplayedResponseBody``
+- ``Operations/Media``
+- ``Operations/MediaContainer``
+- ``Operations/Metadata``
+- ``Operations/MinSize``
+- ``Operations/MyPlex``
+- ``Operations/OnlyTransient``
+- ``Operations/Operator``
+- ``Operations/Part``
+- ``Operations/PathParamTaskName``
+- ``Operations/PerformSearchErrors``
+- ``Operations/PerformSearchRequest``
+- ``Operations/PerformSearchResponseBody``
+- ``Operations/PerformVoiceSearchErrors``
+- ``Operations/PerformVoiceSearchRequest``
+- ``Operations/PerformVoiceSearchResponseBody``
+- ``Operations/Player``
+- ``Operations/PlaylistType``
+- ``Operations/Producer``
+- ``Operations/Provider``
+- ``Operations/QueryParamOnlyTransient``
+- ``Operations/QueryParamSmart``
+- ``Operations/QueryParamType``
+- ``Operations/Ratings``
+- ``Operations/RefreshLibraryErrors``
+- ``Operations/RefreshLibraryRequest``
+- ``Operations/RefreshLibraryResponseBody``
+- ``Operations/Release``
+- ``Operations/Role``
+- ``Operations/Scope``
+- ``Operations/SearchLibraryMediaContainer``
+- ``Operations/SearchLibraryMetadata``
+- ``Operations/SearchLibraryRequest``
+- ``Operations/SearchLibraryResponseBody``
+- ``Operations/Server``
+- ``Operations/Session``
+- ``Operations/Setting``
+- ``Operations/Skip``
+- ``Operations/Smart``
+- ``Operations/Sort``
+- ``Operations/StartAllTasksErrors``
+- ``Operations/StartAllTasksResponseBody``
+- ``Operations/StartTaskErrors``
+- ``Operations/StartTaskRequest``
+- ``Operations/StartTaskResponseBody``
+- ``Operations/StartUniversalTranscodeErrors``
+- ``Operations/StartUniversalTranscodeRequest``
+- ``Operations/StartUniversalTranscodeResponseBody``
+- ``Operations/State``
+- ``Operations/StatisticsMedia``
+- ``Operations/StopAllTasksErrors``
+- ``Operations/StopAllTasksResponseBody``
+- ``Operations/StopTaskErrors``
+- ``Operations/StopTaskRequest``
+- ``Operations/StopTaskResponseBody``
+- ``Operations/StopTranscodeSessionErrors``
+- ``Operations/StopTranscodeSessionRequest``
+- ``Operations/StopTranscodeSessionResponseBody``
+- ``Operations/Stream``
+- ``Operations/Tag``
+- ``Operations/TaskName``
+- ``Operations/Tonight``
+- ``Operations/TranscodeSession``
+- ``Operations/TypeModel``
+- ``Operations/UpdatePlaylistErrors``
+- ``Operations/UpdatePlaylistRequest``
+- ``Operations/UpdatePlaylistResponseBody``
+- ``Operations/UpdatePlayProgressErrors``
+- ``Operations/UpdatePlayProgressRequest``
+- ``Operations/UpdatePlayProgressResponseBody``
+- ``Operations/UploadPlaylistErrors``
+- ``Operations/UploadPlaylistRequest``
+- ``Operations/UploadPlaylistResponseBody``
+- ``Operations/Upscale``
+- ``Operations/User``
+- ``Operations/Writer``
+
+### Type groupings
+- ``Operations``
+- ``Shared``
+
+### Data types
+
+- ``AnyValue``
+- ``APIValue``
+
+### Internal data types
+
+- ``DateConvertible``
+- ``DateOnly``
+- ``DateTime``
+- ``DecimalSerialized``
+- ``DoubleConvertible``
diff --git a/Sources/Plexswift/configuration/GlobalServer.swift b/Sources/Plexswift/configuration/GlobalServer.swift
new file mode 100644
index 0000000..e132457
--- /dev/null
+++ b/Sources/Plexswift/configuration/GlobalServer.swift
@@ -0,0 +1,38 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+/// The protocol to use when connecting to your plex server.
+public enum ServerProtocol: String, Codable, APIValue {
+ case http = "http"
+ case https = "https"
+}
+
+enum GlobalServers: Servers, ServerConvertible {
+ /// Supported server value with substituted variables
+ ///
+ /// Corresponds to `{protocol}://{ip}:{port}`
+ case server1(`protocol`: ServerProtocol = .http, ip: String = "10.10.10.47", port: String = "32400")
+
+ /// Defines the raw URL strings for each server option.
+ ///
+ /// > Note: You do not need to use these values directly.
+ ///
+ /// The available URL strings are defined as:
+ /// ```swift
+ /// public static let urlStrings = [
+ /// "{protocol}://{ip}:{port}"
+ /// ]
+ /// ```
+ public static let urlStrings = [
+ "{protocol}://{ip}:{port}"
+ ]
+
+ func server() throws -> Server {
+ switch self {
+ case .server1(let `protocol`, let ip, let port):
+ return try type(of: self).server(at: 0, substituting: ["protocol": `protocol`.rawValue, "ip": ip, "port": port])
+ }
+ }
+}
diff --git a/Sources/Plexswift/internal/api/_ActivitiesAPI.swift b/Sources/Plexswift/internal/api/_ActivitiesAPI.swift
new file mode 100644
index 0000000..d02d4a7
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_ActivitiesAPI.swift
@@ -0,0 +1,93 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _ActivitiesAPI: ActivitiesAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getServerActivities() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetServerActivitiesRequest(with: configuration)
+ },
+ handleResponse: handleGetServerActivitiesResponse
+ )
+ }
+
+ public func cancelServerActivities(request: Operations.CancelServerActivitiesRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureCancelServerActivitiesRequest(with: configuration, request: request)
+ },
+ handleResponse: handleCancelServerActivitiesResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetServerActivitiesRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/activities"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureCancelServerActivitiesRequest(with configuration: URLRequestConfiguration, request: Operations.CancelServerActivitiesRequest) throws {
+ configuration.path = "/activities/{activityUUID}"
+ configuration.method = .delete
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetServerActivitiesResponse(response: Client.APIResponse) throws -> Operations.GetServerActivitiesResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerActivitiesResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerActivitiesActivitiesResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleCancelServerActivitiesResponse(response: Client.APIResponse) throws -> Operations.CancelServerActivitiesResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.CancelServerActivitiesResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_AuthenticationAPI.swift b/Sources/Plexswift/internal/api/_AuthenticationAPI.swift
new file mode 100644
index 0000000..6df1288
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_AuthenticationAPI.swift
@@ -0,0 +1,86 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _AuthenticationAPI: AuthenticationAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getTransientToken(request: Operations.GetTransientTokenRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetTransientTokenRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetTransientTokenResponse
+ )
+ }
+
+ public func getSourceConnectionInformation(request: Operations.GetSourceConnectionInformationRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetSourceConnectionInformationRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetSourceConnectionInformationResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetTransientTokenRequest(with configuration: URLRequestConfiguration, request: Operations.GetTransientTokenRequest) throws {
+ configuration.path = "/security/token"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetSourceConnectionInformationRequest(with configuration: URLRequestConfiguration, request: Operations.GetSourceConnectionInformationRequest) throws {
+ configuration.path = "/security/resources"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetTransientTokenResponse(response: Client.APIResponse) throws -> Operations.GetTransientTokenResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.GetTransientTokenResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetSourceConnectionInformationResponse(response: Client.APIResponse) throws -> Operations.GetSourceConnectionInformationResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.GetSourceConnectionInformationResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_ButlerAPI.swift b/Sources/Plexswift/internal/api/_ButlerAPI.swift
new file mode 100644
index 0000000..c03cf77
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_ButlerAPI.swift
@@ -0,0 +1,193 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _ButlerAPI: ButlerAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getButlerTasks() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetButlerTasksRequest(with: configuration)
+ },
+ handleResponse: handleGetButlerTasksResponse
+ )
+ }
+
+ public func startAllTasks() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureStartAllTasksRequest(with: configuration)
+ },
+ handleResponse: handleStartAllTasksResponse
+ )
+ }
+
+ public func stopAllTasks() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureStopAllTasksRequest(with: configuration)
+ },
+ handleResponse: handleStopAllTasksResponse
+ )
+ }
+
+ public func startTask(request: Operations.StartTaskRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureStartTaskRequest(with: configuration, request: request)
+ },
+ handleResponse: handleStartTaskResponse
+ )
+ }
+
+ public func stopTask(request: Operations.StopTaskRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureStopTaskRequest(with: configuration, request: request)
+ },
+ handleResponse: handleStopTaskResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetButlerTasksRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/butler"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureStartAllTasksRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/butler"
+ configuration.method = .post
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureStopAllTasksRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/butler"
+ configuration.method = .delete
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureStartTaskRequest(with configuration: URLRequestConfiguration, request: Operations.StartTaskRequest) throws {
+ configuration.path = "/butler/{taskName}"
+ configuration.method = .post
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureStopTaskRequest(with configuration: URLRequestConfiguration, request: Operations.StopTaskRequest) throws {
+ configuration.path = "/butler/{taskName}"
+ configuration.method = .delete
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetButlerTasksResponse(response: Client.APIResponse) throws -> Operations.GetButlerTasksResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetButlerTasksResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetButlerTasksButlerResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleStartAllTasksResponse(response: Client.APIResponse) throws -> Operations.StartAllTasksResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.StartAllTasksResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleStopAllTasksResponse(response: Client.APIResponse) throws -> Operations.StopAllTasksResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.StopAllTasksResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleStartTaskResponse(response: Client.APIResponse) throws -> Operations.StartTaskResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 202, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.StartTaskResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleStopTaskResponse(response: Client.APIResponse) throws -> Operations.StopTaskResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400, 404].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.StopTaskResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_HubsAPI.swift b/Sources/Plexswift/internal/api/_HubsAPI.swift
new file mode 100644
index 0000000..36ab6b1
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_HubsAPI.swift
@@ -0,0 +1,103 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _HubsAPI: HubsAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getGlobalHubs(request: Operations.GetGlobalHubsRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetGlobalHubsRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetGlobalHubsResponse
+ )
+ }
+
+ public func getLibraryHubs(request: Operations.GetLibraryHubsRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetLibraryHubsRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetLibraryHubsResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetGlobalHubsRequest(with configuration: URLRequestConfiguration, request: Operations.GetGlobalHubsRequest) throws {
+ configuration.path = "/hubs"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetLibraryHubsRequest(with configuration: URLRequestConfiguration, request: Operations.GetLibraryHubsRequest) throws {
+ configuration.path = "/hubs/sections/{sectionId}"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetGlobalHubsResponse(response: Client.APIResponse) throws -> Operations.GetGlobalHubsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetGlobalHubsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetGlobalHubsHubsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetLibraryHubsResponse(response: Client.APIResponse) throws -> Operations.GetLibraryHubsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryHubsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryHubsHubsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_LibraryAPI.swift b/Sources/Plexswift/internal/api/_LibraryAPI.swift
new file mode 100644
index 0000000..08caec9
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_LibraryAPI.swift
@@ -0,0 +1,435 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _LibraryAPI: LibraryAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getFileHash(request: Operations.GetFileHashRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetFileHashRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetFileHashResponse
+ )
+ }
+
+ public func getRecentlyAdded() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetRecentlyAddedRequest(with: configuration)
+ },
+ handleResponse: handleGetRecentlyAddedResponse
+ )
+ }
+
+ public func getLibraries() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetLibrariesRequest(with: configuration)
+ },
+ handleResponse: handleGetLibrariesResponse
+ )
+ }
+
+ public func getLibrary(request: Operations.GetLibraryRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetLibraryRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetLibraryResponse
+ )
+ }
+
+ public func deleteLibrary(request: Operations.DeleteLibraryRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureDeleteLibraryRequest(with: configuration, request: request)
+ },
+ handleResponse: handleDeleteLibraryResponse
+ )
+ }
+
+ public func getLibraryItems(request: Operations.GetLibraryItemsRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetLibraryItemsRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetLibraryItemsResponse
+ )
+ }
+
+ public func refreshLibrary(request: Operations.RefreshLibraryRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureRefreshLibraryRequest(with: configuration, request: request)
+ },
+ handleResponse: handleRefreshLibraryResponse
+ )
+ }
+
+ public func searchLibrary(request: Operations.SearchLibraryRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureSearchLibraryRequest(with: configuration, request: request)
+ },
+ handleResponse: handleSearchLibraryResponse
+ )
+ }
+
+ public func getMetadata(request: Operations.GetMetadataRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetMetadataRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetMetadataResponse
+ )
+ }
+
+ public func getMetadataChildren(request: Operations.GetMetadataChildrenRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetMetadataChildrenRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetMetadataChildrenResponse
+ )
+ }
+
+ public func getOnDeck() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetOnDeckRequest(with: configuration)
+ },
+ handleResponse: handleGetOnDeckResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetFileHashRequest(with configuration: URLRequestConfiguration, request: Operations.GetFileHashRequest) throws {
+ configuration.path = "/library/hashes"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetRecentlyAddedRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/library/recentlyAdded"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetLibrariesRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/library/sections"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.GetLibraryRequest) throws {
+ configuration.path = "/library/sections/{sectionId}"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureDeleteLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.DeleteLibraryRequest) throws {
+ configuration.path = "/library/sections/{sectionId}"
+ configuration.method = .delete
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetLibraryItemsRequest(with configuration: URLRequestConfiguration, request: Operations.GetLibraryItemsRequest) throws {
+ configuration.path = "/library/sections/{sectionId}/{tag}"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureRefreshLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.RefreshLibraryRequest) throws {
+ configuration.path = "/library/sections/{sectionId}/refresh"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureSearchLibraryRequest(with configuration: URLRequestConfiguration, request: Operations.SearchLibraryRequest) throws {
+ configuration.path = "/library/sections/{sectionId}/search"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetMetadataRequest(with configuration: URLRequestConfiguration, request: Operations.GetMetadataRequest) throws {
+ configuration.path = "/library/metadata/{ratingKey}"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetMetadataChildrenRequest(with configuration: URLRequestConfiguration, request: Operations.GetMetadataChildrenRequest) throws {
+ configuration.path = "/library/metadata/{ratingKey}/children"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetOnDeckRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/library/onDeck"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetFileHashResponse(response: Client.APIResponse) throws -> Operations.GetFileHashResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.GetFileHashResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetRecentlyAddedResponse(response: Client.APIResponse) throws -> Operations.GetRecentlyAddedResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetRecentlyAddedResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetRecentlyAddedLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetLibrariesResponse(response: Client.APIResponse) throws -> Operations.GetLibrariesResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibrariesResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibrariesLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetLibraryResponse(response: Client.APIResponse) throws -> Operations.GetLibraryResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetLibraryLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleDeleteLibraryResponse(response: Client.APIResponse) throws -> Operations.DeleteLibraryResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.DeleteLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetLibraryItemsResponse(response: Client.APIResponse) throws -> Operations.GetLibraryItemsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.GetLibraryItemsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleRefreshLibraryResponse(response: Client.APIResponse) throws -> Operations.RefreshLibraryResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.RefreshLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleSearchLibraryResponse(response: Client.APIResponse) throws -> Operations.SearchLibraryResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.SearchLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetMetadataResponse(response: Client.APIResponse) throws -> Operations.GetMetadataResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetMetadataResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetMetadataLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetMetadataChildrenResponse(response: Client.APIResponse) throws -> Operations.GetMetadataChildrenResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetMetadataChildrenResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetMetadataChildrenLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetOnDeckResponse(response: Client.APIResponse) throws -> Operations.GetOnDeckResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetOnDeckResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetOnDeckLibraryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_LogAPI.swift b/Sources/Plexswift/internal/api/_LogAPI.swift
new file mode 100644
index 0000000..13e0b89
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_LogAPI.swift
@@ -0,0 +1,123 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _LogAPI: LogAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func logLine(request: Operations.LogLineRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureLogLineRequest(with: configuration, request: request)
+ },
+ handleResponse: handleLogLineResponse
+ )
+ }
+
+ public func logMultiLine(request: String) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureLogMultiLineRequest(with: configuration, request: request)
+ },
+ handleResponse: handleLogMultiLineResponse
+ )
+ }
+
+ public func enablePaperTrail() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureEnablePaperTrailRequest(with: configuration)
+ },
+ handleResponse: handleEnablePaperTrailResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureLogLineRequest(with configuration: URLRequestConfiguration, request: Operations.LogLineRequest) throws {
+ configuration.path = "/log"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureLogMultiLineRequest(with configuration: URLRequestConfiguration, request: String) throws {
+ configuration.path = "/log"
+ configuration.method = .post
+ configuration.contentType = "text/plain"
+ configuration.body = request.data(using: .utf8)
+ if configuration.body == nil {
+ throw SerializationError.missingRequiredRequestBody
+ }
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureEnablePaperTrailRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/log/networked"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleLogLineResponse(response: Client.APIResponse) throws -> Operations.LogLineResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.LogLineResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleLogMultiLineResponse(response: Client.APIResponse) throws -> Operations.LogMultiLineResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.LogMultiLineResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleEnablePaperTrailResponse(response: Client.APIResponse) throws -> Operations.EnablePaperTrailResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400, 403].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.EnablePaperTrailResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_MediaAPI.swift b/Sources/Plexswift/internal/api/_MediaAPI.swift
new file mode 100644
index 0000000..30f7ee0
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_MediaAPI.swift
@@ -0,0 +1,120 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _MediaAPI: MediaAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func markPlayed(request: Operations.MarkPlayedRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureMarkPlayedRequest(with: configuration, request: request)
+ },
+ handleResponse: handleMarkPlayedResponse
+ )
+ }
+
+ public func markUnplayed(request: Operations.MarkUnplayedRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureMarkUnplayedRequest(with: configuration, request: request)
+ },
+ handleResponse: handleMarkUnplayedResponse
+ )
+ }
+
+ public func updatePlayProgress(request: Operations.UpdatePlayProgressRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureUpdatePlayProgressRequest(with: configuration, request: request)
+ },
+ handleResponse: handleUpdatePlayProgressResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureMarkPlayedRequest(with configuration: URLRequestConfiguration, request: Operations.MarkPlayedRequest) throws {
+ configuration.path = "/:/scrobble"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureMarkUnplayedRequest(with configuration: URLRequestConfiguration, request: Operations.MarkUnplayedRequest) throws {
+ configuration.path = "/:/unscrobble"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureUpdatePlayProgressRequest(with configuration: URLRequestConfiguration, request: Operations.UpdatePlayProgressRequest) throws {
+ configuration.path = "/:/progress"
+ configuration.method = .post
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleMarkPlayedResponse(response: Client.APIResponse) throws -> Operations.MarkPlayedResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.MarkPlayedResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleMarkUnplayedResponse(response: Client.APIResponse) throws -> Operations.MarkUnplayedResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.MarkUnplayedResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleUpdatePlayProgressResponse(response: Client.APIResponse) throws -> Operations.UpdatePlayProgressResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.UpdatePlayProgressResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_PlaylistsAPI.swift b/Sources/Plexswift/internal/api/_PlaylistsAPI.swift
new file mode 100644
index 0000000..55ac345
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_PlaylistsAPI.swift
@@ -0,0 +1,367 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _PlaylistsAPI: PlaylistsAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func createPlaylist(request: Operations.CreatePlaylistRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureCreatePlaylistRequest(with: configuration, request: request)
+ },
+ handleResponse: handleCreatePlaylistResponse
+ )
+ }
+
+ public func getPlaylists(request: Operations.GetPlaylistsRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetPlaylistsRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetPlaylistsResponse
+ )
+ }
+
+ public func getPlaylist(request: Operations.GetPlaylistRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetPlaylistRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetPlaylistResponse
+ )
+ }
+
+ public func deletePlaylist(request: Operations.DeletePlaylistRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureDeletePlaylistRequest(with: configuration, request: request)
+ },
+ handleResponse: handleDeletePlaylistResponse
+ )
+ }
+
+ public func updatePlaylist(request: Operations.UpdatePlaylistRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureUpdatePlaylistRequest(with: configuration, request: request)
+ },
+ handleResponse: handleUpdatePlaylistResponse
+ )
+ }
+
+ public func getPlaylistContents(request: Operations.GetPlaylistContentsRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetPlaylistContentsRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetPlaylistContentsResponse
+ )
+ }
+
+ public func clearPlaylistContents(request: Operations.ClearPlaylistContentsRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureClearPlaylistContentsRequest(with: configuration, request: request)
+ },
+ handleResponse: handleClearPlaylistContentsResponse
+ )
+ }
+
+ public func addPlaylistContents(request: Operations.AddPlaylistContentsRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureAddPlaylistContentsRequest(with: configuration, request: request)
+ },
+ handleResponse: handleAddPlaylistContentsResponse
+ )
+ }
+
+ public func uploadPlaylist(request: Operations.UploadPlaylistRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureUploadPlaylistRequest(with: configuration, request: request)
+ },
+ handleResponse: handleUploadPlaylistResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureCreatePlaylistRequest(with configuration: URLRequestConfiguration, request: Operations.CreatePlaylistRequest) throws {
+ configuration.path = "/playlists"
+ configuration.method = .post
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetPlaylistsRequest(with configuration: URLRequestConfiguration, request: Operations.GetPlaylistsRequest) throws {
+ configuration.path = "/playlists"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetPlaylistRequest(with configuration: URLRequestConfiguration, request: Operations.GetPlaylistRequest) throws {
+ configuration.path = "/playlists/{playlistID}"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureDeletePlaylistRequest(with configuration: URLRequestConfiguration, request: Operations.DeletePlaylistRequest) throws {
+ configuration.path = "/playlists/{playlistID}"
+ configuration.method = .delete
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureUpdatePlaylistRequest(with configuration: URLRequestConfiguration, request: Operations.UpdatePlaylistRequest) throws {
+ configuration.path = "/playlists/{playlistID}"
+ configuration.method = .put
+ configuration.pathParameterSerializable = request
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetPlaylistContentsRequest(with configuration: URLRequestConfiguration, request: Operations.GetPlaylistContentsRequest) throws {
+ configuration.path = "/playlists/{playlistID}/items"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureClearPlaylistContentsRequest(with configuration: URLRequestConfiguration, request: Operations.ClearPlaylistContentsRequest) throws {
+ configuration.path = "/playlists/{playlistID}/items"
+ configuration.method = .delete
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureAddPlaylistContentsRequest(with configuration: URLRequestConfiguration, request: Operations.AddPlaylistContentsRequest) throws {
+ configuration.path = "/playlists/{playlistID}/items"
+ configuration.method = .put
+ configuration.pathParameterSerializable = request
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureUploadPlaylistRequest(with configuration: URLRequestConfiguration, request: Operations.UploadPlaylistRequest) throws {
+ configuration.path = "/playlists/upload"
+ configuration.method = .post
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleCreatePlaylistResponse(response: Client.APIResponse) throws -> Operations.CreatePlaylistResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.CreatePlaylistResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.CreatePlaylistPlaylistsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetPlaylistsResponse(response: Client.APIResponse) throws -> Operations.GetPlaylistsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistsPlaylistsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetPlaylistResponse(response: Client.APIResponse) throws -> Operations.GetPlaylistResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistPlaylistsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleDeletePlaylistResponse(response: Client.APIResponse) throws -> Operations.DeletePlaylistResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.DeletePlaylistResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleUpdatePlaylistResponse(response: Client.APIResponse) throws -> Operations.UpdatePlaylistResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.UpdatePlaylistResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetPlaylistContentsResponse(response: Client.APIResponse) throws -> Operations.GetPlaylistContentsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistContentsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetPlaylistContentsPlaylistsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleClearPlaylistContentsResponse(response: Client.APIResponse) throws -> Operations.ClearPlaylistContentsResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.ClearPlaylistContentsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleAddPlaylistContentsResponse(response: Client.APIResponse) throws -> Operations.AddPlaylistContentsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.AddPlaylistContentsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.AddPlaylistContentsPlaylistsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleUploadPlaylistResponse(response: Client.APIResponse) throws -> Operations.UploadPlaylistResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.UploadPlaylistResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_PlexAPI.swift b/Sources/Plexswift/internal/api/_PlexAPI.swift
new file mode 100644
index 0000000..9006a79
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_PlexAPI.swift
@@ -0,0 +1,96 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _PlexAPI: PlexAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getPin(request: Operations.GetPinRequest, server: PlexServers.GetPin?) async throws -> Response {
+ return try await client.makeRequest(
+ with: try server?.server() ?? PlexServers.GetPin.default(),
+ configureRequest: { configuration in
+ try configureGetPinRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetPinResponse
+ )
+ }
+
+ public func getToken(request: Operations.GetTokenRequest, server: PlexServers.GetToken?) async throws -> Response {
+ return try await client.makeRequest(
+ with: try server?.server() ?? PlexServers.GetToken.default(),
+ configureRequest: { configuration in
+ try configureGetTokenRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetTokenResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetPinRequest(with configuration: URLRequestConfiguration, request: Operations.GetPinRequest) throws {
+ configuration.path = "/pins"
+ configuration.method = .post
+ configuration.queryParameterSerializable = request
+ configuration.headerParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetTokenRequest(with configuration: URLRequestConfiguration, request: Operations.GetTokenRequest) throws {
+ configuration.path = "/pins/{pinID}"
+ configuration.method = .get
+ configuration.pathParameterSerializable = request
+ configuration.headerParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetPinResponse(response: Client.APIResponse) throws -> Operations.GetPinResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetPinResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetPinPlexResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetTokenResponse(response: Client.APIResponse) throws -> Operations.GetTokenResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ return .empty
+ } else if httpResponse.statusCode == 400 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.GetTokenResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_SearchAPI.swift b/Sources/Plexswift/internal/api/_SearchAPI.swift
new file mode 100644
index 0000000..eae9e2b
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_SearchAPI.swift
@@ -0,0 +1,128 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _SearchAPI: SearchAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func performSearch(request: Operations.PerformSearchRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configurePerformSearchRequest(with: configuration, request: request)
+ },
+ handleResponse: handlePerformSearchResponse
+ )
+ }
+
+ public func performVoiceSearch(request: Operations.PerformVoiceSearchRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configurePerformVoiceSearchRequest(with: configuration, request: request)
+ },
+ handleResponse: handlePerformVoiceSearchResponse
+ )
+ }
+
+ public func getSearchResults(request: Operations.GetSearchResultsRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetSearchResultsRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetSearchResultsResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configurePerformSearchRequest(with configuration: URLRequestConfiguration, request: Operations.PerformSearchRequest) throws {
+ configuration.path = "/hubs/search"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configurePerformVoiceSearchRequest(with configuration: URLRequestConfiguration, request: Operations.PerformVoiceSearchRequest) throws {
+ configuration.path = "/hubs/search/voice"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetSearchResultsRequest(with configuration: URLRequestConfiguration, request: Operations.GetSearchResultsRequest) throws {
+ configuration.path = "/search"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handlePerformSearchResponse(response: Client.APIResponse) throws -> Operations.PerformSearchResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.PerformSearchResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handlePerformVoiceSearchResponse(response: Client.APIResponse) throws -> Operations.PerformVoiceSearchResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.PerformVoiceSearchResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetSearchResultsResponse(response: Client.APIResponse) throws -> Operations.GetSearchResultsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetSearchResultsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetSearchResultsSearchResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_ServerAPI.swift b/Sources/Plexswift/internal/api/_ServerAPI.swift
new file mode 100644
index 0000000..d5d50ac
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_ServerAPI.swift
@@ -0,0 +1,339 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _ServerAPI: ServerAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getServerCapabilities() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetServerCapabilitiesRequest(with: configuration)
+ },
+ handleResponse: handleGetServerCapabilitiesResponse
+ )
+ }
+
+ public func getServerPreferences() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetServerPreferencesRequest(with: configuration)
+ },
+ handleResponse: handleGetServerPreferencesResponse
+ )
+ }
+
+ public func getAvailableClients() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetAvailableClientsRequest(with: configuration)
+ },
+ handleResponse: handleGetAvailableClientsResponse
+ )
+ }
+
+ public func getDevices() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetDevicesRequest(with: configuration)
+ },
+ handleResponse: handleGetDevicesResponse
+ )
+ }
+
+ public func getServerIdentity() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetServerIdentityRequest(with: configuration)
+ },
+ handleResponse: handleGetServerIdentityResponse
+ )
+ }
+
+ public func getMyPlexAccount() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetMyPlexAccountRequest(with: configuration)
+ },
+ handleResponse: handleGetMyPlexAccountResponse
+ )
+ }
+
+ public func getResizedPhoto(request: Operations.GetResizedPhotoRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetResizedPhotoRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetResizedPhotoResponse
+ )
+ }
+
+ public func getServerList() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetServerListRequest(with: configuration)
+ },
+ handleResponse: handleGetServerListResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetServerCapabilitiesRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetServerPreferencesRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/:/prefs"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetAvailableClientsRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/clients"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetDevicesRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/devices"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetServerIdentityRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/identity"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetMyPlexAccountRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/myplex/account"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetResizedPhotoRequest(with configuration: URLRequestConfiguration, request: Operations.GetResizedPhotoRequest) throws {
+ configuration.path = "/photo/:/transcode"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetServerListRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/servers"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetServerCapabilitiesResponse(response: Client.APIResponse) throws -> Operations.GetServerCapabilitiesResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerCapabilitiesResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerCapabilitiesServerResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetServerPreferencesResponse(response: Client.APIResponse) throws -> Operations.GetServerPreferencesResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerPreferencesResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerPreferencesServerResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetAvailableClientsResponse(response: Client.APIResponse) throws -> Operations.GetAvailableClientsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetAvailableClientsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetAvailableClientsServerResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetDevicesResponse(response: Client.APIResponse) throws -> Operations.GetDevicesResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetDevicesResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetDevicesServerResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetServerIdentityResponse(response: Client.APIResponse) throws -> Operations.GetServerIdentityResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerIdentityResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerIdentityServerResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetMyPlexAccountResponse(response: Client.APIResponse) throws -> Operations.GetMyPlexAccountResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetMyPlexAccountResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetMyPlexAccountServerResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetResizedPhotoResponse(response: Client.APIResponse) throws -> Operations.GetResizedPhotoResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.GetResizedPhotoResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetServerListResponse(response: Client.APIResponse) throws -> Operations.GetServerListResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerListResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetServerListServerResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_SessionsAPI.swift b/Sources/Plexswift/internal/api/_SessionsAPI.swift
new file mode 100644
index 0000000..be02cdd
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_SessionsAPI.swift
@@ -0,0 +1,175 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _SessionsAPI: SessionsAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getSessions() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetSessionsRequest(with: configuration)
+ },
+ handleResponse: handleGetSessionsResponse
+ )
+ }
+
+ public func getSessionHistory() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetSessionHistoryRequest(with: configuration)
+ },
+ handleResponse: handleGetSessionHistoryResponse
+ )
+ }
+
+ public func getTranscodeSessions() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetTranscodeSessionsRequest(with: configuration)
+ },
+ handleResponse: handleGetTranscodeSessionsResponse
+ )
+ }
+
+ public func stopTranscodeSession(request: Operations.StopTranscodeSessionRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureStopTranscodeSessionRequest(with: configuration, request: request)
+ },
+ handleResponse: handleStopTranscodeSessionResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetSessionsRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/status/sessions"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetSessionHistoryRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/status/sessions/history/all"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureGetTranscodeSessionsRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/transcode/sessions"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureStopTranscodeSessionRequest(with configuration: URLRequestConfiguration, request: Operations.StopTranscodeSessionRequest) throws {
+ configuration.path = "/transcode/sessions/{sessionKey}"
+ configuration.method = .delete
+ configuration.pathParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetSessionsResponse(response: Client.APIResponse) throws -> Operations.GetSessionsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetSessionsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetSessionsSessionsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetSessionHistoryResponse(response: Client.APIResponse) throws -> Operations.GetSessionHistoryResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetSessionHistoryResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetSessionHistorySessionsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleGetTranscodeSessionsResponse(response: Client.APIResponse) throws -> Operations.GetTranscodeSessionsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetTranscodeSessionsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetTranscodeSessionsSessionsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleStopTranscodeSessionResponse(response: Client.APIResponse) throws -> Operations.StopTranscodeSessionResponse {
+ let httpResponse = response.httpResponse
+
+ if [204, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.StopTranscodeSessionResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_StatisticsAPI.swift b/Sources/Plexswift/internal/api/_StatisticsAPI.swift
new file mode 100644
index 0000000..d3280bb
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_StatisticsAPI.swift
@@ -0,0 +1,60 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _StatisticsAPI: StatisticsAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getStatistics(request: Operations.GetStatisticsRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetStatisticsRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetStatisticsResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetStatisticsRequest(with configuration: URLRequestConfiguration, request: Operations.GetStatisticsRequest) throws {
+ configuration.path = "/statistics/media"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetStatisticsResponse(response: Client.APIResponse) throws -> Operations.GetStatisticsResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetStatisticsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetStatisticsStatisticsResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_UpdaterAPI.swift b/Sources/Plexswift/internal/api/_UpdaterAPI.swift
new file mode 100644
index 0000000..e28bc06
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_UpdaterAPI.swift
@@ -0,0 +1,127 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _UpdaterAPI: UpdaterAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getUpdateStatus() async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetUpdateStatusRequest(with: configuration)
+ },
+ handleResponse: handleGetUpdateStatusResponse
+ )
+ }
+
+ public func checkForUpdates(request: Operations.CheckForUpdatesRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureCheckForUpdatesRequest(with: configuration, request: request)
+ },
+ handleResponse: handleCheckForUpdatesResponse
+ )
+ }
+
+ public func applyUpdates(request: Operations.ApplyUpdatesRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureApplyUpdatesRequest(with: configuration, request: request)
+ },
+ handleResponse: handleApplyUpdatesResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetUpdateStatusRequest(with configuration: URLRequestConfiguration) throws {
+ configuration.path = "/updater/status"
+ configuration.method = .get
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureCheckForUpdatesRequest(with configuration: URLRequestConfiguration, request: Operations.CheckForUpdatesRequest) throws {
+ configuration.path = "/updater/check"
+ configuration.method = .put
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureApplyUpdatesRequest(with configuration: URLRequestConfiguration, request: Operations.ApplyUpdatesRequest) throws {
+ configuration.path = "/updater/apply"
+ configuration.method = .put
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetUpdateStatusResponse(response: Client.APIResponse) throws -> Operations.GetUpdateStatusResponse {
+ let httpResponse = response.httpResponse
+
+ if httpResponse.statusCode == 200 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .twoHundredApplicationJsonObject(try JSONDecoder().decode(Operations.GetUpdateStatusResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ } else if httpResponse.statusCode == 400 {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .fourHundredAndOneApplicationJsonObject(try JSONDecoder().decode(Operations.GetUpdateStatusUpdaterResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleCheckForUpdatesResponse(response: Client.APIResponse) throws -> Operations.CheckForUpdatesResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.CheckForUpdatesResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleApplyUpdatesResponse(response: Client.APIResponse) throws -> Operations.ApplyUpdatesResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400, 500].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.ApplyUpdatesResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/api/_VideoAPI.swift b/Sources/Plexswift/internal/api/_VideoAPI.swift
new file mode 100644
index 0000000..3767b60
--- /dev/null
+++ b/Sources/Plexswift/internal/api/_VideoAPI.swift
@@ -0,0 +1,86 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+class _VideoAPI: VideoAPI {
+ private let client: Client
+
+ init(client: Client) {
+ self.client = client
+ }
+
+ public func getTimeline(request: Operations.GetTimelineRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureGetTimelineRequest(with: configuration, request: request)
+ },
+ handleResponse: handleGetTimelineResponse
+ )
+ }
+
+ public func startUniversalTranscode(request: Operations.StartUniversalTranscodeRequest) async throws -> Response {
+ return try await client.makeRequest(
+ configureRequest: { configuration in
+ try configureStartUniversalTranscodeRequest(with: configuration, request: request)
+ },
+ handleResponse: handleStartUniversalTranscodeResponse
+ )
+ }
+
+}
+
+// MARK: - Request Configuration
+
+private func configureGetTimelineRequest(with configuration: URLRequestConfiguration, request: Operations.GetTimelineRequest) throws {
+ configuration.path = "/:/timeline"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+private func configureStartUniversalTranscodeRequest(with configuration: URLRequestConfiguration, request: Operations.StartUniversalTranscodeRequest) throws {
+ configuration.path = "/video/:/transcode/universal/start.mpd"
+ configuration.method = .get
+ configuration.queryParameterSerializable = request
+ configuration.telemetryHeader = .userAgent
+}
+
+// MARK: - Response Handlers
+
+private func handleGetTimelineResponse(response: Client.APIResponse) throws -> Operations.GetTimelineResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.GetTimelineResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
+private func handleStartUniversalTranscodeResponse(response: Client.APIResponse) throws -> Operations.StartUniversalTranscodeResponse {
+ let httpResponse = response.httpResponse
+
+ if [200, 400].contains(httpResponse.statusCode) {
+ return .empty
+ } else if httpResponse.statusCode == 401 {
+ if httpResponse.contentType.matchContentType(pattern: "application/json"), let data = response.data {
+ do {
+ return .object(try JSONDecoder().decode(Operations.StartUniversalTranscodeResponseBody.self, from: data))
+ } catch {
+ throw ResponseHandlerError.failedToDecodeJSON(error)
+ }
+ }
+ }
+
+ return .empty
+}
+
diff --git a/Sources/Plexswift/internal/models/AddPlaylistContentsRequest+Serialization.swift b/Sources/Plexswift/internal/models/AddPlaylistContentsRequest+Serialization.swift
new file mode 100644
index 0000000..a688a4c
--- /dev/null
+++ b/Sources/Plexswift/internal/models/AddPlaylistContentsRequest+Serialization.swift
@@ -0,0 +1,40 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.AddPlaylistContentsRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.AddPlaylistContentsRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.AddPlaylistContentsRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "playlistID": try playlistIDWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
+
+extension Operations.AddPlaylistContentsRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: uri, named: "uri", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ if playQueueID != nil {
+ try builder.addQueryParameters(from: playQueueIDWrapper, named: "playQueueID", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/ApplyUpdatesRequest+Serialization.swift b/Sources/Plexswift/internal/models/ApplyUpdatesRequest+Serialization.swift
new file mode 100644
index 0000000..59f37ca
--- /dev/null
+++ b/Sources/Plexswift/internal/models/ApplyUpdatesRequest+Serialization.swift
@@ -0,0 +1,28 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.ApplyUpdatesRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.ApplyUpdatesRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.ApplyUpdatesRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: skip, named: "skip", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: tonight, named: "tonight", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/CancelServerActivitiesRequest+Serialization.swift b/Sources/Plexswift/internal/models/CancelServerActivitiesRequest+Serialization.swift
new file mode 100644
index 0000000..80583e8
--- /dev/null
+++ b/Sources/Plexswift/internal/models/CancelServerActivitiesRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.CancelServerActivitiesRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.CancelServerActivitiesRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.CancelServerActivitiesRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "activityUUID": try activityUUID.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/CheckForUpdatesRequest+Serialization.swift b/Sources/Plexswift/internal/models/CheckForUpdatesRequest+Serialization.swift
new file mode 100644
index 0000000..98e2399
--- /dev/null
+++ b/Sources/Plexswift/internal/models/CheckForUpdatesRequest+Serialization.swift
@@ -0,0 +1,27 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.CheckForUpdatesRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.CheckForUpdatesRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.CheckForUpdatesRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: download, named: "download", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/ClearPlaylistContentsRequest+Serialization.swift b/Sources/Plexswift/internal/models/ClearPlaylistContentsRequest+Serialization.swift
new file mode 100644
index 0000000..b24200c
--- /dev/null
+++ b/Sources/Plexswift/internal/models/ClearPlaylistContentsRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.ClearPlaylistContentsRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.ClearPlaylistContentsRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.ClearPlaylistContentsRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "playlistID": try playlistIDWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/CreatePlaylistRequest+Serialization.swift b/Sources/Plexswift/internal/models/CreatePlaylistRequest+Serialization.swift
new file mode 100644
index 0000000..8998ec4
--- /dev/null
+++ b/Sources/Plexswift/internal/models/CreatePlaylistRequest+Serialization.swift
@@ -0,0 +1,33 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.CreatePlaylistRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.CreatePlaylistRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.CreatePlaylistRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: smart, named: "smart", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: title, named: "title", 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: uri, named: "uri", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ if playQueueID != nil {
+ try builder.addQueryParameters(from: playQueueIDWrapper, named: "playQueueID", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/DeleteLibraryRequest+Serialization.swift b/Sources/Plexswift/internal/models/DeleteLibraryRequest+Serialization.swift
new file mode 100644
index 0000000..72e36cf
--- /dev/null
+++ b/Sources/Plexswift/internal/models/DeleteLibraryRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.DeleteLibraryRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.DeleteLibraryRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.DeleteLibraryRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "sectionId": try sectionIdWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/DeletePlaylistRequest+Serialization.swift b/Sources/Plexswift/internal/models/DeletePlaylistRequest+Serialization.swift
new file mode 100644
index 0000000..f929fb4
--- /dev/null
+++ b/Sources/Plexswift/internal/models/DeletePlaylistRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.DeletePlaylistRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.DeletePlaylistRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.DeletePlaylistRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "playlistID": try playlistIDWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/Download+Serialization.swift b/Sources/Plexswift/internal/models/Download+Serialization.swift
new file mode 100644
index 0000000..520fbe0
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Download+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.Download: 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/Force+Serialization.swift b/Sources/Plexswift/internal/models/Force+Serialization.swift
new file mode 100644
index 0000000..de5913f
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Force+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.Force: 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/GetFileHashRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetFileHashRequest+Serialization.swift
new file mode 100644
index 0000000..44b6905
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetFileHashRequest+Serialization.swift
@@ -0,0 +1,30 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetFileHashRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetFileHashRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetFileHashRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: url, named: "url", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ if type != nil {
+ try builder.addQueryParameters(from: typeWrapper, named: "type", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetGlobalHubsRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetGlobalHubsRequest+Serialization.swift
new file mode 100644
index 0000000..d5184d0
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetGlobalHubsRequest+Serialization.swift
@@ -0,0 +1,30 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetGlobalHubsRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetGlobalHubsRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetGlobalHubsRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ if count != nil {
+ try builder.addQueryParameters(from: countWrapper, named: "count", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ try builder.addQueryParameters(from: onlyTransient, named: "onlyTransient", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetLibraryHubsRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetLibraryHubsRequest+Serialization.swift
new file mode 100644
index 0000000..03a1427
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetLibraryHubsRequest+Serialization.swift
@@ -0,0 +1,40 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetLibraryHubsRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetLibraryHubsRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetLibraryHubsRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "sectionId": try sectionIdWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
+
+extension Operations.GetLibraryHubsRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ if count != nil {
+ try builder.addQueryParameters(from: countWrapper, named: "count", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ try builder.addQueryParameters(from: onlyTransient, named: "onlyTransient", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift
new file mode 100644
index 0000000..e4f8837
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetLibraryItemsRequest+Serialization.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetLibraryItemsRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetLibraryItemsRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.GetLibraryItemsRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "sectionId": try sectionId.serialize(with: formatOverride ?? .path(explode: false)),
+ "tag": try tag.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetLibraryRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetLibraryRequest+Serialization.swift
new file mode 100644
index 0000000..5c59ca0
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetLibraryRequest+Serialization.swift
@@ -0,0 +1,37 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetLibraryRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetLibraryRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetLibraryRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "sectionId": try sectionIdWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
+
+extension Operations.GetLibraryRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: includeDetails, named: "includeDetails", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetMetadataChildrenRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetMetadataChildrenRequest+Serialization.swift
new file mode 100644
index 0000000..d0d8004
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetMetadataChildrenRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetMetadataChildrenRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetMetadataChildrenRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.GetMetadataChildrenRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "ratingKey": try ratingKeyWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetMetadataRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetMetadataRequest+Serialization.swift
new file mode 100644
index 0000000..7bd9b36
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetMetadataRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetMetadataRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetMetadataRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.GetMetadataRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "ratingKey": try ratingKeyWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetPinRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetPinRequest+Serialization.swift
new file mode 100644
index 0000000..c8917ba
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetPinRequest+Serialization.swift
@@ -0,0 +1,37 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetPinRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .header:
+ return serializeModel(with: try serializedHeaderParameters(), format: format)
+ case .path, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetPinRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetPinRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: strong, named: "strong", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
+
+extension Operations.GetPinRequest: HeaderParameterSerializable {
+ func serializedHeaderParameters() throws -> [SerializedParameter] {
+ return [
+ SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try xPlexClientIdentifier.serialize(with: .header(explode: false)))
+ ]
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetPlaylistContentsRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetPlaylistContentsRequest+Serialization.swift
new file mode 100644
index 0000000..9c7f2fa
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetPlaylistContentsRequest+Serialization.swift
@@ -0,0 +1,37 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetPlaylistContentsRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetPlaylistContentsRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetPlaylistContentsRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "playlistID": try playlistIDWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
+
+extension Operations.GetPlaylistContentsRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: typeWrapper, named: "type", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetPlaylistRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetPlaylistRequest+Serialization.swift
new file mode 100644
index 0000000..5d87638
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetPlaylistRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetPlaylistRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetPlaylistRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.GetPlaylistRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "playlistID": try playlistIDWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetPlaylistsRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetPlaylistsRequest+Serialization.swift
new file mode 100644
index 0000000..e3669a7
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetPlaylistsRequest+Serialization.swift
@@ -0,0 +1,28 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetPlaylistsRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetPlaylistsRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetPlaylistsRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: playlistType, named: "playlistType", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: smart, named: "smart", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetResizedPhotoRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetResizedPhotoRequest+Serialization.swift
new file mode 100644
index 0000000..a5c1f1f
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetResizedPhotoRequest+Serialization.swift
@@ -0,0 +1,33 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetResizedPhotoRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetResizedPhotoRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetResizedPhotoRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: blurWrapper, named: "blur", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: heightWrapper, named: "height", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: minSize, named: "minSize", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: opacity, named: "opacity", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: upscale, named: "upscale", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: url, named: "url", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: widthWrapper, named: "width", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetSearchResultsRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetSearchResultsRequest+Serialization.swift
new file mode 100644
index 0000000..36926c9
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetSearchResultsRequest+Serialization.swift
@@ -0,0 +1,27 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetSearchResultsRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetSearchResultsRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetSearchResultsRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: query, named: "query", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetSourceConnectionInformationRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetSourceConnectionInformationRequest+Serialization.swift
new file mode 100644
index 0000000..2e58a04
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetSourceConnectionInformationRequest+Serialization.swift
@@ -0,0 +1,27 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetSourceConnectionInformationRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetSourceConnectionInformationRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetSourceConnectionInformationRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: source, named: "source", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetStatisticsRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetStatisticsRequest+Serialization.swift
new file mode 100644
index 0000000..13cfc64
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetStatisticsRequest+Serialization.swift
@@ -0,0 +1,27 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetStatisticsRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetStatisticsRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetStatisticsRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: timespan, named: "Timespan", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetTimelineRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetTimelineRequest+Serialization.swift
new file mode 100644
index 0000000..3558d05
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetTimelineRequest+Serialization.swift
@@ -0,0 +1,36 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetTimelineRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetTimelineRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetTimelineRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: context, named: "context", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: durationWrapper, named: "duration", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: hasMDEWrapper, named: "hasMDE", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: key, named: "key", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: playBackTimeWrapper, named: "playBackTime", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: playQueueItemIDWrapper, named: "playQueueItemID", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: ratingKeyWrapper, named: "ratingKey", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: rowWrapper, named: "row", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: state, named: "state", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: timeWrapper, named: "time", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetTokenRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetTokenRequest+Serialization.swift
new file mode 100644
index 0000000..11eb05d
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetTokenRequest+Serialization.swift
@@ -0,0 +1,33 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetTokenRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .header:
+ return serializeModel(with: try serializedHeaderParameters(), format: format)
+ case .query, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetTokenRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.GetTokenRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "pinID": try pinID.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
+
+extension Operations.GetTokenRequest: HeaderParameterSerializable {
+ func serializedHeaderParameters() throws -> [SerializedParameter] {
+ return [
+ SerializedParameter(name: "X-Plex-Client-Identifier", serialized: try xPlexClientIdentifier.serialize(with: .header(explode: false)))
+ ]
+ }
+}
diff --git a/Sources/Plexswift/internal/models/GetTransientTokenQueryParamType+Serialization.swift b/Sources/Plexswift/internal/models/GetTransientTokenQueryParamType+Serialization.swift
new file mode 100644
index 0000000..83fae08
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetTransientTokenQueryParamType+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetTransientTokenQueryParamType: 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/GetTransientTokenRequest+Serialization.swift b/Sources/Plexswift/internal/models/GetTransientTokenRequest+Serialization.swift
new file mode 100644
index 0000000..29ca8cd
--- /dev/null
+++ b/Sources/Plexswift/internal/models/GetTransientTokenRequest+Serialization.swift
@@ -0,0 +1,28 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.GetTransientTokenRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.GetTransientTokenRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.GetTransientTokenRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: scope, named: "scope", 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)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/IncludeDetails+Serialization.swift b/Sources/Plexswift/internal/models/IncludeDetails+Serialization.swift
new file mode 100644
index 0000000..47565cb
--- /dev/null
+++ b/Sources/Plexswift/internal/models/IncludeDetails+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.IncludeDetails: 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/Level+Serialization.swift b/Sources/Plexswift/internal/models/Level+Serialization.swift
new file mode 100644
index 0000000..3d8ca8c
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Level+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.Level: 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/LogLineRequest+Serialization.swift b/Sources/Plexswift/internal/models/LogLineRequest+Serialization.swift
new file mode 100644
index 0000000..ad1ee47
--- /dev/null
+++ b/Sources/Plexswift/internal/models/LogLineRequest+Serialization.swift
@@ -0,0 +1,29 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.LogLineRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.LogLineRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.LogLineRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: level, named: "level", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: message, named: "message", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: source, named: "source", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/MarkPlayedRequest+Serialization.swift b/Sources/Plexswift/internal/models/MarkPlayedRequest+Serialization.swift
new file mode 100644
index 0000000..d62a7d2
--- /dev/null
+++ b/Sources/Plexswift/internal/models/MarkPlayedRequest+Serialization.swift
@@ -0,0 +1,27 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.MarkPlayedRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.MarkPlayedRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.MarkPlayedRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: keyWrapper, named: "key", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/MarkUnplayedRequest+Serialization.swift b/Sources/Plexswift/internal/models/MarkUnplayedRequest+Serialization.swift
new file mode 100644
index 0000000..058d0ab
--- /dev/null
+++ b/Sources/Plexswift/internal/models/MarkUnplayedRequest+Serialization.swift
@@ -0,0 +1,27 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.MarkUnplayedRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.MarkUnplayedRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.MarkUnplayedRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: keyWrapper, named: "key", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/MinSize+Serialization.swift b/Sources/Plexswift/internal/models/MinSize+Serialization.swift
new file mode 100644
index 0000000..5fbfa07
--- /dev/null
+++ b/Sources/Plexswift/internal/models/MinSize+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.MinSize: 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/OnlyTransient+Serialization.swift b/Sources/Plexswift/internal/models/OnlyTransient+Serialization.swift
new file mode 100644
index 0000000..b2e3a6d
--- /dev/null
+++ b/Sources/Plexswift/internal/models/OnlyTransient+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.OnlyTransient: 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/PathParamTaskName+Serialization.swift b/Sources/Plexswift/internal/models/PathParamTaskName+Serialization.swift
new file mode 100644
index 0000000..58a0fe4
--- /dev/null
+++ b/Sources/Plexswift/internal/models/PathParamTaskName+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.PathParamTaskName: 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/PerformSearchRequest+Serialization.swift b/Sources/Plexswift/internal/models/PerformSearchRequest+Serialization.swift
new file mode 100644
index 0000000..776412e
--- /dev/null
+++ b/Sources/Plexswift/internal/models/PerformSearchRequest+Serialization.swift
@@ -0,0 +1,33 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.PerformSearchRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.PerformSearchRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.PerformSearchRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: query, named: "query", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ if limit != nil {
+ try builder.addQueryParameters(from: limitWrapper, named: "limit", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ if sectionId != nil {
+ try builder.addQueryParameters(from: sectionIdWrapper, named: "sectionId", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/PerformVoiceSearchRequest+Serialization.swift b/Sources/Plexswift/internal/models/PerformVoiceSearchRequest+Serialization.swift
new file mode 100644
index 0000000..3572928
--- /dev/null
+++ b/Sources/Plexswift/internal/models/PerformVoiceSearchRequest+Serialization.swift
@@ -0,0 +1,33 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.PerformVoiceSearchRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.PerformVoiceSearchRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.PerformVoiceSearchRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: query, named: "query", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ if limit != nil {
+ try builder.addQueryParameters(from: limitWrapper, named: "limit", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ if sectionId != nil {
+ try builder.addQueryParameters(from: sectionIdWrapper, named: "sectionId", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/PlaylistType+Serialization.swift b/Sources/Plexswift/internal/models/PlaylistType+Serialization.swift
new file mode 100644
index 0000000..73ba482
--- /dev/null
+++ b/Sources/Plexswift/internal/models/PlaylistType+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.PlaylistType: 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/QueryParamOnlyTransient+Serialization.swift b/Sources/Plexswift/internal/models/QueryParamOnlyTransient+Serialization.swift
new file mode 100644
index 0000000..19d0840
--- /dev/null
+++ b/Sources/Plexswift/internal/models/QueryParamOnlyTransient+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.QueryParamOnlyTransient: 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/QueryParamSmart+Serialization.swift b/Sources/Plexswift/internal/models/QueryParamSmart+Serialization.swift
new file mode 100644
index 0000000..fd65c5c
--- /dev/null
+++ b/Sources/Plexswift/internal/models/QueryParamSmart+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.QueryParamSmart: 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/QueryParamType+Serialization.swift b/Sources/Plexswift/internal/models/QueryParamType+Serialization.swift
new file mode 100644
index 0000000..b5fbf4c
--- /dev/null
+++ b/Sources/Plexswift/internal/models/QueryParamType+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.QueryParamType: 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/RefreshLibraryRequest+Serialization.swift b/Sources/Plexswift/internal/models/RefreshLibraryRequest+Serialization.swift
new file mode 100644
index 0000000..9d1a0de
--- /dev/null
+++ b/Sources/Plexswift/internal/models/RefreshLibraryRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.RefreshLibraryRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.RefreshLibraryRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.RefreshLibraryRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "sectionId": try sectionIdWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/Scope+Serialization.swift b/Sources/Plexswift/internal/models/Scope+Serialization.swift
new file mode 100644
index 0000000..97d3d18
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Scope+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.Scope: 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/SearchLibraryRequest+Serialization.swift b/Sources/Plexswift/internal/models/SearchLibraryRequest+Serialization.swift
new file mode 100644
index 0000000..ce7e5b5
--- /dev/null
+++ b/Sources/Plexswift/internal/models/SearchLibraryRequest+Serialization.swift
@@ -0,0 +1,37 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.SearchLibraryRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.SearchLibraryRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.SearchLibraryRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "sectionId": try sectionId.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
+
+extension Operations.SearchLibraryRequest: 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)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/Security+Serialization.swift b/Sources/Plexswift/internal/models/Security+Serialization.swift
new file mode 100644
index 0000000..432a3e3
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Security+Serialization.swift
@@ -0,0 +1,13 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Shared.Security: SecurityParameterProviding {
+ func securityParameters() -> [SecurityParameter] {
+ switch self {
+ case .accessToken(let value):
+ return [.apiKey(name: "X-Plex-Token", value: value)]
+ }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/Skip+Serialization.swift b/Sources/Plexswift/internal/models/Skip+Serialization.swift
new file mode 100644
index 0000000..908f34b
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Skip+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.Skip: 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/Smart+Serialization.swift b/Sources/Plexswift/internal/models/Smart+Serialization.swift
new file mode 100644
index 0000000..fc08986
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Smart+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.Smart: 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/StartTaskRequest+Serialization.swift b/Sources/Plexswift/internal/models/StartTaskRequest+Serialization.swift
new file mode 100644
index 0000000..6d73658
--- /dev/null
+++ b/Sources/Plexswift/internal/models/StartTaskRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.StartTaskRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.StartTaskRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.StartTaskRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "taskName": try taskName.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/StartUniversalTranscodeRequest+Serialization.swift b/Sources/Plexswift/internal/models/StartUniversalTranscodeRequest+Serialization.swift
new file mode 100644
index 0000000..4e05cf8
--- /dev/null
+++ b/Sources/Plexswift/internal/models/StartUniversalTranscodeRequest+Serialization.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.StartUniversalTranscodeRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.StartUniversalTranscodeRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.StartUniversalTranscodeRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: hasMDEWrapper, named: "hasMDE", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: mediaIndexWrapper, named: "mediaIndex", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: partIndexWrapper, named: "partIndex", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: path, named: "path", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: `protocol`, named: "protocol", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ if addDebugOverlay != nil {
+ try builder.addQueryParameters(from: addDebugOverlayWrapper, named: "addDebugOverlay", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ if audioBoost != nil {
+ try builder.addQueryParameters(from: audioBoostWrapper, named: "audioBoost", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ if autoAdjustQuality != nil {
+ try builder.addQueryParameters(from: autoAdjustQualityWrapper, named: "autoAdjustQuality", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ if directPlay != nil {
+ try builder.addQueryParameters(from: directPlayWrapper, named: "directPlay", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ if directStream != nil {
+ try builder.addQueryParameters(from: directStreamWrapper, named: "directStream", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ if fastSeek != nil {
+ try builder.addQueryParameters(from: fastSeekWrapper, named: "fastSeek", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ try builder.addQueryParameters(from: location, named: "location", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ if mediaBufferSize != nil {
+ try builder.addQueryParameters(from: mediaBufferSizeWrapper, named: "mediaBufferSize", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ try builder.addQueryParameters(from: session, named: "session", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: subtites, named: "subtites", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ if subtitleSize != nil {
+ try builder.addQueryParameters(from: subtitleSizeWrapper, named: "subtitleSize", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ }
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/State+Serialization.swift b/Sources/Plexswift/internal/models/State+Serialization.swift
new file mode 100644
index 0000000..193eab7
--- /dev/null
+++ b/Sources/Plexswift/internal/models/State+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.State: 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/StopTaskRequest+Serialization.swift b/Sources/Plexswift/internal/models/StopTaskRequest+Serialization.swift
new file mode 100644
index 0000000..22d098e
--- /dev/null
+++ b/Sources/Plexswift/internal/models/StopTaskRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.StopTaskRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.StopTaskRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.StopTaskRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "taskName": try taskName.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/StopTranscodeSessionRequest+Serialization.swift b/Sources/Plexswift/internal/models/StopTranscodeSessionRequest+Serialization.swift
new file mode 100644
index 0000000..14d3e65
--- /dev/null
+++ b/Sources/Plexswift/internal/models/StopTranscodeSessionRequest+Serialization.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.StopTranscodeSessionRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.StopTranscodeSessionRequest", format: format.formatDescription)
+ }
+ }
+}
+
+extension Operations.StopTranscodeSessionRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "sessionKey": try sessionKey.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
diff --git a/Sources/Plexswift/internal/models/Tag+Serialization.swift b/Sources/Plexswift/internal/models/Tag+Serialization.swift
new file mode 100644
index 0000000..eb04237
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Tag+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.Tag: 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/TaskName+Serialization.swift b/Sources/Plexswift/internal/models/TaskName+Serialization.swift
new file mode 100644
index 0000000..e191cdc
--- /dev/null
+++ b/Sources/Plexswift/internal/models/TaskName+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.TaskName: 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/Tonight+Serialization.swift b/Sources/Plexswift/internal/models/Tonight+Serialization.swift
new file mode 100644
index 0000000..446dbd6
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Tonight+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.Tonight: 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/TypeModel+Serialization.swift b/Sources/Plexswift/internal/models/TypeModel+Serialization.swift
new file mode 100644
index 0000000..ee1f54d
--- /dev/null
+++ b/Sources/Plexswift/internal/models/TypeModel+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.TypeModel: 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/UpdatePlayProgressRequest+Serialization.swift b/Sources/Plexswift/internal/models/UpdatePlayProgressRequest+Serialization.swift
new file mode 100644
index 0000000..2c0eff0
--- /dev/null
+++ b/Sources/Plexswift/internal/models/UpdatePlayProgressRequest+Serialization.swift
@@ -0,0 +1,29 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.UpdatePlayProgressRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.UpdatePlayProgressRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.UpdatePlayProgressRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: key, named: "key", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: state, named: "state", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: timeWrapper, named: "time", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/UpdatePlaylistRequest+Serialization.swift b/Sources/Plexswift/internal/models/UpdatePlaylistRequest+Serialization.swift
new file mode 100644
index 0000000..cd1c7ff
--- /dev/null
+++ b/Sources/Plexswift/internal/models/UpdatePlaylistRequest+Serialization.swift
@@ -0,0 +1,38 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.UpdatePlaylistRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .path:
+ return try serializePathParameterSerializable(self, with: format)
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.UpdatePlaylistRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.UpdatePlaylistRequest: PathParameterSerializable {
+ func serializedPathParameters(formatOverride: SerializableFormat?) throws -> [String: String] {
+ return [
+ "playlistID": try playlistIDWrapper.serialize(with: formatOverride ?? .path(explode: false)),
+ ].compactMapValues { $0 }
+ }
+}
+
+extension Operations.UpdatePlaylistRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: summary, named: "summary", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: title, named: "title", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/UploadPlaylistRequest+Serialization.swift b/Sources/Plexswift/internal/models/UploadPlaylistRequest+Serialization.swift
new file mode 100644
index 0000000..143439a
--- /dev/null
+++ b/Sources/Plexswift/internal/models/UploadPlaylistRequest+Serialization.swift
@@ -0,0 +1,28 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.UploadPlaylistRequest: Serializable {
+ func serialize(with format: SerializableFormat) throws -> String {
+ switch format {
+ case .query:
+ return try serializeQueryParameterSerializable(self, with: format)
+ case .path, .header, .multipart, .form:
+ throw SerializationError.invalidSerializationParameter(type: "Operations.UploadPlaylistRequest", format: format.formatDescription)
+ }
+ }
+
+ func serializeQueryParameters(with format: SerializableFormat) throws -> [QueryParameter] {
+ return try serializedQueryParameters(with: nil, formatOverride: format)
+ }
+}
+
+extension Operations.UploadPlaylistRequest: QueryParameterSerializable {
+ func serializedQueryParameters(with parameterDefaults: ParameterDefaults?, formatOverride: SerializableFormat?) throws -> [QueryParameter] {
+ let builder = QueryParameterBuilder()
+ try builder.addQueryParameters(from: force, named: "force", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ try builder.addQueryParameters(from: path, named: "path", format: formatOverride ?? .query(style: .form, explode: true), parameterDefaults: parameterDefaults)
+ return builder.build()
+ }
+}
diff --git a/Sources/Plexswift/internal/models/Upscale+Serialization.swift b/Sources/Plexswift/internal/models/Upscale+Serialization.swift
new file mode 100644
index 0000000..b3da9c1
--- /dev/null
+++ b/Sources/Plexswift/internal/models/Upscale+Serialization.swift
@@ -0,0 +1,14 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+
+import Foundation
+
+extension Operations.Upscale: 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/ModelScopes.swift b/Sources/Plexswift/models/ModelScopes.swift
new file mode 100644
index 0000000..17a84a2
--- /dev/null
+++ b/Sources/Plexswift/models/ModelScopes.swift
@@ -0,0 +1,13 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+/// Top-level type used for grouping operations models
+///
+/// > Note: You do not need to interact with this type directly.
+public enum Operations {}
+
+/// Top-level type used for grouping shared models
+///
+/// > Note: You do not need to interact with this type directly.
+public enum Shared {}
diff --git a/Sources/Plexswift/models/operations/Account.swift b/Sources/Plexswift/models/operations/Account.swift
new file mode 100644
index 0000000..98cd01c
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Account.swift
@@ -0,0 +1,45 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Account {
+ public let autoSelectAudio: Bool?
+ public let defaultAudioLanguage: String?
+ public let defaultSubtitleLanguage: String?
+ public let id: Int?
+ public let key: String?
+ public let name: String?
+ public let subtitleMode: Int?
+ public let thumb: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(autoSelectAudio: Bool? = nil, defaultAudioLanguage: String? = nil, defaultSubtitleLanguage: String? = nil, id: Int? = nil, key: String? = nil, name: String? = nil, subtitleMode: Int? = nil, thumb: String? = nil) {
+ self.autoSelectAudio = autoSelectAudio
+ self.defaultAudioLanguage = defaultAudioLanguage
+ self.defaultSubtitleLanguage = defaultSubtitleLanguage
+ self.id = id
+ self.key = key
+ self.name = name
+ self.subtitleMode = subtitleMode
+ self.thumb = thumb
+ }
+ }
+}
+
+extension Operations.Account: Codable {
+ enum CodingKeys: String, CodingKey {
+ case autoSelectAudio
+ case defaultAudioLanguage
+ case defaultSubtitleLanguage
+ case id
+ case key
+ case name
+ case subtitleMode
+ case thumb
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/Activity.swift b/Sources/Plexswift/models/operations/Activity.swift
new file mode 100644
index 0000000..32ef466
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Activity.swift
@@ -0,0 +1,83 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Activity {
+ public let cancellable: Bool?
+ public let context: Operations.Context?
+ @DecimalSerialized
+ public private(set) var progress: Double?
+ public let subtitle: String?
+ public let title: String?
+ public let type: String?
+ @DecimalSerialized
+ public private(set) var userID: Double?
+ public let uuid: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(cancellable: Bool? = nil, context: Operations.Context? = nil, progress: Double? = nil, subtitle: String? = nil, title: String? = nil, type: String? = nil, userID: Double? = nil, uuid: String? = nil) {
+ self.cancellable = cancellable
+ self.context = context
+ self._progress = DecimalSerialized(wrappedValue: progress)
+ self.subtitle = subtitle
+ self.title = title
+ self.type = type
+ self._userID = DecimalSerialized(wrappedValue: userID)
+ self.uuid = uuid
+ }
+ }
+}
+
+extension Operations.Activity: Codable {
+ enum CodingKeys: String, CodingKey {
+ case cancellable
+ case context = "Context"
+ case progress
+ case subtitle
+ case title
+ case type
+ case userID
+ case uuid
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self.cancellable = try container.decodeIfPresent(Bool.self, forKey: .cancellable)
+ self.context = try container.decodeIfPresent(Operations.Context.self, forKey: .context)
+ self._progress = try container.decodeIfPresent(DecimalSerialized.self, forKey: .progress) ?? DecimalSerialized(wrappedValue: nil)
+ self.subtitle = try container.decodeIfPresent(String.self, forKey: .subtitle)
+ self.title = try container.decodeIfPresent(String.self, forKey: .title)
+ self.type = try container.decodeIfPresent(String.self, forKey: .type)
+ self._userID = try container.decodeIfPresent(DecimalSerialized.self, forKey: .userID) ?? DecimalSerialized(wrappedValue: nil)
+ self.uuid = try container.decodeIfPresent(String.self, forKey: .uuid)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ try container.encodeIfPresent(self.cancellable, forKey: .cancellable)
+ try container.encodeIfPresent(self.context, forKey: .context)
+ if self.progress != nil {
+ try container.encode(self._progress, forKey: .progress)
+ }
+ try container.encodeIfPresent(self.subtitle, forKey: .subtitle)
+ try container.encodeIfPresent(self.title, forKey: .title)
+ try container.encodeIfPresent(self.type, forKey: .type)
+ if self.userID != nil {
+ try container.encode(self._userID, forKey: .userID)
+ }
+ try container.encodeIfPresent(self.uuid, forKey: .uuid)
+ }
+}
+
+extension Operations.Activity {
+ var userIDWrapper: DecimalSerialized {
+ return _userID
+ }
+ var progressWrapper: DecimalSerialized {
+ return _progress
+ }
+}
diff --git a/Sources/Plexswift/models/operations/AddPlaylistContentsErrors.swift b/Sources/Plexswift/models/operations/AddPlaylistContentsErrors.swift
new file mode 100644
index 0000000..6193c4c
--- /dev/null
+++ b/Sources/Plexswift/models/operations/AddPlaylistContentsErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct AddPlaylistContentsErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.AddPlaylistContentsErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.AddPlaylistContentsErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/AddPlaylistContentsMediaContainer.swift b/Sources/Plexswift/models/operations/AddPlaylistContentsMediaContainer.swift
new file mode 100644
index 0000000..36e0a74
--- /dev/null
+++ b/Sources/Plexswift/models/operations/AddPlaylistContentsMediaContainer.swift
@@ -0,0 +1,33 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct AddPlaylistContentsMediaContainer {
+ public let leafCountAdded: Int?
+ public let leafCountRequested: Int?
+ public let metadata: [Operations.AddPlaylistContentsMetadata]?
+ public let size: Int?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(leafCountAdded: Int? = nil, leafCountRequested: Int? = nil, metadata: [Operations.AddPlaylistContentsMetadata]? = nil, size: Int? = nil) {
+ self.leafCountAdded = leafCountAdded
+ self.leafCountRequested = leafCountRequested
+ self.metadata = metadata
+ self.size = size
+ }
+ }
+}
+
+extension Operations.AddPlaylistContentsMediaContainer: Codable {
+ enum CodingKeys: String, CodingKey {
+ case leafCountAdded
+ case leafCountRequested
+ case metadata = "Metadata"
+ case size
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/AddPlaylistContentsMetadata.swift b/Sources/Plexswift/models/operations/AddPlaylistContentsMetadata.swift
new file mode 100644
index 0000000..7c03003
--- /dev/null
+++ b/Sources/Plexswift/models/operations/AddPlaylistContentsMetadata.swift
@@ -0,0 +1,60 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct AddPlaylistContentsMetadata {
+ public let addedAt: Int?
+ public let composite: String?
+ public let duration: Int?
+ public let guid: String?
+ public let key: String?
+ public let leafCount: Int?
+ public let playlistType: String?
+ public let ratingKey: String?
+ public let smart: Bool?
+ public let summary: String?
+ public let title: String?
+ public let type: String?
+ public let updatedAt: Int?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(addedAt: Int? = nil, composite: String? = nil, duration: Int? = nil, guid: String? = nil, key: String? = nil, leafCount: Int? = nil, playlistType: String? = nil, ratingKey: String? = nil, smart: Bool? = nil, summary: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Int? = nil) {
+ self.addedAt = addedAt
+ self.composite = composite
+ self.duration = duration
+ self.guid = guid
+ self.key = key
+ self.leafCount = leafCount
+ self.playlistType = playlistType
+ self.ratingKey = ratingKey
+ self.smart = smart
+ self.summary = summary
+ self.title = title
+ self.type = type
+ self.updatedAt = updatedAt
+ }
+ }
+}
+
+extension Operations.AddPlaylistContentsMetadata: Codable {
+ enum CodingKeys: String, CodingKey {
+ case addedAt
+ case composite
+ case duration
+ case guid
+ case key
+ case leafCount
+ case playlistType
+ case ratingKey
+ case smart
+ case summary
+ case title
+ case type
+ case updatedAt
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/AddPlaylistContentsPlaylistsResponseBody.swift b/Sources/Plexswift/models/operations/AddPlaylistContentsPlaylistsResponseBody.swift
new file mode 100644
index 0000000..b37dacb
--- /dev/null
+++ b/Sources/Plexswift/models/operations/AddPlaylistContentsPlaylistsResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct AddPlaylistContentsPlaylistsResponseBody {
+ public let errors: [Operations.AddPlaylistContentsErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.AddPlaylistContentsErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.AddPlaylistContentsPlaylistsResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/AddPlaylistContentsRequest.swift b/Sources/Plexswift/models/operations/AddPlaylistContentsRequest.swift
new file mode 100644
index 0000000..0c525fa
--- /dev/null
+++ b/Sources/Plexswift/models/operations/AddPlaylistContentsRequest.swift
@@ -0,0 +1,37 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct AddPlaylistContentsRequest: APIValue {
+ /// the ID of the playlist
+ @DecimalSerialized
+ public private(set) var playlistID: Double
+ /// the content URI for the playlist
+ public let uri: String
+ /// the play queue to add to a playlist
+ @DecimalSerialized
+ public private(set) var playQueueID: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter playlistID: the ID of the playlist
+ /// - Parameter uri: the content URI for the playlist
+ /// - Parameter playQueueID: the play queue to add to a playlist
+ ///
+ public init(playlistID: Double, uri: String, playQueueID: Double? = nil) {
+ self._playlistID = DecimalSerialized(wrappedValue: playlistID)
+ self.uri = uri
+ self._playQueueID = DecimalSerialized(wrappedValue: playQueueID)
+ }
+ }
+}
+extension Operations.AddPlaylistContentsRequest {
+ var playlistIDWrapper: DecimalSerialized {
+ return _playlistID
+ }
+ var playQueueIDWrapper: DecimalSerialized {
+ return _playQueueID
+ }
+}
diff --git a/Sources/Plexswift/models/operations/AddPlaylistContentsResponse.swift b/Sources/Plexswift/models/operations/AddPlaylistContentsResponse.swift
new file mode 100644
index 0000000..fb08d76
--- /dev/null
+++ b/Sources/Plexswift/models/operations/AddPlaylistContentsResponse.swift
@@ -0,0 +1,34 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum AddPlaylistContentsResponse {
+ case empty
+ case twoHundredApplicationJsonObject(Operations.AddPlaylistContentsResponseBody)
+ case fourHundredAndOneApplicationJsonObject(Operations.AddPlaylistContentsPlaylistsResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func twoHundredApplicationJsonObject() throws -> Operations.AddPlaylistContentsResponseBody {
+ guard case .twoHundredApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+
+ public func fourHundredAndOneApplicationJsonObject() throws -> Operations.AddPlaylistContentsPlaylistsResponseBody {
+ guard case .fourHundredAndOneApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/AddPlaylistContentsResponseBody.swift b/Sources/Plexswift/models/operations/AddPlaylistContentsResponseBody.swift
new file mode 100644
index 0000000..70f37a2
--- /dev/null
+++ b/Sources/Plexswift/models/operations/AddPlaylistContentsResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Playlist Updated
+ public struct AddPlaylistContentsResponseBody {
+ public let mediaContainer: Operations.AddPlaylistContentsMediaContainer?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(mediaContainer: Operations.AddPlaylistContentsMediaContainer? = nil) {
+ self.mediaContainer = mediaContainer
+ }
+ }
+}
+
+extension Operations.AddPlaylistContentsResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case mediaContainer = "MediaContainer"
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/ApplyUpdatesErrors.swift b/Sources/Plexswift/models/operations/ApplyUpdatesErrors.swift
new file mode 100644
index 0000000..0e19064
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ApplyUpdatesErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct ApplyUpdatesErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.ApplyUpdatesErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.ApplyUpdatesErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/ApplyUpdatesRequest.swift b/Sources/Plexswift/models/operations/ApplyUpdatesRequest.swift
new file mode 100644
index 0000000..4fb8af9
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ApplyUpdatesRequest.swift
@@ -0,0 +1,23 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct ApplyUpdatesRequest: APIValue {
+ /// Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`.
+ public let skip: Operations.Skip?
+ /// Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install
+ public let tonight: Operations.Tonight?
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter skip: Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`.
+ /// - Parameter tonight: Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install
+ ///
+ public init(skip: Operations.Skip? = nil, tonight: Operations.Tonight? = nil) {
+ self.skip = skip
+ self.tonight = tonight
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/ApplyUpdatesResponse.swift b/Sources/Plexswift/models/operations/ApplyUpdatesResponse.swift
new file mode 100644
index 0000000..1bde175
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ApplyUpdatesResponse.swift
@@ -0,0 +1,26 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum ApplyUpdatesResponse {
+ case empty
+ case object(Operations.ApplyUpdatesResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func object() throws -> Operations.ApplyUpdatesResponseBody {
+ guard case .object(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/ApplyUpdatesResponseBody.swift b/Sources/Plexswift/models/operations/ApplyUpdatesResponseBody.swift
new file mode 100644
index 0000000..a4e84c5
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ApplyUpdatesResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct ApplyUpdatesResponseBody {
+ public let errors: [Operations.ApplyUpdatesErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.ApplyUpdatesErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.ApplyUpdatesResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/ButlerTask.swift b/Sources/Plexswift/models/operations/ButlerTask.swift
new file mode 100644
index 0000000..307829b
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ButlerTask.swift
@@ -0,0 +1,67 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct ButlerTask {
+ public let description: String?
+ public let enabled: Bool?
+ @DecimalSerialized
+ public private(set) var interval: Double?
+ public let name: String?
+ public let scheduleRandomized: Bool?
+ public let title: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(description: String? = nil, enabled: Bool? = nil, interval: Double? = nil, name: String? = nil, scheduleRandomized: Bool? = nil, title: String? = nil) {
+ self.description = description
+ self.enabled = enabled
+ self._interval = DecimalSerialized(wrappedValue: interval)
+ self.name = name
+ self.scheduleRandomized = scheduleRandomized
+ self.title = title
+ }
+ }
+}
+
+extension Operations.ButlerTask: Codable {
+ enum CodingKeys: String, CodingKey {
+ case description
+ case enabled
+ case interval
+ case name
+ case scheduleRandomized
+ case title
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self.description = try container.decodeIfPresent(String.self, forKey: .description)
+ self.enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled)
+ self._interval = try container.decodeIfPresent(DecimalSerialized.self, forKey: .interval) ?? DecimalSerialized(wrappedValue: nil)
+ self.name = try container.decodeIfPresent(String.self, forKey: .name)
+ self.scheduleRandomized = try container.decodeIfPresent(Bool.self, forKey: .scheduleRandomized)
+ self.title = try container.decodeIfPresent(String.self, forKey: .title)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ try container.encodeIfPresent(self.description, forKey: .description)
+ try container.encodeIfPresent(self.enabled, forKey: .enabled)
+ if self.interval != nil {
+ try container.encode(self._interval, forKey: .interval)
+ }
+ try container.encodeIfPresent(self.name, forKey: .name)
+ try container.encodeIfPresent(self.scheduleRandomized, forKey: .scheduleRandomized)
+ try container.encodeIfPresent(self.title, forKey: .title)
+ }
+}
+
+extension Operations.ButlerTask {
+ var intervalWrapper: DecimalSerialized {
+ return _interval
+ }
+}
diff --git a/Sources/Plexswift/models/operations/ButlerTasks.swift b/Sources/Plexswift/models/operations/ButlerTasks.swift
new file mode 100644
index 0000000..8b0628b
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ButlerTasks.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct ButlerTasks {
+ public let butlerTask: [Operations.ButlerTask]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(butlerTask: [Operations.ButlerTask]? = nil) {
+ self.butlerTask = butlerTask
+ }
+ }
+}
+
+extension Operations.ButlerTasks: Codable {
+ enum CodingKeys: String, CodingKey {
+ case butlerTask = "ButlerTask"
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/CancelServerActivitiesErrors.swift b/Sources/Plexswift/models/operations/CancelServerActivitiesErrors.swift
new file mode 100644
index 0000000..986b1b8
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CancelServerActivitiesErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct CancelServerActivitiesErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.CancelServerActivitiesErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.CancelServerActivitiesErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/CancelServerActivitiesRequest.swift b/Sources/Plexswift/models/operations/CancelServerActivitiesRequest.swift
new file mode 100644
index 0000000..aafd1e2
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CancelServerActivitiesRequest.swift
@@ -0,0 +1,19 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct CancelServerActivitiesRequest: APIValue {
+ /// The UUID of the activity to cancel.
+ public let activityUUID: String
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter activityUUID: The UUID of the activity to cancel.
+ ///
+ public init(activityUUID: String) {
+ self.activityUUID = activityUUID
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/CancelServerActivitiesResponse.swift b/Sources/Plexswift/models/operations/CancelServerActivitiesResponse.swift
new file mode 100644
index 0000000..a58ea73
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CancelServerActivitiesResponse.swift
@@ -0,0 +1,26 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum CancelServerActivitiesResponse {
+ case empty
+ case object(Operations.CancelServerActivitiesResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func object() throws -> Operations.CancelServerActivitiesResponseBody {
+ guard case .object(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/CancelServerActivitiesResponseBody.swift b/Sources/Plexswift/models/operations/CancelServerActivitiesResponseBody.swift
new file mode 100644
index 0000000..e3965cb
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CancelServerActivitiesResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct CancelServerActivitiesResponseBody {
+ public let errors: [Operations.CancelServerActivitiesErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.CancelServerActivitiesErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.CancelServerActivitiesResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/CheckForUpdatesErrors.swift b/Sources/Plexswift/models/operations/CheckForUpdatesErrors.swift
new file mode 100644
index 0000000..567c5cd
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CheckForUpdatesErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct CheckForUpdatesErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.CheckForUpdatesErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.CheckForUpdatesErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/CheckForUpdatesRequest.swift b/Sources/Plexswift/models/operations/CheckForUpdatesRequest.swift
new file mode 100644
index 0000000..26099c5
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CheckForUpdatesRequest.swift
@@ -0,0 +1,19 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct CheckForUpdatesRequest: APIValue {
+ /// Indicate that you want to start download any updates found.
+ public let download: Operations.Download?
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter download: Indicate that you want to start download any updates found.
+ ///
+ public init(download: Operations.Download? = nil) {
+ self.download = download
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/CheckForUpdatesResponse.swift b/Sources/Plexswift/models/operations/CheckForUpdatesResponse.swift
new file mode 100644
index 0000000..88aaf44
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CheckForUpdatesResponse.swift
@@ -0,0 +1,26 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum CheckForUpdatesResponse {
+ case empty
+ case object(Operations.CheckForUpdatesResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func object() throws -> Operations.CheckForUpdatesResponseBody {
+ guard case .object(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/CheckForUpdatesResponseBody.swift b/Sources/Plexswift/models/operations/CheckForUpdatesResponseBody.swift
new file mode 100644
index 0000000..7d7076e
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CheckForUpdatesResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct CheckForUpdatesResponseBody {
+ public let errors: [Operations.CheckForUpdatesErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.CheckForUpdatesErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.CheckForUpdatesResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/ClearPlaylistContentsErrors.swift b/Sources/Plexswift/models/operations/ClearPlaylistContentsErrors.swift
new file mode 100644
index 0000000..5d2a9c6
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ClearPlaylistContentsErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct ClearPlaylistContentsErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.ClearPlaylistContentsErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.ClearPlaylistContentsErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/ClearPlaylistContentsRequest.swift b/Sources/Plexswift/models/operations/ClearPlaylistContentsRequest.swift
new file mode 100644
index 0000000..36024da
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ClearPlaylistContentsRequest.swift
@@ -0,0 +1,25 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct ClearPlaylistContentsRequest: APIValue {
+ /// the ID of the playlist
+ @DecimalSerialized
+ public private(set) var playlistID: Double
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter playlistID: the ID of the playlist
+ ///
+ public init(playlistID: Double) {
+ self._playlistID = DecimalSerialized(wrappedValue: playlistID)
+ }
+ }
+}
+extension Operations.ClearPlaylistContentsRequest {
+ var playlistIDWrapper: DecimalSerialized {
+ return _playlistID
+ }
+}
diff --git a/Sources/Plexswift/models/operations/ClearPlaylistContentsResponse.swift b/Sources/Plexswift/models/operations/ClearPlaylistContentsResponse.swift
new file mode 100644
index 0000000..4ff7584
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ClearPlaylistContentsResponse.swift
@@ -0,0 +1,26 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum ClearPlaylistContentsResponse {
+ case empty
+ case object(Operations.ClearPlaylistContentsResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func object() throws -> Operations.ClearPlaylistContentsResponseBody {
+ guard case .object(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/ClearPlaylistContentsResponseBody.swift b/Sources/Plexswift/models/operations/ClearPlaylistContentsResponseBody.swift
new file mode 100644
index 0000000..0541233
--- /dev/null
+++ b/Sources/Plexswift/models/operations/ClearPlaylistContentsResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct ClearPlaylistContentsResponseBody {
+ public let errors: [Operations.ClearPlaylistContentsErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.ClearPlaylistContentsErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.ClearPlaylistContentsResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/Context.swift b/Sources/Plexswift/models/operations/Context.swift
new file mode 100644
index 0000000..afda430
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Context.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Context {
+ public let librarySectionID: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(librarySectionID: String? = nil) {
+ self.librarySectionID = librarySectionID
+ }
+ }
+}
+
+extension Operations.Context: Codable {
+ enum CodingKeys: String, CodingKey {
+ case librarySectionID
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/Country.swift b/Sources/Plexswift/models/operations/Country.swift
new file mode 100644
index 0000000..c1c9262
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Country.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Country {
+ public let tag: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(tag: String? = nil) {
+ self.tag = tag
+ }
+ }
+}
+
+extension Operations.Country: Codable {
+ enum CodingKeys: String, CodingKey {
+ case tag
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/CreatePlaylistErrors.swift b/Sources/Plexswift/models/operations/CreatePlaylistErrors.swift
new file mode 100644
index 0000000..10da4d8
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CreatePlaylistErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct CreatePlaylistErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.CreatePlaylistErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.CreatePlaylistErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/CreatePlaylistMediaContainer.swift b/Sources/Plexswift/models/operations/CreatePlaylistMediaContainer.swift
new file mode 100644
index 0000000..a6af143
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CreatePlaylistMediaContainer.swift
@@ -0,0 +1,27 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct CreatePlaylistMediaContainer {
+ public let metadata: [Operations.CreatePlaylistMetadata]?
+ public let size: Int?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(metadata: [Operations.CreatePlaylistMetadata]? = nil, size: Int? = nil) {
+ self.metadata = metadata
+ self.size = size
+ }
+ }
+}
+
+extension Operations.CreatePlaylistMediaContainer: Codable {
+ enum CodingKeys: String, CodingKey {
+ case metadata = "Metadata"
+ case size
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/CreatePlaylistMetadata.swift b/Sources/Plexswift/models/operations/CreatePlaylistMetadata.swift
new file mode 100644
index 0000000..4cb9a52
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CreatePlaylistMetadata.swift
@@ -0,0 +1,69 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct CreatePlaylistMetadata {
+ public let addedAt: Int?
+ public let composite: String?
+ public let duration: Int?
+ public let guid: String?
+ public let icon: String?
+ public let key: String?
+ public let lastViewedAt: Int?
+ public let leafCount: Int?
+ public let playlistType: String?
+ public let ratingKey: String?
+ public let smart: Bool?
+ public let summary: String?
+ public let title: String?
+ public let type: String?
+ public let updatedAt: Int?
+ public let viewCount: Int?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(addedAt: Int? = nil, composite: String? = nil, duration: Int? = nil, guid: String? = nil, icon: String? = nil, key: String? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, playlistType: String? = nil, ratingKey: String? = nil, smart: Bool? = nil, summary: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Int? = nil, viewCount: Int? = nil) {
+ self.addedAt = addedAt
+ self.composite = composite
+ self.duration = duration
+ self.guid = guid
+ self.icon = icon
+ self.key = key
+ self.lastViewedAt = lastViewedAt
+ self.leafCount = leafCount
+ self.playlistType = playlistType
+ self.ratingKey = ratingKey
+ self.smart = smart
+ self.summary = summary
+ self.title = title
+ self.type = type
+ self.updatedAt = updatedAt
+ self.viewCount = viewCount
+ }
+ }
+}
+
+extension Operations.CreatePlaylistMetadata: Codable {
+ enum CodingKeys: String, CodingKey {
+ case addedAt
+ case composite
+ case duration
+ case guid
+ case icon
+ case key
+ case lastViewedAt
+ case leafCount
+ case playlistType
+ case ratingKey
+ case smart
+ case summary
+ case title
+ case type
+ case updatedAt
+ case viewCount
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/CreatePlaylistPlaylistsResponseBody.swift b/Sources/Plexswift/models/operations/CreatePlaylistPlaylistsResponseBody.swift
new file mode 100644
index 0000000..e00283d
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CreatePlaylistPlaylistsResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct CreatePlaylistPlaylistsResponseBody {
+ public let errors: [Operations.CreatePlaylistErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.CreatePlaylistErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.CreatePlaylistPlaylistsResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/CreatePlaylistRequest.swift b/Sources/Plexswift/models/operations/CreatePlaylistRequest.swift
new file mode 100644
index 0000000..23a240c
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CreatePlaylistRequest.swift
@@ -0,0 +1,41 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct CreatePlaylistRequest: APIValue {
+ /// whether the playlist is smart or not
+ public let smart: Operations.Smart
+ /// name of the playlist
+ public let title: String
+ /// type of playlist to create
+ public let type: Operations.QueryParamType
+ /// the content URI for the playlist
+ public let uri: String
+ /// the play queue to copy to a playlist
+ @DecimalSerialized
+ public private(set) var playQueueID: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter smart: whether the playlist is smart or not
+ /// - Parameter title: name of the playlist
+ /// - Parameter type: type of playlist to create
+ /// - Parameter uri: the content URI for the playlist
+ /// - Parameter playQueueID: the play queue to copy to a playlist
+ ///
+ public init(smart: Operations.Smart, title: String, type: Operations.QueryParamType, uri: String, playQueueID: Double? = nil) {
+ self.smart = smart
+ self.title = title
+ self.type = type
+ self.uri = uri
+ self._playQueueID = DecimalSerialized(wrappedValue: playQueueID)
+ }
+ }
+}
+extension Operations.CreatePlaylistRequest {
+ var playQueueIDWrapper: DecimalSerialized {
+ return _playQueueID
+ }
+}
diff --git a/Sources/Plexswift/models/operations/CreatePlaylistResponse.swift b/Sources/Plexswift/models/operations/CreatePlaylistResponse.swift
new file mode 100644
index 0000000..39d7e85
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CreatePlaylistResponse.swift
@@ -0,0 +1,34 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum CreatePlaylistResponse {
+ case empty
+ case twoHundredApplicationJsonObject(Operations.CreatePlaylistResponseBody)
+ case fourHundredAndOneApplicationJsonObject(Operations.CreatePlaylistPlaylistsResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func twoHundredApplicationJsonObject() throws -> Operations.CreatePlaylistResponseBody {
+ guard case .twoHundredApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+
+ public func fourHundredAndOneApplicationJsonObject() throws -> Operations.CreatePlaylistPlaylistsResponseBody {
+ guard case .fourHundredAndOneApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/CreatePlaylistResponseBody.swift b/Sources/Plexswift/models/operations/CreatePlaylistResponseBody.swift
new file mode 100644
index 0000000..8b9aea6
--- /dev/null
+++ b/Sources/Plexswift/models/operations/CreatePlaylistResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// returns all playlists
+ public struct CreatePlaylistResponseBody {
+ public let mediaContainer: Operations.CreatePlaylistMediaContainer?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(mediaContainer: Operations.CreatePlaylistMediaContainer? = nil) {
+ self.mediaContainer = mediaContainer
+ }
+ }
+}
+
+extension Operations.CreatePlaylistResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case mediaContainer = "MediaContainer"
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/DeleteLibraryErrors.swift b/Sources/Plexswift/models/operations/DeleteLibraryErrors.swift
new file mode 100644
index 0000000..837de55
--- /dev/null
+++ b/Sources/Plexswift/models/operations/DeleteLibraryErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct DeleteLibraryErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.DeleteLibraryErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.DeleteLibraryErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/DeleteLibraryRequest.swift b/Sources/Plexswift/models/operations/DeleteLibraryRequest.swift
new file mode 100644
index 0000000..2dd3589
--- /dev/null
+++ b/Sources/Plexswift/models/operations/DeleteLibraryRequest.swift
@@ -0,0 +1,25 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct DeleteLibraryRequest: APIValue {
+ /// the Id of the library to query
+ @DecimalSerialized
+ public private(set) var sectionId: Double
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter sectionId: the Id of the library to query
+ ///
+ public init(sectionId: Double) {
+ self._sectionId = DecimalSerialized(wrappedValue: sectionId)
+ }
+ }
+}
+extension Operations.DeleteLibraryRequest {
+ var sectionIdWrapper: DecimalSerialized {
+ return _sectionId
+ }
+}
diff --git a/Sources/Plexswift/models/operations/DeleteLibraryResponse.swift b/Sources/Plexswift/models/operations/DeleteLibraryResponse.swift
new file mode 100644
index 0000000..aca4a6c
--- /dev/null
+++ b/Sources/Plexswift/models/operations/DeleteLibraryResponse.swift
@@ -0,0 +1,26 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum DeleteLibraryResponse {
+ case empty
+ case object(Operations.DeleteLibraryResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func object() throws -> Operations.DeleteLibraryResponseBody {
+ guard case .object(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/DeleteLibraryResponseBody.swift b/Sources/Plexswift/models/operations/DeleteLibraryResponseBody.swift
new file mode 100644
index 0000000..1c750c6
--- /dev/null
+++ b/Sources/Plexswift/models/operations/DeleteLibraryResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct DeleteLibraryResponseBody {
+ public let errors: [Operations.DeleteLibraryErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.DeleteLibraryErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.DeleteLibraryResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/DeletePlaylistErrors.swift b/Sources/Plexswift/models/operations/DeletePlaylistErrors.swift
new file mode 100644
index 0000000..c85aed2
--- /dev/null
+++ b/Sources/Plexswift/models/operations/DeletePlaylistErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct DeletePlaylistErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.DeletePlaylistErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.DeletePlaylistErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/DeletePlaylistRequest.swift b/Sources/Plexswift/models/operations/DeletePlaylistRequest.swift
new file mode 100644
index 0000000..163bce4
--- /dev/null
+++ b/Sources/Plexswift/models/operations/DeletePlaylistRequest.swift
@@ -0,0 +1,25 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct DeletePlaylistRequest: APIValue {
+ /// the ID of the playlist
+ @DecimalSerialized
+ public private(set) var playlistID: Double
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter playlistID: the ID of the playlist
+ ///
+ public init(playlistID: Double) {
+ self._playlistID = DecimalSerialized(wrappedValue: playlistID)
+ }
+ }
+}
+extension Operations.DeletePlaylistRequest {
+ var playlistIDWrapper: DecimalSerialized {
+ return _playlistID
+ }
+}
diff --git a/Sources/Plexswift/models/operations/DeletePlaylistResponse.swift b/Sources/Plexswift/models/operations/DeletePlaylistResponse.swift
new file mode 100644
index 0000000..91a5198
--- /dev/null
+++ b/Sources/Plexswift/models/operations/DeletePlaylistResponse.swift
@@ -0,0 +1,26 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum DeletePlaylistResponse {
+ case empty
+ case object(Operations.DeletePlaylistResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func object() throws -> Operations.DeletePlaylistResponseBody {
+ guard case .object(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/DeletePlaylistResponseBody.swift b/Sources/Plexswift/models/operations/DeletePlaylistResponseBody.swift
new file mode 100644
index 0000000..585ea7d
--- /dev/null
+++ b/Sources/Plexswift/models/operations/DeletePlaylistResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct DeletePlaylistResponseBody {
+ public let errors: [Operations.DeletePlaylistErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.DeletePlaylistErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.DeletePlaylistResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/Device.swift b/Sources/Plexswift/models/operations/Device.swift
new file mode 100644
index 0000000..fc25e0b
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Device.swift
@@ -0,0 +1,68 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Device {
+ public let clientIdentifier: String?
+ @DecimalSerialized
+ public private(set) var createdAt: Double?
+ @DecimalSerialized
+ public private(set) var id: Double?
+ public let name: String?
+ public let platform: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(clientIdentifier: String? = nil, createdAt: Double? = nil, id: Double? = nil, name: String? = nil, platform: String? = nil) {
+ self.clientIdentifier = clientIdentifier
+ self._createdAt = DecimalSerialized(wrappedValue: createdAt)
+ self._id = DecimalSerialized(wrappedValue: id)
+ self.name = name
+ self.platform = platform
+ }
+ }
+}
+
+extension Operations.Device: Codable {
+ enum CodingKeys: String, CodingKey {
+ case clientIdentifier
+ case createdAt
+ case id
+ case name
+ case platform
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self.clientIdentifier = try container.decodeIfPresent(String.self, forKey: .clientIdentifier)
+ self._createdAt = try container.decodeIfPresent(DecimalSerialized.self, forKey: .createdAt) ?? DecimalSerialized(wrappedValue: nil)
+ self._id = try container.decodeIfPresent(DecimalSerialized.self, forKey: .id) ?? DecimalSerialized(wrappedValue: nil)
+ self.name = try container.decodeIfPresent(String.self, forKey: .name)
+ self.platform = try container.decodeIfPresent(String.self, forKey: .platform)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ try container.encodeIfPresent(self.clientIdentifier, forKey: .clientIdentifier)
+ if self.createdAt != nil {
+ try container.encode(self._createdAt, forKey: .createdAt)
+ }
+ if self.id != nil {
+ try container.encode(self._id, forKey: .id)
+ }
+ try container.encodeIfPresent(self.name, forKey: .name)
+ try container.encodeIfPresent(self.platform, forKey: .platform)
+ }
+}
+
+extension Operations.Device {
+ var idWrapper: DecimalSerialized {
+ return _id
+ }
+ var createdAtWrapper: DecimalSerialized {
+ return _createdAt
+ }
+}
diff --git a/Sources/Plexswift/models/operations/Director.swift b/Sources/Plexswift/models/operations/Director.swift
new file mode 100644
index 0000000..b60d46e
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Director.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Director {
+ public let tag: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(tag: String? = nil) {
+ self.tag = tag
+ }
+ }
+}
+
+extension Operations.Director: Codable {
+ enum CodingKeys: String, CodingKey {
+ case tag
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/Directory.swift b/Sources/Plexswift/models/operations/Directory.swift
new file mode 100644
index 0000000..11a6224
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Directory.swift
@@ -0,0 +1,52 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Directory {
+ @DecimalSerialized
+ public private(set) var count: Double?
+ public let key: String?
+ public let title: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(count: Double? = nil, key: String? = nil, title: String? = nil) {
+ self._count = DecimalSerialized(wrappedValue: count)
+ self.key = key
+ self.title = title
+ }
+ }
+}
+
+extension Operations.Directory: Codable {
+ enum CodingKeys: String, CodingKey {
+ case count
+ case key
+ case title
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._count = try container.decodeIfPresent(DecimalSerialized.self, forKey: .count) ?? DecimalSerialized(wrappedValue: nil)
+ self.key = try container.decodeIfPresent(String.self, forKey: .key)
+ self.title = try container.decodeIfPresent(String.self, forKey: .title)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.count != nil {
+ try container.encode(self._count, forKey: .count)
+ }
+ try container.encodeIfPresent(self.key, forKey: .key)
+ try container.encodeIfPresent(self.title, forKey: .title)
+ }
+}
+
+extension Operations.Directory {
+ var countWrapper: DecimalSerialized {
+ return _count
+ }
+}
diff --git a/Sources/Plexswift/models/operations/Download.swift b/Sources/Plexswift/models/operations/Download.swift
new file mode 100644
index 0000000..0447c4d
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Download.swift
@@ -0,0 +1,11 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Indicate that you want to start download any updates found.
+ public enum Download: Int, Codable, APIValue {
+ case zero = 0
+ case one = 1
+ }
+}
diff --git a/Sources/Plexswift/models/operations/EnablePaperTrailErrors.swift b/Sources/Plexswift/models/operations/EnablePaperTrailErrors.swift
new file mode 100644
index 0000000..eaf0884
--- /dev/null
+++ b/Sources/Plexswift/models/operations/EnablePaperTrailErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct EnablePaperTrailErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.EnablePaperTrailErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.EnablePaperTrailErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/EnablePaperTrailResponse.swift b/Sources/Plexswift/models/operations/EnablePaperTrailResponse.swift
new file mode 100644
index 0000000..10786cc
--- /dev/null
+++ b/Sources/Plexswift/models/operations/EnablePaperTrailResponse.swift
@@ -0,0 +1,26 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum EnablePaperTrailResponse {
+ case empty
+ case object(Operations.EnablePaperTrailResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func object() throws -> Operations.EnablePaperTrailResponseBody {
+ guard case .object(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/EnablePaperTrailResponseBody.swift b/Sources/Plexswift/models/operations/EnablePaperTrailResponseBody.swift
new file mode 100644
index 0000000..829bf57
--- /dev/null
+++ b/Sources/Plexswift/models/operations/EnablePaperTrailResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct EnablePaperTrailResponseBody {
+ public let errors: [Operations.EnablePaperTrailErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.EnablePaperTrailErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.EnablePaperTrailResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/Errors.swift b/Sources/Plexswift/models/operations/Errors.swift
new file mode 100644
index 0000000..d96b5bd
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Errors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Errors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.Errors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.Errors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/Field.swift b/Sources/Plexswift/models/operations/Field.swift
new file mode 100644
index 0000000..bd8c0c3
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Field.swift
@@ -0,0 +1,33 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Field {
+ public let key: String?
+ public let subType: String?
+ public let title: String?
+ public let type: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(key: String? = nil, subType: String? = nil, title: String? = nil, type: String? = nil) {
+ self.key = key
+ self.subType = subType
+ self.title = title
+ self.type = type
+ }
+ }
+}
+
+extension Operations.Field: Codable {
+ enum CodingKeys: String, CodingKey {
+ case key
+ case subType
+ case title
+ case type
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/FieldType.swift b/Sources/Plexswift/models/operations/FieldType.swift
new file mode 100644
index 0000000..381c51a
--- /dev/null
+++ b/Sources/Plexswift/models/operations/FieldType.swift
@@ -0,0 +1,27 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct FieldType {
+ public let `operator`: [Operations.Operator]?
+ public let type: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(`operator`: [Operations.Operator]? = nil, type: String? = nil) {
+ self.`operator` = `operator`
+ self.type = type
+ }
+ }
+}
+
+extension Operations.FieldType: Codable {
+ enum CodingKeys: String, CodingKey {
+ case `operator` = "Operator"
+ case type
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/Filter.swift b/Sources/Plexswift/models/operations/Filter.swift
new file mode 100644
index 0000000..2f415de
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Filter.swift
@@ -0,0 +1,36 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Filter {
+ public let filter: String?
+ public let filterType: String?
+ public let key: String?
+ public let title: String?
+ public let type: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(filter: String? = nil, filterType: String? = nil, key: String? = nil, title: String? = nil, type: String? = nil) {
+ self.filter = filter
+ self.filterType = filterType
+ self.key = key
+ self.title = title
+ self.type = type
+ }
+ }
+}
+
+extension Operations.Filter: Codable {
+ enum CodingKeys: String, CodingKey {
+ case filter
+ case filterType
+ case key
+ case title
+ case type
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/Force.swift b/Sources/Plexswift/models/operations/Force.swift
new file mode 100644
index 0000000..0a6df9c
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Force.swift
@@ -0,0 +1,15 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Force overwriting of duplicate playlists.
+ /// By default, a playlist file uploaded with the same path will overwrite the existing playlist.
+ /// The `force` argument is used to disable overwriting.
+ /// If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
+ ///
+ public enum Force: Int, Codable, APIValue {
+ case zero = 0
+ case one = 1
+ }
+}
diff --git a/Sources/Plexswift/models/operations/Genre.swift b/Sources/Plexswift/models/operations/Genre.swift
new file mode 100644
index 0000000..2f1afe5
--- /dev/null
+++ b/Sources/Plexswift/models/operations/Genre.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct Genre {
+ public let tag: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(tag: String? = nil) {
+ self.tag = tag
+ }
+ }
+}
+
+extension Operations.Genre: Codable {
+ enum CodingKeys: String, CodingKey {
+ case tag
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetAvailableClientsErrors.swift b/Sources/Plexswift/models/operations/GetAvailableClientsErrors.swift
new file mode 100644
index 0000000..bad8616
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetAvailableClientsErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetAvailableClientsErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.GetAvailableClientsErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.GetAvailableClientsErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetAvailableClientsMediaContainer.swift b/Sources/Plexswift/models/operations/GetAvailableClientsMediaContainer.swift
new file mode 100644
index 0000000..bdd448e
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetAvailableClientsMediaContainer.swift
@@ -0,0 +1,47 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetAvailableClientsMediaContainer {
+ public let server: [Operations.Server]?
+ @DecimalSerialized
+ public private(set) var size: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(server: [Operations.Server]? = nil, size: Double? = nil) {
+ self.server = server
+ self._size = DecimalSerialized(wrappedValue: size)
+ }
+ }
+}
+
+extension Operations.GetAvailableClientsMediaContainer: Codable {
+ enum CodingKeys: String, CodingKey {
+ case server = "Server"
+ case size
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self.server = try container.decodeIfPresent([Operations.Server].self, forKey: .server)
+ self._size = try container.decodeIfPresent(DecimalSerialized.self, forKey: .size) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ try container.encodeIfPresent(self.server, forKey: .server)
+ if self.size != nil {
+ try container.encode(self._size, forKey: .size)
+ }
+ }
+}
+
+extension Operations.GetAvailableClientsMediaContainer {
+ var sizeWrapper: DecimalSerialized {
+ return _size
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetAvailableClientsResponse.swift b/Sources/Plexswift/models/operations/GetAvailableClientsResponse.swift
new file mode 100644
index 0000000..c71e2a0
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetAvailableClientsResponse.swift
@@ -0,0 +1,34 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum GetAvailableClientsResponse {
+ case empty
+ case twoHundredApplicationJsonObject(Operations.GetAvailableClientsResponseBody)
+ case fourHundredAndOneApplicationJsonObject(Operations.GetAvailableClientsServerResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func twoHundredApplicationJsonObject() throws -> Operations.GetAvailableClientsResponseBody {
+ guard case .twoHundredApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+
+ public func fourHundredAndOneApplicationJsonObject() throws -> Operations.GetAvailableClientsServerResponseBody {
+ guard case .fourHundredAndOneApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetAvailableClientsResponseBody.swift b/Sources/Plexswift/models/operations/GetAvailableClientsResponseBody.swift
new file mode 100644
index 0000000..2488206
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetAvailableClientsResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Available Clients
+ public struct GetAvailableClientsResponseBody {
+ public let mediaContainer: Operations.GetAvailableClientsMediaContainer?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(mediaContainer: Operations.GetAvailableClientsMediaContainer? = nil) {
+ self.mediaContainer = mediaContainer
+ }
+ }
+}
+
+extension Operations.GetAvailableClientsResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case mediaContainer = "MediaContainer"
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetAvailableClientsServerResponseBody.swift b/Sources/Plexswift/models/operations/GetAvailableClientsServerResponseBody.swift
new file mode 100644
index 0000000..1f4fdbc
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetAvailableClientsServerResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct GetAvailableClientsServerResponseBody {
+ public let errors: [Operations.GetAvailableClientsErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.GetAvailableClientsErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.GetAvailableClientsServerResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetButlerTasksButlerResponseBody.swift b/Sources/Plexswift/models/operations/GetButlerTasksButlerResponseBody.swift
new file mode 100644
index 0000000..f4df845
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetButlerTasksButlerResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct GetButlerTasksButlerResponseBody {
+ public let errors: [Operations.GetButlerTasksErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.GetButlerTasksErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.GetButlerTasksButlerResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetButlerTasksErrors.swift b/Sources/Plexswift/models/operations/GetButlerTasksErrors.swift
new file mode 100644
index 0000000..47401fd
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetButlerTasksErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetButlerTasksErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.GetButlerTasksErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.GetButlerTasksErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetButlerTasksResponse.swift b/Sources/Plexswift/models/operations/GetButlerTasksResponse.swift
new file mode 100644
index 0000000..f9136ca
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetButlerTasksResponse.swift
@@ -0,0 +1,34 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum GetButlerTasksResponse {
+ case empty
+ case twoHundredApplicationJsonObject(Operations.GetButlerTasksResponseBody)
+ case fourHundredAndOneApplicationJsonObject(Operations.GetButlerTasksButlerResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func twoHundredApplicationJsonObject() throws -> Operations.GetButlerTasksResponseBody {
+ guard case .twoHundredApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+
+ public func fourHundredAndOneApplicationJsonObject() throws -> Operations.GetButlerTasksButlerResponseBody {
+ guard case .fourHundredAndOneApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetButlerTasksResponseBody.swift b/Sources/Plexswift/models/operations/GetButlerTasksResponseBody.swift
new file mode 100644
index 0000000..42320c3
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetButlerTasksResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// All butler tasks
+ public struct GetButlerTasksResponseBody {
+ public let butlerTasks: Operations.ButlerTasks?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(butlerTasks: Operations.ButlerTasks? = nil) {
+ self.butlerTasks = butlerTasks
+ }
+ }
+}
+
+extension Operations.GetButlerTasksResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case butlerTasks = "ButlerTasks"
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetDevicesErrors.swift b/Sources/Plexswift/models/operations/GetDevicesErrors.swift
new file mode 100644
index 0000000..84fbc59
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetDevicesErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetDevicesErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.GetDevicesErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.GetDevicesErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetDevicesMediaContainer.swift b/Sources/Plexswift/models/operations/GetDevicesMediaContainer.swift
new file mode 100644
index 0000000..d08deb4
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetDevicesMediaContainer.swift
@@ -0,0 +1,52 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetDevicesMediaContainer {
+ public let device: [Operations.Device]?
+ public let identifier: String?
+ @DecimalSerialized
+ public private(set) var size: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(device: [Operations.Device]? = nil, identifier: String? = nil, size: Double? = nil) {
+ self.device = device
+ self.identifier = identifier
+ self._size = DecimalSerialized(wrappedValue: size)
+ }
+ }
+}
+
+extension Operations.GetDevicesMediaContainer: Codable {
+ enum CodingKeys: String, CodingKey {
+ case device = "Device"
+ case identifier
+ case size
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self.device = try container.decodeIfPresent([Operations.Device].self, forKey: .device)
+ self.identifier = try container.decodeIfPresent(String.self, forKey: .identifier)
+ self._size = try container.decodeIfPresent(DecimalSerialized.self, forKey: .size) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ try container.encodeIfPresent(self.device, forKey: .device)
+ try container.encodeIfPresent(self.identifier, forKey: .identifier)
+ if self.size != nil {
+ try container.encode(self._size, forKey: .size)
+ }
+ }
+}
+
+extension Operations.GetDevicesMediaContainer {
+ var sizeWrapper: DecimalSerialized {
+ return _size
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetDevicesResponse.swift b/Sources/Plexswift/models/operations/GetDevicesResponse.swift
new file mode 100644
index 0000000..5245aa3
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetDevicesResponse.swift
@@ -0,0 +1,34 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum GetDevicesResponse {
+ case empty
+ case twoHundredApplicationJsonObject(Operations.GetDevicesResponseBody)
+ case fourHundredAndOneApplicationJsonObject(Operations.GetDevicesServerResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func twoHundredApplicationJsonObject() throws -> Operations.GetDevicesResponseBody {
+ guard case .twoHundredApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+
+ public func fourHundredAndOneApplicationJsonObject() throws -> Operations.GetDevicesServerResponseBody {
+ guard case .fourHundredAndOneApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetDevicesResponseBody.swift b/Sources/Plexswift/models/operations/GetDevicesResponseBody.swift
new file mode 100644
index 0000000..ffd1c26
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetDevicesResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Devices
+ public struct GetDevicesResponseBody {
+ public let mediaContainer: Operations.GetDevicesMediaContainer?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(mediaContainer: Operations.GetDevicesMediaContainer? = nil) {
+ self.mediaContainer = mediaContainer
+ }
+ }
+}
+
+extension Operations.GetDevicesResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case mediaContainer = "MediaContainer"
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetDevicesServerResponseBody.swift b/Sources/Plexswift/models/operations/GetDevicesServerResponseBody.swift
new file mode 100644
index 0000000..861eb37
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetDevicesServerResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct GetDevicesServerResponseBody {
+ public let errors: [Operations.GetDevicesErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.GetDevicesErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.GetDevicesServerResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetFileHashErrors.swift b/Sources/Plexswift/models/operations/GetFileHashErrors.swift
new file mode 100644
index 0000000..1c7d6f0
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetFileHashErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetFileHashErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.GetFileHashErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.GetFileHashErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetFileHashRequest.swift b/Sources/Plexswift/models/operations/GetFileHashRequest.swift
new file mode 100644
index 0000000..43d3042
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetFileHashRequest.swift
@@ -0,0 +1,29 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetFileHashRequest: APIValue {
+ /// This is the path to the local file, must be prefixed by `file://`
+ public let url: String
+ /// Item type
+ @DecimalSerialized
+ public private(set) var type: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter url: This is the path to the local file, must be prefixed by `file://`
+ /// - Parameter type: Item type
+ ///
+ public init(url: String, type: Double? = nil) {
+ self.url = url
+ self._type = DecimalSerialized(wrappedValue: type)
+ }
+ }
+}
+extension Operations.GetFileHashRequest {
+ var typeWrapper: DecimalSerialized {
+ return _type
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetFileHashResponse.swift b/Sources/Plexswift/models/operations/GetFileHashResponse.swift
new file mode 100644
index 0000000..5bbb24d
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetFileHashResponse.swift
@@ -0,0 +1,26 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum GetFileHashResponse {
+ case empty
+ case object(Operations.GetFileHashResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func object() throws -> Operations.GetFileHashResponseBody {
+ guard case .object(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetFileHashResponseBody.swift b/Sources/Plexswift/models/operations/GetFileHashResponseBody.swift
new file mode 100644
index 0000000..c53bb93
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetFileHashResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct GetFileHashResponseBody {
+ public let errors: [Operations.GetFileHashErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.GetFileHashErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.GetFileHashResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetGlobalHubsErrors.swift b/Sources/Plexswift/models/operations/GetGlobalHubsErrors.swift
new file mode 100644
index 0000000..cca3898
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetGlobalHubsErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetGlobalHubsErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.GetGlobalHubsErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.GetGlobalHubsErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetGlobalHubsHubsResponseBody.swift b/Sources/Plexswift/models/operations/GetGlobalHubsHubsResponseBody.swift
new file mode 100644
index 0000000..f13246c
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetGlobalHubsHubsResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct GetGlobalHubsHubsResponseBody {
+ public let errors: [Operations.GetGlobalHubsErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.GetGlobalHubsErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.GetGlobalHubsHubsResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetGlobalHubsMediaContainer.swift b/Sources/Plexswift/models/operations/GetGlobalHubsMediaContainer.swift
new file mode 100644
index 0000000..5ac33b0
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetGlobalHubsMediaContainer.swift
@@ -0,0 +1,33 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetGlobalHubsMediaContainer {
+ public let allowSync: Bool?
+ public let hub: [Operations.Hub]?
+ public let identifier: String?
+ public let size: Int?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(allowSync: Bool? = nil, hub: [Operations.Hub]? = nil, identifier: String? = nil, size: Int? = nil) {
+ self.allowSync = allowSync
+ self.hub = hub
+ self.identifier = identifier
+ self.size = size
+ }
+ }
+}
+
+extension Operations.GetGlobalHubsMediaContainer: Codable {
+ enum CodingKeys: String, CodingKey {
+ case allowSync
+ case hub = "Hub"
+ case identifier
+ case size
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetGlobalHubsMetadata.swift b/Sources/Plexswift/models/operations/GetGlobalHubsMetadata.swift
new file mode 100644
index 0000000..e571262
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetGlobalHubsMetadata.swift
@@ -0,0 +1,72 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetGlobalHubsMetadata {
+ public let addedAt: Int?
+ public let composite: String?
+ public let duration: Int?
+ public let guid: String?
+ public let icon: String?
+ public let key: String?
+ public let lastViewedAt: Int?
+ public let leafCount: Int?
+ public let playlistType: String?
+ public let ratingKey: String?
+ public let smart: Bool?
+ public let summary: String?
+ public let title: String?
+ public let titleSort: String?
+ public let type: String?
+ public let updatedAt: Int?
+ public let viewCount: Int?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(addedAt: Int? = nil, composite: String? = nil, duration: Int? = nil, guid: String? = nil, icon: String? = nil, key: String? = nil, lastViewedAt: Int? = nil, leafCount: Int? = nil, playlistType: String? = nil, ratingKey: String? = nil, smart: Bool? = nil, summary: String? = nil, title: String? = nil, titleSort: String? = nil, type: String? = nil, updatedAt: Int? = nil, viewCount: Int? = nil) {
+ self.addedAt = addedAt
+ self.composite = composite
+ self.duration = duration
+ self.guid = guid
+ self.icon = icon
+ self.key = key
+ self.lastViewedAt = lastViewedAt
+ self.leafCount = leafCount
+ self.playlistType = playlistType
+ self.ratingKey = ratingKey
+ self.smart = smart
+ self.summary = summary
+ self.title = title
+ self.titleSort = titleSort
+ self.type = type
+ self.updatedAt = updatedAt
+ self.viewCount = viewCount
+ }
+ }
+}
+
+extension Operations.GetGlobalHubsMetadata: Codable {
+ enum CodingKeys: String, CodingKey {
+ case addedAt
+ case composite
+ case duration
+ case guid
+ case icon
+ case key
+ case lastViewedAt
+ case leafCount
+ case playlistType
+ case ratingKey
+ case smart
+ case summary
+ case title
+ case titleSort
+ case type
+ case updatedAt
+ case viewCount
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetGlobalHubsRequest.swift b/Sources/Plexswift/models/operations/GetGlobalHubsRequest.swift
new file mode 100644
index 0000000..949ca40
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetGlobalHubsRequest.swift
@@ -0,0 +1,29 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetGlobalHubsRequest: APIValue {
+ /// The number of items to return with each hub.
+ @DecimalSerialized
+ public private(set) var count: Double?
+ /// Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
+ public let onlyTransient: Operations.OnlyTransient?
+
+ /// Creates an object with the specified parameters
+ ///
+ /// - Parameter count: The number of items to return with each hub.
+ /// - Parameter onlyTransient: Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
+ ///
+ public init(count: Double? = nil, onlyTransient: Operations.OnlyTransient? = nil) {
+ self._count = DecimalSerialized(wrappedValue: count)
+ self.onlyTransient = onlyTransient
+ }
+ }
+}
+extension Operations.GetGlobalHubsRequest {
+ var countWrapper: DecimalSerialized {
+ return _count
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetGlobalHubsResponse.swift b/Sources/Plexswift/models/operations/GetGlobalHubsResponse.swift
new file mode 100644
index 0000000..41707b4
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetGlobalHubsResponse.swift
@@ -0,0 +1,34 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum GetGlobalHubsResponse {
+ case empty
+ case twoHundredApplicationJsonObject(Operations.GetGlobalHubsResponseBody)
+ case fourHundredAndOneApplicationJsonObject(Operations.GetGlobalHubsHubsResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func twoHundredApplicationJsonObject() throws -> Operations.GetGlobalHubsResponseBody {
+ guard case .twoHundredApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+
+ public func fourHundredAndOneApplicationJsonObject() throws -> Operations.GetGlobalHubsHubsResponseBody {
+ guard case .fourHundredAndOneApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetGlobalHubsResponseBody.swift b/Sources/Plexswift/models/operations/GetGlobalHubsResponseBody.swift
new file mode 100644
index 0000000..b1805c5
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetGlobalHubsResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// returns global hubs
+ public struct GetGlobalHubsResponseBody {
+ public let mediaContainer: Operations.GetGlobalHubsMediaContainer?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(mediaContainer: Operations.GetGlobalHubsMediaContainer? = nil) {
+ self.mediaContainer = mediaContainer
+ }
+ }
+}
+
+extension Operations.GetGlobalHubsResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case mediaContainer = "MediaContainer"
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetLibrariesDirectory.swift b/Sources/Plexswift/models/operations/GetLibrariesDirectory.swift
new file mode 100644
index 0000000..eeeb8f5
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetLibrariesDirectory.swift
@@ -0,0 +1,84 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetLibrariesDirectory {
+ public let agent: String?
+ public let allowSync: Bool?
+ public let art: String?
+ public let composite: String?
+ public let content: Bool?
+ public let contentChangedAt: Int?
+ public let createdAt: Int?
+ public let directory: Bool?
+ public let filters: Bool?
+ public let hidden: Int?
+ public let key: String?
+ public let language: String?
+ public let location: [Operations.GetLibrariesLocation]?
+ public let refreshing: Bool?
+ public let scannedAt: Int?
+ public let scanner: String?
+ public let thumb: String?
+ public let title: String?
+ public let type: String?
+ public let updatedAt: Int?
+ public let uuid: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(agent: String? = nil, allowSync: Bool? = nil, art: String? = nil, composite: String? = nil, content: Bool? = nil, contentChangedAt: Int? = nil, createdAt: Int? = nil, directory: Bool? = nil, filters: Bool? = nil, hidden: Int? = nil, key: String? = nil, language: String? = nil, location: [Operations.GetLibrariesLocation]? = nil, refreshing: Bool? = nil, scannedAt: Int? = nil, scanner: String? = nil, thumb: String? = nil, title: String? = nil, type: String? = nil, updatedAt: Int? = nil, uuid: String? = nil) {
+ self.agent = agent
+ self.allowSync = allowSync
+ self.art = art
+ self.composite = composite
+ self.content = content
+ self.contentChangedAt = contentChangedAt
+ self.createdAt = createdAt
+ self.directory = directory
+ self.filters = filters
+ self.hidden = hidden
+ self.key = key
+ self.language = language
+ self.location = location
+ self.refreshing = refreshing
+ self.scannedAt = scannedAt
+ self.scanner = scanner
+ self.thumb = thumb
+ self.title = title
+ self.type = type
+ self.updatedAt = updatedAt
+ self.uuid = uuid
+ }
+ }
+}
+
+extension Operations.GetLibrariesDirectory: Codable {
+ enum CodingKeys: String, CodingKey {
+ case agent
+ case allowSync
+ case art
+ case composite
+ case content
+ case contentChangedAt
+ case createdAt
+ case directory
+ case filters
+ case hidden
+ case key
+ case language
+ case location = "Location"
+ case refreshing
+ case scannedAt
+ case scanner
+ case thumb
+ case title
+ case type
+ case updatedAt
+ case uuid
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetLibrariesErrors.swift b/Sources/Plexswift/models/operations/GetLibrariesErrors.swift
new file mode 100644
index 0000000..8a3e157
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetLibrariesErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetLibrariesErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.GetLibrariesErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized(wrappedValue: nil)
+ }
+
+ public func encode(to encoder: Encoder) throws {
+ var container = encoder.container(keyedBy: CodingKeys.self)
+ if self.code != nil {
+ try container.encode(self._code, forKey: .code)
+ }
+ try container.encodeIfPresent(self.message, forKey: .message)
+ if self.status != nil {
+ try container.encode(self._status, forKey: .status)
+ }
+ }
+}
+
+extension Operations.GetLibrariesErrors {
+ var codeWrapper: DecimalSerialized {
+ return _code
+ }
+ var statusWrapper: DecimalSerialized {
+ return _status
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetLibrariesLibraryResponseBody.swift b/Sources/Plexswift/models/operations/GetLibrariesLibraryResponseBody.swift
new file mode 100644
index 0000000..66f72e6
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetLibrariesLibraryResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
+ public struct GetLibrariesLibraryResponseBody {
+ public let errors: [Operations.GetLibrariesErrors]?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(errors: [Operations.GetLibrariesErrors]? = nil) {
+ self.errors = errors
+ }
+ }
+}
+
+extension Operations.GetLibrariesLibraryResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case errors
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetLibrariesLocation.swift b/Sources/Plexswift/models/operations/GetLibrariesLocation.swift
new file mode 100644
index 0000000..3da9161
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetLibrariesLocation.swift
@@ -0,0 +1,27 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetLibrariesLocation {
+ public let id: Int?
+ public let path: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(id: Int? = nil, path: String? = nil) {
+ self.id = id
+ self.path = path
+ }
+ }
+}
+
+extension Operations.GetLibrariesLocation: Codable {
+ enum CodingKeys: String, CodingKey {
+ case id
+ case path
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetLibrariesMediaContainer.swift b/Sources/Plexswift/models/operations/GetLibrariesMediaContainer.swift
new file mode 100644
index 0000000..4cf99e5
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetLibrariesMediaContainer.swift
@@ -0,0 +1,33 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetLibrariesMediaContainer {
+ public let allowSync: Bool?
+ public let directory: [Operations.GetLibrariesDirectory]?
+ public let size: Int?
+ public let title1: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(allowSync: Bool? = nil, directory: [Operations.GetLibrariesDirectory]? = nil, size: Int? = nil, title1: String? = nil) {
+ self.allowSync = allowSync
+ self.directory = directory
+ self.size = size
+ self.title1 = title1
+ }
+ }
+}
+
+extension Operations.GetLibrariesMediaContainer: Codable {
+ enum CodingKeys: String, CodingKey {
+ case allowSync
+ case directory = "Directory"
+ case size
+ case title1
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetLibrariesResponse.swift b/Sources/Plexswift/models/operations/GetLibrariesResponse.swift
new file mode 100644
index 0000000..a8679c3
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetLibrariesResponse.swift
@@ -0,0 +1,34 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A response model
+ public enum GetLibrariesResponse {
+ case empty
+ case twoHundredApplicationJsonObject(Operations.GetLibrariesResponseBody)
+ case fourHundredAndOneApplicationJsonObject(Operations.GetLibrariesLibraryResponseBody)
+
+ var isEmpty: Bool {
+ if case .empty = self {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ public func twoHundredApplicationJsonObject() throws -> Operations.GetLibrariesResponseBody {
+ guard case .twoHundredApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+
+ public func fourHundredAndOneApplicationJsonObject() throws -> Operations.GetLibrariesLibraryResponseBody {
+ guard case .fourHundredAndOneApplicationJsonObject(let value) = self else {
+ throw PlexswiftError.missingResponseData
+ }
+ return value
+ }
+ }
+}
diff --git a/Sources/Plexswift/models/operations/GetLibrariesResponseBody.swift b/Sources/Plexswift/models/operations/GetLibrariesResponseBody.swift
new file mode 100644
index 0000000..73fde21
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetLibrariesResponseBody.swift
@@ -0,0 +1,24 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// The libraries available on the Server
+ public struct GetLibrariesResponseBody {
+ public let mediaContainer: Operations.GetLibrariesMediaContainer?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(mediaContainer: Operations.GetLibrariesMediaContainer? = nil) {
+ self.mediaContainer = mediaContainer
+ }
+ }
+}
+
+extension Operations.GetLibrariesResponseBody: Codable {
+ enum CodingKeys: String, CodingKey {
+ case mediaContainer = "MediaContainer"
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetLibraryDirectory.swift b/Sources/Plexswift/models/operations/GetLibraryDirectory.swift
new file mode 100644
index 0000000..9e0b9c9
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetLibraryDirectory.swift
@@ -0,0 +1,36 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetLibraryDirectory {
+ public let key: String?
+ public let prompt: String?
+ public let search: Bool?
+ public let secondary: Bool?
+ public let title: String?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(key: String? = nil, prompt: String? = nil, search: Bool? = nil, secondary: Bool? = nil, title: String? = nil) {
+ self.key = key
+ self.prompt = prompt
+ self.search = search
+ self.secondary = secondary
+ self.title = title
+ }
+ }
+}
+
+extension Operations.GetLibraryDirectory: Codable {
+ enum CodingKeys: String, CodingKey {
+ case key
+ case prompt
+ case search
+ case secondary
+ case title
+ }
+}
+
diff --git a/Sources/Plexswift/models/operations/GetLibraryErrors.swift b/Sources/Plexswift/models/operations/GetLibraryErrors.swift
new file mode 100644
index 0000000..4149c36
--- /dev/null
+++ b/Sources/Plexswift/models/operations/GetLibraryErrors.swift
@@ -0,0 +1,58 @@
+// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
+
+import Foundation
+
+extension Operations {
+ /// A model object
+ public struct GetLibraryErrors {
+ @DecimalSerialized
+ public private(set) var code: Double?
+ public let message: String?
+ @DecimalSerialized
+ public private(set) var status: Double?
+
+ /// Creates an object with the specified parameters
+ ///
+ ///
+ public init(code: Double? = nil, message: String? = nil, status: Double? = nil) {
+ self._code = DecimalSerialized(wrappedValue: code)
+ self.message = message
+ self._status = DecimalSerialized(wrappedValue: status)
+ }
+ }
+}
+
+extension Operations.GetLibraryErrors: Codable {
+ enum CodingKeys: String, CodingKey {
+ case code
+ case message
+ case status
+ }
+
+ public init(from decoder: Decoder) throws {
+ let container = try decoder.container(keyedBy: CodingKeys.self)
+ self._code = try container.decodeIfPresent(DecimalSerialized.self, forKey: .code) ?? DecimalSerialized(wrappedValue: nil)
+ self.message = try container.decodeIfPresent(String.self, forKey: .message)
+ self._status = try container.decodeIfPresent(DecimalSerialized.self, forKey: .status) ?? DecimalSerialized