mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 20:47:49 +00:00
Compare commits
22 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 |
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/
|
||||||
|
|||||||
1224
.speakeasy/gen.lock
1224
.speakeasy/gen.lock
File diff suppressed because one or more lines are too long
@@ -4,18 +4,28 @@ 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
|
oAuth2PasswordEnabled: false
|
||||||
|
hoistGlobalSecurity: true
|
||||||
|
tests:
|
||||||
|
generateTests: true
|
||||||
|
generateNewTests: false
|
||||||
|
skipResponseBodyAssertions: false
|
||||||
csharp:
|
csharp:
|
||||||
version: 0.13.0
|
version: 0.17.0
|
||||||
additionalDependencies: []
|
additionalDependencies: []
|
||||||
author: LukeHagar
|
author: LukeHagar
|
||||||
|
baseErrorName: PlexAPIError
|
||||||
clientServerStatusCodesAsErrors: true
|
clientServerStatusCodesAsErrors: true
|
||||||
defaultErrorName: SDKException
|
defaultErrorName: SDKException
|
||||||
disableNamespacePascalCasingApr2024: true
|
disableNamespacePascalCasingApr2024: true
|
||||||
@@ -23,6 +33,7 @@ csharp:
|
|||||||
enableSourceLink: true
|
enableSourceLink: true
|
||||||
flattenGlobalSecurity: true
|
flattenGlobalSecurity: true
|
||||||
flatteningOrder: ""
|
flatteningOrder: ""
|
||||||
|
httpClientPrefix: Speakeasy
|
||||||
imports:
|
imports:
|
||||||
option: openapi
|
option: openapi
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
speakeasyVersion: 1.474.0
|
speakeasyVersion: 1.615.2
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
my-source:
|
||||||
sourceNamespace: my-source
|
sourceNamespace: my-source
|
||||||
@@ -16,19 +16,19 @@ sources:
|
|||||||
- main
|
- main
|
||||||
plexapi:
|
plexapi:
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:b146684d2d813daa8ba29e432a12334838753d0b20183beca8178a74ec4d895a
|
sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787
|
||||||
sourceBlobDigest: sha256:58f51c4319fcda931d63950fd926e8650e20a2e1375e356bf3a930111e246a58
|
sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- speakeasy-sdk-regen-1737678066
|
- speakeasy-sdk-regen-1757895932
|
||||||
targets:
|
targets:
|
||||||
plexcsharp:
|
plexcsharp:
|
||||||
source: plexapi
|
source: plexapi
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:b146684d2d813daa8ba29e432a12334838753d0b20183beca8178a74ec4d895a
|
sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787
|
||||||
sourceBlobDigest: sha256:58f51c4319fcda931d63950fd926e8650e20a2e1375e356bf3a930111e246a58
|
sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0
|
||||||
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
||||||
codeSamplesRevisionDigest: sha256:8dae0b2319b9211623d814029b0a35e75c6343eaf116bf5a3822cfe16b32a522
|
codeSamplesRevisionDigest: sha256:41c049f80e89195d5537bfbc2aa652942aeb669534f6c7d22e2172361fd708aa
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
@@ -47,3 +47,5 @@ workflow:
|
|||||||
output: codeSamples.yaml
|
output: codeSamples.yaml
|
||||||
registry:
|
registry:
|
||||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
|
||||||
|
labelOverride:
|
||||||
|
fixedValue: PlexCSharp
|
||||||
|
|||||||
@@ -15,3 +15,5 @@ targets:
|
|||||||
output: codeSamples.yaml
|
output: codeSamples.yaml
|
||||||
registry:
|
registry:
|
||||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
|
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
|
||||||
|
labelOverride:
|
||||||
|
fixedValue: PlexCSharp
|
||||||
|
|||||||
@@ -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.13.0";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.495.0";
|
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.13.0 2.495.0 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<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,
|
||||||
@@ -155,40 +158,60 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetServerActivitiesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetServerActivitiesBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<GetServerActivitiesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetServerActivitiesUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetServerActivitiesUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -201,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)
|
||||||
@@ -245,7 +268,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new CancelServerActivitiesResponse()
|
return new CancelServerActivitiesResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -257,34 +280,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<CancelServerActivitiesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
CancelServerActivitiesBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<CancelServerActivitiesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
CancelServerActivitiesUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<CancelServerActivitiesUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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.13.0";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.495.0";
|
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.13.0 2.495.0 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)
|
||||||
@@ -166,7 +159,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new GetTransientTokenResponse()
|
return new GetTransientTokenResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -178,34 +171,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetTransientTokenBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetTransientTokenBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<GetTransientTokenUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetTransientTokenUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTransientTokenUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -218,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)
|
||||||
@@ -262,7 +275,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new GetSourceConnectionInformationResponse()
|
return new GetSourceConnectionInformationResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -274,34 +287,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetSourceConnectionInformationBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetSourceConnectionInformationBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<GetSourceConnectionInformationUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetSourceConnectionInformationUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetSourceConnectionInformationUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetSourceConnectionInformationUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetSourceConnectionInformationUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null)
|
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null)
|
||||||
@@ -316,21 +349,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var urlString = baseUrl + "/user";
|
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("getTokenDetails", 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)
|
||||||
@@ -363,7 +396,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetTokenDetailsUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
|
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()
|
var response = new GetTokenDetailsResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -374,40 +417,60 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetTokenDetailsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetTokenDetailsBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<GetTokenDetailsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetTokenDetailsUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTokenDetailsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ResponseValidationException("Failed to deserialize response body into GetTokenDetailsUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
payload.RawResponse = httpResponse;
|
||||||
|
throw new GetTokenDetailsUnauthorized(payload, httpResponse, httpResponseBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null)
|
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null)
|
||||||
@@ -422,7 +485,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var urlString = baseUrl + "/users/signin";
|
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);
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
|
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
|
||||||
@@ -431,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)
|
||||||
@@ -471,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,
|
||||||
@@ -482,40 +555,60 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
PostUsersSignInDataBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<PostUsersSignInDataUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
PostUsersSignInDataUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<PostUsersSignInDataUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -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.13.0";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.495.0";
|
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.13.0 2.495.0 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<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,
|
||||||
@@ -182,40 +187,60 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetButlerTasksBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetButlerTasksBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<GetButlerTasksUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetButlerTasksUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetButlerTasksUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
||||||
@@ -225,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)
|
||||||
@@ -269,7 +294,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new StartAllTasksResponse()
|
return new StartAllTasksResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -281,34 +306,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<StartAllTasksBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StartAllTasksBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<StartAllTasksUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StartAllTasksUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StartAllTasksUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
||||||
@@ -318,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)
|
||||||
@@ -362,7 +407,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new StopAllTasksResponse()
|
return new StopAllTasksResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -374,34 +419,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<StopAllTasksBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StopAllTasksBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<StopAllTasksUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StopAllTasksUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StopAllTasksUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -414,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)
|
||||||
@@ -458,7 +523,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(new List<int>{200, 202}.Contains(responseStatusCode))
|
if(new List<int>{200, 202}.Contains(responseStatusCode))
|
||||||
{
|
{
|
||||||
return new StartTaskResponse()
|
return new StartTaskResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -470,34 +535,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<StartTaskBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StartTaskBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<StartTaskUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StartTaskUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StartTaskUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -510,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)
|
||||||
@@ -554,7 +639,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new StopTaskResponse()
|
return new StopTaskResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -566,34 +651,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<StopTaskBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StopTaskBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<StopTaskUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
StopTaskUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<StopTaskUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
|
|||||||
{
|
{
|
||||||
this.afterErrorHooks.Add(hook);
|
this.afterErrorHooks.Add(hook);
|
||||||
}
|
}
|
||||||
|
|
||||||
public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client)
|
public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client)
|
||||||
{
|
{
|
||||||
var urlAndClient = (baseUrl, client);
|
var urlAndClient = (baseUrl, client);
|
||||||
@@ -68,7 +68,7 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
|
|||||||
}
|
}
|
||||||
return urlAndClient;
|
return urlAndClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request)
|
public async Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request)
|
||||||
{
|
{
|
||||||
foreach (var hook in this.beforeRequestHooks)
|
foreach (var hook in this.beforeRequestHooks)
|
||||||
|
|||||||
@@ -73,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.13.0";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.495.0";
|
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.13.0 2.495.0 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,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)
|
||||||
@@ -147,7 +140,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
|
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,
|
||||||
@@ -158,40 +161,60 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetGlobalHubsBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<GetGlobalHubsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request)
|
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request)
|
||||||
@@ -200,21 +223,21 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
|
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", 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("get-recently-added", null, _securitySource);
|
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-recently-added", 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)
|
||||||
@@ -247,7 +270,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
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()
|
var response = new GetRecentlyAddedResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -258,18 +291,18 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400 || responseStatusCode == 401 || responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode == 400 || responseStatusCode == 401 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -284,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)
|
||||||
@@ -331,7 +364,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<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,
|
||||||
@@ -342,40 +385,60 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetLibraryHubsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetLibraryHubsBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<GetLibraryHubsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetLibraryHubsUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetLibraryHubsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -46,13 +48,13 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Logging a multi-line message
|
/// Logging a multi-line message
|
||||||
///
|
///
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This endpoint allows for the batch addition of log entries to the main Plex Media Server log. <br/>
|
/// This endpoint allows for the batch addition of log entries to the main Plex Media Server log.<br/>
|
||||||
/// It accepts a text/plain request body, where each line represents a distinct log entry. <br/>
|
/// It accepts a text/plain request body, where each line represents a distinct log entry.<br/>
|
||||||
/// Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'. <br/>
|
/// Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.<br/>
|
||||||
/// <br/>
|
/// <br/>
|
||||||
/// Log entries are separated by a newline character (`\n`). <br/>
|
/// Log entries are separated by a newline character (`\n`).<br/>
|
||||||
/// Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters. <br/>
|
/// Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters.<br/>
|
||||||
/// This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests. <br/>
|
/// This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.<br/>
|
||||||
/// <br/>
|
/// <br/>
|
||||||
/// The 'level' parameter specifies the log entry's severity or importance, with the following integer values:<br/>
|
/// The 'level' parameter specifies the log entry's severity or importance, with the following integer values:<br/>
|
||||||
/// - `0`: Error - Critical issues that require immediate attention.<br/>
|
/// - `0`: Error - Critical issues that require immediate attention.<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.13.0";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.495.0";
|
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.13.0 2.495.0 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)
|
||||||
@@ -166,7 +161,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new LogLineResponse()
|
return new LogLineResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -178,34 +173,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<LogLineBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
LogLineBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<LogLineUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
LogLineUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<LogLineUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -215,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)
|
||||||
@@ -223,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)
|
||||||
@@ -265,7 +280,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new LogMultiLineResponse()
|
return new LogMultiLineResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -277,34 +292,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<LogMultiLineBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
LogMultiLineBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<LogMultiLineUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
LogMultiLineUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<LogMultiLineUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
||||||
@@ -314,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)
|
||||||
@@ -358,7 +393,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new EnablePaperTrailResponse()
|
return new EnablePaperTrailResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -370,34 +405,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<EnablePaperTrailBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
EnablePaperTrailBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<EnablePaperTrailUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
EnablePaperTrailUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<EnablePaperTrailUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
||||||
<Version>0.13.0</Version>
|
<Version>0.17.0</Version>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<Authors>LukeHagar</Authors>
|
<Authors>LukeHagar</Authors>
|
||||||
<Copyright>Copyright (c) LukeHagar 2025</Copyright>
|
<Copyright>Copyright (c) LukeHagar 2025</Copyright>
|
||||||
|
|||||||
@@ -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.13.0";
|
private const string _sdkVersion = "0.17.0";
|
||||||
private const string _sdkGenVersion = "2.495.0";
|
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.13.0 2.495.0 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)
|
||||||
@@ -160,7 +153,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new MarkPlayedResponse()
|
return new MarkPlayedResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -172,34 +165,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<MarkPlayedBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
MarkPlayedBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<MarkPlayedUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
MarkPlayedUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<MarkPlayedUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -212,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)
|
||||||
@@ -256,7 +269,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new MarkUnplayedResponse()
|
return new MarkUnplayedResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -268,34 +281,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<MarkUnplayedBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
MarkUnplayedBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<MarkUnplayedUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
MarkUnplayedUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<MarkUnplayedUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -310,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)
|
||||||
@@ -354,7 +387,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
if(responseStatusCode == 200)
|
if(responseStatusCode == 200)
|
||||||
{
|
{
|
||||||
return new UpdatePlayProgressResponse()
|
return new UpdatePlayProgressResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
@@ -366,34 +399,54 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<UpdatePlayProgressBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
UpdatePlayProgressBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<UpdatePlayProgressUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
UpdatePlayProgressUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<UpdatePlayProgressUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -402,22 +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);
|
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)
|
||||||
@@ -460,40 +513,60 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetBannerImageBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetBannerImageBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<GetBannerImageUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetBannerImageUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetBannerImageUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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)
|
||||||
@@ -502,22 +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);
|
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)
|
||||||
@@ -560,40 +633,60 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode == 400)
|
else if(responseStatusCode == 400)
|
||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetThumbImageBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetThumbImageBadRequestPayload payload;
|
||||||
throw obj!;
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
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<GetThumbImageUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||||
obj!.RawResponse = httpResponse;
|
GetThumbImageUnauthorizedPayload payload;
|
||||||
throw obj!;
|
try
|
||||||
|
{
|
||||||
|
payload = ResponseBodyDeserializer.DeserializeNotNull<GetThumbImageUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
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", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
{
|
{
|
||||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class AddPlaylistContentsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class AddPlaylistContentsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<AddPlaylistContentsErrors>? Errors { get; set; }
|
public List<AddPlaylistContentsErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class AddPlaylistContentsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class AddPlaylistContentsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<AddPlaylistContentsPlaylistsErrors>? Errors { get; set; }
|
public List<AddPlaylistContentsPlaylistsErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class ApplyUpdatesBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class ApplyUpdatesBadRequestPayload
|
||||||
|
{
|
||||||
[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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class ApplyUpdatesUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class ApplyUpdatesUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<ApplyUpdatesUpdaterErrors>? Errors { get; set; }
|
public List<ApplyUpdatesUpdaterErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class CancelServerActivitiesBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class CancelServerActivitiesBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<CancelServerActivitiesErrors>? Errors { get; set; }
|
public List<CancelServerActivitiesErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class CancelServerActivitiesUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class CancelServerActivitiesUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<CancelServerActivitiesActivitiesErrors>? Errors { get; set; }
|
public List<CancelServerActivitiesActivitiesErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class CheckForUpdatesBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class CheckForUpdatesBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<CheckForUpdatesErrors>? Errors { get; set; }
|
public List<CheckForUpdatesErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class CheckForUpdatesUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class CheckForUpdatesUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<CheckForUpdatesUpdaterErrors>? Errors { get; set; }
|
public List<CheckForUpdatesUpdaterErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class ClearPlaylistContentsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class ClearPlaylistContentsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<ClearPlaylistContentsErrors>? Errors { get; set; }
|
public List<ClearPlaylistContentsErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class ClearPlaylistContentsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class ClearPlaylistContentsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<ClearPlaylistContentsPlaylistsErrors>? Errors { get; set; }
|
public List<ClearPlaylistContentsPlaylistsErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class CreatePlaylistBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class CreatePlaylistBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<CreatePlaylistErrors>? Errors { get; set; }
|
public List<CreatePlaylistErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class CreatePlaylistUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class CreatePlaylistUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<CreatePlaylistPlaylistsErrors>? Errors { get; set; }
|
public List<CreatePlaylistPlaylistsErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class DeleteLibraryBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class DeleteLibraryBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<DeleteLibraryErrors>? Errors { get; set; }
|
public List<DeleteLibraryErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class DeleteLibraryUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class DeleteLibraryUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<DeleteLibraryLibraryErrors>? Errors { get; set; }
|
public List<DeleteLibraryLibraryErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class DeletePlaylistBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class DeletePlaylistBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<DeletePlaylistErrors>? Errors { get; set; }
|
public List<DeletePlaylistErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class DeletePlaylistUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class DeletePlaylistUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<DeletePlaylistPlaylistsErrors>? Errors { get; set; }
|
public List<DeletePlaylistPlaylistsErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class EnablePaperTrailBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class EnablePaperTrailBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<EnablePaperTrailErrors>? Errors { get; set; }
|
public List<EnablePaperTrailErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class EnablePaperTrailUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class EnablePaperTrailUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<EnablePaperTrailLogErrors>? Errors { get; set; }
|
public List<EnablePaperTrailLogErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,15 +15,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetOnDeckBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetActorsLibraryBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetOnDeckErrors>? Errors { get; set; }
|
public List<GetActorsLibraryErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
public class GetOnDeckLibraryErrors
|
public class GetActorsLibraryErrors
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
public class GetMetaDataByRatingKeyLibraryErrors
|
public class GetActorsLibraryLibraryErrors
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetAllLibrariesBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetAllLibrariesBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetAllLibrariesErrors>? Errors { get; set; }
|
public List<GetAllLibrariesErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetAllLibrariesUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetAllLibrariesUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetAllLibrariesLibraryErrors>? Errors { get; set; }
|
public List<GetAllLibrariesLibraryErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetAvailableClientsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetAvailableClientsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetAvailableClientsErrors>? Errors { get; set; }
|
public List<GetAvailableClientsErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetAvailableClientsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetAvailableClientsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetAvailableClientsServerErrors>? Errors { get; set; }
|
public List<GetAvailableClientsServerErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetBandwidthStatisticsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetBandwidthStatisticsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetBandwidthStatisticsErrors>? Errors { get; set; }
|
public List<GetBandwidthStatisticsErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetBandwidthStatisticsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetBandwidthStatisticsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetBandwidthStatisticsStatisticsErrors>? Errors { get; set; }
|
public List<GetBandwidthStatisticsStatisticsErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetBannerImageBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetBannerImageBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetBannerImageErrors>? Errors { get; set; }
|
public List<GetBannerImageErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetBannerImageUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetBannerImageUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetBannerImageMediaErrors>? Errors { get; set; }
|
public List<GetBannerImageMediaErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetButlerTasksBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetButlerTasksBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetButlerTasksErrors>? Errors { get; set; }
|
public List<GetButlerTasksErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetButlerTasksUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetButlerTasksUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetButlerTasksButlerErrors>? Errors { get; set; }
|
public List<GetButlerTasksButlerErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetCompanionsDataBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetCompanionsDataBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetCompanionsDataErrors>? Errors { get; set; }
|
public List<GetCompanionsDataErrors>? 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 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetCompanionsDataUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetCompanionsDataUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetCompanionsDataPlexErrors>? Errors { get; set; }
|
public List<GetCompanionsDataPlexErrors>? 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>
|
||||||
|
/// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ 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 GetCountriesLibraryErrors
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetDevicesBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetDevicesBadRequestPayload
|
||||||
|
{
|
||||||
[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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetDevicesUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetDevicesUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetDevicesServerErrors>? Errors { get; set; }
|
public List<GetDevicesServerErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetDevicesUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetDevicesUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetDevicesUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetDevicesServerErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetDevicesUnauthorized(
|
||||||
|
GetDevicesUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetFileHashBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetFileHashBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetFileHashErrors>? Errors { get; set; }
|
public List<GetFileHashErrors>? 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 GetFileHashBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetFileHashBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetFileHashBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetFileHashErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetFileHashBadRequest(
|
||||||
|
GetFileHashBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetFileHashUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetFileHashUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetFileHashLibraryErrors>? Errors { get; set; }
|
public List<GetFileHashLibraryErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetFileHashUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetFileHashUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetFileHashUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetFileHashLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetFileHashUnauthorized(
|
||||||
|
GetFileHashUnauthorizedPayload 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 GetGenresLibraryBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetGenresLibraryErrors>? 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 GetGenresLibraryBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetGenresLibraryBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetGenresLibraryBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetGenresLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetGenresLibraryBadRequest(
|
||||||
|
GetGenresLibraryBadRequestPayload 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 GetGenresLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[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 GetGenresLibraryLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[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 GetGenresLibraryUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetGenresLibraryLibraryErrors>? 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 GetGenresLibraryUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetGenresLibraryUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetGenresLibraryUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetGenresLibraryLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetGenresLibraryUnauthorized(
|
||||||
|
GetGenresLibraryUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetGeoDataBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetGeoDataBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetGeoDataErrors>? Errors { get; set; }
|
public List<GetGeoDataErrors>? 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 GetGeoDataBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetGeoDataBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetGeoDataBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetGeoDataErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetGeoDataBadRequest(
|
||||||
|
GetGeoDataBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetGeoDataUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetGeoDataUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetGeoDataPlexErrors>? Errors { get; set; }
|
public List<GetGeoDataPlexErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetGeoDataUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetGeoDataUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetGeoDataUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetGeoDataPlexErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetGeoDataUnauthorized(
|
||||||
|
GetGeoDataUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetGlobalHubsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetGlobalHubsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetGlobalHubsErrors>? Errors { get; set; }
|
public List<GetGlobalHubsErrors>? 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 GetGlobalHubsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetGlobalHubsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetGlobalHubsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetGlobalHubsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetGlobalHubsBadRequest(
|
||||||
|
GetGlobalHubsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetGlobalHubsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetGlobalHubsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetGlobalHubsHubsErrors>? Errors { get; set; }
|
public List<GetGlobalHubsHubsErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetGlobalHubsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetGlobalHubsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetGlobalHubsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetGlobalHubsHubsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetGlobalHubsUnauthorized(
|
||||||
|
GetGlobalHubsUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetHomeDataBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetHomeDataBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetHomeDataErrors>? Errors { get; set; }
|
public List<GetHomeDataErrors>? 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 GetHomeDataBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetHomeDataBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetHomeDataBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetHomeDataErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetHomeDataBadRequest(
|
||||||
|
GetHomeDataBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetHomeDataUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetHomeDataUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetHomeDataPlexErrors>? Errors { get; set; }
|
public List<GetHomeDataPlexErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetHomeDataUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetHomeDataUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetHomeDataUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetHomeDataPlexErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetHomeDataUnauthorized(
|
||||||
|
GetHomeDataUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetLibraryDetailsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetLibraryDetailsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetLibraryDetailsErrors>? Errors { get; set; }
|
public List<GetLibraryDetailsErrors>? 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 GetLibraryDetailsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetLibraryDetailsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetLibraryDetailsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetLibraryDetailsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetLibraryDetailsBadRequest(
|
||||||
|
GetLibraryDetailsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetLibraryDetailsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetLibraryDetailsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetLibraryDetailsLibraryErrors>? Errors { get; set; }
|
public List<GetLibraryDetailsLibraryErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetLibraryDetailsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetLibraryDetailsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetLibraryDetailsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetLibraryDetailsLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetLibraryDetailsUnauthorized(
|
||||||
|
GetLibraryDetailsUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetLibraryHubsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetLibraryHubsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetLibraryHubsErrors>? Errors { get; set; }
|
public List<GetLibraryHubsErrors>? 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 GetLibraryHubsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetLibraryHubsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetLibraryHubsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetLibraryHubsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetLibraryHubsBadRequest(
|
||||||
|
GetLibraryHubsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetLibraryHubsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetLibraryHubsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetLibraryHubsHubsErrors>? Errors { get; set; }
|
public List<GetLibraryHubsHubsErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetLibraryHubsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetLibraryHubsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetLibraryHubsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetLibraryHubsHubsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetLibraryHubsUnauthorized(
|
||||||
|
GetLibraryHubsUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetLibraryItemsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetLibraryItemsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetLibraryItemsErrors>? Errors { get; set; }
|
public List<GetLibraryItemsErrors>? 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 GetLibraryItemsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetLibraryItemsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetLibraryItemsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetLibraryItemsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetLibraryItemsBadRequest(
|
||||||
|
GetLibraryItemsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetLibraryItemsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetLibraryItemsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetLibraryItemsLibraryErrors>? Errors { get; set; }
|
public List<GetLibraryItemsLibraryErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetLibraryItemsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetLibraryItemsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetLibraryItemsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetLibraryItemsLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetLibraryItemsUnauthorized(
|
||||||
|
GetLibraryItemsUnauthorizedPayload 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 GetLibrarySectionsAllBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetLibrarySectionsAllErrors>? 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 GetLibrarySectionsAllBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetLibrarySectionsAllBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetLibrarySectionsAllBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetLibrarySectionsAllErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetLibrarySectionsAllBadRequest(
|
||||||
|
GetLibrarySectionsAllBadRequestPayload 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 GetLibrarySectionsAllErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[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 GetLibrarySectionsAllLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[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 GetLibrarySectionsAllUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetLibrarySectionsAllLibraryErrors>? 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 GetLibrarySectionsAllUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetLibrarySectionsAllUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetLibrarySectionsAllUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetLibrarySectionsAllLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetLibrarySectionsAllUnauthorized(
|
||||||
|
GetLibrarySectionsAllUnauthorizedPayload 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 GetMediaMetaDataBadRequestPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetMediaMetaDataErrors>? 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 GetMediaMetaDataBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetMediaMetaDataBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetMediaMetaDataBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetMediaMetaDataErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetMediaMetaDataBadRequest(
|
||||||
|
GetMediaMetaDataBadRequestPayload 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 GetMediaMetaDataErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[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 GetMediaMetaDataLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[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 GetMediaMetaDataUnauthorizedPayload
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetMediaMetaDataLibraryErrors>? 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 GetMediaMetaDataUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetMediaMetaDataUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetMediaMetaDataUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetMediaMetaDataLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetMediaMetaDataUnauthorized(
|
||||||
|
GetMediaMetaDataUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetMediaProvidersBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetMediaProvidersBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetMediaProvidersErrors>? Errors { get; set; }
|
public List<GetMediaProvidersErrors>? 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 GetMediaProvidersBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetMediaProvidersBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetMediaProvidersBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetMediaProvidersErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetMediaProvidersBadRequest(
|
||||||
|
GetMediaProvidersBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetMediaProvidersUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetMediaProvidersUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetMediaProvidersServerErrors>? Errors { get; set; }
|
public List<GetMediaProvidersServerErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetMediaProvidersUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetMediaProvidersUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetMediaProvidersUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetMediaProvidersServerErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetMediaProvidersUnauthorized(
|
||||||
|
GetMediaProvidersUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetMetaDataByRatingKeyUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
|
||||||
public List<GetMetaDataByRatingKeyLibraryErrors>? Errors { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("-")]
|
|
||||||
public HttpResponseMessage? RawResponse { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetMetadataChildrenBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetMetadataChildrenBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetMetadataChildrenErrors>? Errors { get; set; }
|
public List<GetMetadataChildrenErrors>? 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 GetMetadataChildrenBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetMetadataChildrenBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetMetadataChildrenBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetMetadataChildrenErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetMetadataChildrenBadRequest(
|
||||||
|
GetMetadataChildrenBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetMetadataChildrenUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetMetadataChildrenUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetMetadataChildrenLibraryErrors>? Errors { get; set; }
|
public List<GetMetadataChildrenLibraryErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetMetadataChildrenUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetMetadataChildrenUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetMetadataChildrenUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetMetadataChildrenLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetMetadataChildrenUnauthorized(
|
||||||
|
GetMetadataChildrenUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetMyPlexAccountBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetMyPlexAccountBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetMyPlexAccountErrors>? Errors { get; set; }
|
public List<GetMyPlexAccountErrors>? 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 GetMyPlexAccountBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetMyPlexAccountBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetMyPlexAccountBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetMyPlexAccountErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetMyPlexAccountBadRequest(
|
||||||
|
GetMyPlexAccountBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetMyPlexAccountUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetMyPlexAccountUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetMyPlexAccountServerErrors>? Errors { get; set; }
|
public List<GetMyPlexAccountServerErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetMyPlexAccountUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetMyPlexAccountUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetMyPlexAccountUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetMyPlexAccountServerErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetMyPlexAccountUnauthorized(
|
||||||
|
GetMyPlexAccountUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetPinBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetPinBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetPinErrors>? Errors { get; set; }
|
public List<GetPinErrors>? 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 GetPinBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetPinBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetPinBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetPinErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetPinBadRequest(
|
||||||
|
GetPinBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetPlaylistBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetPlaylistBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetPlaylistErrors>? Errors { get; set; }
|
public List<GetPlaylistErrors>? 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 GetPlaylistBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetPlaylistBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetPlaylistBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetPlaylistErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetPlaylistBadRequest(
|
||||||
|
GetPlaylistBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetPlaylistContentsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetPlaylistContentsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetPlaylistContentsErrors>? Errors { get; set; }
|
public List<GetPlaylistContentsErrors>? 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 GetPlaylistContentsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetPlaylistContentsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetPlaylistContentsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetPlaylistContentsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetPlaylistContentsBadRequest(
|
||||||
|
GetPlaylistContentsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetPlaylistContentsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetPlaylistContentsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetPlaylistContentsPlaylistsErrors>? Errors { get; set; }
|
public List<GetPlaylistContentsPlaylistsErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetPlaylistContentsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetPlaylistContentsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetPlaylistContentsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetPlaylistContentsPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetPlaylistContentsUnauthorized(
|
||||||
|
GetPlaylistContentsUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetPlaylistUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetPlaylistUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetPlaylistPlaylistsErrors>? Errors { get; set; }
|
public List<GetPlaylistPlaylistsErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetPlaylistUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetPlaylistUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetPlaylistUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetPlaylistPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetPlaylistUnauthorized(
|
||||||
|
GetPlaylistUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetPlaylistsBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetPlaylistsBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetPlaylistsErrors>? Errors { get; set; }
|
public List<GetPlaylistsErrors>? 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 GetPlaylistsBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetPlaylistsBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetPlaylistsBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetPlaylistsBadRequest(
|
||||||
|
GetPlaylistsBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetPlaylistsUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetPlaylistsUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetPlaylistsPlaylistsErrors>? Errors { get; set; }
|
public List<GetPlaylistsPlaylistsErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetPlaylistsUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetPlaylistsUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetPlaylistsUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetPlaylistsPlaylistsErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetPlaylistsUnauthorized(
|
||||||
|
GetPlaylistsUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetRecentlyAddedLibraryBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetRecentlyAddedLibraryBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetRecentlyAddedLibraryErrors>? Errors { get; set; }
|
public List<GetRecentlyAddedLibraryErrors>? 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 GetRecentlyAddedLibraryBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetRecentlyAddedLibraryBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetRecentlyAddedLibraryBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetRecentlyAddedLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetRecentlyAddedLibraryBadRequest(
|
||||||
|
GetRecentlyAddedLibraryBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetRecentlyAddedLibraryUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetRecentlyAddedLibraryUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetRecentlyAddedLibraryLibraryErrors>? Errors { get; set; }
|
public List<GetRecentlyAddedLibraryLibraryErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetRecentlyAddedLibraryUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetRecentlyAddedLibraryUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetRecentlyAddedLibraryUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetRecentlyAddedLibraryLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetRecentlyAddedLibraryUnauthorized(
|
||||||
|
GetRecentlyAddedLibraryUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetRefreshLibraryMetadataBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetRefreshLibraryMetadataBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetRefreshLibraryMetadataErrors>? Errors { get; set; }
|
public List<GetRefreshLibraryMetadataErrors>? 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 GetRefreshLibraryMetadataBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetRefreshLibraryMetadataBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetRefreshLibraryMetadataBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetRefreshLibraryMetadataErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetRefreshLibraryMetadataBadRequest(
|
||||||
|
GetRefreshLibraryMetadataBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
||||||
/// </summary>
|
|
||||||
public class GetRefreshLibraryMetadataUnauthorized : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetRefreshLibraryMetadataUnauthorizedPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetRefreshLibraryMetadataLibraryErrors>? Errors { get; set; }
|
public List<GetRefreshLibraryMetadataLibraryErrors>? 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>
|
||||||
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
/// </summary>
|
||||||
|
public class GetRefreshLibraryMetadataUnauthorized : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetRefreshLibraryMetadataUnauthorizedPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetRefreshLibraryMetadataUnauthorized.Payload.Errors instead.")]
|
||||||
|
public List<GetRefreshLibraryMetadataLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetRefreshLibraryMetadataUnauthorized(
|
||||||
|
GetRefreshLibraryMetadataUnauthorizedPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
|
||||||
/// </summary>
|
|
||||||
public class GetResizedPhotoBadRequest : Exception
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public class GetResizedPhotoBadRequestPayload
|
||||||
|
{
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetResizedPhotoErrors>? Errors { get; set; }
|
public List<GetResizedPhotoErrors>? 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 GetResizedPhotoBadRequest : PlexAPIError
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The original data that was passed to this exception.
|
||||||
|
/// </summary>
|
||||||
|
public GetResizedPhotoBadRequestPayload Payload { get; }
|
||||||
|
|
||||||
|
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetResizedPhotoBadRequest.Payload.Errors instead.")]
|
||||||
|
public List<GetResizedPhotoErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
public GetResizedPhotoBadRequest(
|
||||||
|
GetResizedPhotoBadRequestPayload payload,
|
||||||
|
HttpResponseMessage rawResponse,
|
||||||
|
string body
|
||||||
|
): base("API error occurred", rawResponse, body)
|
||||||
|
{
|
||||||
|
Payload = payload;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618
|
||||||
|
Errors = payload.Errors;
|
||||||
|
#pragma warning restore CS0618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user