mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 12:37:46 +00:00
Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc02ecef34 | ||
|
|
55b5c2b3dd | ||
|
|
67a53e72d5 | ||
|
|
9ccab7b22d | ||
|
|
eb2f6e54a2 | ||
|
|
4b798cbb85 | ||
|
|
a89870d526 | ||
|
|
01b116a71c | ||
|
|
9831457f45 | ||
|
|
653b23dab6 | ||
|
|
86c36c72b7 | ||
|
|
3e00ddc6b1 | ||
|
|
d976a079a9 | ||
|
|
b10d5f7023 | ||
|
|
c431cee288 | ||
|
|
5195de1dca | ||
|
|
43dc47a5a0 | ||
|
|
53157408b3 | ||
|
|
fe81f4dff0 | ||
|
|
c9746b7ad8 | ||
|
|
0ec48b6a1d | ||
|
|
14e54fa017 | ||
|
|
61492e5dad | ||
|
|
f099c01940 | ||
|
|
92be5b3a91 | ||
|
|
a183f389bc | ||
|
|
4a443f6f2e | ||
|
|
b9b7cd1146 | ||
|
|
81c55cb08b | ||
|
|
860991f2a0 | ||
|
|
d25639db53 | ||
|
|
227e2351d5 | ||
|
|
3bd4f51297 | ||
|
|
4828de2345 | ||
|
|
2beb707ed5 | ||
|
|
affe5d5a8c | ||
|
|
d16abdad70 | ||
|
|
3e9ae76433 | ||
|
|
e7023f61d0 | ||
|
|
223ab320b2 | ||
|
|
5421ae0531 | ||
|
|
4b10ba72ca | ||
|
|
3b6806d2db | ||
|
|
5883791d10 | ||
|
|
548ce2564d | ||
|
|
46c35ae5e3 | ||
|
|
d15c54d86f | ||
|
|
f517fffa89 | ||
|
|
2309d5a37f | ||
|
|
d71b1b96ea | ||
|
|
24948e0718 | ||
|
|
39a5a0dfb6 | ||
|
|
92730cbe24 | ||
|
|
591cddc929 | ||
|
|
6a6c770319 | ||
|
|
d141934f09 | ||
|
|
61d12eaf66 |
1
.github/workflows/sdk_generation.yaml
vendored
1
.github/workflows/sdk_generation.yaml
vendored
@@ -24,6 +24,7 @@ jobs:
|
||||
mode: direct
|
||||
set_version: ${{ github.event.inputs.set_version }}
|
||||
speakeasy_version: latest
|
||||
dotnet_version: "8.x"
|
||||
secrets:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
.DS_Store
|
||||
**/.speakeasy/temp/
|
||||
**/.speakeasy/logs/
|
||||
obj/
|
||||
bin/
|
||||
debug/
|
||||
|
||||
1
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/.name
generated
Normal file
1
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
LukeHagar.PlexAPI.SDK
|
||||
4
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
8
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/projectSettingsUpdater.xml
generated
Normal file
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/projectSettingsUpdater.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="vcsConfiguration" value="3" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
1497
.speakeasy/gen.lock
1497
.speakeasy/gen.lock
File diff suppressed because one or more lines are too long
@@ -4,22 +4,29 @@ generation:
|
||||
maintainOpenAPIOrder: true
|
||||
usageSnippets:
|
||||
optionalPropertyRendering: withExample
|
||||
sdkInitStyle: constructor
|
||||
useClassNamesForArrayFields: true
|
||||
fixes:
|
||||
nameResolutionDec2023: true
|
||||
nameResolutionFeb2025: false
|
||||
parameterOrderingFeb2024: true
|
||||
requestResponseComponentNamesFeb2024: true
|
||||
securityFeb2025: false
|
||||
sharedErrorComponentsApr2025: false
|
||||
auth:
|
||||
oAuth2ClientCredentialsEnabled: true
|
||||
oAuth2PasswordEnabled: false
|
||||
csharp:
|
||||
version: 0.6.1
|
||||
version: 0.15.0
|
||||
additionalDependencies: []
|
||||
author: LukeHagar
|
||||
clientServerStatusCodesAsErrors: true
|
||||
defaultErrorName: SDKException
|
||||
disableNamespacePascalCasingApr2024: true
|
||||
dotnetVersion: net8.0
|
||||
enableSourceLink: true
|
||||
flattenGlobalSecurity: true
|
||||
flatteningOrder: ""
|
||||
imports:
|
||||
option: openapi
|
||||
paths:
|
||||
@@ -31,7 +38,9 @@ csharp:
|
||||
includeDebugSymbols: true
|
||||
inputModelSuffix: input
|
||||
maxMethodParams: 4
|
||||
methodArguments: infer-optional-args
|
||||
outputModelSuffix: output
|
||||
packageName: LukeHagar.PlexAPI.SDK
|
||||
packageTags: Plex Media Server SDK
|
||||
responseFormat: envelope
|
||||
sourceDirectory: ""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.394.0
|
||||
speakeasyVersion: 1.555.2
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
@@ -14,24 +14,38 @@ sources:
|
||||
tags:
|
||||
- latest
|
||||
- main
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:78d07ad78ff60d0e9918696208d8c68a562e170d4e9c431797c02995fb8816d0
|
||||
sourceBlobDigest: sha256:d38dd2a36c1b2fd73409267f7b30c2d5d45d709616141803ea01db424ec68ae4
|
||||
tags:
|
||||
- latest
|
||||
- speakeasy-sdk-regen-1748996711
|
||||
targets:
|
||||
plexcsharp:
|
||||
source: plex-api
|
||||
sourceNamespace: plex-api
|
||||
sourceRevisionDigest: sha256:289c5a73965c8fa779f32919d1353d0d275163982c0a0f5525ef4146c462a486
|
||||
sourceBlobDigest: sha256:f7e2709f52370dff16c1851a7a4e44a89f2e978e9cae335bffc10625950b3bd9
|
||||
outLocation: /github/workspace/repo
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:78d07ad78ff60d0e9918696208d8c68a562e170d4e9c431797c02995fb8816d0
|
||||
sourceBlobDigest: sha256:d38dd2a36c1b2fd73409267f7b30c2d5d45d709616141803ea01db424ec68ae4
|
||||
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
||||
codeSamplesRevisionDigest: sha256:5609267a659a1b1fdebdd8516758904fc983fb919b5b5a8bbd0044567e8bfa0f
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
sources:
|
||||
plex-api:
|
||||
plexapi:
|
||||
inputs:
|
||||
- location: registry.speakeasyapi.dev/lukehagar/lukehagar/plex-api:main
|
||||
- location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main
|
||||
targets:
|
||||
plexcsharp:
|
||||
target: csharp
|
||||
source: plex-api
|
||||
source: plexapi
|
||||
publish:
|
||||
nuget:
|
||||
apiKey: $nuget_api_key
|
||||
codeSamples:
|
||||
output: codeSamples.yaml
|
||||
registry:
|
||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
|
||||
labelOverride:
|
||||
fixedValue: PlexCSharp
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
sources:
|
||||
plex-api:
|
||||
plexapi:
|
||||
inputs:
|
||||
- location: registry.speakeasyapi.dev/lukehagar/lukehagar/plex-api:main
|
||||
- location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main
|
||||
targets:
|
||||
plexcsharp:
|
||||
target: csharp
|
||||
source: plex-api
|
||||
source: plexapi
|
||||
publish:
|
||||
nuget:
|
||||
apiKey: $nuget_api_key
|
||||
codeSamples:
|
||||
output: codeSamples.yaml
|
||||
registry:
|
||||
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
|
||||
labelOverride:
|
||||
fixedValue: PlexCSharp
|
||||
|
||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.<br/>
|
||||
@@ -74,19 +74,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.6.1";
|
||||
private const string _sdkGenVersion = "2.413.0";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.6.1 2.413.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;
|
||||
}
|
||||
|
||||
@@ -97,21 +90,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/activities";
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -154,10 +147,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
response.Object = obj;
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
@@ -167,10 +158,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -180,19 +169,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
|
||||
@@ -205,21 +194,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -265,10 +254,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -278,19 +265,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// API Calls regarding authentication for Plex Media Server<br/>
|
||||
@@ -69,7 +69,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Sign in user with username and password and return user data with Plex authentication token
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(string? xPlexClientIdentifier = null, PostUsersSignInDataRequestBody? requestBody = null, string? serverUrl = null);
|
||||
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -85,29 +85,22 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// List of server URLs available for the getTokenDetails operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetTokenDetailsServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
/// <summary>
|
||||
/// List of server URLs available for the post-users-sign-in-data operation.
|
||||
/// </summary>
|
||||
public static readonly string[] PostUsersSignInDataServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.6.1";
|
||||
private const string _sdkGenVersion = "2.413.0";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.6.1 2.413.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;
|
||||
}
|
||||
|
||||
@@ -122,21 +115,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -182,10 +175,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -195,19 +186,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
|
||||
@@ -220,21 +211,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/security/resources", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -280,10 +271,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -293,19 +282,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null)
|
||||
@@ -320,21 +309,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/user";
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -377,10 +366,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
response.UserPlexAccount = obj;
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
@@ -390,10 +377,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -403,40 +388,35 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(string? xPlexClientIdentifier = null, PostUsersSignInDataRequestBody? requestBody = null, string? serverUrl = null)
|
||||
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null)
|
||||
{
|
||||
var request = new PostUsersSignInDataRequest()
|
||||
{
|
||||
XPlexClientIdentifier = xPlexClientIdentifier,
|
||||
RequestBody = requestBody,
|
||||
};
|
||||
request.XPlexClientIdentifier ??= SDKConfiguration.XPlexClientIdentifier;
|
||||
|
||||
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
if (serverUrl != null)
|
||||
{
|
||||
baseUrl = serverUrl;
|
||||
}
|
||||
var urlString = URLBuilder.Build(baseUrl, "/users/signin", request);
|
||||
|
||||
var urlString = baseUrl + "/users/signin";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
|
||||
if (serializedBody != null)
|
||||
@@ -444,14 +424,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -494,10 +474,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
response.UserPlexAccount = obj;
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
@@ -507,10 +485,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -520,19 +496,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// Butler is the task manager of the Plex Media Server Ecosystem.<br/>
|
||||
@@ -101,19 +101,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.6.1";
|
||||
private const string _sdkGenVersion = "2.413.0";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.6.1 2.413.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;
|
||||
}
|
||||
|
||||
@@ -124,21 +117,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/butler";
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -181,10 +174,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
response.Object = obj;
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
@@ -194,10 +185,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -207,19 +196,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
||||
@@ -229,21 +218,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/butler";
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -289,10 +278,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -302,19 +289,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
||||
@@ -324,21 +311,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/butler";
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -384,10 +371,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -397,19 +382,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
|
||||
@@ -422,21 +407,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -482,10 +467,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -495,19 +478,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
|
||||
@@ -520,21 +503,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -580,10 +563,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -593,19 +574,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,34 +17,47 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
|
||||
|
||||
public class HookContext
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; set; }
|
||||
public string BaseURL { get; set; } = "";
|
||||
public string OperationID { get; set; }
|
||||
public List<string>? Oauth2Scopes { 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;
|
||||
Oauth2Scopes = oauth2Scopes;
|
||||
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 BeforeRequestContext(HookContext hookCtx)
|
||||
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
|
||||
: base(hookCtx) { }
|
||||
}
|
||||
|
||||
public class AfterSuccessContext : HookContext
|
||||
{
|
||||
public AfterSuccessContext(HookContext hookCtx)
|
||||
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
|
||||
: base(hookCtx) { }
|
||||
}
|
||||
|
||||
public class AfterErrorContext : HookContext
|
||||
{
|
||||
public AfterErrorContext(HookContext hookCtx)
|
||||
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
|
||||
: base(hookCtx) { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
|
||||
{
|
||||
this.afterErrorHooks.Add(hook);
|
||||
}
|
||||
|
||||
|
||||
public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client)
|
||||
{
|
||||
var urlAndClient = (baseUrl, client);
|
||||
@@ -68,7 +68,7 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
|
||||
}
|
||||
return urlAndClient;
|
||||
}
|
||||
|
||||
|
||||
public async Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request)
|
||||
{
|
||||
foreach (var hook in this.beforeRequestHooks)
|
||||
|
||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.<br/>
|
||||
@@ -41,6 +41,16 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// </summary>
|
||||
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Recently Added
|
||||
///
|
||||
/// <remarks>
|
||||
/// This endpoint will return the recently added content.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// Get library specific hubs
|
||||
///
|
||||
@@ -63,19 +73,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.6.1";
|
||||
private const string _sdkGenVersion = "2.413.0";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.6.1 2.413.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;
|
||||
}
|
||||
|
||||
@@ -90,21 +93,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/hubs", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -137,7 +140,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
|
||||
var response = new GetGlobalHubsResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
@@ -147,45 +150,119 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
response.Object = obj;
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
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("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-recently-added", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
httpResponse = _httpResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
catch (Exception error)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
httpResponse = _httpResponse;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
|
||||
|
||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||
if(responseStatusCode == 200)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var response = new GetRecentlyAddedResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
response.Object = obj;
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400 || responseStatusCode == 401 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
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("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
|
||||
@@ -200,21 +277,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -257,10 +334,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
response.Object = obj;
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
@@ -270,10 +345,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -283,19 +356,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// Submit logs to the Log Handler for Plex Media Server<br/>
|
||||
@@ -46,13 +46,13 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Logging a multi-line message
|
||||
///
|
||||
/// <remarks>
|
||||
/// 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/>
|
||||
/// Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'. <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/>
|
||||
/// Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'.<br/>
|
||||
/// <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/>
|
||||
/// This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests. <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/>
|
||||
/// This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.<br/>
|
||||
/// <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/>
|
||||
@@ -94,19 +94,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.6.1";
|
||||
private const string _sdkGenVersion = "2.413.0";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.6.1 2.413.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;
|
||||
}
|
||||
|
||||
@@ -122,21 +115,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/log", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -182,10 +175,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -195,19 +186,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
|
||||
@@ -217,7 +208,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/log";
|
||||
|
||||
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);
|
||||
if (serializedBody != null)
|
||||
@@ -225,19 +216,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -283,10 +274,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -296,19 +285,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
||||
@@ -318,21 +307,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/log/networked";
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -378,10 +367,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -391,19 +378,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,38 @@
|
||||
<PropertyGroup>
|
||||
<IsPackable>true</IsPackable>
|
||||
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
||||
<Version>0.6.1</Version>
|
||||
<Version>0.15.0</Version>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Authors>LukeHagar</Authors>
|
||||
<Copyright>Copyright (c) LukeHagar 2024</Copyright>
|
||||
<Copyright>Copyright (c) LukeHagar 2025</Copyright>
|
||||
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageTags>Plex Media Server SDK</PackageTags>
|
||||
<Description>Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server</Description>
|
||||
<Description># Plex Media Server OpenAPI Specification<br/>
|
||||
<br/>
|
||||
An Open Source OpenAPI Specification for Plex Media Server<br/>
|
||||
<br/>
|
||||
Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
|
||||
<br/>
|
||||
## Documentation<br/>
|
||||
<br/>
|
||||
<a href="https://plexapi.dev">API Documentation</a><br/>
|
||||
<br/>
|
||||
## SDKs<br/>
|
||||
<br/>
|
||||
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
|
||||
<br/>
|
||||
| Language | Repository | Releases | Other |<br/>
|
||||
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
|
||||
| Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
|
||||
| JavaScript/TypeScript | <a href="https://github.com/LukeHagar/plexjs">GitHub</a> | <a href="https://www.npmjs.com/package/@lukehagar/plexjs">NPM</a> \ <a href="https://jsr.io/@lukehagar/plexjs">JSR</a> | - |<br/>
|
||||
| Go | <a href="https://github.com/LukeHagar/plexgo">GitHub</a> | <a href="https://github.com/LukeHagar/plexgo/releases">Releases</a> | <a href="https://pkg.go.dev/github.com/LukeHagar/plexgo">GoDoc</a> |<br/>
|
||||
| Ruby | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/releases">Releases</a> | - |<br/>
|
||||
| Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
|
||||
| PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
|
||||
| Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
|
||||
| C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | -<br/>
|
||||
</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// API Calls interacting with Plex Media Server Media<br/>
|
||||
@@ -90,19 +90,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.6.1";
|
||||
private const string _sdkGenVersion = "2.413.0";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.6.1 2.413.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;
|
||||
}
|
||||
|
||||
@@ -116,21 +109,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -176,10 +169,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -189,19 +180,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
|
||||
@@ -214,21 +205,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -274,10 +265,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -287,19 +276,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
|
||||
@@ -314,21 +303,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/:/progress", request);
|
||||
|
||||
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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -374,10 +363,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -387,19 +374,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request)
|
||||
@@ -408,21 +395,22 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext("get-banner-image", null, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-banner-image", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -464,10 +452,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
@@ -477,10 +463,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -490,19 +474,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request)
|
||||
@@ -511,21 +495,22 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext("get-thumb-image", null, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-thumb-image", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -567,10 +552,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
@@ -580,10 +563,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
@@ -593,19 +574,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Components
|
||||
public class Security
|
||||
{
|
||||
|
||||
[SpeakeasyMetadata("security:scheme=true,type=apiKey,subType=query,name=X-Plex-Token")]
|
||||
[SpeakeasyMetadata("security:scheme=true,type=apiKey,subType=header,name=X-Plex-Token")]
|
||||
public string? AccessToken { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,18 +12,18 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
/// </summary>
|
||||
public class GetRecentlyAddedBadRequest : Exception
|
||||
public class GetActorsLibraryBadRequest : Exception
|
||||
{
|
||||
|
||||
[JsonProperty("errors")]
|
||||
public List<GetRecentlyAddedErrors>? Errors { get; set; }
|
||||
public List<GetActorsLibraryErrors>? Errors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Raw HTTP response; suitable for custom response parsing
|
||||
@@ -12,16 +12,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetRecentlyAddedErrors
|
||||
public class GetActorsLibraryErrors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,16 +12,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetMetaDataByRatingKeyErrors
|
||||
public class GetActorsLibraryLibraryErrors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,18 +12,18 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
/// </summary>
|
||||
public class GetRecentlyAddedUnauthorized : Exception
|
||||
public class GetActorsLibraryUnauthorized : Exception
|
||||
{
|
||||
|
||||
[JsonProperty("errors")]
|
||||
public List<GetRecentlyAddedLibraryErrors>? Errors { get; set; }
|
||||
public List<GetActorsLibraryLibraryErrors>? Errors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Raw HTTP response; suitable for custom response parsing
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,18 +12,18 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
/// </summary>
|
||||
public class GetMetaDataByRatingKeyBadRequest : Exception
|
||||
public class GetCountriesLibraryBadRequest : Exception
|
||||
{
|
||||
|
||||
[JsonProperty("errors")]
|
||||
public List<GetMetaDataByRatingKeyErrors>? Errors { get; set; }
|
||||
public List<GetCountriesLibraryErrors>? Errors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Raw HTTP response; suitable for custom response parsing
|
||||
@@ -0,0 +1,27 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetCountriesLibraryErrors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetCountriesLibraryLibraryErrors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,18 +12,18 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
/// </summary>
|
||||
public class GetMetaDataByRatingKeyUnauthorized : Exception
|
||||
public class GetCountriesLibraryUnauthorized : Exception
|
||||
{
|
||||
|
||||
[JsonProperty("errors")]
|
||||
public List<GetMetaDataByRatingKeyLibraryErrors>? Errors { get; set; }
|
||||
public List<GetCountriesLibraryLibraryErrors>? Errors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Raw HTTP response; suitable for custom response parsing
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public long? Code { get; set; }
|
||||
public int? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public long? Status { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@ 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;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
/// </summary>
|
||||
public class GetGenresLibraryBadRequest : Exception
|
||||
{
|
||||
|
||||
[JsonProperty("errors")]
|
||||
public List<GetGenresLibraryErrors>? Errors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Raw HTTP response; suitable for custom response parsing
|
||||
/// </summary>
|
||||
[JsonProperty("-")]
|
||||
public HttpResponseMessage? RawResponse { get; set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user