mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 20:47:49 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.193.0
This commit is contained in:
@@ -1,37 +1,41 @@
|
|||||||
lockVersion: 2.0.0
|
lockVersion: 2.0.0
|
||||||
id: 5a8dbcbc-e0ee-41f0-9d84-b8b50567d1e9
|
id: 5a8dbcbc-e0ee-41f0-9d84-b8b50567d1e9
|
||||||
management:
|
management:
|
||||||
docChecksum: 7aba498c024534142941d65a7c2e649c
|
docChecksum: 278d186496d83d5830ba4870f8cad39d
|
||||||
docVersion: 0.0.3
|
docVersion: 0.0.3
|
||||||
speakeasyVersion: internal
|
speakeasyVersion: internal
|
||||||
generationVersion: 2.237.3
|
generationVersion: 2.269.0
|
||||||
releaseVersion: 0.1.5
|
releaseVersion: 0.2.0
|
||||||
configChecksum: 112f7d72fae8408e2dd1ef59ee88fb3a
|
configChecksum: 4ebe302dc8fa1b45e1377207cb76f6ff
|
||||||
repoURL: https://github.com/LukeHagar/plexcsharp.git
|
repoURL: https://github.com/LukeHagar/plexcsharp.git
|
||||||
repoSubDirectory: .
|
repoSubDirectory: .
|
||||||
published: true
|
published: true
|
||||||
features:
|
features:
|
||||||
csharp:
|
csharp:
|
||||||
core: 3.3.1
|
core: 3.4.1
|
||||||
flattening: 2.81.1
|
flattening: 2.81.1
|
||||||
globalSecurity: 2.81.3
|
globalSecurity: 2.83.1
|
||||||
globalServerURLs: 2.82.2
|
globalServerURLs: 2.82.2
|
||||||
|
methodServerURLs: 2.82.1
|
||||||
nameOverrides: 2.81.1
|
nameOverrides: 2.81.1
|
||||||
generatedFiles:
|
generatedFiles:
|
||||||
- PlexAPI/Server.cs
|
- PlexAPI/Server.cs
|
||||||
- PlexAPI/Media.cs
|
- PlexAPI/Media.cs
|
||||||
|
- PlexAPI/Video.cs
|
||||||
- PlexAPI/Activities.cs
|
- PlexAPI/Activities.cs
|
||||||
- PlexAPI/Butler.cs
|
- PlexAPI/Butler.cs
|
||||||
- PlexAPI/Hubs.cs
|
- PlexAPI/Hubs.cs
|
||||||
- PlexAPI/Search.cs
|
- PlexAPI/Search.cs
|
||||||
- PlexAPI/Library.cs
|
- PlexAPI/Library.cs
|
||||||
- PlexAPI/Log.cs
|
- PlexAPI/Log.cs
|
||||||
|
- PlexAPI/Plex.cs
|
||||||
- PlexAPI/Playlists.cs
|
- PlexAPI/Playlists.cs
|
||||||
- PlexAPI/Security.cs
|
- PlexAPI/Security.cs
|
||||||
|
- PlexAPI/Statistics.cs
|
||||||
- PlexAPI/Sessions.cs
|
- PlexAPI/Sessions.cs
|
||||||
- PlexAPI/Updater.cs
|
- PlexAPI/Updater.cs
|
||||||
- PlexAPI/Video.cs
|
|
||||||
- PlexAPI/PlexAPISDK.cs
|
- PlexAPI/PlexAPISDK.cs
|
||||||
|
- global.json
|
||||||
- PlexAPI/Utils/BigIntSerializer.cs
|
- PlexAPI/Utils/BigIntSerializer.cs
|
||||||
- PlexAPI/Utils/DecimalSerializer.cs
|
- PlexAPI/Utils/DecimalSerializer.cs
|
||||||
- PlexAPI/Utils/EnumSerializer.cs
|
- PlexAPI/Utils/EnumSerializer.cs
|
||||||
@@ -54,6 +58,7 @@ generatedFiles:
|
|||||||
- PlexAPI/Models/Requests/GetServerCapabilitiesResponse.cs
|
- PlexAPI/Models/Requests/GetServerCapabilitiesResponse.cs
|
||||||
- PlexAPI/Models/Requests/GetServerPreferencesErrors.cs
|
- PlexAPI/Models/Requests/GetServerPreferencesErrors.cs
|
||||||
- PlexAPI/Models/Requests/GetServerPreferencesServerResponseBody.cs
|
- PlexAPI/Models/Requests/GetServerPreferencesServerResponseBody.cs
|
||||||
|
- PlexAPI/Models/Requests/Setting.cs
|
||||||
- PlexAPI/Models/Requests/GetServerPreferencesMediaContainer.cs
|
- PlexAPI/Models/Requests/GetServerPreferencesMediaContainer.cs
|
||||||
- PlexAPI/Models/Requests/GetServerPreferencesResponseBody.cs
|
- PlexAPI/Models/Requests/GetServerPreferencesResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/GetServerPreferencesResponse.cs
|
- PlexAPI/Models/Requests/GetServerPreferencesResponse.cs
|
||||||
@@ -103,6 +108,15 @@ generatedFiles:
|
|||||||
- PlexAPI/Models/Requests/UpdatePlayProgressErrors.cs
|
- PlexAPI/Models/Requests/UpdatePlayProgressErrors.cs
|
||||||
- PlexAPI/Models/Requests/UpdatePlayProgressResponseBody.cs
|
- PlexAPI/Models/Requests/UpdatePlayProgressResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/UpdatePlayProgressResponse.cs
|
- PlexAPI/Models/Requests/UpdatePlayProgressResponse.cs
|
||||||
|
- PlexAPI/Models/Requests/State.cs
|
||||||
|
- PlexAPI/Models/Requests/GetTimelineRequest.cs
|
||||||
|
- PlexAPI/Models/Requests/GetTimelineErrors.cs
|
||||||
|
- PlexAPI/Models/Requests/GetTimelineResponseBody.cs
|
||||||
|
- PlexAPI/Models/Requests/GetTimelineResponse.cs
|
||||||
|
- PlexAPI/Models/Requests/StartUniversalTranscodeRequest.cs
|
||||||
|
- PlexAPI/Models/Requests/StartUniversalTranscodeErrors.cs
|
||||||
|
- PlexAPI/Models/Requests/StartUniversalTranscodeResponseBody.cs
|
||||||
|
- PlexAPI/Models/Requests/StartUniversalTranscodeResponse.cs
|
||||||
- PlexAPI/Models/Requests/GetServerActivitiesErrors.cs
|
- PlexAPI/Models/Requests/GetServerActivitiesErrors.cs
|
||||||
- PlexAPI/Models/Requests/GetServerActivitiesActivitiesResponseBody.cs
|
- PlexAPI/Models/Requests/GetServerActivitiesActivitiesResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/Context.cs
|
- PlexAPI/Models/Requests/Context.cs
|
||||||
@@ -203,7 +217,7 @@ generatedFiles:
|
|||||||
- PlexAPI/Models/Requests/GetRecentlyAddedResponse.cs
|
- PlexAPI/Models/Requests/GetRecentlyAddedResponse.cs
|
||||||
- PlexAPI/Models/Requests/GetLibrariesErrors.cs
|
- PlexAPI/Models/Requests/GetLibrariesErrors.cs
|
||||||
- PlexAPI/Models/Requests/GetLibrariesLibraryResponseBody.cs
|
- PlexAPI/Models/Requests/GetLibrariesLibraryResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/Location.cs
|
- PlexAPI/Models/Requests/GetLibrariesLocation.cs
|
||||||
- PlexAPI/Models/Requests/GetLibrariesDirectory.cs
|
- PlexAPI/Models/Requests/GetLibrariesDirectory.cs
|
||||||
- PlexAPI/Models/Requests/GetLibrariesMediaContainer.cs
|
- PlexAPI/Models/Requests/GetLibrariesMediaContainer.cs
|
||||||
- PlexAPI/Models/Requests/GetLibrariesResponseBody.cs
|
- PlexAPI/Models/Requests/GetLibrariesResponseBody.cs
|
||||||
@@ -243,6 +257,12 @@ generatedFiles:
|
|||||||
- PlexAPI/Models/Requests/RefreshLibraryErrors.cs
|
- PlexAPI/Models/Requests/RefreshLibraryErrors.cs
|
||||||
- PlexAPI/Models/Requests/RefreshLibraryResponseBody.cs
|
- PlexAPI/Models/Requests/RefreshLibraryResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/RefreshLibraryResponse.cs
|
- PlexAPI/Models/Requests/RefreshLibraryResponse.cs
|
||||||
|
- PlexAPI/Models/Requests/Type.cs
|
||||||
|
- PlexAPI/Models/Requests/SearchLibraryRequest.cs
|
||||||
|
- PlexAPI/Models/Requests/SearchLibraryMetadata.cs
|
||||||
|
- PlexAPI/Models/Requests/SearchLibraryMediaContainer.cs
|
||||||
|
- PlexAPI/Models/Requests/SearchLibraryResponseBody.cs
|
||||||
|
- PlexAPI/Models/Requests/SearchLibraryResponse.cs
|
||||||
- PlexAPI/Models/Requests/GetMetadataRequest.cs
|
- PlexAPI/Models/Requests/GetMetadataRequest.cs
|
||||||
- PlexAPI/Models/Requests/GetMetadataErrors.cs
|
- PlexAPI/Models/Requests/GetMetadataErrors.cs
|
||||||
- PlexAPI/Models/Requests/GetMetadataLibraryResponseBody.cs
|
- PlexAPI/Models/Requests/GetMetadataLibraryResponseBody.cs
|
||||||
@@ -290,7 +310,17 @@ generatedFiles:
|
|||||||
- PlexAPI/Models/Requests/EnablePaperTrailErrors.cs
|
- PlexAPI/Models/Requests/EnablePaperTrailErrors.cs
|
||||||
- PlexAPI/Models/Requests/EnablePaperTrailResponseBody.cs
|
- PlexAPI/Models/Requests/EnablePaperTrailResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/EnablePaperTrailResponse.cs
|
- PlexAPI/Models/Requests/EnablePaperTrailResponse.cs
|
||||||
- PlexAPI/Models/Requests/Type.cs
|
- PlexAPI/Models/Requests/GetPinRequest.cs
|
||||||
|
- PlexAPI/Models/Requests/GetPinErrors.cs
|
||||||
|
- PlexAPI/Models/Requests/GetPinPlexResponseBody.cs
|
||||||
|
- PlexAPI/Models/Requests/Location.cs
|
||||||
|
- PlexAPI/Models/Requests/GetPinResponseBody.cs
|
||||||
|
- PlexAPI/Models/Requests/GetPinResponse.cs
|
||||||
|
- PlexAPI/Models/Requests/GetTokenRequest.cs
|
||||||
|
- PlexAPI/Models/Requests/GetTokenErrors.cs
|
||||||
|
- PlexAPI/Models/Requests/GetTokenResponseBody.cs
|
||||||
|
- PlexAPI/Models/Requests/GetTokenResponse.cs
|
||||||
|
- PlexAPI/Models/Requests/QueryParamType.cs
|
||||||
- PlexAPI/Models/Requests/Smart.cs
|
- PlexAPI/Models/Requests/Smart.cs
|
||||||
- PlexAPI/Models/Requests/CreatePlaylistRequest.cs
|
- PlexAPI/Models/Requests/CreatePlaylistRequest.cs
|
||||||
- PlexAPI/Models/Requests/CreatePlaylistErrors.cs
|
- PlexAPI/Models/Requests/CreatePlaylistErrors.cs
|
||||||
@@ -353,7 +383,7 @@ generatedFiles:
|
|||||||
- PlexAPI/Models/Requests/UploadPlaylistErrors.cs
|
- PlexAPI/Models/Requests/UploadPlaylistErrors.cs
|
||||||
- PlexAPI/Models/Requests/UploadPlaylistResponseBody.cs
|
- PlexAPI/Models/Requests/UploadPlaylistResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/UploadPlaylistResponse.cs
|
- PlexAPI/Models/Requests/UploadPlaylistResponse.cs
|
||||||
- PlexAPI/Models/Requests/QueryParamType.cs
|
- PlexAPI/Models/Requests/GetTransientTokenQueryParamType.cs
|
||||||
- PlexAPI/Models/Requests/Scope.cs
|
- PlexAPI/Models/Requests/Scope.cs
|
||||||
- PlexAPI/Models/Requests/GetTransientTokenRequest.cs
|
- PlexAPI/Models/Requests/GetTransientTokenRequest.cs
|
||||||
- PlexAPI/Models/Requests/GetTransientTokenErrors.cs
|
- PlexAPI/Models/Requests/GetTransientTokenErrors.cs
|
||||||
@@ -363,6 +393,15 @@ generatedFiles:
|
|||||||
- PlexAPI/Models/Requests/GetSourceConnectionInformationErrors.cs
|
- PlexAPI/Models/Requests/GetSourceConnectionInformationErrors.cs
|
||||||
- PlexAPI/Models/Requests/GetSourceConnectionInformationResponseBody.cs
|
- PlexAPI/Models/Requests/GetSourceConnectionInformationResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/GetSourceConnectionInformationResponse.cs
|
- PlexAPI/Models/Requests/GetSourceConnectionInformationResponse.cs
|
||||||
|
- PlexAPI/Models/Requests/GetStatisticsRequest.cs
|
||||||
|
- PlexAPI/Models/Requests/GetStatisticsErrors.cs
|
||||||
|
- PlexAPI/Models/Requests/GetStatisticsStatisticsResponseBody.cs
|
||||||
|
- PlexAPI/Models/Requests/GetStatisticsDevice.cs
|
||||||
|
- PlexAPI/Models/Requests/Account.cs
|
||||||
|
- PlexAPI/Models/Requests/StatisticsMedia.cs
|
||||||
|
- PlexAPI/Models/Requests/GetStatisticsMediaContainer.cs
|
||||||
|
- PlexAPI/Models/Requests/GetStatisticsResponseBody.cs
|
||||||
|
- PlexAPI/Models/Requests/GetStatisticsResponse.cs
|
||||||
- PlexAPI/Models/Requests/GetSessionsErrors.cs
|
- PlexAPI/Models/Requests/GetSessionsErrors.cs
|
||||||
- PlexAPI/Models/Requests/GetSessionsSessionsResponseBody.cs
|
- PlexAPI/Models/Requests/GetSessionsSessionsResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/GetSessionsStream.cs
|
- PlexAPI/Models/Requests/GetSessionsStream.cs
|
||||||
@@ -408,15 +447,6 @@ generatedFiles:
|
|||||||
- PlexAPI/Models/Requests/ApplyUpdatesErrors.cs
|
- PlexAPI/Models/Requests/ApplyUpdatesErrors.cs
|
||||||
- PlexAPI/Models/Requests/ApplyUpdatesResponseBody.cs
|
- PlexAPI/Models/Requests/ApplyUpdatesResponseBody.cs
|
||||||
- PlexAPI/Models/Requests/ApplyUpdatesResponse.cs
|
- PlexAPI/Models/Requests/ApplyUpdatesResponse.cs
|
||||||
- PlexAPI/Models/Requests/StartUniversalTranscodeRequest.cs
|
|
||||||
- PlexAPI/Models/Requests/StartUniversalTranscodeErrors.cs
|
|
||||||
- PlexAPI/Models/Requests/StartUniversalTranscodeResponseBody.cs
|
|
||||||
- PlexAPI/Models/Requests/StartUniversalTranscodeResponse.cs
|
|
||||||
- PlexAPI/Models/Requests/State.cs
|
|
||||||
- PlexAPI/Models/Requests/GetTimelineRequest.cs
|
|
||||||
- PlexAPI/Models/Requests/GetTimelineErrors.cs
|
|
||||||
- PlexAPI/Models/Requests/GetTimelineResponseBody.cs
|
|
||||||
- PlexAPI/Models/Requests/GetTimelineResponse.cs
|
|
||||||
- PlexAPI/Models/Components/Security.cs
|
- PlexAPI/Models/Components/Security.cs
|
||||||
- docs/Models/Requests/Errors.md
|
- docs/Models/Requests/Errors.md
|
||||||
- docs/Models/Requests/GetServerCapabilitiesServerResponseBody.md
|
- docs/Models/Requests/GetServerCapabilitiesServerResponseBody.md
|
||||||
@@ -426,6 +456,7 @@ generatedFiles:
|
|||||||
- docs/Models/Requests/GetServerCapabilitiesResponse.md
|
- docs/Models/Requests/GetServerCapabilitiesResponse.md
|
||||||
- docs/Models/Requests/GetServerPreferencesErrors.md
|
- docs/Models/Requests/GetServerPreferencesErrors.md
|
||||||
- docs/Models/Requests/GetServerPreferencesServerResponseBody.md
|
- docs/Models/Requests/GetServerPreferencesServerResponseBody.md
|
||||||
|
- docs/Models/Requests/Setting.md
|
||||||
- docs/Models/Requests/GetServerPreferencesMediaContainer.md
|
- docs/Models/Requests/GetServerPreferencesMediaContainer.md
|
||||||
- docs/Models/Requests/GetServerPreferencesResponseBody.md
|
- docs/Models/Requests/GetServerPreferencesResponseBody.md
|
||||||
- docs/Models/Requests/GetServerPreferencesResponse.md
|
- docs/Models/Requests/GetServerPreferencesResponse.md
|
||||||
@@ -475,6 +506,15 @@ generatedFiles:
|
|||||||
- docs/Models/Requests/UpdatePlayProgressErrors.md
|
- docs/Models/Requests/UpdatePlayProgressErrors.md
|
||||||
- docs/Models/Requests/UpdatePlayProgressResponseBody.md
|
- docs/Models/Requests/UpdatePlayProgressResponseBody.md
|
||||||
- docs/Models/Requests/UpdatePlayProgressResponse.md
|
- docs/Models/Requests/UpdatePlayProgressResponse.md
|
||||||
|
- docs/Models/Requests/State.md
|
||||||
|
- docs/Models/Requests/GetTimelineRequest.md
|
||||||
|
- docs/Models/Requests/GetTimelineErrors.md
|
||||||
|
- docs/Models/Requests/GetTimelineResponseBody.md
|
||||||
|
- docs/Models/Requests/GetTimelineResponse.md
|
||||||
|
- docs/Models/Requests/StartUniversalTranscodeRequest.md
|
||||||
|
- docs/Models/Requests/StartUniversalTranscodeErrors.md
|
||||||
|
- docs/Models/Requests/StartUniversalTranscodeResponseBody.md
|
||||||
|
- docs/Models/Requests/StartUniversalTranscodeResponse.md
|
||||||
- docs/Models/Requests/GetServerActivitiesErrors.md
|
- docs/Models/Requests/GetServerActivitiesErrors.md
|
||||||
- docs/Models/Requests/GetServerActivitiesActivitiesResponseBody.md
|
- docs/Models/Requests/GetServerActivitiesActivitiesResponseBody.md
|
||||||
- docs/Models/Requests/Context.md
|
- docs/Models/Requests/Context.md
|
||||||
@@ -575,7 +615,7 @@ generatedFiles:
|
|||||||
- docs/Models/Requests/GetRecentlyAddedResponse.md
|
- docs/Models/Requests/GetRecentlyAddedResponse.md
|
||||||
- docs/Models/Requests/GetLibrariesErrors.md
|
- docs/Models/Requests/GetLibrariesErrors.md
|
||||||
- docs/Models/Requests/GetLibrariesLibraryResponseBody.md
|
- docs/Models/Requests/GetLibrariesLibraryResponseBody.md
|
||||||
- docs/Models/Requests/Location.md
|
- docs/Models/Requests/GetLibrariesLocation.md
|
||||||
- docs/Models/Requests/GetLibrariesDirectory.md
|
- docs/Models/Requests/GetLibrariesDirectory.md
|
||||||
- docs/Models/Requests/GetLibrariesMediaContainer.md
|
- docs/Models/Requests/GetLibrariesMediaContainer.md
|
||||||
- docs/Models/Requests/GetLibrariesResponseBody.md
|
- docs/Models/Requests/GetLibrariesResponseBody.md
|
||||||
@@ -615,6 +655,12 @@ generatedFiles:
|
|||||||
- docs/Models/Requests/RefreshLibraryErrors.md
|
- docs/Models/Requests/RefreshLibraryErrors.md
|
||||||
- docs/Models/Requests/RefreshLibraryResponseBody.md
|
- docs/Models/Requests/RefreshLibraryResponseBody.md
|
||||||
- docs/Models/Requests/RefreshLibraryResponse.md
|
- docs/Models/Requests/RefreshLibraryResponse.md
|
||||||
|
- docs/Models/Requests/Type.md
|
||||||
|
- docs/Models/Requests/SearchLibraryRequest.md
|
||||||
|
- docs/Models/Requests/SearchLibraryMetadata.md
|
||||||
|
- docs/Models/Requests/SearchLibraryMediaContainer.md
|
||||||
|
- docs/Models/Requests/SearchLibraryResponseBody.md
|
||||||
|
- docs/Models/Requests/SearchLibraryResponse.md
|
||||||
- docs/Models/Requests/GetMetadataRequest.md
|
- docs/Models/Requests/GetMetadataRequest.md
|
||||||
- docs/Models/Requests/GetMetadataErrors.md
|
- docs/Models/Requests/GetMetadataErrors.md
|
||||||
- docs/Models/Requests/GetMetadataLibraryResponseBody.md
|
- docs/Models/Requests/GetMetadataLibraryResponseBody.md
|
||||||
@@ -662,7 +708,17 @@ generatedFiles:
|
|||||||
- docs/Models/Requests/EnablePaperTrailErrors.md
|
- docs/Models/Requests/EnablePaperTrailErrors.md
|
||||||
- docs/Models/Requests/EnablePaperTrailResponseBody.md
|
- docs/Models/Requests/EnablePaperTrailResponseBody.md
|
||||||
- docs/Models/Requests/EnablePaperTrailResponse.md
|
- docs/Models/Requests/EnablePaperTrailResponse.md
|
||||||
- docs/Models/Requests/Type.md
|
- docs/Models/Requests/GetPinRequest.md
|
||||||
|
- docs/Models/Requests/GetPinErrors.md
|
||||||
|
- docs/Models/Requests/GetPinPlexResponseBody.md
|
||||||
|
- docs/Models/Requests/Location.md
|
||||||
|
- docs/Models/Requests/GetPinResponseBody.md
|
||||||
|
- docs/Models/Requests/GetPinResponse.md
|
||||||
|
- docs/Models/Requests/GetTokenRequest.md
|
||||||
|
- docs/Models/Requests/GetTokenErrors.md
|
||||||
|
- docs/Models/Requests/GetTokenResponseBody.md
|
||||||
|
- docs/Models/Requests/GetTokenResponse.md
|
||||||
|
- docs/Models/Requests/QueryParamType.md
|
||||||
- docs/Models/Requests/Smart.md
|
- docs/Models/Requests/Smart.md
|
||||||
- docs/Models/Requests/CreatePlaylistRequest.md
|
- docs/Models/Requests/CreatePlaylistRequest.md
|
||||||
- docs/Models/Requests/CreatePlaylistErrors.md
|
- docs/Models/Requests/CreatePlaylistErrors.md
|
||||||
@@ -725,7 +781,7 @@ generatedFiles:
|
|||||||
- docs/Models/Requests/UploadPlaylistErrors.md
|
- docs/Models/Requests/UploadPlaylistErrors.md
|
||||||
- docs/Models/Requests/UploadPlaylistResponseBody.md
|
- docs/Models/Requests/UploadPlaylistResponseBody.md
|
||||||
- docs/Models/Requests/UploadPlaylistResponse.md
|
- docs/Models/Requests/UploadPlaylistResponse.md
|
||||||
- docs/Models/Requests/QueryParamType.md
|
- docs/Models/Requests/GetTransientTokenQueryParamType.md
|
||||||
- docs/Models/Requests/Scope.md
|
- docs/Models/Requests/Scope.md
|
||||||
- docs/Models/Requests/GetTransientTokenRequest.md
|
- docs/Models/Requests/GetTransientTokenRequest.md
|
||||||
- docs/Models/Requests/GetTransientTokenErrors.md
|
- docs/Models/Requests/GetTransientTokenErrors.md
|
||||||
@@ -735,6 +791,15 @@ generatedFiles:
|
|||||||
- docs/Models/Requests/GetSourceConnectionInformationErrors.md
|
- docs/Models/Requests/GetSourceConnectionInformationErrors.md
|
||||||
- docs/Models/Requests/GetSourceConnectionInformationResponseBody.md
|
- docs/Models/Requests/GetSourceConnectionInformationResponseBody.md
|
||||||
- docs/Models/Requests/GetSourceConnectionInformationResponse.md
|
- docs/Models/Requests/GetSourceConnectionInformationResponse.md
|
||||||
|
- docs/Models/Requests/GetStatisticsRequest.md
|
||||||
|
- docs/Models/Requests/GetStatisticsErrors.md
|
||||||
|
- docs/Models/Requests/GetStatisticsStatisticsResponseBody.md
|
||||||
|
- docs/Models/Requests/GetStatisticsDevice.md
|
||||||
|
- docs/Models/Requests/Account.md
|
||||||
|
- docs/Models/Requests/StatisticsMedia.md
|
||||||
|
- docs/Models/Requests/GetStatisticsMediaContainer.md
|
||||||
|
- docs/Models/Requests/GetStatisticsResponseBody.md
|
||||||
|
- docs/Models/Requests/GetStatisticsResponse.md
|
||||||
- docs/Models/Requests/GetSessionsErrors.md
|
- docs/Models/Requests/GetSessionsErrors.md
|
||||||
- docs/Models/Requests/GetSessionsSessionsResponseBody.md
|
- docs/Models/Requests/GetSessionsSessionsResponseBody.md
|
||||||
- docs/Models/Requests/GetSessionsStream.md
|
- docs/Models/Requests/GetSessionsStream.md
|
||||||
@@ -780,29 +845,22 @@ generatedFiles:
|
|||||||
- docs/Models/Requests/ApplyUpdatesErrors.md
|
- docs/Models/Requests/ApplyUpdatesErrors.md
|
||||||
- docs/Models/Requests/ApplyUpdatesResponseBody.md
|
- docs/Models/Requests/ApplyUpdatesResponseBody.md
|
||||||
- docs/Models/Requests/ApplyUpdatesResponse.md
|
- docs/Models/Requests/ApplyUpdatesResponse.md
|
||||||
- docs/Models/Requests/StartUniversalTranscodeRequest.md
|
|
||||||
- docs/Models/Requests/StartUniversalTranscodeErrors.md
|
|
||||||
- docs/Models/Requests/StartUniversalTranscodeResponseBody.md
|
|
||||||
- docs/Models/Requests/StartUniversalTranscodeResponse.md
|
|
||||||
- docs/Models/Requests/State.md
|
|
||||||
- docs/Models/Requests/GetTimelineRequest.md
|
|
||||||
- docs/Models/Requests/GetTimelineErrors.md
|
|
||||||
- docs/Models/Requests/GetTimelineResponseBody.md
|
|
||||||
- docs/Models/Requests/GetTimelineResponse.md
|
|
||||||
- docs/Models/Components/Security.md
|
- docs/Models/Components/Security.md
|
||||||
- docs/sdks/plexapi/README.md
|
- docs/sdks/plexapi/README.md
|
||||||
- docs/sdks/server/README.md
|
- docs/sdks/server/README.md
|
||||||
- docs/sdks/media/README.md
|
- docs/sdks/media/README.md
|
||||||
|
- docs/sdks/video/README.md
|
||||||
- docs/sdks/activities/README.md
|
- docs/sdks/activities/README.md
|
||||||
- docs/sdks/butler/README.md
|
- docs/sdks/butler/README.md
|
||||||
- docs/sdks/hubs/README.md
|
- docs/sdks/hubs/README.md
|
||||||
- docs/sdks/search/README.md
|
- docs/sdks/search/README.md
|
||||||
- docs/sdks/library/README.md
|
- docs/sdks/library/README.md
|
||||||
- docs/sdks/log/README.md
|
- docs/sdks/log/README.md
|
||||||
|
- docs/sdks/plex/README.md
|
||||||
- docs/sdks/playlists/README.md
|
- docs/sdks/playlists/README.md
|
||||||
- docs/sdks/security/README.md
|
- docs/sdks/security/README.md
|
||||||
|
- docs/sdks/statistics/README.md
|
||||||
- docs/sdks/sessions/README.md
|
- docs/sdks/sessions/README.md
|
||||||
- docs/sdks/updater/README.md
|
- docs/sdks/updater/README.md
|
||||||
- docs/sdks/video/README.md
|
|
||||||
- USAGE.md
|
- USAGE.md
|
||||||
- .gitattributes
|
- .gitattributes
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -70,18 +71,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Activities(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Activities(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -90,50 +91,57 @@ namespace PlexAPI
|
|||||||
public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync()
|
public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/activities";
|
var urlString = baseUrl + "/activities";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetServerActivitiesResponse
|
var response = new GetServerActivitiesResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerActivitiesActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerActivitiesActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
|
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
|
||||||
@@ -144,40 +152,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new CancelServerActivitiesResponse
|
var response = new CancelServerActivitiesResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<CancelServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<CancelServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -97,18 +98,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Butler(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Butler(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -117,130 +118,149 @@ namespace PlexAPI
|
|||||||
public async Task<GetButlerTasksResponse> GetButlerTasksAsync()
|
public async Task<GetButlerTasksResponse> GetButlerTasksAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/butler";
|
var urlString = baseUrl + "/butler";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetButlerTasksResponse
|
var response = new GetButlerTasksResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetButlerTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetButlerTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetButlerTasksButlerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetButlerTasksButlerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/butler";
|
var urlString = baseUrl + "/butler";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new StartAllTasksResponse
|
var response = new StartAllTasksResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<StartAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<StartAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/butler";
|
var urlString = baseUrl + "/butler";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new StopAllTasksResponse
|
var response = new StopAllTasksResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<StopAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<StopAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
|
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
|
||||||
@@ -251,40 +271,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new StartTaskResponse
|
var response = new StartTaskResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 202) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 202) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<StartTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<StartTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
|
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
|
||||||
@@ -295,40 +320,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new StopTaskResponse
|
var response = new StopTaskResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400) || (response.StatusCode == 404))
|
if((response.StatusCode == 200) || (response.StatusCode == 400) || (response.StatusCode == 404))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<StopTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<StopTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -59,18 +60,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Hubs(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Hubs(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -85,49 +86,55 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/hubs", request);
|
var urlString = URLBuilder.Build(baseUrl, "/hubs", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetGlobalHubsResponse
|
var response = new GetGlobalHubsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetGlobalHubsHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetGlobalHubsHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
|
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
|
||||||
@@ -140,49 +147,55 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetLibraryHubsResponse
|
var response = new GetLibraryHubsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryHubsHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryHubsHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -143,7 +144,6 @@ namespace PlexAPI
|
|||||||
/// - `resolution`: Items categorized by resolution.<br/>
|
/// - `resolution`: Items categorized by resolution.<br/>
|
||||||
/// - `firstCharacter`: Items categorized by the first letter.<br/>
|
/// - `firstCharacter`: Items categorized by the first letter.<br/>
|
||||||
/// - `folder`: Items categorized by folder.<br/>
|
/// - `folder`: Items categorized by folder.<br/>
|
||||||
/// - `search?type=1`: Search functionality within the section.<br/>
|
|
||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -159,6 +159,33 @@ namespace PlexAPI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
Task<RefreshLibraryResponse> RefreshLibraryAsync(double sectionId);
|
Task<RefreshLibraryResponse> RefreshLibraryAsync(double sectionId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Search Library
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Search for content within a specific section of the library.<br/>
|
||||||
|
/// <br/>
|
||||||
|
/// ### Types<br/>
|
||||||
|
/// Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:<br/>
|
||||||
|
/// <br/>
|
||||||
|
/// - **Type Object Attributes**:<br/>
|
||||||
|
/// - `type`: Metadata type (if standard Plex type). <br/>
|
||||||
|
/// - `title`: Title for this content type (e.g., "Movies").<br/>
|
||||||
|
/// <br/>
|
||||||
|
/// - **Filter Objects**:<br/>
|
||||||
|
/// - Subset of the media query language.<br/>
|
||||||
|
/// - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.<br/>
|
||||||
|
/// <br/>
|
||||||
|
/// - **Sort Objects**:<br/>
|
||||||
|
/// - Description of sort fields.<br/>
|
||||||
|
/// - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.<br/>
|
||||||
|
/// <br/>
|
||||||
|
/// > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.<br/>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Type type);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Items Metadata
|
/// Get Items Metadata
|
||||||
///
|
///
|
||||||
@@ -201,18 +228,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Library(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Library(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -227,138 +254,157 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/hashes", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/hashes", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetFileHashResponse
|
var response = new GetFileHashResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<GetFileHashResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<GetFileHashResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync()
|
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/library/recentlyAdded";
|
var urlString = baseUrl + "/library/recentlyAdded";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetRecentlyAddedResponse
|
var response = new GetRecentlyAddedResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetRecentlyAddedLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetRecentlyAddedLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetLibrariesResponse> GetLibrariesAsync()
|
public async Task<GetLibrariesResponse> GetLibrariesAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/library/sections";
|
var urlString = baseUrl + "/library/sections";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetLibrariesResponse
|
var response = new GetLibrariesResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetLibrariesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetLibrariesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetLibrariesLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetLibrariesLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetLibraryResponse> GetLibraryAsync(double sectionId, IncludeDetails? includeDetails = null)
|
public async Task<GetLibraryResponse> GetLibraryAsync(double sectionId, IncludeDetails? includeDetails = null)
|
||||||
@@ -370,49 +416,55 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetLibraryResponse
|
var response = new GetLibraryResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(double sectionId)
|
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(double sectionId)
|
||||||
@@ -423,40 +475,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new DeleteLibraryResponse
|
var response = new DeleteLibraryResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<DeleteLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<DeleteLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(long sectionId, Tag tag)
|
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(long sectionId, Tag tag)
|
||||||
@@ -468,35 +525,39 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/{tag}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/{tag}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetLibraryItemsResponse
|
var response = new GetLibraryItemsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<GetLibraryItemsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<GetLibraryItemsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<RefreshLibraryResponse> RefreshLibraryAsync(double sectionId)
|
public async Task<RefreshLibraryResponse> RefreshLibraryAsync(double sectionId)
|
||||||
@@ -507,40 +568,89 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/refresh", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/refresh", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new RefreshLibraryResponse
|
var response = new RefreshLibraryResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<RefreshLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<RefreshLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Type type)
|
||||||
|
{
|
||||||
|
var request = new SearchLibraryRequest()
|
||||||
|
{
|
||||||
|
SectionId = sectionId,
|
||||||
|
Type = type,
|
||||||
|
};
|
||||||
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/search", request);
|
||||||
|
|
||||||
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
|
var response = new SearchLibraryResponse
|
||||||
|
{
|
||||||
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
|
ContentType = contentType,
|
||||||
|
RawResponse = httpResponse
|
||||||
|
};
|
||||||
|
|
||||||
|
if((response.StatusCode == 200))
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
|
{
|
||||||
|
response.Object = JsonConvert.DeserializeObject<SearchLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetMetadataResponse> GetMetadataAsync(double ratingKey)
|
public async Task<GetMetadataResponse> GetMetadataAsync(double ratingKey)
|
||||||
@@ -551,49 +661,55 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetMetadataResponse
|
var response = new GetMetadataResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetMetadataResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetMetadataResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetMetadataLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetMetadataLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey)
|
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey)
|
||||||
@@ -604,98 +720,111 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/children", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/children", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetMetadataChildrenResponse
|
var response = new GetMetadataChildrenResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetMetadataChildrenResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetMetadataChildrenResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetMetadataChildrenLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetMetadataChildrenLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetOnDeckResponse> GetOnDeckAsync()
|
public async Task<GetOnDeckResponse> GetOnDeckAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/library/onDeck";
|
var urlString = baseUrl + "/library/onDeck";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetOnDeckResponse
|
var response = new GetOnDeckResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetOnDeckResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetOnDeckResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetOnDeckLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetOnDeckLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -90,18 +91,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Log(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Log(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -117,129 +118,143 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/log", request);
|
var urlString = URLBuilder.Build(baseUrl, "/log", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new LogLineResponse
|
var response = new LogLineResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<LogLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<LogLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
|
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/log";
|
var urlString = baseUrl + "/log";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string");
|
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string", false, false);
|
||||||
if (serializedBody == null)
|
if (serializedBody != null)
|
||||||
{
|
|
||||||
throw new ArgumentNullException("request body is required");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
httpRequest.Content = serializedBody;
|
httpRequest.Content = serializedBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
var client = _securityClient;
|
var client = _defaultClient;
|
||||||
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new LogMultiLineResponse
|
var response = new LogMultiLineResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<LogMultiLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<LogMultiLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/log/networked";
|
var urlString = baseUrl + "/log/networked";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new EnablePaperTrailResponse
|
var response = new EnablePaperTrailResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400) || (response.StatusCode == 403))
|
if((response.StatusCode == 200) || (response.StatusCode == 400) || (response.StatusCode == 403))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<EnablePaperTrailResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<EnablePaperTrailResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -68,18 +69,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Media(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Media(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -93,40 +94,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request);
|
var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new MarkPlayedResponse
|
var response = new MarkPlayedResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<MarkPlayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<MarkPlayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
|
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
|
||||||
@@ -137,40 +143,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request);
|
var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new MarkUnplayedResponse
|
var response = new MarkUnplayedResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<MarkUnplayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<MarkUnplayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
|
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
|
||||||
@@ -183,40 +194,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/:/progress", request);
|
var urlString = URLBuilder.Build(baseUrl, "/:/progress", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new UpdatePlayProgressResponse
|
var response = new UpdatePlayProgressResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<UpdatePlayProgressResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<UpdatePlayProgressResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
42
PlexAPI/Models/Requests/Account.cs
Normal file
42
PlexAPI/Models/Requests/Account.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class Account
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("id")]
|
||||||
|
public int? Id { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("key")]
|
||||||
|
public string? Key { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("name")]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("defaultAudioLanguage")]
|
||||||
|
public string? DefaultAudioLanguage { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("autoSelectAudio")]
|
||||||
|
public bool? AutoSelectAudio { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("defaultSubtitleLanguage")]
|
||||||
|
public string? DefaultSubtitleLanguage { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("subtitleMode")]
|
||||||
|
public int? SubtitleMode { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("thumb")]
|
||||||
|
public string? Thumb { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,7 +25,7 @@ namespace PlexAPI.Models.Requests
|
|||||||
/// type of playlist to create
|
/// type of playlist to create
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
|
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
|
||||||
public Type Type { get; set; } = default!;
|
public QueryParamType Type { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// whether the playlist is smart or not
|
/// whether the playlist is smart or not
|
||||||
|
|||||||
@@ -77,6 +77,6 @@ namespace PlexAPI.Models.Requests
|
|||||||
public int? Hidden { get; set; }
|
public int? Hidden { get; set; }
|
||||||
|
|
||||||
[JsonProperty("Location")]
|
[JsonProperty("Location")]
|
||||||
public List<Location>? Location { get; set; }
|
public List<GetLibrariesLocation>? Location { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
24
PlexAPI/Models/Requests/GetLibrariesLocation.cs
Normal file
24
PlexAPI/Models/Requests/GetLibrariesLocation.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetLibrariesLocation
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("id")]
|
||||||
|
public int? Id { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("path")]
|
||||||
|
public string? Path { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,6 +58,9 @@ namespace PlexAPI.Models.Requests
|
|||||||
[JsonProperty("viewMode")]
|
[JsonProperty("viewMode")]
|
||||||
public int? ViewMode { get; set; }
|
public int? ViewMode { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("mixedParents")]
|
||||||
|
public bool? MixedParents { get; set; }
|
||||||
|
|
||||||
[JsonProperty("Metadata")]
|
[JsonProperty("Metadata")]
|
||||||
public List<GetLibraryItemsMetadata>? Metadata { get; set; }
|
public List<GetLibraryItemsMetadata>? Metadata { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,27 @@ namespace PlexAPI.Models.Requests
|
|||||||
[JsonProperty("ratingImage")]
|
[JsonProperty("ratingImage")]
|
||||||
public string? RatingImage { get; set; }
|
public string? RatingImage { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("grandparentRatingKey")]
|
||||||
|
public string? GrandparentRatingKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("grandparentGuid")]
|
||||||
|
public string? GrandparentGuid { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("grandparentKey")]
|
||||||
|
public string? GrandparentKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("grandparentTitle")]
|
||||||
|
public string? GrandparentTitle { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("grandparentThumb")]
|
||||||
|
public string? GrandparentThumb { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("grandparentArt")]
|
||||||
|
public string? GrandparentArt { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("grandparentTheme")]
|
||||||
|
public string? GrandparentTheme { get; set; }
|
||||||
|
|
||||||
[JsonProperty("Media")]
|
[JsonProperty("Media")]
|
||||||
public List<GetLibraryItemsMedia>? Media { get; set; }
|
public List<GetLibraryItemsMedia>? Media { get; set; }
|
||||||
|
|
||||||
@@ -118,5 +139,53 @@ namespace PlexAPI.Models.Requests
|
|||||||
|
|
||||||
[JsonProperty("skipCount")]
|
[JsonProperty("skipCount")]
|
||||||
public int? SkipCount { get; set; }
|
public int? SkipCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("index")]
|
||||||
|
public int? Index { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("theme")]
|
||||||
|
public string? Theme { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("leafCount")]
|
||||||
|
public int? LeafCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("viewedLeafCount")]
|
||||||
|
public int? ViewedLeafCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("childCount")]
|
||||||
|
public int? ChildCount { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("hasPremiumExtras")]
|
||||||
|
public string? HasPremiumExtras { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("hasPremiumPrimaryExtra")]
|
||||||
|
public string? HasPremiumPrimaryExtra { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentRatingKey")]
|
||||||
|
public string? ParentRatingKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentGuid")]
|
||||||
|
public string? ParentGuid { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentStudio")]
|
||||||
|
public string? ParentStudio { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentKey")]
|
||||||
|
public string? ParentKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentTitle")]
|
||||||
|
public string? ParentTitle { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentIndex")]
|
||||||
|
public int? ParentIndex { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentYear")]
|
||||||
|
public int? ParentYear { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentThumb")]
|
||||||
|
public string? ParentThumb { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentTheme")]
|
||||||
|
public string? ParentTheme { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
27
PlexAPI/Models/Requests/GetPinErrors.cs
Normal file
27
PlexAPI/Models/Requests/GetPinErrors.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetPinErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public double? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public double? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
25
PlexAPI/Models/Requests/GetPinPlexResponseBody.cs
Normal file
25
PlexAPI/Models/Requests/GetPinPlexResponseBody.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// X-Plex-Client-Identifier is missing
|
||||||
|
/// </summary>
|
||||||
|
public class GetPinPlexResponseBody
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetPinErrors>? Errors { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
42
PlexAPI/Models/Requests/GetPinRequest.cs
Normal file
42
PlexAPI/Models/Requests/GetPinRequest.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using PlexAPI.Utils;
|
||||||
|
|
||||||
|
public class GetPinRequest
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The unique identifier for the client application<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// This is used to track the client application and its usage<br/>
|
||||||
|
/// (UUID, serial number, or other number unique per device)<br/>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
|
||||||
|
public string XPlexClientIdentifier { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines the kind of code returned by the API call<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Strong codes are used for Pin authentication flows<br/>
|
||||||
|
/// Non-Strong codes are used for `Plex.tv/link`<br/>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=strong")]
|
||||||
|
public bool? Strong { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
44
PlexAPI/Models/Requests/GetPinResponse.cs
Normal file
44
PlexAPI/Models/Requests/GetPinResponse.cs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using System.Net.Http;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public class GetPinResponse
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// HTTP response content type for this operation
|
||||||
|
/// </summary>
|
||||||
|
public string? ContentType { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// HTTP response status code for this operation
|
||||||
|
/// </summary>
|
||||||
|
public int StatusCode { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
public HttpResponseMessage RawResponse { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The Pin
|
||||||
|
/// </summary>
|
||||||
|
public GetPinResponseBody? TwoHundredApplicationJsonObject { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// X-Plex-Client-Identifier is missing
|
||||||
|
/// </summary>
|
||||||
|
public GetPinPlexResponseBody? FourHundredApplicationJsonObject { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
70
PlexAPI/Models/Requests/GetPinResponseBody.cs
Normal file
70
PlexAPI/Models/Requests/GetPinResponseBody.cs
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The Pin
|
||||||
|
/// </summary>
|
||||||
|
public class GetPinResponseBody
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PinID for use with authentication
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("id")]
|
||||||
|
public double? Id { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public string? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("product")]
|
||||||
|
public string? Product { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("trusted")]
|
||||||
|
public bool? Trusted { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// a link to a QR code hosted on plex.tv <br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// The QR code redirects to the relevant `plex.tv/link` authentication page<br/>
|
||||||
|
/// Which then prompts the user for the 4 Digit Link Pin<br/>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("qr")]
|
||||||
|
public string? Qr { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("clientIdentifier")]
|
||||||
|
public string? ClientIdentifier { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("location")]
|
||||||
|
public Location? Location { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("expiresIn")]
|
||||||
|
public double? ExpiresIn { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("createdAt")]
|
||||||
|
public DateTime? CreatedAt { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("expiresAt")]
|
||||||
|
public DateTime? ExpiresAt { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("authToken")]
|
||||||
|
public string? AuthToken { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("newRegistration")]
|
||||||
|
public string? NewRegistration { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,6 @@ namespace PlexAPI.Models.Requests
|
|||||||
public int? Size { get; set; }
|
public int? Size { get; set; }
|
||||||
|
|
||||||
[JsonProperty("Setting")]
|
[JsonProperty("Setting")]
|
||||||
public List<object>? Setting { get; set; }
|
public List<Setting>? Setting { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
33
PlexAPI/Models/Requests/GetStatisticsDevice.cs
Normal file
33
PlexAPI/Models/Requests/GetStatisticsDevice.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetStatisticsDevice
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("id")]
|
||||||
|
public int? Id { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("name")]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("platform")]
|
||||||
|
public string? Platform { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("clientIdentifier")]
|
||||||
|
public string? ClientIdentifier { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("createdAt")]
|
||||||
|
public int? CreatedAt { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
27
PlexAPI/Models/Requests/GetStatisticsErrors.cs
Normal file
27
PlexAPI/Models/Requests/GetStatisticsErrors.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetStatisticsErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public double? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public double? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
31
PlexAPI/Models/Requests/GetStatisticsMediaContainer.cs
Normal file
31
PlexAPI/Models/Requests/GetStatisticsMediaContainer.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public class GetStatisticsMediaContainer
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("size")]
|
||||||
|
public int? Size { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("Device")]
|
||||||
|
public List<GetStatisticsDevice>? Device { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("Account")]
|
||||||
|
public List<Account>? Account { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("StatisticsMedia")]
|
||||||
|
public List<StatisticsMedia>? StatisticsMedia { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
29
PlexAPI/Models/Requests/GetStatisticsRequest.cs
Normal file
29
PlexAPI/Models/Requests/GetStatisticsRequest.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using PlexAPI.Utils;
|
||||||
|
|
||||||
|
public class GetStatisticsRequest
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The timespan to retrieve statistics for<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// the exact meaning of this parameter is not known<br/>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=Timespan")]
|
||||||
|
public long? Timespan { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
44
PlexAPI/Models/Requests/GetStatisticsResponse.cs
Normal file
44
PlexAPI/Models/Requests/GetStatisticsResponse.cs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using System.Net.Http;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public class GetStatisticsResponse
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// HTTP response content type for this operation
|
||||||
|
/// </summary>
|
||||||
|
public string? ContentType { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// HTTP response status code for this operation
|
||||||
|
/// </summary>
|
||||||
|
public int StatusCode { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
public HttpResponseMessage RawResponse { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Media Statistics
|
||||||
|
/// </summary>
|
||||||
|
public GetStatisticsResponseBody? TwoHundredApplicationJsonObject { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public GetStatisticsStatisticsResponseBody? FourHundredAndOneApplicationJsonObject { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
24
PlexAPI/Models/Requests/GetStatisticsResponseBody.cs
Normal file
24
PlexAPI/Models/Requests/GetStatisticsResponseBody.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Media Statistics
|
||||||
|
/// </summary>
|
||||||
|
public class GetStatisticsResponseBody
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("MediaContainer")]
|
||||||
|
public GetStatisticsMediaContainer? MediaContainer { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetStatisticsStatisticsResponseBody
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetStatisticsErrors>? Errors { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
27
PlexAPI/Models/Requests/GetTokenErrors.cs
Normal file
27
PlexAPI/Models/Requests/GetTokenErrors.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetTokenErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public double? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public double? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
36
PlexAPI/Models/Requests/GetTokenRequest.cs
Normal file
36
PlexAPI/Models/Requests/GetTokenRequest.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using PlexAPI.Utils;
|
||||||
|
|
||||||
|
public class GetTokenRequest
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The PinID to retrieve an access token for
|
||||||
|
/// </summary>
|
||||||
|
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=pinID")]
|
||||||
|
public string PinID { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The unique identifier for the client application<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// This is used to track the client application and its usage<br/>
|
||||||
|
/// (UUID, serial number, or other number unique per device)<br/>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
|
||||||
|
public string XPlexClientIdentifier { get; set; } = default!;
|
||||||
|
}
|
||||||
|
}
|
||||||
39
PlexAPI/Models/Requests/GetTokenResponse.cs
Normal file
39
PlexAPI/Models/Requests/GetTokenResponse.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using System.Net.Http;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public class GetTokenResponse
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// HTTP response content type for this operation
|
||||||
|
/// </summary>
|
||||||
|
public string? ContentType { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// HTTP response status code for this operation
|
||||||
|
/// </summary>
|
||||||
|
public int StatusCode { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
public HttpResponseMessage RawResponse { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// X-Plex-Client-Identifier is missing
|
||||||
|
/// </summary>
|
||||||
|
public GetTokenResponseBody? Object { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
25
PlexAPI/Models/Requests/GetTokenResponseBody.cs
Normal file
25
PlexAPI/Models/Requests/GetTokenResponseBody.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// X-Plex-Client-Identifier is missing
|
||||||
|
/// </summary>
|
||||||
|
public class GetTokenResponseBody
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetTokenErrors>? Errors { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
58
PlexAPI/Models/Requests/GetTransientTokenQueryParamType.cs
Normal file
58
PlexAPI/Models/Requests/GetTransientTokenQueryParamType.cs
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// `delegation` - This is the only supported `type` parameter.
|
||||||
|
/// </summary>
|
||||||
|
public enum GetTransientTokenQueryParamType
|
||||||
|
{
|
||||||
|
[JsonProperty("delegation")]
|
||||||
|
Delegation,
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class GetTransientTokenQueryParamTypeExtension
|
||||||
|
{
|
||||||
|
public static string Value(this GetTransientTokenQueryParamType value)
|
||||||
|
{
|
||||||
|
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GetTransientTokenQueryParamType ToEnum(this string value)
|
||||||
|
{
|
||||||
|
foreach(var field in typeof(GetTransientTokenQueryParamType).GetFields())
|
||||||
|
{
|
||||||
|
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
||||||
|
if (attributes.Length == 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var attribute = attributes[0] as JsonPropertyAttribute;
|
||||||
|
if (attribute != null && attribute.PropertyName == value)
|
||||||
|
{
|
||||||
|
var enumVal = field.GetValue(null);
|
||||||
|
|
||||||
|
if (enumVal is GetTransientTokenQueryParamType)
|
||||||
|
{
|
||||||
|
return (GetTransientTokenQueryParamType)enumVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Exception($"Unknown value {value} for enum GetTransientTokenQueryParamType");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@ namespace PlexAPI.Models.Requests
|
|||||||
/// `delegation` - This is the only supported `type` parameter.
|
/// `delegation` - This is the only supported `type` parameter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
|
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
|
||||||
public QueryParamType Type { get; set; } = default!;
|
public GetTransientTokenQueryParamType Type { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// `all` - This is the only supported `scope` parameter.
|
/// `all` - This is the only supported `scope` parameter.
|
||||||
|
|||||||
@@ -15,10 +15,34 @@ namespace PlexAPI.Models.Requests
|
|||||||
public class Location
|
public class Location
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("id")]
|
[JsonProperty("code")]
|
||||||
public int? Id { get; set; }
|
public string? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("path")]
|
[JsonProperty("european_union_member")]
|
||||||
public string? Path { get; set; }
|
public bool? EuropeanUnionMember { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("continent_code")]
|
||||||
|
public string? ContinentCode { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("country")]
|
||||||
|
public string? Country { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("city")]
|
||||||
|
public string? City { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("time_zone")]
|
||||||
|
public string? TimeZone { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("postal_code")]
|
||||||
|
public double? PostalCode { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("in_privacy_restricted_country")]
|
||||||
|
public bool? InPrivacyRestrictedCountry { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("subdivisions")]
|
||||||
|
public string? Subdivisions { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("coordinates")]
|
||||||
|
public string? Coordinates { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,12 +14,16 @@ namespace PlexAPI.Models.Requests
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// `delegation` - This is the only supported `type` parameter.
|
/// type of playlist to create
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum QueryParamType
|
public enum QueryParamType
|
||||||
{
|
{
|
||||||
[JsonProperty("delegation")]
|
[JsonProperty("audio")]
|
||||||
Delegation,
|
Audio,
|
||||||
|
[JsonProperty("video")]
|
||||||
|
Video,
|
||||||
|
[JsonProperty("photo")]
|
||||||
|
Photo,
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class QueryParamTypeExtension
|
public static class QueryParamTypeExtension
|
||||||
|
|||||||
58
PlexAPI/Models/Requests/SearchLibraryMediaContainer.cs
Normal file
58
PlexAPI/Models/Requests/SearchLibraryMediaContainer.cs
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public class SearchLibraryMediaContainer
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("size")]
|
||||||
|
public int? Size { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("allowSync")]
|
||||||
|
public bool? AllowSync { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("art")]
|
||||||
|
public string? Art { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("identifier")]
|
||||||
|
public string? Identifier { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("mediaTagPrefix")]
|
||||||
|
public string? MediaTagPrefix { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("mediaTagVersion")]
|
||||||
|
public int? MediaTagVersion { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("nocache")]
|
||||||
|
public bool? Nocache { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("thumb")]
|
||||||
|
public string? Thumb { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("title1")]
|
||||||
|
public string? Title1 { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("title2")]
|
||||||
|
public string? Title2 { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("viewGroup")]
|
||||||
|
public string? ViewGroup { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("viewMode")]
|
||||||
|
public int? ViewMode { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("Metadata")]
|
||||||
|
public List<SearchLibraryMetadata>? Metadata { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
78
PlexAPI/Models/Requests/SearchLibraryMetadata.cs
Normal file
78
PlexAPI/Models/Requests/SearchLibraryMetadata.cs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class SearchLibraryMetadata
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("ratingKey")]
|
||||||
|
public string? RatingKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("key")]
|
||||||
|
public string? Key { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentRatingKey")]
|
||||||
|
public string? ParentRatingKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("guid")]
|
||||||
|
public string? Guid { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentGuid")]
|
||||||
|
public string? ParentGuid { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentStudio")]
|
||||||
|
public string? ParentStudio { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("type")]
|
||||||
|
public string? Type { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("title")]
|
||||||
|
public string? Title { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentKey")]
|
||||||
|
public string? ParentKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentTitle")]
|
||||||
|
public string? ParentTitle { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("summary")]
|
||||||
|
public string? Summary { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("index")]
|
||||||
|
public int? Index { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentIndex")]
|
||||||
|
public int? ParentIndex { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentYear")]
|
||||||
|
public int? ParentYear { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("thumb")]
|
||||||
|
public string? Thumb { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("art")]
|
||||||
|
public string? Art { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentThumb")]
|
||||||
|
public string? ParentThumb { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("parentTheme")]
|
||||||
|
public string? ParentTheme { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("addedAt")]
|
||||||
|
public int? AddedAt { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("updatedAt")]
|
||||||
|
public int? UpdatedAt { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
30
PlexAPI/Models/Requests/SearchLibraryRequest.cs
Normal file
30
PlexAPI/Models/Requests/SearchLibraryRequest.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using PlexAPI.Utils;
|
||||||
|
|
||||||
|
public class SearchLibraryRequest
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// the Id of the library to query
|
||||||
|
/// </summary>
|
||||||
|
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionId")]
|
||||||
|
public long SectionId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Plex content type to search for
|
||||||
|
/// </summary>
|
||||||
|
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
|
||||||
|
public Type Type { get; set; } = default!;
|
||||||
|
}
|
||||||
|
}
|
||||||
39
PlexAPI/Models/Requests/SearchLibraryResponse.cs
Normal file
39
PlexAPI/Models/Requests/SearchLibraryResponse.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using System.Net.Http;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public class SearchLibraryResponse
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// HTTP response content type for this operation
|
||||||
|
/// </summary>
|
||||||
|
public string? ContentType { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// HTTP response status code for this operation
|
||||||
|
/// </summary>
|
||||||
|
public int StatusCode { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
public HttpResponseMessage RawResponse { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The contents of the library by section and type
|
||||||
|
/// </summary>
|
||||||
|
public SearchLibraryResponseBody? Object { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
24
PlexAPI/Models/Requests/SearchLibraryResponseBody.cs
Normal file
24
PlexAPI/Models/Requests/SearchLibraryResponseBody.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The contents of the library by section and type
|
||||||
|
/// </summary>
|
||||||
|
public class SearchLibraryResponseBody
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("MediaContainer")]
|
||||||
|
public SearchLibraryMediaContainer? MediaContainer { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
48
PlexAPI/Models/Requests/Setting.cs
Normal file
48
PlexAPI/Models/Requests/Setting.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class Setting
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("id")]
|
||||||
|
public string? Id { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("label")]
|
||||||
|
public string? Label { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("summary")]
|
||||||
|
public string? Summary { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("type")]
|
||||||
|
public string? Type { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("default")]
|
||||||
|
public bool? Default { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("value")]
|
||||||
|
public bool? Value { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("hidden")]
|
||||||
|
public bool? Hidden { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("advanced")]
|
||||||
|
public bool? Advanced { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("group")]
|
||||||
|
public string? Group { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("enumValues")]
|
||||||
|
public string? EnumValues { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
39
PlexAPI/Models/Requests/StatisticsMedia.cs
Normal file
39
PlexAPI/Models/Requests/StatisticsMedia.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI.Models.Requests
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class StatisticsMedia
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("accountID")]
|
||||||
|
public int? AccountID { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("deviceID")]
|
||||||
|
public int? DeviceID { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("timespan")]
|
||||||
|
public int? Timespan { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("at")]
|
||||||
|
public int? At { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("metadataType")]
|
||||||
|
public int? MetadataType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("count")]
|
||||||
|
public int? Count { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("duration")]
|
||||||
|
public int? Duration { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -56,8 +56,6 @@ namespace PlexAPI.Models.Requests
|
|||||||
FirstCharacter,
|
FirstCharacter,
|
||||||
[JsonProperty("folder")]
|
[JsonProperty("folder")]
|
||||||
Folder,
|
Folder,
|
||||||
[JsonProperty("search?type=1")]
|
|
||||||
SearchTypeEqual1,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TagExtension
|
public static class TagExtension
|
||||||
|
|||||||
@@ -10,53 +10,16 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
namespace PlexAPI.Models.Requests
|
namespace PlexAPI.Models.Requests
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// type of playlist to create
|
/// Plex content type to search for
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum Type
|
public enum Type
|
||||||
{
|
{
|
||||||
[JsonProperty("audio")]
|
One = 1,
|
||||||
Audio,
|
Two = 2,
|
||||||
[JsonProperty("video")]
|
Three = 3,
|
||||||
Video,
|
Four = 4,
|
||||||
[JsonProperty("photo")]
|
|
||||||
Photo,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TypeExtension
|
|
||||||
{
|
|
||||||
public static string Value(this Type value)
|
|
||||||
{
|
|
||||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Type ToEnum(this string value)
|
|
||||||
{
|
|
||||||
foreach(var field in typeof(Type).GetFields())
|
|
||||||
{
|
|
||||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
|
||||||
if (attributes.Length == 0)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
|
||||||
if (attribute != null && attribute.PropertyName == value)
|
|
||||||
{
|
|
||||||
var enumVal = field.GetValue(null);
|
|
||||||
|
|
||||||
if (enumVal is Type)
|
|
||||||
{
|
|
||||||
return (Type)enumVal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception($"Unknown value {value} for enum Type");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -41,7 +42,7 @@ namespace PlexAPI
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest? request = null);
|
Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get All Playlists
|
/// Get All Playlists
|
||||||
@@ -142,70 +143,76 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Playlists(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Playlists(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest? request = null)
|
public async Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/playlists", request);
|
var urlString = URLBuilder.Build(baseUrl, "/playlists", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new CreatePlaylistResponse
|
var response = new CreatePlaylistResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<CreatePlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<CreatePlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<CreatePlaylistPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<CreatePlaylistPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null)
|
public async Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null)
|
||||||
@@ -217,49 +224,55 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/playlists", request);
|
var urlString = URLBuilder.Build(baseUrl, "/playlists", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetPlaylistsResponse
|
var response = new GetPlaylistsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistsPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistsPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID)
|
public async Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID)
|
||||||
@@ -270,49 +283,55 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetPlaylistResponse
|
var response = new GetPlaylistResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID)
|
public async Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID)
|
||||||
@@ -323,40 +342,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new DeletePlaylistResponse
|
var response = new DeletePlaylistResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<DeletePlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<DeletePlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null)
|
public async Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null)
|
||||||
@@ -369,40 +393,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new UpdatePlaylistResponse
|
var response = new UpdatePlaylistResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<UpdatePlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<UpdatePlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, double type)
|
public async Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, double type)
|
||||||
@@ -414,49 +443,55 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}/items", request);
|
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}/items", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetPlaylistContentsResponse
|
var response = new GetPlaylistContentsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistContentsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistContentsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistContentsPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetPlaylistContentsPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID)
|
public async Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID)
|
||||||
@@ -467,40 +502,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}/items", request);
|
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}/items", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new ClearPlaylistContentsResponse
|
var response = new ClearPlaylistContentsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<ClearPlaylistContentsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<ClearPlaylistContentsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null)
|
public async Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null)
|
||||||
@@ -513,49 +553,55 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}/items", request);
|
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}/items", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new AddPlaylistContentsResponse
|
var response = new AddPlaylistContentsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<AddPlaylistContentsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<AddPlaylistContentsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<AddPlaylistContentsPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<AddPlaylistContentsPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, Force force)
|
public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, Force force)
|
||||||
@@ -567,40 +613,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/upload", request);
|
var urlString = URLBuilder.Build(baseUrl, "/playlists/upload", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new UploadPlaylistResponse
|
var response = new UploadPlaylistResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<UploadPlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<UploadPlaylistResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
210
PlexAPI/Plex.cs
Normal file
210
PlexAPI/Plex.cs
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
|
using PlexAPI.Models.Requests;
|
||||||
|
using PlexAPI.Utils;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API Calls that perform operations directly against https://Plex.tv<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
public interface IPlex
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a Pin
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Retrieve a Pin from Plex.tv for authentication flows
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
Task<GetPinResponse> GetPinAsync(string xPlexClientIdentifier, bool? strong = null, string? serverUrl = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Access Token
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
Task<GetTokenResponse> GetTokenAsync(string pinID, string xPlexClientIdentifier, string? serverUrl = null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API Calls that perform operations directly against https://Plex.tv<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
public class Plex: IPlex
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* GetPinServerList contains the list of server urls available to the SDK.
|
||||||
|
*/
|
||||||
|
public static readonly string[] GetPinServerList = {
|
||||||
|
"https://plex.tv/api/v2",
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetTokenServerList contains the list of server urls available to the SDK.
|
||||||
|
*/
|
||||||
|
public static readonly string[] GetTokenServerList = {
|
||||||
|
"https://plex.tv/api/v2",
|
||||||
|
};
|
||||||
|
|
||||||
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
|
private const string _language = "csharp";
|
||||||
|
private const string _sdkVersion = "0.2.0";
|
||||||
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
|
private string _serverUrl = "";
|
||||||
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
|
public Plex(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
|
{
|
||||||
|
_defaultClient = defaultClient;
|
||||||
|
_securitySource = securitySource;
|
||||||
|
_serverUrl = serverUrl;
|
||||||
|
SDKConfiguration = config;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<GetPinResponse> GetPinAsync(string xPlexClientIdentifier, bool? strong = null, string? serverUrl = null)
|
||||||
|
{
|
||||||
|
var request = new GetPinRequest()
|
||||||
|
{
|
||||||
|
XPlexClientIdentifier = xPlexClientIdentifier,
|
||||||
|
Strong = strong,
|
||||||
|
};
|
||||||
|
string baseUrl = Utilities.TemplateUrl(GetPinServerList[0], new Dictionary<string, string>(){
|
||||||
|
});
|
||||||
|
if (serverUrl != null)
|
||||||
|
{
|
||||||
|
baseUrl = serverUrl;
|
||||||
|
}
|
||||||
|
var urlString = URLBuilder.Build(baseUrl, "/pins", request);
|
||||||
|
|
||||||
|
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||||
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
|
var response = new GetPinResponse
|
||||||
|
{
|
||||||
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
|
ContentType = contentType,
|
||||||
|
RawResponse = httpResponse
|
||||||
|
};
|
||||||
|
|
||||||
|
if((response.StatusCode == 200))
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
|
{
|
||||||
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPinResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((response.StatusCode == 400))
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
|
{
|
||||||
|
response.FourHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPinPlexResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<GetTokenResponse> GetTokenAsync(string pinID, string xPlexClientIdentifier, string? serverUrl = null)
|
||||||
|
{
|
||||||
|
var request = new GetTokenRequest()
|
||||||
|
{
|
||||||
|
PinID = pinID,
|
||||||
|
XPlexClientIdentifier = xPlexClientIdentifier,
|
||||||
|
};
|
||||||
|
string baseUrl = Utilities.TemplateUrl(GetTokenServerList[0], new Dictionary<string, string>(){
|
||||||
|
});
|
||||||
|
if (serverUrl != null)
|
||||||
|
{
|
||||||
|
baseUrl = serverUrl;
|
||||||
|
}
|
||||||
|
var urlString = URLBuilder.Build(baseUrl, "/pins/{pinID}", request);
|
||||||
|
|
||||||
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
|
var response = new GetTokenResponse
|
||||||
|
{
|
||||||
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
|
ContentType = contentType,
|
||||||
|
RawResponse = httpResponse
|
||||||
|
};
|
||||||
|
|
||||||
|
if((response.StatusCode == 200))
|
||||||
|
{
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((response.StatusCode == 400))
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
|
{
|
||||||
|
response.Object = JsonConvert.DeserializeObject<GetTokenResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<PackageId>Plex-API</PackageId>
|
<PackageId>Plex-API</PackageId>
|
||||||
<Version>0.1.5</Version>
|
<Version>0.2.0</Version>
|
||||||
<Authors>LukeHagar</Authors>
|
<Authors>LukeHagar</Authors>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|||||||
@@ -92,6 +92,15 @@ namespace PlexAPI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public IMedia Media { get; }
|
public IMedia Media { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API Calls that perform operations with Plex Media Server Videos<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
public IVideo Video { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.<br/>
|
/// Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.<br/>
|
||||||
///
|
///
|
||||||
@@ -152,6 +161,15 @@ namespace PlexAPI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ILog Log { get; }
|
public ILog Log { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API Calls that perform operations directly against https://Plex.tv<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
public IPlex Plex { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). <br/>
|
/// Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). <br/>
|
||||||
///
|
///
|
||||||
@@ -173,6 +191,15 @@ namespace PlexAPI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ISecurity Security { get; }
|
public ISecurity Security { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API Calls that perform operations with Plex Media Server Statistics<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
public IStatistics Statistics { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// API Calls that perform search operations with Plex Media Server Sessions<br/>
|
/// API Calls that perform search operations with Plex Media Server Sessions<br/>
|
||||||
///
|
///
|
||||||
@@ -191,15 +218,6 @@ namespace PlexAPI
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IUpdater Updater { get; }
|
public IUpdater Updater { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// API Calls that perform operations with Plex Media Server Videos<br/>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
///
|
|
||||||
/// </remarks>
|
|
||||||
/// </summary>
|
|
||||||
public IVideo Video { get; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SDKConfig
|
public class SDKConfig
|
||||||
@@ -235,31 +253,41 @@ namespace PlexAPI
|
|||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
|
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
|
private int _serverIndex = 0;
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
public IServer Server { get; private set; }
|
public IServer Server { get; private set; }
|
||||||
public IMedia Media { get; private set; }
|
public IMedia Media { get; private set; }
|
||||||
|
public IVideo Video { get; private set; }
|
||||||
public IActivities Activities { get; private set; }
|
public IActivities Activities { get; private set; }
|
||||||
public IButler Butler { get; private set; }
|
public IButler Butler { get; private set; }
|
||||||
public IHubs Hubs { get; private set; }
|
public IHubs Hubs { get; private set; }
|
||||||
public ISearch Search { get; private set; }
|
public ISearch Search { get; private set; }
|
||||||
public ILibrary Library { get; private set; }
|
public ILibrary Library { get; private set; }
|
||||||
public ILog Log { get; private set; }
|
public ILog Log { get; private set; }
|
||||||
|
public IPlex Plex { get; private set; }
|
||||||
public IPlaylists Playlists { get; private set; }
|
public IPlaylists Playlists { get; private set; }
|
||||||
public ISecurity Security { get; private set; }
|
public ISecurity Security { get; private set; }
|
||||||
|
public IStatistics Statistics { get; private set; }
|
||||||
public ISessions Sessions { get; private set; }
|
public ISessions Sessions { get; private set; }
|
||||||
public IUpdater Updater { get; private set; }
|
public IUpdater Updater { get; private set; }
|
||||||
public IVideo Video { get; private set; }
|
|
||||||
|
|
||||||
public PlexAPISDK(Security? security = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null)
|
public PlexAPISDK(Security? security = null, Func<Security>? securitySource = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null)
|
||||||
{
|
{
|
||||||
if (serverUrl != null) {
|
if (serverIndex != null)
|
||||||
if (urlParams != null) {
|
{
|
||||||
|
_serverIndex = serverIndex.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (serverUrl != null)
|
||||||
|
{
|
||||||
|
if (urlParams != null)
|
||||||
|
{
|
||||||
serverUrl = Utilities.TemplateUrl(serverUrl, urlParams);
|
serverUrl = Utilities.TemplateUrl(serverUrl, urlParams);
|
||||||
}
|
}
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
@@ -275,32 +303,42 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
|
|
||||||
_defaultClient = new SpeakeasyHttpClient(client);
|
_defaultClient = new SpeakeasyHttpClient(client);
|
||||||
_securityClient = _defaultClient;
|
|
||||||
|
if(securitySource != null)
|
||||||
if(security != null)
|
|
||||||
{
|
{
|
||||||
_securityClient = SecuritySerializer.Apply(_defaultClient, security);
|
_securitySource = securitySource;
|
||||||
}
|
}
|
||||||
|
else if(security != null)
|
||||||
|
{
|
||||||
|
_securitySource = () => security;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("security and securitySource cannot both be null");
|
||||||
|
}
|
||||||
|
|
||||||
SDKConfiguration = new SDKConfig()
|
SDKConfiguration = new SDKConfig()
|
||||||
{
|
{
|
||||||
ServerDefaults = serverDefaults,
|
ServerDefaults = serverDefaults,
|
||||||
|
serverIndex = _serverIndex,
|
||||||
serverUrl = _serverUrl
|
serverUrl = _serverUrl
|
||||||
};
|
};
|
||||||
|
|
||||||
Server = new Server(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Server = new Server(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Media = new Media(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Media = new Media(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Activities = new Activities(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Video = new Video(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Butler = new Butler(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Activities = new Activities(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Hubs = new Hubs(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Butler = new Butler(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Search = new Search(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Hubs = new Hubs(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Library = new Library(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Search = new Search(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Log = new Log(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Library = new Library(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Playlists = new Playlists(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Log = new Log(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Security = new Security(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Plex = new Plex(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Sessions = new Sessions(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Playlists = new Playlists(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Updater = new Updater(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Security = new Security(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
Video = new Video(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
|
Statistics = new Statistics(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
|
Sessions = new Sessions(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
|
Updater = new Updater(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -83,18 +84,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Search(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Search(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -110,40 +111,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/search", request);
|
var urlString = URLBuilder.Build(baseUrl, "/hubs/search", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new PerformSearchResponse
|
var response = new PerformSearchResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<PerformSearchResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<PerformSearchResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null)
|
public async Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null)
|
||||||
@@ -156,40 +162,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/search/voice", request);
|
var urlString = URLBuilder.Build(baseUrl, "/hubs/search/voice", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new PerformVoiceSearchResponse
|
var response = new PerformVoiceSearchResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<PerformVoiceSearchResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<PerformVoiceSearchResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetSearchResultsResponse> GetSearchResultsAsync(string query)
|
public async Task<GetSearchResultsResponse> GetSearchResultsAsync(string query)
|
||||||
@@ -200,49 +211,55 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/search", request);
|
var urlString = URLBuilder.Build(baseUrl, "/search", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetSearchResultsResponse
|
var response = new GetSearchResultsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetSearchResultsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetSearchResultsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetSearchResultsSearchResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetSearchResultsSearchResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -36,7 +37,7 @@ namespace PlexAPI
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetTransientTokenResponse> GetTransientTokenAsync(QueryParamType type, Scope scope);
|
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Source Connection Information
|
/// Get Source Connection Information
|
||||||
@@ -61,24 +62,24 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Security(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Security(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(QueryParamType type, Scope scope)
|
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope)
|
||||||
{
|
{
|
||||||
var request = new GetTransientTokenRequest()
|
var request = new GetTransientTokenRequest()
|
||||||
{
|
{
|
||||||
@@ -87,40 +88,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
|
var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetTransientTokenResponse
|
var response = new GetTransientTokenResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<GetTransientTokenResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<GetTransientTokenResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
|
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
|
||||||
@@ -131,40 +137,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/security/resources", request);
|
var urlString = URLBuilder.Build(baseUrl, "/security/resources", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetSourceConnectionInformationResponse
|
var response = new GetSourceConnectionInformationResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<GetSourceConnectionInformationResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<GetSourceConnectionInformationResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -90,7 +91,7 @@ namespace PlexAPI
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest? request = null);
|
Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Server List
|
/// Get Server List
|
||||||
@@ -113,18 +114,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Server(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Server(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -133,384 +134,438 @@ namespace PlexAPI
|
|||||||
public async Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync()
|
public async Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/";
|
var urlString = baseUrl + "/";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetServerCapabilitiesResponse
|
var response = new GetServerCapabilitiesResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerCapabilitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerCapabilitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerCapabilitiesServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerCapabilitiesServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetServerPreferencesResponse> GetServerPreferencesAsync()
|
public async Task<GetServerPreferencesResponse> GetServerPreferencesAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/:/prefs";
|
var urlString = baseUrl + "/:/prefs";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetServerPreferencesResponse
|
var response = new GetServerPreferencesResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerPreferencesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerPreferencesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerPreferencesServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerPreferencesServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetAvailableClientsResponse> GetAvailableClientsAsync()
|
public async Task<GetAvailableClientsResponse> GetAvailableClientsAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/clients";
|
var urlString = baseUrl + "/clients";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetAvailableClientsResponse
|
var response = new GetAvailableClientsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetAvailableClientsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetAvailableClientsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetAvailableClientsServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetAvailableClientsServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetDevicesResponse> GetDevicesAsync()
|
public async Task<GetDevicesResponse> GetDevicesAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/devices";
|
var urlString = baseUrl + "/devices";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetDevicesResponse
|
var response = new GetDevicesResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetDevicesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetDevicesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetDevicesServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetDevicesServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetServerIdentityResponse> GetServerIdentityAsync()
|
public async Task<GetServerIdentityResponse> GetServerIdentityAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/identity";
|
var urlString = baseUrl + "/identity";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetServerIdentityResponse
|
var response = new GetServerIdentityResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerIdentityResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerIdentityResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerIdentityServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerIdentityServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync()
|
public async Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/myplex/account";
|
var urlString = baseUrl + "/myplex/account";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetMyPlexAccountResponse
|
var response = new GetMyPlexAccountResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetMyPlexAccountResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetMyPlexAccountResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetMyPlexAccountServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetMyPlexAccountServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest? request = null)
|
public async Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/photo/:/transcode", request);
|
var urlString = URLBuilder.Build(baseUrl, "/photo/:/transcode", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetResizedPhotoResponse
|
var response = new GetResizedPhotoResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<GetResizedPhotoResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<GetResizedPhotoResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetServerListResponse> GetServerListAsync()
|
public async Task<GetServerListResponse> GetServerListAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/servers";
|
var urlString = baseUrl + "/servers";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetServerListResponse
|
var response = new GetServerListResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerListResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerListResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerListServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerListServerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -76,18 +77,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Sessions(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Sessions(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -96,148 +97,169 @@ namespace PlexAPI
|
|||||||
public async Task<GetSessionsResponse> GetSessionsAsync()
|
public async Task<GetSessionsResponse> GetSessionsAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/status/sessions";
|
var urlString = baseUrl + "/status/sessions";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetSessionsResponse
|
var response = new GetSessionsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetSessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetSessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetSessionsSessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetSessionsSessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetSessionHistoryResponse> GetSessionHistoryAsync()
|
public async Task<GetSessionHistoryResponse> GetSessionHistoryAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/status/sessions/history/all";
|
var urlString = baseUrl + "/status/sessions/history/all";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetSessionHistoryResponse
|
var response = new GetSessionHistoryResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetSessionHistoryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetSessionHistoryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetSessionHistorySessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetSessionHistorySessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync()
|
public async Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/transcode/sessions";
|
var urlString = baseUrl + "/transcode/sessions";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetTranscodeSessionsResponse
|
var response = new GetTranscodeSessionsResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetTranscodeSessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetTranscodeSessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetTranscodeSessionsSessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetTranscodeSessionsSessionsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey)
|
public async Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey)
|
||||||
@@ -248,40 +270,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/transcode/sessions/{sessionKey}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/transcode/sessions/{sessionKey}", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new StopTranscodeSessionResponse
|
var response = new StopTranscodeSessionResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 204) || (response.StatusCode == 400))
|
if((response.StatusCode == 204) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<StopTranscodeSessionResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<StopTranscodeSessionResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
129
PlexAPI/Statistics.cs
Normal file
129
PlexAPI/Statistics.cs
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost when
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#nullable enable
|
||||||
|
namespace PlexAPI
|
||||||
|
{
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
|
using PlexAPI.Models.Requests;
|
||||||
|
using PlexAPI.Utils;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API Calls that perform operations with Plex Media Server Statistics<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
public interface IStatistics
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Media Statistics
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// This will return the media statistics for the server
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API Calls that perform operations with Plex Media Server Statistics<br/>
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
public class Statistics: IStatistics
|
||||||
|
{
|
||||||
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
|
private const string _language = "csharp";
|
||||||
|
private const string _sdkVersion = "0.2.0";
|
||||||
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
|
private string _serverUrl = "";
|
||||||
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
|
public Statistics(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
|
{
|
||||||
|
_defaultClient = defaultClient;
|
||||||
|
_securitySource = securitySource;
|
||||||
|
_serverUrl = serverUrl;
|
||||||
|
SDKConfiguration = config;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null)
|
||||||
|
{
|
||||||
|
var request = new GetStatisticsRequest()
|
||||||
|
{
|
||||||
|
Timespan = timespan,
|
||||||
|
};
|
||||||
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
var urlString = URLBuilder.Build(baseUrl, "/statistics/media", request);
|
||||||
|
|
||||||
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
|
var response = new GetStatisticsResponse
|
||||||
|
{
|
||||||
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
|
ContentType = contentType,
|
||||||
|
RawResponse = httpResponse
|
||||||
|
};
|
||||||
|
|
||||||
|
if((response.StatusCode == 200))
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
|
{
|
||||||
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetStatisticsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((response.StatusCode == 400))
|
||||||
|
{
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((response.StatusCode == 401))
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
|
{
|
||||||
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetStatisticsStatisticsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -70,18 +71,18 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Updater(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Updater(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
@@ -90,50 +91,57 @@ namespace PlexAPI
|
|||||||
public async Task<GetUpdateStatusResponse> GetUpdateStatusAsync()
|
public async Task<GetUpdateStatusResponse> GetUpdateStatusAsync()
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
|
||||||
var urlString = baseUrl + "/updater/status";
|
var urlString = baseUrl + "/updater/status";
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetUpdateStatusResponse
|
var response = new GetUpdateStatusResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200))
|
if((response.StatusCode == 200))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetUpdateStatusResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetUpdateStatusResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 400))
|
if((response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetUpdateStatusUpdaterResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetUpdateStatusUpdaterResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null)
|
public async Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null)
|
||||||
@@ -144,40 +152,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/updater/check", request);
|
var urlString = URLBuilder.Build(baseUrl, "/updater/check", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new CheckForUpdatesResponse
|
var response = new CheckForUpdatesResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<CheckForUpdatesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<CheckForUpdatesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null)
|
public async Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null)
|
||||||
@@ -189,40 +202,45 @@ namespace PlexAPI
|
|||||||
};
|
};
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/updater/apply", request);
|
var urlString = URLBuilder.Build(baseUrl, "/updater/apply", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new ApplyUpdatesResponse
|
var response = new ApplyUpdatesResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400) || (response.StatusCode == 500))
|
if((response.StatusCode == 200) || (response.StatusCode == 400) || (response.StatusCode == 500))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<ApplyUpdatesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<ApplyUpdatesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,16 @@ namespace PlexAPI.Utils
|
|||||||
|
|
||||||
internal class BigIntSerializer : JsonConverter
|
internal class BigIntSerializer : JsonConverter
|
||||||
{
|
{
|
||||||
public override bool CanConvert(Type objectType) => objectType == typeof(BigInteger);
|
public override bool CanConvert(Type objectType)
|
||||||
|
{
|
||||||
|
var nullableType = Nullable.GetUnderlyingType(objectType);
|
||||||
|
if (nullableType != null)
|
||||||
|
{
|
||||||
|
return nullableType == typeof(BigInteger);
|
||||||
|
}
|
||||||
|
|
||||||
|
return objectType == typeof(BigInteger);
|
||||||
|
}
|
||||||
|
|
||||||
public override bool CanRead => true;
|
public override bool CanRead => true;
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,16 @@ namespace PlexAPI.Utils
|
|||||||
|
|
||||||
internal class DecimalSerializer : JsonConverter
|
internal class DecimalSerializer : JsonConverter
|
||||||
{
|
{
|
||||||
public override bool CanConvert(Type objectType) => objectType == typeof(Decimal);
|
public override bool CanConvert(Type objectType)
|
||||||
|
{
|
||||||
|
var nullableType = Nullable.GetUnderlyingType(objectType);
|
||||||
|
if (nullableType != null)
|
||||||
|
{
|
||||||
|
return nullableType == typeof(Decimal);
|
||||||
|
}
|
||||||
|
|
||||||
|
return objectType == typeof(Decimal);
|
||||||
|
}
|
||||||
|
|
||||||
public override bool CanRead => true;
|
public override bool CanRead => true;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,16 @@ namespace PlexAPI.Utils
|
|||||||
{
|
{
|
||||||
internal class EnumSerializer : JsonConverter
|
internal class EnumSerializer : JsonConverter
|
||||||
{
|
{
|
||||||
public override bool CanConvert(System.Type objectType) => objectType.IsEnum;
|
public override bool CanConvert(System.Type objectType)
|
||||||
|
{
|
||||||
|
var nullableType = Nullable.GetUnderlyingType(objectType);
|
||||||
|
if (nullableType != null)
|
||||||
|
{
|
||||||
|
return nullableType.IsEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
return objectType.IsEnum;
|
||||||
|
}
|
||||||
|
|
||||||
public override bool CanRead => true;
|
public override bool CanRead => true;
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,16 @@ namespace PlexAPI.Utils
|
|||||||
|
|
||||||
internal class IsoDateTimeSerializer: JsonConverter
|
internal class IsoDateTimeSerializer: JsonConverter
|
||||||
{
|
{
|
||||||
public override bool CanConvert(Type objectType) =>
|
public override bool CanConvert(Type objectType)
|
||||||
objectType == typeof(DateTime);
|
{
|
||||||
|
var nullableType = Nullable.GetUnderlyingType(objectType);
|
||||||
|
if (nullableType != null)
|
||||||
|
{
|
||||||
|
return nullableType == typeof(DateTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
return objectType == typeof(DateTime);
|
||||||
|
}
|
||||||
|
|
||||||
public override bool CanRead => false;
|
public override bool CanRead => false;
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,23 @@ namespace PlexAPI.Utils
|
|||||||
public static HttpContent? Serialize(
|
public static HttpContent? Serialize(
|
||||||
object? request,
|
object? request,
|
||||||
string requestFieldName,
|
string requestFieldName,
|
||||||
string serializationMethod
|
string serializationMethod,
|
||||||
|
bool nullable = false,
|
||||||
|
bool optional = false,
|
||||||
|
string format = ""
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (request == null)
|
if (request == null)
|
||||||
{
|
{
|
||||||
|
if (!nullable && !optional)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("request body is required");
|
||||||
|
}
|
||||||
|
else if (nullable && serializationMethod == "json")
|
||||||
|
{
|
||||||
|
return new StringContent("null", Encoding.UTF8, "application/json");
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,14 +68,15 @@ namespace PlexAPI.Utils
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Not an object or flattened request
|
// Not an object or flattened request
|
||||||
return TrySerialize(request, requestFieldName, serializationMethod);
|
return TrySerialize(request, requestFieldName, serializationMethod, "", format);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HttpContent? TrySerialize(
|
private static HttpContent? TrySerialize(
|
||||||
object request,
|
object request,
|
||||||
string requestFieldName,
|
string requestFieldName,
|
||||||
string serializationMethod,
|
string serializationMethod,
|
||||||
string mediaType = ""
|
string mediaType = "",
|
||||||
|
string format = ""
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (mediaType == "")
|
if (mediaType == "")
|
||||||
@@ -81,7 +94,7 @@ namespace PlexAPI.Utils
|
|||||||
switch (serializationMethod)
|
switch (serializationMethod)
|
||||||
{
|
{
|
||||||
case "json":
|
case "json":
|
||||||
return SerializeJson(request, mediaType);
|
return SerializeJson(request, mediaType, format);
|
||||||
case "form":
|
case "form":
|
||||||
return SerializeForm(request, requestFieldName, mediaType);
|
return SerializeForm(request, requestFieldName, mediaType);
|
||||||
case "multipart":
|
case "multipart":
|
||||||
@@ -109,9 +122,9 @@ namespace PlexAPI.Utils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HttpContent SerializeJson(object request, string mediaType)
|
private static HttpContent SerializeJson(object request, string mediaType, string format = "")
|
||||||
{
|
{
|
||||||
return new StringContent(Utilities.SerializeJSON(request), Encoding.UTF8, mediaType);
|
return new StringContent(Utilities.SerializeJSON(request, format), Encoding.UTF8, mediaType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HttpContent SerializeForm(
|
private static HttpContent SerializeForm(
|
||||||
@@ -482,7 +495,7 @@ namespace PlexAPI.Utils
|
|||||||
{
|
{
|
||||||
form[fieldName] = new List<string>();
|
form[fieldName] = new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
form[fieldName].Add(Utilities.ValueToString(value));
|
form[fieldName].Add(Utilities.ValueToString(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -499,4 +512,4 @@ namespace PlexAPI.Utils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,14 @@ namespace PlexAPI.Utils
|
|||||||
|
|
||||||
internal static class SecuritySerializer
|
internal static class SecuritySerializer
|
||||||
{
|
{
|
||||||
public static ISpeakeasyHttpClient Apply(ISpeakeasyHttpClient client, object security)
|
public static ISpeakeasyHttpClient Apply(ISpeakeasyHttpClient client, Func<object> securitySource)
|
||||||
{
|
{
|
||||||
|
if (securitySource == null)
|
||||||
|
{
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
|
||||||
|
var security = securitySource();
|
||||||
if (security == null)
|
if (security == null)
|
||||||
{
|
{
|
||||||
return client;
|
return client;
|
||||||
|
|||||||
@@ -15,24 +15,52 @@ namespace PlexAPI.Utils
|
|||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Numerics;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
public class Utilities
|
public class Utilities
|
||||||
{
|
{
|
||||||
public static string SerializeJSON(object obj)
|
public static JsonConverter[] GetJsonConverters(Type type, string format = "")
|
||||||
{
|
{
|
||||||
|
if (format == "string")
|
||||||
|
{
|
||||||
|
if (type == typeof(BigInteger))
|
||||||
|
{
|
||||||
|
return new JsonConverter[] { new BigIntSerializer() };
|
||||||
|
}
|
||||||
|
if (type == typeof(Decimal))
|
||||||
|
{
|
||||||
|
return new JsonConverter[] { new DecimalSerializer() };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new JsonConverter[]
|
||||||
|
{
|
||||||
|
new IsoDateTimeSerializer(),
|
||||||
|
new EnumSerializer(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string SerializeJSON(object obj, string format = "")
|
||||||
|
{
|
||||||
|
var type = obj.GetType();
|
||||||
|
if (IsList(obj))
|
||||||
|
{
|
||||||
|
type = type.GetGenericArguments().Single();
|
||||||
|
}
|
||||||
|
else if (IsDictionary(obj))
|
||||||
|
{
|
||||||
|
type = type.GetGenericArguments().Last();
|
||||||
|
}
|
||||||
|
|
||||||
return JsonConvert.SerializeObject(
|
return JsonConvert.SerializeObject(
|
||||||
obj,
|
obj,
|
||||||
new JsonSerializerSettings()
|
new JsonSerializerSettings()
|
||||||
{
|
{
|
||||||
NullValueHandling = NullValueHandling.Ignore,
|
NullValueHandling = NullValueHandling.Ignore,
|
||||||
Converters = new JsonConverter[]
|
Converters = GetJsonConverters(type, format)
|
||||||
{
|
|
||||||
new IsoDateTimeSerializer(),
|
|
||||||
new EnumSerializer()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -82,11 +110,11 @@ namespace PlexAPI.Utils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsPrimitive(object obj) => obj != null && obj.GetType().IsPrimitive;
|
public static bool IsPrimitive(object? obj) => obj != null && obj.GetType().IsPrimitive;
|
||||||
|
|
||||||
public static bool IsEnum(object obj) => obj != null && obj.GetType().IsEnum;
|
public static bool IsEnum(object? obj) => obj != null && obj.GetType().IsEnum;
|
||||||
|
|
||||||
public static bool IsDate(object obj) =>
|
public static bool IsDate(object? obj) =>
|
||||||
obj != null && (obj.GetType() == typeof(DateTime) || obj.GetType() == typeof(LocalDate));
|
obj != null && (obj.GetType() == typeof(DateTime) || obj.GetType() == typeof(LocalDate));
|
||||||
|
|
||||||
private static string StripSurroundingQuotes(string input)
|
private static string StripSurroundingQuotes(string input)
|
||||||
@@ -238,4 +266,4 @@ namespace PlexAPI.Utils
|
|||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
143
PlexAPI/Video.cs
143
PlexAPI/Video.cs
@@ -11,6 +11,7 @@
|
|||||||
namespace PlexAPI
|
namespace PlexAPI
|
||||||
{
|
{
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
using PlexAPI.Models.Requests;
|
using PlexAPI.Models.Requests;
|
||||||
using PlexAPI.Utils;
|
using PlexAPI.Utils;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
@@ -28,6 +29,15 @@ namespace PlexAPI
|
|||||||
public interface IVideo
|
public interface IVideo
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the timeline for a media item
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Get the timeline for a media item
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start Universal Transcode
|
/// Start Universal Transcode
|
||||||
///
|
///
|
||||||
@@ -35,16 +45,7 @@ namespace PlexAPI
|
|||||||
/// Begin a Universal Transcode Session
|
/// Begin a Universal Transcode Session
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest? request = null);
|
Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the timeline for a media item
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Get the timeline for a media item
|
|
||||||
/// </remarks>
|
|
||||||
/// </summary>
|
|
||||||
Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest? request = null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -58,101 +59,111 @@ namespace PlexAPI
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.1.5";
|
private const string _sdkVersion = "0.2.0";
|
||||||
private const string _sdkGenVersion = "2.237.3";
|
private const string _sdkGenVersion = "2.269.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.269.0 0.0.3 Plex-API";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _defaultClient;
|
private ISpeakeasyHttpClient _defaultClient;
|
||||||
private ISpeakeasyHttpClient _securityClient;
|
private Func<Security>? _securitySource;
|
||||||
|
|
||||||
public Video(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
|
public Video(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
|
||||||
{
|
{
|
||||||
_defaultClient = defaultClient;
|
_defaultClient = defaultClient;
|
||||||
_securityClient = securityClient;
|
_securitySource = securitySource;
|
||||||
_serverUrl = serverUrl;
|
_serverUrl = serverUrl;
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest? request = null)
|
public async Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request)
|
||||||
{
|
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/video/:/transcode/universal/start.mpd", request);
|
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
|
||||||
|
|
||||||
|
|
||||||
var client = _securityClient;
|
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
|
||||||
|
|
||||||
var response = new StartUniversalTranscodeResponse
|
|
||||||
{
|
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
|
||||||
ContentType = contentType,
|
|
||||||
RawResponse = httpResponse
|
|
||||||
};
|
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
|
||||||
{
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
if((response.StatusCode == 401))
|
|
||||||
{
|
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
|
||||||
{
|
|
||||||
response.Object = JsonConvert.DeserializeObject<StartUniversalTranscodeResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest? request = null)
|
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/:/timeline", request);
|
var urlString = URLBuilder.Build(baseUrl, "/:/timeline", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
var client = _securityClient;
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
var httpResponse = await client.SendAsync(httpRequest);
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
var response = new GetTimelineResponse
|
var response = new GetTimelineResponse
|
||||||
{
|
{
|
||||||
StatusCode = (int)httpResponse.StatusCode,
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
|
|
||||||
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
{
|
{
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((response.StatusCode == 401))
|
if((response.StatusCode == 401))
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
{
|
{
|
||||||
response.Object = JsonConvert.DeserializeObject<GetTimelineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
response.Object = JsonConvert.DeserializeObject<GetTimelineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request)
|
||||||
|
{
|
||||||
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
|
||||||
|
var urlString = URLBuilder.Build(baseUrl, "/video/:/transcode/universal/start.mpd", request);
|
||||||
|
|
||||||
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
var client = _defaultClient;
|
||||||
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
|
||||||
|
}
|
||||||
|
|
||||||
|
var httpResponse = await client.SendAsync(httpRequest);
|
||||||
|
|
||||||
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
|
||||||
|
var response = new StartUniversalTranscodeResponse
|
||||||
|
{
|
||||||
|
StatusCode = (int)httpResponse.StatusCode,
|
||||||
|
ContentType = contentType,
|
||||||
|
RawResponse = httpResponse
|
||||||
|
};
|
||||||
|
|
||||||
|
if((response.StatusCode == 200) || (response.StatusCode == 400))
|
||||||
|
{
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((response.StatusCode == 401))
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
|
||||||
|
{
|
||||||
|
response.Object = JsonConvert.DeserializeObject<StartUniversalTranscodeResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
70
README.md
70
README.md
@@ -26,8 +26,7 @@ dotnet add package Plex-API
|
|||||||
using PlexAPI;
|
using PlexAPI;
|
||||||
using PlexAPI.Models.Components;
|
using PlexAPI.Models.Components;
|
||||||
|
|
||||||
var sdk = new PlexAPISDK(
|
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
|
||||||
security: new Models.Components.Security() {
|
|
||||||
AccessToken = "<YOUR_API_KEY_HERE>",
|
AccessToken = "<YOUR_API_KEY_HERE>",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -57,6 +56,11 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
|
|||||||
* [MarkUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed
|
* [MarkUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed
|
||||||
* [UpdatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress
|
* [UpdatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress
|
||||||
|
|
||||||
|
### [Video](docs/sdks/video/README.md)
|
||||||
|
|
||||||
|
* [GetTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
|
||||||
|
* [StartUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
|
||||||
|
|
||||||
### [Activities](docs/sdks/activities/README.md)
|
### [Activities](docs/sdks/activities/README.md)
|
||||||
|
|
||||||
* [GetServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities
|
* [GetServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities
|
||||||
@@ -90,6 +94,7 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
|
|||||||
* [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section
|
* [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section
|
||||||
* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
|
* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
|
||||||
* [RefreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library
|
* [RefreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library
|
||||||
|
* [SearchLibrary](docs/sdks/library/README.md#searchlibrary) - Search Library
|
||||||
* [GetMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata
|
* [GetMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata
|
||||||
* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
|
* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
|
||||||
* [GetOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck
|
* [GetOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck
|
||||||
@@ -100,6 +105,11 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
|
|||||||
* [LogMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
|
* [LogMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
|
||||||
* [EnablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
|
* [EnablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
|
||||||
|
|
||||||
|
### [Plex](docs/sdks/plex/README.md)
|
||||||
|
|
||||||
|
* [GetPin](docs/sdks/plex/README.md#getpin) - Get a Pin
|
||||||
|
* [GetToken](docs/sdks/plex/README.md#gettoken) - Get Access Token
|
||||||
|
|
||||||
### [Playlists](docs/sdks/playlists/README.md)
|
### [Playlists](docs/sdks/playlists/README.md)
|
||||||
|
|
||||||
* [CreatePlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
|
* [CreatePlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
|
||||||
@@ -117,6 +127,10 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
|
|||||||
* [GetTransientToken](docs/sdks/security/README.md#gettransienttoken) - Get a Transient Token.
|
* [GetTransientToken](docs/sdks/security/README.md#gettransienttoken) - Get a Transient Token.
|
||||||
* [GetSourceConnectionInformation](docs/sdks/security/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
* [GetSourceConnectionInformation](docs/sdks/security/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
||||||
|
|
||||||
|
### [Statistics](docs/sdks/statistics/README.md)
|
||||||
|
|
||||||
|
* [GetStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics
|
||||||
|
|
||||||
### [Sessions](docs/sdks/sessions/README.md)
|
### [Sessions](docs/sdks/sessions/README.md)
|
||||||
|
|
||||||
* [GetSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions
|
* [GetSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions
|
||||||
@@ -129,11 +143,6 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
|
|||||||
* [GetUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
|
* [GetUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
|
||||||
* [CheckForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
|
* [CheckForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
|
||||||
* [ApplyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates
|
* [ApplyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates
|
||||||
|
|
||||||
### [Video](docs/sdks/video/README.md)
|
|
||||||
|
|
||||||
* [StartUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
|
|
||||||
* [GetTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
|
|
||||||
<!-- End Available Resources and Operations [operations] -->
|
<!-- End Available Resources and Operations [operations] -->
|
||||||
|
|
||||||
<!-- Start Server Selection [server] -->
|
<!-- Start Server Selection [server] -->
|
||||||
@@ -161,8 +170,55 @@ Some of the server options above contain variables. If you want to set the value
|
|||||||
### Override Server URL Per-Client
|
### Override Server URL Per-Client
|
||||||
|
|
||||||
The default server can also be overridden globally by passing a URL to the `serverUrl: str` optional parameter when initializing the SDK client instance. For example:
|
The default server can also be overridden globally by passing a URL to the `serverUrl: str` optional parameter when initializing the SDK client instance. For example:
|
||||||
|
|
||||||
|
|
||||||
|
### Override Server URL Per-Operation
|
||||||
|
|
||||||
|
The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
|
||||||
|
```csharp
|
||||||
|
using PlexAPI;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
|
using PlexAPI.Models.Requests;
|
||||||
|
|
||||||
|
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
|
||||||
|
AccessToken = "<YOUR_API_KEY_HERE>",
|
||||||
|
});
|
||||||
|
|
||||||
|
var res = await sdk.Plex.GetPinAsync(
|
||||||
|
serverUrl: "https://plex.tv/api/v2",
|
||||||
|
xPlexClientIdentifier: "<value>",
|
||||||
|
strong: false);
|
||||||
|
|
||||||
|
// handle response
|
||||||
|
```
|
||||||
<!-- End Server Selection [server] -->
|
<!-- End Server Selection [server] -->
|
||||||
|
|
||||||
|
<!-- Start Authentication [security] -->
|
||||||
|
## Authentication
|
||||||
|
|
||||||
|
### Per-Client Security Schemes
|
||||||
|
|
||||||
|
This SDK supports the following security scheme globally:
|
||||||
|
|
||||||
|
| Name | Type | Scheme |
|
||||||
|
| ------------- | ------------- | ------------- |
|
||||||
|
| `AccessToken` | apiKey | API key |
|
||||||
|
|
||||||
|
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:
|
||||||
|
```csharp
|
||||||
|
using PlexAPI;
|
||||||
|
using PlexAPI.Models.Components;
|
||||||
|
|
||||||
|
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
|
||||||
|
AccessToken = "<YOUR_API_KEY_HERE>",
|
||||||
|
});
|
||||||
|
|
||||||
|
var res = await sdk.Server.GetServerCapabilitiesAsync();
|
||||||
|
|
||||||
|
// handle response
|
||||||
|
```
|
||||||
|
<!-- End Authentication [security] -->
|
||||||
|
|
||||||
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
||||||
|
|
||||||
# Development
|
# Development
|
||||||
|
|||||||
10
RELEASES.md
10
RELEASES.md
@@ -54,4 +54,12 @@ Based on:
|
|||||||
- OpenAPI Doc 0.0.3
|
- OpenAPI Doc 0.0.3
|
||||||
- Speakeasy CLI 1.148.0 (2.237.3) https://github.com/speakeasy-api/speakeasy
|
- Speakeasy CLI 1.148.0 (2.237.3) https://github.com/speakeasy-api/speakeasy
|
||||||
### Generated
|
### Generated
|
||||||
- [csharp v0.1.5] .
|
- [csharp v0.1.5] .
|
||||||
|
|
||||||
|
## 2024-02-23 14:46:24
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc 0.0.3
|
||||||
|
- Speakeasy CLI 1.193.0 (2.269.0) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [csharp v0.2.0] .
|
||||||
3
USAGE.md
3
USAGE.md
@@ -3,8 +3,7 @@
|
|||||||
using PlexAPI;
|
using PlexAPI;
|
||||||
using PlexAPI.Models.Components;
|
using PlexAPI.Models.Components;
|
||||||
|
|
||||||
var sdk = new PlexAPISDK(
|
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
|
||||||
security: new Models.Components.Security() {
|
|
||||||
AccessToken = "<YOUR_API_KEY_HERE>",
|
AccessToken = "<YOUR_API_KEY_HERE>",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
15
docs/Models/Requests/Account.md
Normal file
15
docs/Models/Requests/Account.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Account
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||||
|
| `Id` | *int* | :heavy_minus_sign: | N/A | 238960586 |
|
||||||
|
| `Key` | *string* | :heavy_minus_sign: | N/A | /accounts/238960586 |
|
||||||
|
| `Name` | *string* | :heavy_minus_sign: | N/A | Diane |
|
||||||
|
| `DefaultAudioLanguage` | *string* | :heavy_minus_sign: | N/A | en |
|
||||||
|
| `AutoSelectAudio` | *bool* | :heavy_minus_sign: | N/A | true |
|
||||||
|
| `DefaultSubtitleLanguage` | *string* | :heavy_minus_sign: | N/A | en |
|
||||||
|
| `SubtitleMode` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Thumb` | *string* | :heavy_minus_sign: | N/A | https://plex.tv/users/50d83634246da1de/avatar?c=1707110967 |
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- |
|
| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
|
||||||
| `Title` | *string* | :heavy_check_mark: | name of the playlist |
|
| `Title` | *string* | :heavy_check_mark: | name of the playlist |
|
||||||
| `Type` | [Type](../../Models/Requests/Type.md) | :heavy_check_mark: | type of playlist to create |
|
| `Type` | [QueryParamType](../../Models/Requests/QueryParamType.md) | :heavy_check_mark: | type of playlist to create |
|
||||||
| `Smart` | [Smart](../../Models/Requests/Smart.md) | :heavy_check_mark: | whether the playlist is smart or not |
|
| `Smart` | [Smart](../../Models/Requests/Smart.md) | :heavy_check_mark: | whether the playlist is smart or not |
|
||||||
| `Uri` | *string* | :heavy_check_mark: | the content URI for the playlist |
|
| `Uri` | *string* | :heavy_check_mark: | the content URI for the playlist |
|
||||||
| `PlayQueueID` | *double* | :heavy_minus_sign: | the play queue to copy to a playlist |
|
| `PlayQueueID` | *double* | :heavy_minus_sign: | the play queue to copy to a playlist |
|
||||||
@@ -3,26 +3,26 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
|
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
||||||
| `AllowSync` | *bool* | :heavy_minus_sign: | N/A | true |
|
| `AllowSync` | *bool* | :heavy_minus_sign: | N/A | true |
|
||||||
| `Art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg |
|
| `Art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg |
|
||||||
| `Composite` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/composite/1705615584 |
|
| `Composite` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/composite/1705615584 |
|
||||||
| `Filters` | *bool* | :heavy_minus_sign: | N/A | true |
|
| `Filters` | *bool* | :heavy_minus_sign: | N/A | true |
|
||||||
| `Refreshing` | *bool* | :heavy_minus_sign: | N/A | false |
|
| `Refreshing` | *bool* | :heavy_minus_sign: | N/A | false |
|
||||||
| `Thumb` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie.png |
|
| `Thumb` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie.png |
|
||||||
| `Key` | *string* | :heavy_minus_sign: | N/A | 1 |
|
| `Key` | *string* | :heavy_minus_sign: | N/A | 1 |
|
||||||
| `Type` | *string* | :heavy_minus_sign: | N/A | movie |
|
| `Type` | *string* | :heavy_minus_sign: | N/A | movie |
|
||||||
| `Title` | *string* | :heavy_minus_sign: | N/A | Movies |
|
| `Title` | *string* | :heavy_minus_sign: | N/A | Movies |
|
||||||
| `Agent` | *string* | :heavy_minus_sign: | N/A | tv.plex.agents.movie |
|
| `Agent` | *string* | :heavy_minus_sign: | N/A | tv.plex.agents.movie |
|
||||||
| `Scanner` | *string* | :heavy_minus_sign: | N/A | Plex Movie |
|
| `Scanner` | *string* | :heavy_minus_sign: | N/A | Plex Movie |
|
||||||
| `Language` | *string* | :heavy_minus_sign: | N/A | en-US |
|
| `Language` | *string* | :heavy_minus_sign: | N/A | en-US |
|
||||||
| `Uuid` | *string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
|
| `Uuid` | *string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
|
||||||
| `UpdatedAt` | *int* | :heavy_minus_sign: | N/A | 1705615634 |
|
| `UpdatedAt` | *int* | :heavy_minus_sign: | N/A | 1705615634 |
|
||||||
| `CreatedAt` | *int* | :heavy_minus_sign: | N/A | 1654131312 |
|
| `CreatedAt` | *int* | :heavy_minus_sign: | N/A | 1654131312 |
|
||||||
| `ScannedAt` | *int* | :heavy_minus_sign: | N/A | 1705615584 |
|
| `ScannedAt` | *int* | :heavy_minus_sign: | N/A | 1705615584 |
|
||||||
| `Content` | *bool* | :heavy_minus_sign: | N/A | true |
|
| `Content` | *bool* | :heavy_minus_sign: | N/A | true |
|
||||||
| `Directory` | *bool* | :heavy_minus_sign: | N/A | true |
|
| `Directory` | *bool* | :heavy_minus_sign: | N/A | true |
|
||||||
| `ContentChangedAt` | *int* | :heavy_minus_sign: | N/A | 3192854 |
|
| `ContentChangedAt` | *int* | :heavy_minus_sign: | N/A | 3192854 |
|
||||||
| `Hidden` | *int* | :heavy_minus_sign: | N/A | 0 |
|
| `Hidden` | *int* | :heavy_minus_sign: | N/A | 0 |
|
||||||
| `Location` | List<[Location](../../Models/Requests/Location.md)> | :heavy_minus_sign: | N/A | [{"id":1,"path":"/movies"}] |
|
| `Location` | List<[GetLibrariesLocation](../../Models/Requests/GetLibrariesLocation.md)> | :heavy_minus_sign: | N/A | [{"id":1,"path":"/movies"}] |
|
||||||
9
docs/Models/Requests/GetLibrariesLocation.md
Normal file
9
docs/Models/Requests/GetLibrariesLocation.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetLibrariesLocation
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `Id` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Path` | *string* | :heavy_minus_sign: | N/A | /movies |
|
||||||
File diff suppressed because one or more lines are too long
@@ -27,6 +27,13 @@
|
|||||||
| `ChapterSource` | *string* | :heavy_minus_sign: | N/A | media |
|
| `ChapterSource` | *string* | :heavy_minus_sign: | N/A | media |
|
||||||
| `PrimaryExtraKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58684 |
|
| `PrimaryExtraKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58684 |
|
||||||
| `RatingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe |
|
| `RatingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe |
|
||||||
|
| `GrandparentRatingKey` | *string* | :heavy_minus_sign: | N/A | 66 |
|
||||||
|
| `GrandparentGuid` | *string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
|
||||||
|
| `GrandparentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
|
||||||
|
| `GrandparentTitle` | *string* | :heavy_minus_sign: | N/A | Caprica |
|
||||||
|
| `GrandparentThumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
|
||||||
|
| `GrandparentArt` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 |
|
||||||
|
| `GrandparentTheme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |
|
||||||
| `Media` | List<[GetLibraryItemsMedia](../../Models/Requests/GetLibraryItemsMedia.md)> | :heavy_minus_sign: | N/A | [{"Part":[{"container":"mkv","duration":11558112,"file":"/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv","id":119542,"key":"/library/parts/119542/1680457526/file.mkv","size":36158371307,"videoProfile":"main 10"}],"aspectRatio":1.85,"audioChannels":6,"audioCodec":"eac3","bitrate":25025,"container":"mkv","duration":11558112,"height":2072,"id":119534,"videoCodec":"hevc","videoFrameRate":"24p","videoProfile":"main 10","videoResolution":"4k","width":3840}] |
|
| `Media` | List<[GetLibraryItemsMedia](../../Models/Requests/GetLibraryItemsMedia.md)> | :heavy_minus_sign: | N/A | [{"Part":[{"container":"mkv","duration":11558112,"file":"/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv","id":119542,"key":"/library/parts/119542/1680457526/file.mkv","size":36158371307,"videoProfile":"main 10"}],"aspectRatio":1.85,"audioChannels":6,"audioCodec":"eac3","bitrate":25025,"container":"mkv","duration":11558112,"height":2072,"id":119534,"videoCodec":"hevc","videoFrameRate":"24p","videoProfile":"main 10","videoResolution":"4k","width":3840}] |
|
||||||
| `Genre` | List<[GetLibraryItemsGenre](../../Models/Requests/GetLibraryItemsGenre.md)> | :heavy_minus_sign: | N/A | [{"tag":"Adventure"}] |
|
| `Genre` | List<[GetLibraryItemsGenre](../../Models/Requests/GetLibraryItemsGenre.md)> | :heavy_minus_sign: | N/A | [{"tag":"Adventure"}] |
|
||||||
| `Country` | List<[GetLibraryItemsCountry](../../Models/Requests/GetLibraryItemsCountry.md)> | :heavy_minus_sign: | N/A | [{"tag":"United States of America"}] |
|
| `Country` | List<[GetLibraryItemsCountry](../../Models/Requests/GetLibraryItemsCountry.md)> | :heavy_minus_sign: | N/A | [{"tag":"United States of America"}] |
|
||||||
@@ -38,4 +45,20 @@
|
|||||||
| `LastViewedAt` | *int* | :heavy_minus_sign: | N/A | 1682752242 |
|
| `LastViewedAt` | *int* | :heavy_minus_sign: | N/A | 1682752242 |
|
||||||
| `OriginalTitle` | *string* | :heavy_minus_sign: | N/A | 映画 ブラッククローバー 魔法帝の剣 |
|
| `OriginalTitle` | *string* | :heavy_minus_sign: | N/A | 映画 ブラッククローバー 魔法帝の剣 |
|
||||||
| `ViewOffset` | *int* | :heavy_minus_sign: | N/A | 5222500 |
|
| `ViewOffset` | *int* | :heavy_minus_sign: | N/A | 5222500 |
|
||||||
| `SkipCount` | *int* | :heavy_minus_sign: | N/A | 1 |
|
| `SkipCount` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Index` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Theme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 |
|
||||||
|
| `LeafCount` | *int* | :heavy_minus_sign: | N/A | 14 |
|
||||||
|
| `ViewedLeafCount` | *int* | :heavy_minus_sign: | N/A | 0 |
|
||||||
|
| `ChildCount` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `HasPremiumExtras` | *string* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `HasPremiumPrimaryExtra` | *string* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `ParentRatingKey` | *string* | :heavy_minus_sign: | N/A | 66 |
|
||||||
|
| `ParentGuid` | *string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
|
||||||
|
| `ParentStudio` | *string* | :heavy_minus_sign: | N/A | UCP |
|
||||||
|
| `ParentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
|
||||||
|
| `ParentTitle` | *string* | :heavy_minus_sign: | N/A | Caprica |
|
||||||
|
| `ParentIndex` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `ParentYear` | *int* | :heavy_minus_sign: | N/A | 2010 |
|
||||||
|
| `ParentThumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
|
||||||
|
| `ParentTheme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |
|
||||||
10
docs/Models/Requests/GetPinErrors.md
Normal file
10
docs/Models/Requests/GetPinErrors.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetPinErrors
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||||
|
| `Code` | *double* | :heavy_minus_sign: | N/A | 1000 |
|
||||||
|
| `Message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
|
||||||
|
| `Status` | *double* | :heavy_minus_sign: | N/A | 400 |
|
||||||
10
docs/Models/Requests/GetPinPlexResponseBody.md
Normal file
10
docs/Models/Requests/GetPinPlexResponseBody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetPinPlexResponseBody
|
||||||
|
|
||||||
|
X-Plex-Client-Identifier is missing
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
|
||||||
|
| `Errors` | List<[GetPinErrors](../../Models/Requests/GetPinErrors.md)> | :heavy_minus_sign: | N/A |
|
||||||
9
docs/Models/Requests/GetPinRequest.md
Normal file
9
docs/Models/Requests/GetPinRequest.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetPinRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `XPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> |
|
||||||
|
| `Strong` | *bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> |
|
||||||
12
docs/Models/Requests/GetPinResponse.md
Normal file
12
docs/Models/Requests/GetPinResponse.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetPinResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `TwoHundredApplicationJsonObject` | [GetPinResponseBody](../../Models/Requests/GetPinResponseBody.md) | :heavy_minus_sign: | The Pin |
|
||||||
|
| `FourHundredApplicationJsonObject` | [GetPinPlexResponseBody](../../Models/Requests/GetPinPlexResponseBody.md) | :heavy_minus_sign: | X-Plex-Client-Identifier is missing |
|
||||||
21
docs/Models/Requests/GetPinResponseBody.md
Normal file
21
docs/Models/Requests/GetPinResponseBody.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# GetPinResponseBody
|
||||||
|
|
||||||
|
The Pin
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Id` | *double* | :heavy_minus_sign: | PinID for use with authentication | 1272322473 |
|
||||||
|
| `Code` | *string* | :heavy_minus_sign: | N/A | 3patfx1a78ukcbr7x0n9bl26t |
|
||||||
|
| `Product` | *string* | :heavy_minus_sign: | N/A | Plex Web |
|
||||||
|
| `Trusted` | *bool* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Qr` | *string* | :heavy_minus_sign: | a link to a QR code hosted on plex.tv <br/>The QR code redirects to the relevant `plex.tv/link` authentication page<br/>Which then prompts the user for the 4 Digit Link Pin<br/> | https://plex.tv/api/v2/pins/qr/3patfx1a78ukcbr7x0n9bl26t |
|
||||||
|
| `ClientIdentifier` | *string* | :heavy_minus_sign: | N/A | Postman |
|
||||||
|
| `Location` | [Location](../../Models/Requests/Location.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `ExpiresIn` | *double* | :heavy_minus_sign: | N/A | 1800 |
|
||||||
|
| `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | N/A | 2023-04-12 17:00:03 +0000 UTC |
|
||||||
|
| `ExpiresAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | N/A | 2023-04-12 17:30:03 +0000 UTC |
|
||||||
|
| `AuthToken` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `NewRegistration` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `Size` | *int* | :heavy_minus_sign: | N/A | 161 |
|
| `Size` | *int* | :heavy_minus_sign: | N/A | 161 |
|
||||||
| `Setting` | List<*object*> | :heavy_minus_sign: | N/A | [{"advanced":false,"default":"","group":"general","hidden":false,"id":"FriendlyName","label":"Friendly name","summary":"This name will be used to identify this media server to other computers on your network. If you leave it blank, your computer's name will be used instead.","type":"text","value":"Hera"},{"advanced":false,"default":3600,"enumValues":"900:every 15 minutes\|1800:every 30 minutes\|3600:hourly\|7200:every 2 hours\|21600:every 6 hours\|43200:every 12 hours\|86400:daily","group":"library","hidden":false,"id":"ScheduledLibraryUpdateInterval","label":"Library scan interval","summary":"","type":"int","value":3600}] |
|
| `Setting` | List<[Setting](../../Models/Requests/Setting.md)> | :heavy_minus_sign: | N/A | [{"advanced":false,"default":false,"enumValues":"1:admin only\|2:everyone","group":"","hidden":true,"id":"EnableDatabaseTrace","label":"","summary":"","type":"bool","value":false}] |
|
||||||
12
docs/Models/Requests/GetStatisticsDevice.md
Normal file
12
docs/Models/Requests/GetStatisticsDevice.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetStatisticsDevice
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
|
||||||
|
| `Id` | *int* | :heavy_minus_sign: | N/A | 208 |
|
||||||
|
| `Name` | *string* | :heavy_minus_sign: | N/A | Roku Express |
|
||||||
|
| `Platform` | *string* | :heavy_minus_sign: | N/A | Roku |
|
||||||
|
| `ClientIdentifier` | *string* | :heavy_minus_sign: | N/A | 793095d235660625108ef785cc7646e9 |
|
||||||
|
| `CreatedAt` | *int* | :heavy_minus_sign: | N/A | 1706470556 |
|
||||||
10
docs/Models/Requests/GetStatisticsErrors.md
Normal file
10
docs/Models/Requests/GetStatisticsErrors.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetStatisticsErrors
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
|
||||||
|
| `Code` | *double* | :heavy_minus_sign: | N/A | 1001 |
|
||||||
|
| `Message` | *string* | :heavy_minus_sign: | N/A | User could not be authenticated |
|
||||||
|
| `Status` | *double* | :heavy_minus_sign: | N/A | 401 |
|
||||||
11
docs/Models/Requests/GetStatisticsMediaContainer.md
Normal file
11
docs/Models/Requests/GetStatisticsMediaContainer.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetStatisticsMediaContainer
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `Size` | *int* | :heavy_minus_sign: | N/A | 5497 |
|
||||||
|
| `Device` | List<[GetStatisticsDevice](../../Models/Requests/GetStatisticsDevice.md)> | :heavy_minus_sign: | N/A | [{"clientIdentifier":"793095d235660625108ef785cc7646e9","createdAt":1706470556,"id":208,"name":"Roku Express","platform":"Roku"}] |
|
||||||
|
| `Account` | List<[Account](../../Models/Requests/Account.md)> | :heavy_minus_sign: | N/A | [{"autoSelectAudio":true,"defaultAudioLanguage":"en","defaultSubtitleLanguage":"en","id":238960586,"key":"/accounts/238960586","name":"Diane","subtitleMode":1,"thumb":"https://plex.tv/users/50d83634246da1de/avatar?c=1707110967"}] |
|
||||||
|
| `StatisticsMedia` | List<[StatisticsMedia](../../Models/Requests/StatisticsMedia.md)> | :heavy_minus_sign: | N/A | [{"accountID":1,"at":1707141600,"count":1,"deviceID":13,"duration":1555,"metadataType":4,"timespan":4}] |
|
||||||
8
docs/Models/Requests/GetStatisticsRequest.md
Normal file
8
docs/Models/Requests/GetStatisticsRequest.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# GetStatisticsRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||||
|
| `Timespan` | *long* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> |
|
||||||
12
docs/Models/Requests/GetStatisticsResponse.md
Normal file
12
docs/Models/Requests/GetStatisticsResponse.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetStatisticsResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `TwoHundredApplicationJsonObject` | [GetStatisticsResponseBody](../../Models/Requests/GetStatisticsResponseBody.md) | :heavy_minus_sign: | Media Statistics |
|
||||||
|
| `FourHundredAndOneApplicationJsonObject` | [GetStatisticsStatisticsResponseBody](../../Models/Requests/GetStatisticsStatisticsResponseBody.md) | :heavy_minus_sign: | Unauthorized - Returned if the X-Plex-Token is missing from the header or query. |
|
||||||
10
docs/Models/Requests/GetStatisticsResponseBody.md
Normal file
10
docs/Models/Requests/GetStatisticsResponseBody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetStatisticsResponseBody
|
||||||
|
|
||||||
|
Media Statistics
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||||||
|
| `MediaContainer` | [GetStatisticsMediaContainer](../../Models/Requests/GetStatisticsMediaContainer.md) | :heavy_minus_sign: | N/A |
|
||||||
10
docs/Models/Requests/GetStatisticsStatisticsResponseBody.md
Normal file
10
docs/Models/Requests/GetStatisticsStatisticsResponseBody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetStatisticsStatisticsResponseBody
|
||||||
|
|
||||||
|
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
||||||
|
| `Errors` | List<[GetStatisticsErrors](../../Models/Requests/GetStatisticsErrors.md)> | :heavy_minus_sign: | N/A |
|
||||||
10
docs/Models/Requests/GetTokenErrors.md
Normal file
10
docs/Models/Requests/GetTokenErrors.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetTokenErrors
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||||
|
| `Code` | *double* | :heavy_minus_sign: | N/A | 1000 |
|
||||||
|
| `Message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
|
||||||
|
| `Status` | *double* | :heavy_minus_sign: | N/A | 400 |
|
||||||
9
docs/Models/Requests/GetTokenRequest.md
Normal file
9
docs/Models/Requests/GetTokenRequest.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetTokenRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `PinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for |
|
||||||
|
| `XPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> |
|
||||||
11
docs/Models/Requests/GetTokenResponse.md
Normal file
11
docs/Models/Requests/GetTokenResponse.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetTokenResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `Object` | [GetTokenResponseBody](../../Models/Requests/GetTokenResponseBody.md) | :heavy_minus_sign: | X-Plex-Client-Identifier is missing |
|
||||||
10
docs/Models/Requests/GetTokenResponseBody.md
Normal file
10
docs/Models/Requests/GetTokenResponseBody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetTokenResponseBody
|
||||||
|
|
||||||
|
X-Plex-Client-Identifier is missing
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
|
||||||
|
| `Errors` | List<[GetTokenErrors](../../Models/Requests/GetTokenErrors.md)> | :heavy_minus_sign: | N/A |
|
||||||
10
docs/Models/Requests/GetTransientTokenQueryParamType.md
Normal file
10
docs/Models/Requests/GetTransientTokenQueryParamType.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetTransientTokenQueryParamType
|
||||||
|
|
||||||
|
`delegation` - This is the only supported `type` parameter.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------ | ------------ |
|
||||||
|
| `Delegation` | delegation |
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
|
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
||||||
| `Type` | [QueryParamType](../../Models/Requests/QueryParamType.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
|
| `Type` | [GetTransientTokenQueryParamType](../../Models/Requests/GetTransientTokenQueryParamType.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
|
||||||
| `Scope` | [Scope](../../Models/Requests/Scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
|
| `Scope` | [Scope](../../Models/Requests/Scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
|
||||||
@@ -3,7 +3,15 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- |
|
||||||
| `Id` | *int* | :heavy_minus_sign: | N/A | 1 |
|
| `Code` | *string* | :heavy_minus_sign: | N/A | US |
|
||||||
| `Path` | *string* | :heavy_minus_sign: | N/A | /movies |
|
| `EuropeanUnionMember` | *bool* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `ContinentCode` | *string* | :heavy_minus_sign: | N/A | NA |
|
||||||
|
| `Country` | *string* | :heavy_minus_sign: | N/A | United States |
|
||||||
|
| `City` | *string* | :heavy_minus_sign: | N/A | Austin |
|
||||||
|
| `TimeZone` | *string* | :heavy_minus_sign: | N/A | America/Chicago |
|
||||||
|
| `PostalCode` | *double* | :heavy_minus_sign: | N/A | 78732 |
|
||||||
|
| `InPrivacyRestrictedCountry` | *bool* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Subdivisions` | *string* | :heavy_minus_sign: | N/A | Texas |
|
||||||
|
| `Coordinates` | *string* | :heavy_minus_sign: | N/A | 30.3768 -97.8935 |
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
# QueryParamType
|
# QueryParamType
|
||||||
|
|
||||||
`delegation` - This is the only supported `type` parameter.
|
type of playlist to create
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
|
|
||||||
| Name | Value |
|
| Name | Value |
|
||||||
| ------------ | ------------ |
|
| ------- | ------- |
|
||||||
| `Delegation` | delegation |
|
| `Audio` | audio |
|
||||||
|
| `Video` | video |
|
||||||
|
| `Photo` | photo |
|
||||||
20
docs/Models/Requests/SearchLibraryMediaContainer.md
Normal file
20
docs/Models/Requests/SearchLibraryMediaContainer.md
Normal file
File diff suppressed because one or more lines are too long
27
docs/Models/Requests/SearchLibraryMetadata.md
Normal file
27
docs/Models/Requests/SearchLibraryMetadata.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# SearchLibraryMetadata
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `RatingKey` | *string* | :heavy_minus_sign: | N/A | 2 |
|
||||||
|
| `Key` | *string* | :heavy_minus_sign: | N/A | /library/metadata/2/children |
|
||||||
|
| `ParentRatingKey` | *string* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Guid` | *string* | :heavy_minus_sign: | N/A | plex://season/602e67e766dfdb002c0a1b5b |
|
||||||
|
| `ParentGuid` | *string* | :heavy_minus_sign: | N/A | plex://show/5d9c086c7d06d9001ffd27aa |
|
||||||
|
| `ParentStudio` | *string* | :heavy_minus_sign: | N/A | Mutant Enemy Productions |
|
||||||
|
| `Type` | *string* | :heavy_minus_sign: | N/A | season |
|
||||||
|
| `Title` | *string* | :heavy_minus_sign: | N/A | Season 1 |
|
||||||
|
| `ParentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1 |
|
||||||
|
| `ParentTitle` | *string* | :heavy_minus_sign: | N/A | Firefly |
|
||||||
|
| `Summary` | *string* | :heavy_minus_sign: | N/A | Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is the captain of the transport ship "Serenity". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government "The Alliance"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space. |
|
||||||
|
| `Index` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `ParentIndex` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `ParentYear` | *int* | :heavy_minus_sign: | N/A | 2002 |
|
||||||
|
| `Thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/2/thumb/1705636920 |
|
||||||
|
| `Art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1/art/1705636920 |
|
||||||
|
| `ParentThumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1/thumb/1705636920 |
|
||||||
|
| `ParentTheme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 |
|
||||||
|
| `AddedAt` | *int* | :heavy_minus_sign: | N/A | 1705636916 |
|
||||||
|
| `UpdatedAt` | *int* | :heavy_minus_sign: | N/A | 1705636920 |
|
||||||
9
docs/Models/Requests/SearchLibraryRequest.md
Normal file
9
docs/Models/Requests/SearchLibraryRequest.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# SearchLibraryRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||||
|
| `SectionId` | *long* | :heavy_check_mark: | the Id of the library to query |
|
||||||
|
| `Type` | [Type](../../Models/Requests/Type.md) | :heavy_check_mark: | Plex content type to search for |
|
||||||
11
docs/Models/Requests/SearchLibraryResponse.md
Normal file
11
docs/Models/Requests/SearchLibraryResponse.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# SearchLibraryResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `Object` | [SearchLibraryResponseBody](../../Models/Requests/SearchLibraryResponseBody.md) | :heavy_minus_sign: | The contents of the library by section and type |
|
||||||
10
docs/Models/Requests/SearchLibraryResponseBody.md
Normal file
10
docs/Models/Requests/SearchLibraryResponseBody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# SearchLibraryResponseBody
|
||||||
|
|
||||||
|
The contents of the library by section and type
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||||||
|
| `MediaContainer` | [SearchLibraryMediaContainer](../../Models/Requests/SearchLibraryMediaContainer.md) | :heavy_minus_sign: | N/A |
|
||||||
17
docs/Models/Requests/Setting.md
Normal file
17
docs/Models/Requests/Setting.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Setting
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- |
|
||||||
|
| `Id` | *string* | :heavy_minus_sign: | N/A | EnableDatabaseTrace |
|
||||||
|
| `Label` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Summary` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `Type` | *string* | :heavy_minus_sign: | N/A | bool |
|
||||||
|
| `Default` | *bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `Value` | *bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `Hidden` | *bool* | :heavy_minus_sign: | N/A | true |
|
||||||
|
| `Advanced` | *bool* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `Group` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `EnumValues` | *string* | :heavy_minus_sign: | N/A | 1:admin only\|2:everyone |
|
||||||
14
docs/Models/Requests/StatisticsMedia.md
Normal file
14
docs/Models/Requests/StatisticsMedia.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# StatisticsMedia
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `AccountID` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `DeviceID` | *int* | :heavy_minus_sign: | N/A | 13 |
|
||||||
|
| `Timespan` | *int* | :heavy_minus_sign: | N/A | 4 |
|
||||||
|
| `At` | *int* | :heavy_minus_sign: | N/A | 1707141600 |
|
||||||
|
| `MetadataType` | *int* | :heavy_minus_sign: | N/A | 4 |
|
||||||
|
| `Count` | *int* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `Duration` | *int* | :heavy_minus_sign: | N/A | 1555 |
|
||||||
@@ -5,25 +5,24 @@ A key representing a specific tag within the section.
|
|||||||
|
|
||||||
## Values
|
## Values
|
||||||
|
|
||||||
| Name | Value |
|
| Name | Value |
|
||||||
| ------------------ | ------------------ |
|
| ---------------- | ---------------- |
|
||||||
| `All` | all |
|
| `All` | all |
|
||||||
| `Unwatched` | unwatched |
|
| `Unwatched` | unwatched |
|
||||||
| `Newest` | newest |
|
| `Newest` | newest |
|
||||||
| `RecentlyAdded` | recentlyAdded |
|
| `RecentlyAdded` | recentlyAdded |
|
||||||
| `RecentlyViewed` | recentlyViewed |
|
| `RecentlyViewed` | recentlyViewed |
|
||||||
| `OnDeck` | onDeck |
|
| `OnDeck` | onDeck |
|
||||||
| `Collection` | collection |
|
| `Collection` | collection |
|
||||||
| `Edition` | edition |
|
| `Edition` | edition |
|
||||||
| `Genre` | genre |
|
| `Genre` | genre |
|
||||||
| `Year` | year |
|
| `Year` | year |
|
||||||
| `Decade` | decade |
|
| `Decade` | decade |
|
||||||
| `Director` | director |
|
| `Director` | director |
|
||||||
| `Actor` | actor |
|
| `Actor` | actor |
|
||||||
| `Country` | country |
|
| `Country` | country |
|
||||||
| `ContentRating` | contentRating |
|
| `ContentRating` | contentRating |
|
||||||
| `Rating` | rating |
|
| `Rating` | rating |
|
||||||
| `Resolution` | resolution |
|
| `Resolution` | resolution |
|
||||||
| `FirstCharacter` | firstCharacter |
|
| `FirstCharacter` | firstCharacter |
|
||||||
| `Folder` | folder |
|
| `Folder` | folder |
|
||||||
| `SearchTypeEqual1` | search?type=1 |
|
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
# Type
|
# Type
|
||||||
|
|
||||||
type of playlist to create
|
Plex content type to search for
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
|
|
||||||
| Name | Value |
|
| Name | Value |
|
||||||
| ------- | ------- |
|
| ------- | ------- |
|
||||||
| `Audio` | audio |
|
| `One` | 1 |
|
||||||
| `Video` | video |
|
| `Two` | 2 |
|
||||||
| `Photo` | photo |
|
| `Three` | 3 |
|
||||||
|
| `Four` | 4 |
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user