mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 20:47:49 +00:00
Compare commits
70 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8563e8fef2 | ||
|
|
1f5d4ff03a | ||
|
|
d970db3b6f | ||
|
|
4197184f92 | ||
|
|
bc02ecef34 | ||
|
|
55b5c2b3dd | ||
|
|
67a53e72d5 | ||
|
|
9ccab7b22d | ||
|
|
eb2f6e54a2 | ||
|
|
4b798cbb85 | ||
|
|
a89870d526 | ||
|
|
01b116a71c | ||
|
|
9831457f45 | ||
|
|
653b23dab6 | ||
|
|
86c36c72b7 | ||
|
|
3e00ddc6b1 | ||
|
|
d976a079a9 | ||
|
|
b10d5f7023 | ||
|
|
c431cee288 | ||
|
|
5195de1dca | ||
|
|
43dc47a5a0 | ||
|
|
53157408b3 | ||
|
|
fe81f4dff0 | ||
|
|
c9746b7ad8 | ||
|
|
0ec48b6a1d | ||
|
|
14e54fa017 | ||
|
|
61492e5dad | ||
|
|
f099c01940 | ||
|
|
92be5b3a91 | ||
|
|
a183f389bc | ||
|
|
4a443f6f2e | ||
|
|
b9b7cd1146 | ||
|
|
81c55cb08b | ||
|
|
860991f2a0 | ||
|
|
d25639db53 | ||
|
|
227e2351d5 | ||
|
|
3bd4f51297 | ||
|
|
4828de2345 | ||
|
|
2beb707ed5 | ||
|
|
affe5d5a8c | ||
|
|
d16abdad70 | ||
|
|
3e9ae76433 | ||
|
|
e7023f61d0 | ||
|
|
223ab320b2 | ||
|
|
5421ae0531 | ||
|
|
4b10ba72ca | ||
|
|
3b6806d2db | ||
|
|
5883791d10 | ||
|
|
548ce2564d | ||
|
|
46c35ae5e3 | ||
|
|
d15c54d86f | ||
|
|
f517fffa89 | ||
|
|
2309d5a37f | ||
|
|
d71b1b96ea | ||
|
|
24948e0718 | ||
|
|
39a5a0dfb6 | ||
|
|
92730cbe24 | ||
|
|
591cddc929 | ||
|
|
6a6c770319 | ||
|
|
d141934f09 | ||
|
|
61d12eaf66 | ||
|
|
307bd0f675 | ||
|
|
08dcf43f3d | ||
|
|
201fa479dd | ||
|
|
4896fe1bc1 | ||
|
|
241e563440 | ||
|
|
92bc4311c1 | ||
|
|
40563a5174 | ||
|
|
c203fd6602 | ||
|
|
c1f617f0f3 |
31
.github/workflows/sdk_generation.yaml
vendored
Normal file
31
.github/workflows/sdk_generation.yaml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: Generate
|
||||||
|
permissions:
|
||||||
|
checks: write
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
statuses: write
|
||||||
|
"on":
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
force:
|
||||||
|
description: Force generation of SDKs
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
set_version:
|
||||||
|
description: optionally set a specific SDK version
|
||||||
|
type: string
|
||||||
|
schedule:
|
||||||
|
- cron: 0 0 * * *
|
||||||
|
jobs:
|
||||||
|
generate:
|
||||||
|
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
|
||||||
|
with:
|
||||||
|
force: ${{ github.event.inputs.force }}
|
||||||
|
mode: direct
|
||||||
|
set_version: ${{ github.event.inputs.set_version }}
|
||||||
|
speakeasy_version: latest
|
||||||
|
dotnet_version: "8.x"
|
||||||
|
secrets:
|
||||||
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
|
||||||
|
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
|
||||||
20
.github/workflows/sdk_publish.yaml
vendored
Normal file
20
.github/workflows/sdk_publish.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: Publish
|
||||||
|
permissions:
|
||||||
|
checks: write
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
statuses: write
|
||||||
|
"on":
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- RELEASES.md
|
||||||
|
- '*/RELEASES.md'
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
|
||||||
|
secrets:
|
||||||
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
|
||||||
|
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
|
||||||
25
.github/workflows/speakeasy_sdk_generation.yml
vendored
25
.github/workflows/speakeasy_sdk_generation.yml
vendored
@@ -1,25 +0,0 @@
|
|||||||
name: Generate
|
|
||||||
permissions:
|
|
||||||
checks: write
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
statuses: write
|
|
||||||
"on":
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
force:
|
|
||||||
description: Force generation of SDKs
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
schedule:
|
|
||||||
- cron: 0 0 * * *
|
|
||||||
jobs:
|
|
||||||
generate:
|
|
||||||
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
|
|
||||||
with:
|
|
||||||
force: ${{ github.event.inputs.force }}
|
|
||||||
mode: direct
|
|
||||||
speakeasy_version: latest
|
|
||||||
secrets:
|
|
||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,3 +1,8 @@
|
|||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.DS_Store
|
||||||
|
**/.speakeasy/temp/
|
||||||
|
**/.speakeasy/logs/
|
||||||
obj/
|
obj/
|
||||||
bin/
|
bin/
|
||||||
debug/
|
debug/
|
||||||
|
|||||||
1
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/.name
generated
Normal file
1
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
|||||||
|
LukeHagar.PlexAPI.SDK
|
||||||
4
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
||||||
8
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/projectSettingsUpdater.xml
generated
Normal file
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/projectSettingsUpdater.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RiderProjectSettingsUpdater">
|
||||||
|
<option name="vcsConfiguration" value="3" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
2133
.speakeasy/gen.lock
2133
.speakeasy/gen.lock
File diff suppressed because one or more lines are too long
@@ -4,22 +4,36 @@ generation:
|
|||||||
maintainOpenAPIOrder: true
|
maintainOpenAPIOrder: true
|
||||||
usageSnippets:
|
usageSnippets:
|
||||||
optionalPropertyRendering: withExample
|
optionalPropertyRendering: withExample
|
||||||
|
sdkInitStyle: constructor
|
||||||
useClassNamesForArrayFields: true
|
useClassNamesForArrayFields: true
|
||||||
fixes:
|
fixes:
|
||||||
nameResolutionDec2023: true
|
nameResolutionDec2023: true
|
||||||
|
nameResolutionFeb2025: false
|
||||||
parameterOrderingFeb2024: true
|
parameterOrderingFeb2024: true
|
||||||
requestResponseComponentNamesFeb2024: true
|
requestResponseComponentNamesFeb2024: true
|
||||||
|
securityFeb2025: false
|
||||||
|
sharedErrorComponentsApr2025: false
|
||||||
auth:
|
auth:
|
||||||
oAuth2ClientCredentialsEnabled: true
|
oAuth2ClientCredentialsEnabled: true
|
||||||
|
oAuth2PasswordEnabled: false
|
||||||
|
hoistGlobalSecurity: true
|
||||||
|
tests:
|
||||||
|
generateTests: true
|
||||||
|
generateNewTests: false
|
||||||
|
skipResponseBodyAssertions: false
|
||||||
csharp:
|
csharp:
|
||||||
version: 0.5.1
|
version: 0.17.0
|
||||||
additionalDependencies: []
|
additionalDependencies: []
|
||||||
author: LukeHagar
|
author: LukeHagar
|
||||||
|
baseErrorName: PlexAPIError
|
||||||
clientServerStatusCodesAsErrors: true
|
clientServerStatusCodesAsErrors: true
|
||||||
|
defaultErrorName: SDKException
|
||||||
disableNamespacePascalCasingApr2024: true
|
disableNamespacePascalCasingApr2024: true
|
||||||
dotnetVersion: net8.0
|
dotnetVersion: net8.0
|
||||||
enableSourceLink: false
|
enableSourceLink: true
|
||||||
flattenGlobalSecurity: true
|
flattenGlobalSecurity: true
|
||||||
|
flatteningOrder: ""
|
||||||
|
httpClientPrefix: Speakeasy
|
||||||
imports:
|
imports:
|
||||||
option: openapi
|
option: openapi
|
||||||
paths:
|
paths:
|
||||||
@@ -28,10 +42,12 @@ csharp:
|
|||||||
operations: Models/Requests
|
operations: Models/Requests
|
||||||
shared: Models/Components
|
shared: Models/Components
|
||||||
webhooks: Models/Webhooks
|
webhooks: Models/Webhooks
|
||||||
includeDebugSymbols: false
|
includeDebugSymbols: true
|
||||||
inputModelSuffix: input
|
inputModelSuffix: input
|
||||||
maxMethodParams: 4
|
maxMethodParams: 4
|
||||||
|
methodArguments: infer-optional-args
|
||||||
outputModelSuffix: output
|
outputModelSuffix: output
|
||||||
packageName: LukeHagar.PlexAPI.SDK
|
packageName: LukeHagar.PlexAPI.SDK
|
||||||
packageTags: ""
|
packageTags: Plex Media Server SDK
|
||||||
responseFormat: envelope
|
responseFormat: envelope
|
||||||
|
sourceDirectory: ""
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
speakeasyVersion: 1.391.3
|
speakeasyVersion: 1.615.2
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
my-source:
|
||||||
sourceNamespace: my-source
|
sourceNamespace: my-source
|
||||||
@@ -7,23 +7,45 @@ sources:
|
|||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- main
|
- main
|
||||||
|
plex-api:
|
||||||
|
sourceNamespace: plex-api
|
||||||
|
sourceRevisionDigest: sha256:289c5a73965c8fa779f32919d1353d0d275163982c0a0f5525ef4146c462a486
|
||||||
|
sourceBlobDigest: sha256:f7e2709f52370dff16c1851a7a4e44a89f2e978e9cae335bffc10625950b3bd9
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- main
|
||||||
|
plexapi:
|
||||||
|
sourceNamespace: plexapi
|
||||||
|
sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787
|
||||||
|
sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- speakeasy-sdk-regen-1757895932
|
||||||
targets:
|
targets:
|
||||||
plexcsharp:
|
plexcsharp:
|
||||||
source: my-source
|
source: plexapi
|
||||||
sourceNamespace: my-source
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:674cfdd3e98489e023ae9a80ff8753f30d1b6f625d25bd11b9897875477a4392
|
sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787
|
||||||
sourceBlobDigest: sha256:370cb4409748c4811372a81d94f1a84f60b538087c23f2cb24f72082bcc827f6
|
sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0
|
||||||
outLocation: /github/workspace/repo
|
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
||||||
|
codeSamplesRevisionDigest: sha256:41c049f80e89195d5537bfbc2aa652942aeb669534f6c7d22e2172361fd708aa
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
plexapi:
|
||||||
inputs:
|
inputs:
|
||||||
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/output/plex-media-server-spec-dereferenced.yaml
|
- location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main
|
||||||
registry:
|
|
||||||
location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source
|
|
||||||
targets:
|
targets:
|
||||||
plexcsharp:
|
plexcsharp:
|
||||||
target: csharp
|
target: csharp
|
||||||
source: my-source
|
source: plexapi
|
||||||
|
publish:
|
||||||
|
nuget:
|
||||||
|
apiKey: $nuget_api_key
|
||||||
|
codeSamples:
|
||||||
|
output: codeSamples.yaml
|
||||||
|
registry:
|
||||||
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
|
||||||
|
labelOverride:
|
||||||
|
fixedValue: PlexCSharp
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
plexapi:
|
||||||
inputs:
|
inputs:
|
||||||
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/output/plex-media-server-spec-dereferenced.yaml
|
- location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main
|
||||||
registry:
|
|
||||||
location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source
|
|
||||||
targets:
|
targets:
|
||||||
plexcsharp:
|
plexcsharp:
|
||||||
target: csharp
|
target: csharp
|
||||||
source: my-source
|
source: plexapi
|
||||||
|
publish:
|
||||||
|
nuget:
|
||||||
|
apiKey: $nuget_api_key
|
||||||
|
codeSamples:
|
||||||
|
output: codeSamples.yaml
|
||||||
|
registry:
|
||||||
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
|
||||||
|
labelOverride:
|
||||||
|
fixedValue: PlexCSharp
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
/// <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/>
|
||||||
@@ -74,19 +74,12 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
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.5.1";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.411.5";
|
private const string _sdkGenVersion = "2.698.4";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
|
|
||||||
private string _serverUrl = "";
|
|
||||||
private ISpeakeasyHttpClient _client;
|
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
|
||||||
|
|
||||||
public Activities(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
public Activities(SDKConfig config)
|
||||||
{
|
{
|
||||||
_client = client;
|
|
||||||
_securitySource = securitySource;
|
|
||||||
_serverUrl = serverUrl;
|
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,21 +90,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("getServerActivities", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -144,7 +137,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetServerActivitiesResponseBody obj;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
obj = ResponseBodyDeserializer.DeserializeNotNull<GetServerActivitiesResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetServerActivitiesResponseBody.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
var response = new GetServerActivitiesResponse()
|
var response = new GetServerActivitiesResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -154,32 +157,61 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
response.Object = obj;
|
response.Object = obj;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
|
||||||
}
|
}
|
||||||
}
|
else if(responseStatusCode == 400)
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetServerActivitiesBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetServerActivitiesBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetServerActivitiesBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetServerActivitiesBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetServerActivitiesUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetServerActivitiesUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into GetServerActivitiesUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetServerActivitiesUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
|
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
|
||||||
@@ -192,21 +224,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("cancelServerActivities", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "cancelServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -244,27 +276,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
CancelServerActivitiesBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<CancelServerActivitiesBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into CancelServerActivitiesBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new CancelServerActivitiesBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<CancelServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
CancelServerActivitiesUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<CancelServerActivitiesUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into CancelServerActivitiesUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new CancelServerActivitiesUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// API Calls regarding authentication for Plex Media Server<br/>
|
/// API Calls regarding authentication for Plex Media Server<br/>
|
||||||
@@ -33,7 +33,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a Transient Token.
|
/// Get a Transient Token
|
||||||
///
|
///
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.<br/>
|
/// This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.<br/>
|
||||||
@@ -54,13 +54,13 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source);
|
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get User Data By Token
|
/// Get Token Details
|
||||||
///
|
///
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Get the User data from the provided X-Plex-Token
|
/// Get the User data from the provided X-Plex-Token
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetUserDetailsResponse> GetUserDetailsAsync(string xPlexToken, string? serverUrl = null);
|
Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get User Sign In Data
|
/// Get User Sign In Data
|
||||||
@@ -69,7 +69,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Sign in user with username and password and return user data with Plex authentication token
|
/// Sign in user with username and password and return user data with Plex authentication token
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(string? xPlexClientIdentifier = null, PostUsersSignInDataRequestBody? requestBody = null, string? serverUrl = null);
|
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -82,9 +82,9 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
public class Authentication: IAuthentication
|
public class Authentication: IAuthentication
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of server URLs available for the getUserDetails operation.
|
/// List of server URLs available for the getTokenDetails operation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string[] GetUserDetailsServerList = {
|
public static readonly string[] GetTokenDetailsServerList = {
|
||||||
"https://plex.tv/api/v2",
|
"https://plex.tv/api/v2",
|
||||||
};
|
};
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -95,19 +95,12 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
};
|
};
|
||||||
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.5.1";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.411.5";
|
private const string _sdkGenVersion = "2.698.4";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
|
|
||||||
private string _serverUrl = "";
|
|
||||||
private ISpeakeasyHttpClient _client;
|
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
|
||||||
|
|
||||||
public Authentication(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
public Authentication(SDKConfig config)
|
||||||
{
|
{
|
||||||
_client = client;
|
|
||||||
_securitySource = securitySource;
|
|
||||||
_serverUrl = serverUrl;
|
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,21 +115,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("getTransientToken", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTransientToken", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -174,27 +167,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetTransientTokenBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTransientTokenBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetTransientTokenBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetTransientTokenBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetTransientTokenResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetTransientTokenUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTransientTokenUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into GetTransientTokenUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetTransientTokenUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
|
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
|
||||||
@@ -207,21 +231,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSourceConnectionInformation", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -259,59 +283,87 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetSourceConnectionInformationBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetSourceConnectionInformationBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetSourceConnectionInformationBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetSourceConnectionInformationBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetSourceConnectionInformationResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetSourceConnectionInformationUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetSourceConnectionInformationUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into GetSourceConnectionInformationUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetUserDetailsResponse> GetUserDetailsAsync(string xPlexToken, string? serverUrl = null)
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetSourceConnectionInformationUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
var request = new GetUserDetailsRequest()
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
XPlexToken = xPlexToken,
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
};
|
}
|
||||||
string baseUrl = Utilities.TemplateUrl(GetUserDetailsServerList[0], new Dictionary<string, string>(){
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null)
|
||||||
|
{
|
||||||
|
string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary<string, string>(){
|
||||||
});
|
});
|
||||||
if (serverUrl != null)
|
if (serverUrl != null)
|
||||||
{
|
{
|
||||||
baseUrl = serverUrl;
|
baseUrl = serverUrl;
|
||||||
}
|
}
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/user", request);
|
|
||||||
|
var urlString = baseUrl + "/user";
|
||||||
|
|
||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("getUserDetails", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTokenDetails", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -344,8 +396,18 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetUserDetailsUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
var response = new GetUserDetailsResponse()
|
GetTokenDetailsUserPlexAccount obj;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
obj = ResponseBodyDeserializer.DeserializeNotNull<GetTokenDetailsUserPlexAccount>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetTokenDetailsUserPlexAccount.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
var response = new GetTokenDetailsResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
@@ -354,53 +416,77 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
response.UserPlexAccount = obj;
|
response.UserPlexAccount = obj;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
|
||||||
}
|
}
|
||||||
}
|
else if(responseStatusCode == 400)
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetTokenDetailsBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTokenDetailsBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetTokenDetailsBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetTokenDetailsBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetUserDetailsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetTokenDetailsUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTokenDetailsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into GetTokenDetailsUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(string? xPlexClientIdentifier = null, PostUsersSignInDataRequestBody? requestBody = null, string? serverUrl = null)
|
payload.RawResponse = httpResponse;
|
||||||
{
|
throw new GetTokenDetailsUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
var request = new PostUsersSignInDataRequest()
|
}
|
||||||
{
|
|
||||||
XPlexClientIdentifier = xPlexClientIdentifier,
|
|
||||||
RequestBody = requestBody,
|
|
||||||
};
|
|
||||||
request.XPlexClientIdentifier ??= SDKConfiguration.XPlexClientIdentifier;
|
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null)
|
||||||
|
{
|
||||||
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
|
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
|
||||||
});
|
});
|
||||||
if (serverUrl != null)
|
if (serverUrl != null)
|
||||||
{
|
{
|
||||||
baseUrl = serverUrl;
|
baseUrl = serverUrl;
|
||||||
}
|
}
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/users/signin", request);
|
|
||||||
|
var urlString = baseUrl + "/users/signin";
|
||||||
|
|
||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
|
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
|
||||||
if (serializedBody != null)
|
if (serializedBody != null)
|
||||||
@@ -408,14 +494,14 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
httpRequest.Content = serializedBody;
|
httpRequest.Content = serializedBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("post-users-sign-in-data", null, null);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "post-users-sign-in-data", new List<string> { }, null);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -448,7 +534,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
PostUsersSignInDataUserPlexAccount obj;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
obj = ResponseBodyDeserializer.DeserializeNotNull<PostUsersSignInDataUserPlexAccount>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into PostUsersSignInDataUserPlexAccount.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
var response = new PostUsersSignInDataResponse()
|
var response = new PostUsersSignInDataResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -458,32 +554,61 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
response.UserPlexAccount = obj;
|
response.UserPlexAccount = obj;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
|
||||||
}
|
}
|
||||||
}
|
else if(responseStatusCode == 400)
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
PostUsersSignInDataBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<PostUsersSignInDataBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into PostUsersSignInDataBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new PostUsersSignInDataBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
PostUsersSignInDataUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<PostUsersSignInDataUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into PostUsersSignInDataUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new PostUsersSignInDataUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,14 +13,16 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Butler is the task manager of the Plex Media Server Ecosystem.<br/>
|
/// Butler is the task manager of the Plex Media Server Ecosystem.<br/>
|
||||||
@@ -101,19 +103,12 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
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.5.1";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.411.5";
|
private const string _sdkGenVersion = "2.698.4";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
|
|
||||||
private string _serverUrl = "";
|
|
||||||
private ISpeakeasyHttpClient _client;
|
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
|
||||||
|
|
||||||
public Butler(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
public Butler(SDKConfig config)
|
||||||
{
|
{
|
||||||
_client = client;
|
|
||||||
_securitySource = securitySource;
|
|
||||||
_serverUrl = serverUrl;
|
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,21 +119,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("getButlerTasks", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getButlerTasks", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -171,7 +166,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetButlerTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetButlerTasksResponseBody obj;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
obj = ResponseBodyDeserializer.DeserializeNotNull<GetButlerTasksResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetButlerTasksResponseBody.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
var response = new GetButlerTasksResponse()
|
var response = new GetButlerTasksResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -181,32 +186,61 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
response.Object = obj;
|
response.Object = obj;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
|
||||||
}
|
}
|
||||||
}
|
else if(responseStatusCode == 400)
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetButlerTasksBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetButlerTasksBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetButlerTasksBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetButlerTasksBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetButlerTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetButlerTasksUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetButlerTasksUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into GetButlerTasksUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetButlerTasksUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
||||||
@@ -216,21 +250,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("startAllTasks", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -268,27 +302,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
StartAllTasksBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StartAllTasksBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into StartAllTasksBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new StartAllTasksBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<StartAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StartAllTasksUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StartAllTasksUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into StartAllTasksUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new StartAllTasksUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
||||||
@@ -298,21 +363,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("stopAllTasks", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -350,27 +415,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
StopAllTasksBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StopAllTasksBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into StopAllTasksBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new StopAllTasksBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<StopAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StopAllTasksUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StopAllTasksUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into StopAllTasksUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new StopAllTasksUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
|
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
|
||||||
@@ -383,21 +479,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("startTask", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startTask", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -435,27 +531,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
StartTaskBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StartTaskBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into StartTaskBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new StartTaskBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<StartTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StartTaskUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StartTaskUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into StartTaskUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new StartTaskUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
|
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
|
||||||
@@ -468,21 +595,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("stopTask", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopTask", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -520,27 +647,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
StopTaskBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StopTaskBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into StopTaskBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new StopTaskBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<StopTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StopTaskUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StopTaskUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into StopTaskUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new StopTaskUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,34 +17,47 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
|
|||||||
|
|
||||||
public class HookContext
|
public class HookContext
|
||||||
{
|
{
|
||||||
|
public SDKConfig SDKConfiguration { get; set; }
|
||||||
|
public string BaseURL { get; set; } = "";
|
||||||
public string OperationID { get; set; }
|
public string OperationID { get; set; }
|
||||||
public List<string>? Oauth2Scopes { get; set; }
|
public List<string>? Oauth2Scopes { get; set; }
|
||||||
public Func<object>? SecuritySource { get; set; }
|
public Func<object>? SecuritySource { get; set; }
|
||||||
|
|
||||||
public HookContext(string operationID, List<string>? oauth2Scopes, Func<object>? securitySource)
|
public HookContext(SDKConfig config, string baseURL, string operationID, List<string>? oauth2Scopes, Func<object>? securitySource)
|
||||||
{
|
{
|
||||||
|
SDKConfiguration = config;
|
||||||
|
BaseURL = baseURL;
|
||||||
OperationID = operationID;
|
OperationID = operationID;
|
||||||
Oauth2Scopes = oauth2Scopes;
|
Oauth2Scopes = oauth2Scopes;
|
||||||
SecuritySource = securitySource;
|
SecuritySource = securitySource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HookContext(HookContext hookCtx)
|
||||||
|
{
|
||||||
|
SDKConfiguration = hookCtx.SDKConfiguration;
|
||||||
|
BaseURL = hookCtx.BaseURL;
|
||||||
|
OperationID = hookCtx.OperationID;
|
||||||
|
Oauth2Scopes = hookCtx.Oauth2Scopes;
|
||||||
|
SecuritySource = hookCtx.SecuritySource;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BeforeRequestContext : HookContext
|
public class BeforeRequestContext : HookContext
|
||||||
{
|
{
|
||||||
public BeforeRequestContext(HookContext hookCtx)
|
public BeforeRequestContext(HookContext hookCtx)
|
||||||
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
|
: base(hookCtx) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AfterSuccessContext : HookContext
|
public class AfterSuccessContext : HookContext
|
||||||
{
|
{
|
||||||
public AfterSuccessContext(HookContext hookCtx)
|
public AfterSuccessContext(HookContext hookCtx)
|
||||||
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
|
: base(hookCtx) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AfterErrorContext : HookContext
|
public class AfterErrorContext : HookContext
|
||||||
{
|
{
|
||||||
public AfterErrorContext(HookContext hookCtx)
|
public AfterErrorContext(HookContext hookCtx)
|
||||||
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
|
: base(hookCtx) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.<br/>
|
/// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.<br/>
|
||||||
@@ -41,6 +41,16 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null);
|
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Recently Added
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// This endpoint will return the recently added content.<br/>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get library specific hubs
|
/// Get library specific hubs
|
||||||
///
|
///
|
||||||
@@ -63,19 +73,12 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
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.5.1";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.411.5";
|
private const string _sdkGenVersion = "2.698.4";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
|
|
||||||
private string _serverUrl = "";
|
|
||||||
private ISpeakeasyHttpClient _client;
|
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
|
||||||
|
|
||||||
public Hubs(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
public Hubs(SDKConfig config)
|
||||||
{
|
{
|
||||||
_client = client;
|
|
||||||
_securitySource = securitySource;
|
|
||||||
_serverUrl = serverUrl;
|
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,21 +93,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("getGlobalHubs", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getGlobalHubs", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -137,7 +140,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetGlobalHubsResponseBody obj;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
obj = ResponseBodyDeserializer.DeserializeNotNull<GetGlobalHubsResponseBody>(httpResponseBody, NullValueHandling.Include);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetGlobalHubsResponseBody.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
var response = new GetGlobalHubsResponse()
|
var response = new GetGlobalHubsResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -147,32 +160,149 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
response.Object = obj;
|
response.Object = obj;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
|
||||||
}
|
}
|
||||||
}
|
else if(responseStatusCode == 400)
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetGlobalHubsBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetGlobalHubsBadRequestPayload>(httpResponseBody, NullValueHandling.Include);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetGlobalHubsBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetGlobalHubsBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetGlobalHubsUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetGlobalHubsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Include);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetGlobalHubsUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetGlobalHubsUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request)
|
||||||
|
{
|
||||||
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
|
||||||
|
|
||||||
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
|
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
|
{
|
||||||
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-recently-added", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
|
HttpResponseMessage httpResponse;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
{
|
||||||
|
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||||
|
if (_httpResponse != null)
|
||||||
|
{
|
||||||
|
httpResponse = _httpResponse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception error)
|
||||||
|
{
|
||||||
|
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
|
||||||
|
if (_httpResponse != null)
|
||||||
|
{
|
||||||
|
httpResponse = _httpResponse;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
|
||||||
|
|
||||||
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetRecentlyAddedResponseBody obj;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
obj = ResponseBodyDeserializer.DeserializeNotNull<GetRecentlyAddedResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetRecentlyAddedResponseBody.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
var response = new GetRecentlyAddedResponse()
|
||||||
|
{
|
||||||
|
StatusCode = responseStatusCode,
|
||||||
|
ContentType = contentType,
|
||||||
|
RawResponse = httpResponse
|
||||||
|
};
|
||||||
|
response.Object = obj;
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode == 400 || responseStatusCode == 401 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
@@ -187,21 +317,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("getLibraryHubs", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getLibraryHubs", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -234,7 +364,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetLibraryHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetLibraryHubsResponseBody obj;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
obj = ResponseBodyDeserializer.DeserializeNotNull<GetLibraryHubsResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetLibraryHubsResponseBody.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
var response = new GetLibraryHubsResponse()
|
var response = new GetLibraryHubsResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -244,32 +384,61 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
response.Object = obj;
|
response.Object = obj;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
|
||||||
}
|
}
|
||||||
}
|
else if(responseStatusCode == 400)
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetLibraryHubsBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetLibraryHubsBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetLibraryHubsBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetLibraryHubsBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetLibraryHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetLibraryHubsUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetLibraryHubsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into GetLibraryHubsUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetLibraryHubsUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -13,14 +13,16 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Submit logs to the Log Handler for Plex Media Server<br/>
|
/// Submit logs to the Log Handler for Plex Media Server<br/>
|
||||||
@@ -94,19 +96,12 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
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.5.1";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.411.5";
|
private const string _sdkGenVersion = "2.698.4";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
|
|
||||||
private string _serverUrl = "";
|
|
||||||
private ISpeakeasyHttpClient _client;
|
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
|
||||||
|
|
||||||
public Log(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
public Log(SDKConfig config)
|
||||||
{
|
{
|
||||||
_client = client;
|
|
||||||
_securitySource = securitySource;
|
|
||||||
_serverUrl = serverUrl;
|
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,21 +117,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("logLine", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "logLine", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -174,27 +169,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
LogLineBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<LogLineBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into LogLineBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new LogLineBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<LogLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
LogLineUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<LogLineUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into LogLineUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new LogLineUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
|
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
|
||||||
@@ -204,7 +230,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string", false, false);
|
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string", false, false);
|
||||||
if (serializedBody != null)
|
if (serializedBody != null)
|
||||||
@@ -212,19 +238,19 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
httpRequest.Content = serializedBody;
|
httpRequest.Content = serializedBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("logMultiLine", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "logMultiLine", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -262,27 +288,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
LogMultiLineBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<LogMultiLineBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into LogMultiLineBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new LogMultiLineBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<LogMultiLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
LogMultiLineUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<LogMultiLineUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into LogMultiLineUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new LogMultiLineUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
||||||
@@ -292,21 +349,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("enablePaperTrail", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "enablePaperTrail", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -344,27 +401,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
EnablePaperTrailBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<EnablePaperTrailBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into EnablePaperTrailBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new EnablePaperTrailBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<EnablePaperTrailResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
EnablePaperTrailUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<EnablePaperTrailUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into EnablePaperTrailUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new EnablePaperTrailUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,13 +3,38 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
||||||
<Version>0.5.1</Version>
|
<Version>0.17.0</Version>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<Authors>LukeHagar</Authors>
|
<Authors>LukeHagar</Authors>
|
||||||
<Copyright>Copyright (c) LukeHagar 2024</Copyright>
|
<Copyright>Copyright (c) LukeHagar 2025</Copyright>
|
||||||
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
|
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<Description>Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server</Description>
|
<PackageTags>Plex Media Server SDK</PackageTags>
|
||||||
|
<Description># Plex Media Server OpenAPI Specification<br/>
|
||||||
|
<br/>
|
||||||
|
An Open Source OpenAPI Specification for Plex Media Server<br/>
|
||||||
|
<br/>
|
||||||
|
Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
|
||||||
|
<br/>
|
||||||
|
## Documentation<br/>
|
||||||
|
<br/>
|
||||||
|
<a href="https://plexapi.dev">API Documentation</a><br/>
|
||||||
|
<br/>
|
||||||
|
## SDKs<br/>
|
||||||
|
<br/>
|
||||||
|
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
|
||||||
|
<br/>
|
||||||
|
| Language | Repository | Releases | Other |<br/>
|
||||||
|
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
|
||||||
|
| Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
|
||||||
|
| JavaScript/TypeScript | <a href="https://github.com/LukeHagar/plexjs">GitHub</a> | <a href="https://www.npmjs.com/package/@lukehagar/plexjs">NPM</a> \ <a href="https://jsr.io/@lukehagar/plexjs">JSR</a> | - |<br/>
|
||||||
|
| Go | <a href="https://github.com/LukeHagar/plexgo">GitHub</a> | <a href="https://github.com/LukeHagar/plexgo/releases">Releases</a> | <a href="https://pkg.go.dev/github.com/LukeHagar/plexgo">GoDoc</a> |<br/>
|
||||||
|
| Ruby | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/releases">Releases</a> | - |<br/>
|
||||||
|
| Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
|
||||||
|
| PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
|
||||||
|
| Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
|
||||||
|
| C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | -<br/>
|
||||||
|
</Description>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
@@ -29,9 +54,23 @@
|
|||||||
<None Include="..\..\..\docs\**\*" Pack="true" PackagePath="\docs" CopyToOutputDirectory="PreserveNewest"/>
|
<None Include="..\..\..\docs\**\*" Pack="true" PackagePath="\docs" CopyToOutputDirectory="PreserveNewest"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>portable</DebugType>
|
||||||
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||||
|
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||||
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<EmbedAllSources>true</EmbedAllSources>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="newtonsoft.json" Version="13.0.3" />
|
<PackageReference Include="newtonsoft.json" Version="13.0.3" />
|
||||||
<PackageReference Include="nodatime" Version="3.1.9" />
|
<PackageReference Include="nodatime" Version="3.1.9" />
|
||||||
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// API Calls interacting with Plex Media Server Media<br/>
|
/// API Calls interacting with Plex Media Server Media<br/>
|
||||||
@@ -90,19 +90,12 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
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.5.1";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.411.5";
|
private const string _sdkGenVersion = "2.698.4";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
|
|
||||||
private string _serverUrl = "";
|
|
||||||
private ISpeakeasyHttpClient _client;
|
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
|
||||||
|
|
||||||
public Media(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
public Media(SDKConfig config)
|
||||||
{
|
{
|
||||||
_client = client;
|
|
||||||
_securitySource = securitySource;
|
|
||||||
_serverUrl = serverUrl;
|
|
||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,21 +109,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("markPlayed", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "markPlayed", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -168,27 +161,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
MarkPlayedBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<MarkPlayedBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into MarkPlayedBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new MarkPlayedBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<MarkPlayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
MarkPlayedUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<MarkPlayedUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into MarkPlayedUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new MarkPlayedUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
|
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
|
||||||
@@ -201,21 +225,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("markUnplayed", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "markUnplayed", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -253,27 +277,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
MarkUnplayedBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<MarkUnplayedBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into MarkUnplayedBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new MarkUnplayedBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<MarkUnplayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
MarkUnplayedUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<MarkUnplayedUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into MarkUnplayedUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new MarkUnplayedUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
|
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
|
||||||
@@ -288,21 +343,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
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", SDKConfiguration.UserAgent);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("updatePlayProgress", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "updatePlayProgress", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -340,27 +395,58 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
RawResponse = httpResponse
|
RawResponse = httpResponse
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
UpdatePlayProgressBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<UpdatePlayProgressBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into UpdatePlayProgressBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new UpdatePlayProgressBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<UpdatePlayProgressResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
UpdatePlayProgressUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<UpdatePlayProgressUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into UpdatePlayProgressUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new UpdatePlayProgressUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request)
|
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request)
|
||||||
@@ -369,21 +455,22 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", 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", SDKConfiguration.UserAgent);
|
||||||
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("get-banner-image", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-banner-image", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -425,32 +512,61 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
|
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
|
||||||
}
|
}
|
||||||
}
|
else if(responseStatusCode == 400)
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetBannerImageBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetBannerImageBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetBannerImageBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetBannerImageBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetBannerImageResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetBannerImageUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetBannerImageUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into GetBannerImageUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetBannerImageUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request)
|
public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request)
|
||||||
@@ -459,21 +575,22 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", 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", SDKConfiguration.UserAgent);
|
||||||
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (SDKConfiguration.SecuritySource != null)
|
||||||
{
|
{
|
||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("get-thumb-image", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-thumb-image", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -515,32 +632,61 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
|
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
|
||||||
}
|
}
|
||||||
}
|
else if(responseStatusCode == 400)
|
||||||
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
|
||||||
{
|
{
|
||||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
GetThumbImageBadRequestPayload payload;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetThumbImageBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetThumbImageBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetThumbImageBadRequest(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 401)
|
else if(responseStatusCode == 401)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetThumbImageResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetThumbImageUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetThumbImageUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
}
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new ResponseValidationException("Failed to deserialize response body into GetThumbImageUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetThumbImageUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Components
|
|||||||
public class Security
|
public class Security
|
||||||
{
|
{
|
||||||
|
|
||||||
[SpeakeasyMetadata("security:scheme=true,type=apiKey,subType=query,name=X-Plex-Token")]
|
[SpeakeasyMetadata("security:scheme=true,type=apiKey,subType=header,name=X-Plex-Token")]
|
||||||
public string? AccessToken { get; set; }
|
public string? AccessToken { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class AddPlaylistContentsBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<AddPlaylistContentsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class AddPlaylistContentsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public AddPlaylistContentsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use AddPlaylistContentsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<AddPlaylistContentsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public AddPlaylistContentsBadRequest(
|
||||||
|
AddPlaylistContentsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,16 +12,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
public class GetMetaDataByRatingKeyErrors
|
public class AddPlaylistContentsPlaylistsErrors
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class AddPlaylistContentsUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<AddPlaylistContentsPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class AddPlaylistContentsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public AddPlaylistContentsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use AddPlaylistContentsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<AddPlaylistContentsPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public AddPlaylistContentsUnauthorized(
|
||||||
|
AddPlaylistContentsUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,16 +12,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
public class ApplyUpdatesBadRequestPayload
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class ApplyUpdatesResponseBody : Exception
|
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<ApplyUpdatesErrors>? Errors { get; set; }
|
public List<ApplyUpdatesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
@@ -31,4 +27,32 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
[JsonProperty("-")]
|
[JsonProperty("-")]
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class ApplyUpdatesBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public ApplyUpdatesBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ApplyUpdatesBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<ApplyUpdatesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public ApplyUpdatesBadRequest(
|
||||||
|
ApplyUpdatesBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,18 +12,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
public class ApplyUpdatesUnauthorizedPayload
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class AddPlaylistContentsResponseBody : Exception
|
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<AddPlaylistContentsErrors>? Errors { get; set; }
|
public List<ApplyUpdatesUpdaterErrors>? Errors { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
@@ -31,4 +27,32 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
[JsonProperty("-")]
|
[JsonProperty("-")]
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class ApplyUpdatesUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public ApplyUpdatesUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ApplyUpdatesUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<ApplyUpdatesUpdaterErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public ApplyUpdatesUnauthorized(
|
||||||
|
ApplyUpdatesUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,16 +12,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
public class GetUserDetailsErrors
|
public class ApplyUpdatesUpdaterErrors
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class CancelServerActivitiesActivitiesErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class CancelServerActivitiesBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<CancelServerActivitiesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class CancelServerActivitiesBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public CancelServerActivitiesBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CancelServerActivitiesBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<CancelServerActivitiesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public CancelServerActivitiesBadRequest(
|
||||||
|
CancelServerActivitiesBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class CancelServerActivitiesUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<CancelServerActivitiesActivitiesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class CancelServerActivitiesUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public CancelServerActivitiesUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CancelServerActivitiesUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<CancelServerActivitiesActivitiesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public CancelServerActivitiesUnauthorized(
|
||||||
|
CancelServerActivitiesUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class CheckForUpdatesBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<CheckForUpdatesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class CheckForUpdatesBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public CheckForUpdatesBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CheckForUpdatesBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<CheckForUpdatesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public CheckForUpdatesBadRequest(
|
||||||
|
CheckForUpdatesBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,18 +12,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
public class CheckForUpdatesUnauthorizedPayload
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetMetaDataByRatingKeyResponseBody : Exception
|
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetMetaDataByRatingKeyErrors>? Errors { get; set; }
|
public List<CheckForUpdatesUpdaterErrors>? Errors { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
@@ -31,4 +27,32 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
[JsonProperty("-")]
|
[JsonProperty("-")]
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class CheckForUpdatesUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public CheckForUpdatesUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CheckForUpdatesUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<CheckForUpdatesUpdaterErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public CheckForUpdatesUnauthorized(
|
||||||
|
CheckForUpdatesUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,16 +12,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
public class GetRecentlyAddedErrors
|
public class CheckForUpdatesUpdaterErrors
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class ClearPlaylistContentsBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<ClearPlaylistContentsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class ClearPlaylistContentsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public ClearPlaylistContentsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ClearPlaylistContentsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<ClearPlaylistContentsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public ClearPlaylistContentsBadRequest(
|
||||||
|
ClearPlaylistContentsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class ClearPlaylistContentsPlaylistsErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class ClearPlaylistContentsUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<ClearPlaylistContentsPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class ClearPlaylistContentsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public ClearPlaylistContentsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ClearPlaylistContentsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<ClearPlaylistContentsPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public ClearPlaylistContentsUnauthorized(
|
||||||
|
ClearPlaylistContentsUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class CreatePlaylistBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<CreatePlaylistErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class CreatePlaylistBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public CreatePlaylistBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CreatePlaylistBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<CreatePlaylistErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public CreatePlaylistBadRequest(
|
||||||
|
CreatePlaylistBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class CreatePlaylistPlaylistsErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
|
||||||
{
|
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class CreatePlaylistResponseBody : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
|
||||||
public List<CreatePlaylistErrors>? Errors { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("-")]
|
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,18 +12,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
public class CreatePlaylistUnauthorizedPayload
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetRecentlyAddedResponseBody : Exception
|
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetRecentlyAddedErrors>? Errors { get; set; }
|
public List<CreatePlaylistPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
@@ -31,4 +27,32 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
[JsonProperty("-")]
|
[JsonProperty("-")]
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class CreatePlaylistUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public CreatePlaylistUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use CreatePlaylistUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<CreatePlaylistPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public CreatePlaylistUnauthorized(
|
||||||
|
CreatePlaylistUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class DeleteLibraryBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<DeleteLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class DeleteLibraryBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public DeleteLibraryBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use DeleteLibraryBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<DeleteLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public DeleteLibraryBadRequest(
|
||||||
|
DeleteLibraryBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class DeleteLibraryLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
|
||||||
{
|
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class DeleteLibraryResponseBody : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
|
||||||
public List<DeleteLibraryErrors>? Errors { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("-")]
|
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,18 +12,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
public class DeleteLibraryUnauthorizedPayload
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetTopWatchedContentResponseBody : Exception
|
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetTopWatchedContentErrors>? Errors { get; set; }
|
public List<DeleteLibraryLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
@@ -31,4 +27,32 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
[JsonProperty("-")]
|
[JsonProperty("-")]
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class DeleteLibraryUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public DeleteLibraryUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use DeleteLibraryUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<DeleteLibraryLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public DeleteLibraryUnauthorized(
|
||||||
|
DeleteLibraryUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class DeletePlaylistBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<DeletePlaylistErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class DeletePlaylistBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public DeletePlaylistBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use DeletePlaylistBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<DeletePlaylistErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public DeletePlaylistBadRequest(
|
||||||
|
DeletePlaylistBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class DeletePlaylistPlaylistsErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
|
||||||
{
|
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class DeletePlaylistResponseBody : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
|
||||||
public List<DeletePlaylistErrors>? Errors { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("-")]
|
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class DeletePlaylistUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<DeletePlaylistPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class DeletePlaylistUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public DeletePlaylistUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use DeletePlaylistUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<DeletePlaylistPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public DeletePlaylistUnauthorized(
|
||||||
|
DeletePlaylistUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class EnablePaperTrailBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<EnablePaperTrailErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class EnablePaperTrailBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public EnablePaperTrailBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use EnablePaperTrailBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<EnablePaperTrailErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public EnablePaperTrailBadRequest(
|
||||||
|
EnablePaperTrailBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class EnablePaperTrailLogErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class EnablePaperTrailUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<EnablePaperTrailLogErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class EnablePaperTrailUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public EnablePaperTrailUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use EnablePaperTrailUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<EnablePaperTrailLogErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public EnablePaperTrailUnauthorized(
|
||||||
|
EnablePaperTrailUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetActorsLibraryBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetActorsLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetActorsLibraryBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetActorsLibraryBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetActorsLibraryBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetActorsLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetActorsLibraryBadRequest(
|
||||||
|
GetActorsLibraryBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetActorsLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetActorsLibraryLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetActorsLibraryUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetActorsLibraryLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetActorsLibraryUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetActorsLibraryUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetActorsLibraryUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetActorsLibraryLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetActorsLibraryUnauthorized(
|
||||||
|
GetActorsLibraryUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetAllLibrariesBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetAllLibrariesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetAllLibrariesBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetAllLibrariesBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetAllLibrariesBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetAllLibrariesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetAllLibrariesBadRequest(
|
||||||
|
GetAllLibrariesBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetAllLibrariesLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,18 +12,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
public class GetAllLibrariesUnauthorizedPayload
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetBandwidthStatisticsResponseBody : Exception
|
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetBandwidthStatisticsErrors>? Errors { get; set; }
|
public List<GetAllLibrariesLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
@@ -31,4 +27,32 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
[JsonProperty("-")]
|
[JsonProperty("-")]
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetAllLibrariesUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetAllLibrariesUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetAllLibrariesUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetAllLibrariesLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetAllLibrariesUnauthorized(
|
||||||
|
GetAllLibrariesUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetAvailableClientsBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetAvailableClientsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetAvailableClientsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetAvailableClientsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetAvailableClientsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetAvailableClientsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetAvailableClientsBadRequest(
|
||||||
|
GetAvailableClientsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetAvailableClientsServerErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetAvailableClientsUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetAvailableClientsServerErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetAvailableClientsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetAvailableClientsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetAvailableClientsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetAvailableClientsServerErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetAvailableClientsUnauthorized(
|
||||||
|
GetAvailableClientsUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetBandwidthStatisticsBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetBandwidthStatisticsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetBandwidthStatisticsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetBandwidthStatisticsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetBandwidthStatisticsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetBandwidthStatisticsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetBandwidthStatisticsBadRequest(
|
||||||
|
GetBandwidthStatisticsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetBandwidthStatisticsStatisticsErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetBandwidthStatisticsUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetBandwidthStatisticsStatisticsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetBandwidthStatisticsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetBandwidthStatisticsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetBandwidthStatisticsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetBandwidthStatisticsStatisticsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetBandwidthStatisticsUnauthorized(
|
||||||
|
GetBandwidthStatisticsUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetBannerImageBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetBannerImageErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetBannerImageBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetBannerImageBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetBannerImageBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetBannerImageErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetBannerImageBadRequest(
|
||||||
|
GetBannerImageBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetBannerImageMediaErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
|
||||||
{
|
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetBannerImageResponseBody : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
|
||||||
public List<GetBannerImageErrors>? Errors { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("-")]
|
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetBannerImageUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetBannerImageMediaErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetBannerImageUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetBannerImageUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetBannerImageUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetBannerImageMediaErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetBannerImageUnauthorized(
|
||||||
|
GetBannerImageUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetButlerTasksBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetButlerTasksErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetButlerTasksBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetButlerTasksBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetButlerTasksBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetButlerTasksErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetButlerTasksBadRequest(
|
||||||
|
GetButlerTasksBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetButlerTasksButlerErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
|
||||||
{
|
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetButlerTasksResponseBody : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
|
||||||
public List<GetButlerTasksErrors>? Errors { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("-")]
|
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,18 +12,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
public class GetButlerTasksUnauthorizedPayload
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetTranscodeSessionsResponseBody : Exception
|
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetTranscodeSessionsErrors>? Errors { get; set; }
|
public List<GetButlerTasksButlerErrors>? Errors { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
@@ -31,4 +27,32 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
[JsonProperty("-")]
|
[JsonProperty("-")]
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetButlerTasksUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetButlerTasksUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetButlerTasksUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetButlerTasksButlerErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetButlerTasksUnauthorized(
|
||||||
|
GetButlerTasksUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetCompanionsDataBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetCompanionsDataErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetCompanionsDataBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetCompanionsDataBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetCompanionsDataBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetCompanionsDataErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetCompanionsDataBadRequest(
|
||||||
|
GetCompanionsDataBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetCompanionsDataPlexErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
|
||||||
{
|
|
||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetCompanionsDataResponseBody : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
|
||||||
public List<GetCompanionsDataErrors>? Errors { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("-")]
|
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetCompanionsDataUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetCompanionsDataPlexErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetCompanionsDataUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetCompanionsDataUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetCompanionsDataUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetCompanionsDataPlexErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetCompanionsDataUnauthorized(
|
||||||
|
GetCompanionsDataUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetCountriesLibraryBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetCountriesLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetCountriesLibraryBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetCountriesLibraryBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetCountriesLibraryBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetCountriesLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetCountriesLibraryBadRequest(
|
||||||
|
GetCountriesLibraryBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetCountriesLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
public class GetCountriesLibraryLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("code")]
|
||||||
|
public int? Code { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public int? Status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
|
||||||
|
{
|
||||||
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
|
public class GetCountriesLibraryUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetCountriesLibraryLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetCountriesLibraryUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetCountriesLibraryUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetCountriesLibraryUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetCountriesLibraryLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetCountriesLibraryUnauthorized(
|
||||||
|
GetCountriesLibraryUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,16 +12,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System;
|
|
||||||
|
|
||||||
/// <summary>
|
public class GetDevicesBadRequestPayload
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetDevicesResponseBody : Exception
|
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetDevicesErrors>? Errors { get; set; }
|
public List<GetDevicesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
@@ -31,4 +27,32 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
[JsonProperty("-")]
|
[JsonProperty("-")]
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetDevicesBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetDevicesBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetDevicesBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetDevicesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetDevicesBadRequest(
|
||||||
|
GetDevicesBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public double? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public double? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user