Compare commits

...

30 Commits

Author SHA1 Message Date
speakeasybot
d970db3b6f ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.598.0 2025-08-06 00:28:40 +00:00
speakeasybot
4197184f92 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.557.0 2025-06-09 00:28:07 +00:00
speakeasybot
bc02ecef34 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.555.2 2025-06-04 00:26:20 +00:00
speakeasybot
55b5c2b3dd ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.542.1 2025-05-05 00:26:49 +00:00
speakeasybot
67a53e72d5 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.541.2 2025-05-01 00:28:06 +00:00
speakeasybot
9ccab7b22d ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-19 00:24:30 +00:00
speakeasybot
eb2f6e54a2 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-14 00:26:56 +00:00
speakeasybot
4b798cbb85 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-06 00:25:51 +00:00
speakeasybot
a89870d526 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.528.1 2025-04-03 00:23:53 +00:00
speakeasybot
01b116a71c ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.526.6 2025-03-31 17:08:42 +00:00
Luke Hagar
9831457f45 Update workflow.yaml 2025-03-31 12:06:13 -05:00
speakeasybot
653b23dab6 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.513.4 2025-03-09 00:21:37 +00:00
speakeasybot
86c36c72b7 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.513.2 2025-03-07 00:23:51 +00:00
speakeasybot
3e00ddc6b1 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.487.1 2025-02-10 00:23:35 +00:00
speakeasybot
d976a079a9 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.487.0 2025-02-07 00:22:51 +00:00
speakeasybot
b10d5f7023 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.484.1 2025-02-06 00:22:53 +00:00
speakeasybot
c431cee288 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.484.1 2025-02-05 00:22:30 +00:00
speakeasybot
5195de1dca ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.1 2025-01-27 00:23:03 +00:00
speakeasybot
43dc47a5a0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.1 2025-01-26 17:23:56 +00:00
speakeasybot
53157408b3 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.1 2025-01-26 16:03:29 +00:00
speakeasybot
fe81f4dff0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.474.0 2025-01-24 00:22:18 +00:00
speakeasybot
c9746b7ad8 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.459.2 2024-12-22 00:24:32 +00:00
speakeasybot
0ec48b6a1d ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.459.2 2024-12-21 00:22:05 +00:00
speakeasybot
14e54fa017 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.3 2024-11-14 00:22:09 +00:00
speakeasybot
61492e5dad ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.1 2024-11-12 00:21:43 +00:00
speakeasybot
f099c01940 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.406.0 2024-10-03 12:26:13 +00:00
speakeasybot
92be5b3a91 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 11:11:07 +00:00
speakeasybot
a183f389bc ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 10:46:38 +00:00
speakeasybot
4a443f6f2e ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 09:49:57 +00:00
speakeasybot
b9b7cd1146 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.4 2024-09-30 17:36:49 +00:00
904 changed files with 23933 additions and 9538 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,6 @@
.DS_Store
**/.speakeasy/temp/
**/.speakeasy/logs/
obj/ obj/
bin/ bin/
debug/ debug/

File diff suppressed because one or more lines are too long

View File

@@ -4,22 +4,34 @@ generation:
maintainOpenAPIOrder: true maintainOpenAPIOrder: true
usageSnippets: usageSnippets:
optionalPropertyRendering: withExample optionalPropertyRendering: withExample
sdkInitStyle: constructor
useClassNamesForArrayFields: true useClassNamesForArrayFields: true
fixes: fixes:
nameResolutionDec2023: true nameResolutionDec2023: true
nameResolutionFeb2025: false
parameterOrderingFeb2024: true parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true requestResponseComponentNamesFeb2024: true
securityFeb2025: false
sharedErrorComponentsApr2025: false
auth: auth:
oAuth2ClientCredentialsEnabled: true oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
csharp: csharp:
version: 0.8.6 version: 0.16.0
additionalDependencies: [] additionalDependencies: []
author: LukeHagar author: LukeHagar
baseErrorName: PlexAPIError
clientServerStatusCodesAsErrors: true clientServerStatusCodesAsErrors: true
defaultErrorName: SDKException
disableNamespacePascalCasingApr2024: true disableNamespacePascalCasingApr2024: true
dotnetVersion: net8.0 dotnetVersion: net8.0
enableSourceLink: true enableSourceLink: true
flattenGlobalSecurity: true flattenGlobalSecurity: true
flatteningOrder: ""
imports: imports:
option: openapi option: openapi
paths: paths:
@@ -31,6 +43,7 @@ csharp:
includeDebugSymbols: true includeDebugSymbols: true
inputModelSuffix: input inputModelSuffix: input
maxMethodParams: 4 maxMethodParams: 4
methodArguments: infer-optional-args
outputModelSuffix: output outputModelSuffix: output
packageName: LukeHagar.PlexAPI.SDK packageName: LukeHagar.PlexAPI.SDK
packageTags: Plex Media Server SDK packageTags: Plex Media Server SDK

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.405.4 speakeasyVersion: 1.598.0
sources: sources:
my-source: my-source:
sourceNamespace: my-source sourceNamespace: my-source
@@ -16,19 +16,19 @@ sources:
- main - main
plexapi: plexapi:
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:79dca9232c55c6829ffc5f89a9eeb957e6273213be222d012238da40d5086df1 sourceRevisionDigest: sha256:b4fa89a3571fbdcb4228800772a5fe1c292170babcd3e055161ae54402f89577
sourceBlobDigest: sha256:91b080122ff1fe0c86a02f3c39accc03dbad569b4324503941523d1d29c51b7e sourceBlobDigest: sha256:f84dd2bfdaea4074454cea3c7fbc6c9e05515c5e9e961abb4923b77f8faf48f1
tags: tags:
- latest - latest
- main - speakeasy-sdk-regen-1754440055
targets: targets:
plexcsharp: plexcsharp:
source: plexapi source: plexapi
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:79dca9232c55c6829ffc5f89a9eeb957e6273213be222d012238da40d5086df1 sourceRevisionDigest: sha256:b4fa89a3571fbdcb4228800772a5fe1c292170babcd3e055161ae54402f89577
sourceBlobDigest: sha256:91b080122ff1fe0c86a02f3c39accc03dbad569b4324503941523d1d29c51b7e sourceBlobDigest: sha256:f84dd2bfdaea4074454cea3c7fbc6c9e05515c5e9e961abb4923b77f8faf48f1
codeSamplesNamespace: code-samples-csharp-plexcsharp codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:987240ddee9f8c477ffda9c313d53abd6cb52b460ba53b0bed9ec62188b7f4a3 codeSamplesRevisionDigest: sha256:c2f97be4e2fb1380a7f91adf6b91cc8a701cd90ffa314ff36785d1aaf58cb01c
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: latest speakeasyVersion: latest
@@ -47,3 +47,5 @@ workflow:
output: codeSamples.yaml output: codeSamples.yaml
registry: registry:
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
labelOverride:
fixedValue: PlexCSharp

View File

@@ -15,3 +15,5 @@ targets:
output: codeSamples.yaml output: codeSamples.yaml
registry: registry:
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-csharp-plexcsharp
labelOverride:
fixedValue: PlexCSharp

View File

@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System; using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary> /// <summary>
/// Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.<br/> /// Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.<br/>
@@ -74,19 +74,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.8.6"; private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.428.1"; private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.6 2.428.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Activities(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Activities(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -97,21 +90,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/activities"; var urlString = baseUrl + "/activities";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getServerActivities", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -179,7 +172,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -197,21 +194,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request); var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("cancelServerActivities", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "cancelServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -271,7 +268,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }

View File

@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System; using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary> /// <summary>
/// API Calls regarding authentication for Plex Media Server<br/> /// API Calls regarding authentication for Plex Media Server<br/>
@@ -69,7 +69,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Sign in user with username and password and return user data with Plex authentication token /// Sign in user with username and password and return user data with Plex authentication token
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null); Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null);
} }
/// <summary> /// <summary>
@@ -95,19 +95,12 @@ namespace LukeHagar.PlexAPI.SDK
}; };
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.8.6"; private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.428.1"; private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.6 2.428.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Authentication(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Authentication(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -122,21 +115,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/security/token", request); var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getTransientToken", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTransientToken", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -196,7 +189,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -214,21 +211,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/security/resources", request); var urlString = URLBuilder.Build(baseUrl, "/security/resources", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSourceConnectionInformation", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -288,7 +285,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -308,21 +309,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/user"; var urlString = baseUrl + "/user";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getTokenDetails", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTokenDetails", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -390,7 +391,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -398,24 +403,20 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", 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(PostUsersSignInDataRequest? request = null, string? serverUrl = null) public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest request, string? serverUrl = null)
{ {
request.ClientID ??= SDKConfiguration.ClientID;
request.ClientName ??= SDKConfiguration.ClientName;
request.ClientVersion ??= SDKConfiguration.ClientVersion;
request.ClientPlatform ??= SDKConfiguration.ClientPlatform;
request.DeviceName ??= SDKConfiguration.DeviceName;
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){ string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
}); });
if (serverUrl != null) if (serverUrl != null)
{ {
baseUrl = serverUrl; baseUrl = serverUrl;
} }
var urlString = URLBuilder.Build(baseUrl, "/users/signin", request);
var urlString = baseUrl + "/users/signin";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
if (serializedBody != null) if (serializedBody != null)
@@ -423,14 +424,14 @@ namespace LukeHagar.PlexAPI.SDK
httpRequest.Content = serializedBody; httpRequest.Content = serializedBody;
} }
var hookCtx = new HookContext("post-users-sign-in-data", null, null); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "post-users-sign-in-data", new List<string> { }, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -463,7 +464,7 @@ namespace LukeHagar.PlexAPI.SDK
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new PostUsersSignInDataResponse() var response = new PostUsersSignInDataResponse()
{ {
StatusCode = responseStatusCode, StatusCode = responseStatusCode,
@@ -480,7 +481,7 @@ namespace LukeHagar.PlexAPI.SDK
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse; obj!.RawResponse = httpResponse;
throw obj!; throw obj!;
} }
@@ -491,14 +492,18 @@ namespace LukeHagar.PlexAPI.SDK
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse; obj!.RawResponse = httpResponse;
throw obj!; throw obj!;
} }
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }

View File

@@ -13,14 +13,16 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System; using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary> /// <summary>
/// Butler is the task manager of the Plex Media Server Ecosystem.<br/> /// Butler is the task manager of the Plex Media Server Ecosystem.<br/>
@@ -101,19 +103,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.8.6"; private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.428.1"; private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.6 2.428.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Butler(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Butler(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -124,21 +119,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/butler"; var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getButlerTasks", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getButlerTasks", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -206,7 +201,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -221,21 +220,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/butler"; var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("startAllTasks", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -295,7 +294,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -310,21 +313,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/butler"; var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("stopAllTasks", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -384,7 +387,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -402,21 +409,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request); var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("startTask", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startTask", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -476,7 +483,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -494,21 +505,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request); var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("stopTask", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopTask", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -568,7 +579,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }

View File

@@ -17,34 +17,47 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
public class HookContext public class HookContext
{ {
public SDKConfig SDKConfiguration { get; set; }
public string BaseURL { get; set; } = "";
public string OperationID { get; set; } public string OperationID { get; set; }
public List<string>? Oauth2Scopes { get; set; } public List<string>? Oauth2Scopes { get; set; }
public Func<object>? SecuritySource { get; set; } public Func<object>? SecuritySource { get; set; }
public HookContext(string operationID, List<string>? oauth2Scopes, Func<object>? securitySource) public HookContext(SDKConfig config, string baseURL, string operationID, List<string>? oauth2Scopes, Func<object>? securitySource)
{ {
SDKConfiguration = config;
BaseURL = baseURL;
OperationID = operationID; OperationID = operationID;
Oauth2Scopes = oauth2Scopes; Oauth2Scopes = oauth2Scopes;
SecuritySource = securitySource; SecuritySource = securitySource;
} }
public HookContext(HookContext hookCtx)
{
SDKConfiguration = hookCtx.SDKConfiguration;
BaseURL = hookCtx.BaseURL;
OperationID = hookCtx.OperationID;
Oauth2Scopes = hookCtx.Oauth2Scopes;
SecuritySource = hookCtx.SecuritySource;
}
} }
public class BeforeRequestContext : HookContext public class BeforeRequestContext : HookContext
{ {
public BeforeRequestContext(HookContext hookCtx) public BeforeRequestContext(HookContext hookCtx)
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } : base(hookCtx) { }
} }
public class AfterSuccessContext : HookContext public class AfterSuccessContext : HookContext
{ {
public AfterSuccessContext(HookContext hookCtx) public AfterSuccessContext(HookContext hookCtx)
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } : base(hookCtx) { }
} }
public class AfterErrorContext : HookContext public class AfterErrorContext : HookContext
{ {
public AfterErrorContext(HookContext hookCtx) public AfterErrorContext(HookContext hookCtx)
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } : base(hookCtx) { }
} }
/// <summary> /// <summary>

View File

@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
{ {
this.afterErrorHooks.Add(hook); this.afterErrorHooks.Add(hook);
} }
public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client) public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client)
{ {
var urlAndClient = (baseUrl, client); var urlAndClient = (baseUrl, client);
@@ -68,7 +68,7 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
} }
return urlAndClient; return urlAndClient;
} }
public async Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request) public async Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request)
{ {
foreach (var hook in this.beforeRequestHooks) foreach (var hook in this.beforeRequestHooks)

View File

@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System; using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary> /// <summary>
/// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.<br/> /// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.<br/>
@@ -73,19 +73,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.8.6"; private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.428.1"; private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.6 2.428.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Hubs(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Hubs(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -100,21 +93,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/hubs", request); var urlString = URLBuilder.Build(baseUrl, "/hubs", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getGlobalHubs", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getGlobalHubs", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -182,7 +175,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -196,21 +193,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request); var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("get-recently-added", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-recently-added", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -256,7 +253,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 == 401 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -276,21 +277,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request); var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getLibraryHubs", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getLibraryHubs", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -358,7 +359,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -13,14 +13,16 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System; using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary> /// <summary>
/// Submit logs to the Log Handler for Plex Media Server<br/> /// Submit logs to the Log Handler for Plex Media Server<br/>
@@ -46,13 +48,13 @@ namespace LukeHagar.PlexAPI.SDK
/// Logging a multi-line message /// Logging a multi-line message
/// ///
/// <remarks> /// <remarks>
/// This endpoint allows for the batch addition of log entries to the main Plex Media Server log. <br/> /// This endpoint allows for the batch addition of log entries to the main Plex Media Server log.<br/>
/// It accepts a text/plain request body, where each line represents a distinct log entry. <br/> /// It accepts a text/plain request body, where each line represents a distinct log entry.<br/>
/// Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as &apos;level&apos;, &apos;message&apos;, and &apos;source&apos;. <br/> /// Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as &apos;level&apos;, &apos;message&apos;, and &apos;source&apos;.<br/>
/// <br/> /// <br/>
/// Log entries are separated by a newline character (`\n`). <br/> /// Log entries are separated by a newline character (`\n`).<br/>
/// Each entry&apos;s parameters should be URL-encoded to ensure accurate parsing and handling of special characters. <br/> /// Each entry&apos;s parameters should be URL-encoded to ensure accurate parsing and handling of special characters.<br/>
/// This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests. <br/> /// This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests.<br/>
/// <br/> /// <br/>
/// The &apos;level&apos; parameter specifies the log entry&apos;s severity or importance, with the following integer values:<br/> /// The &apos;level&apos; parameter specifies the log entry&apos;s severity or importance, with the following integer values:<br/>
/// - `0`: Error - Critical issues that require immediate attention.<br/> /// - `0`: Error - Critical issues that require immediate attention.<br/>
@@ -94,19 +96,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.8.6"; private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.428.1"; private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.6 2.428.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Log(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Log(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -122,21 +117,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/log", request); var urlString = URLBuilder.Build(baseUrl, "/log", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("logLine", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "logLine", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -196,7 +191,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -211,7 +210,7 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/log"; var urlString = baseUrl + "/log";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string", false, false); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string", false, false);
if (serializedBody != null) if (serializedBody != null)
@@ -219,19 +218,19 @@ namespace LukeHagar.PlexAPI.SDK
httpRequest.Content = serializedBody; httpRequest.Content = serializedBody;
} }
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("logMultiLine", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "logMultiLine", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -291,7 +290,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -306,21 +309,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/log/networked"; var urlString = baseUrl + "/log/networked";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("enablePaperTrail", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "enablePaperTrail", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -380,7 +383,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }

View File

@@ -3,37 +3,37 @@
<PropertyGroup> <PropertyGroup>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId> <PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.8.6</Version> <Version>0.16.0</Version>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors> <Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2024</Copyright> <Copyright>Copyright (c) LukeHagar 2025</Copyright>
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl> <RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<PackageTags>Plex Media Server SDK</PackageTags> <PackageTags>Plex Media Server SDK</PackageTags>
<Description># Plex Media Server OpenAPI Specification <Description># Plex Media Server OpenAPI Specification<br/>
<br/>
An Open Source OpenAPI Specification for Plex Media Server An Open Source OpenAPI Specification for Plex Media Server<br/>
<br/>
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/) Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
<br/>
## Documentation ## Documentation<br/>
<br/>
[API Documentation](https://plexapi.dev) <a href="https://plexapi.dev">API Documentation</a><br/>
<br/>
## SDKs ## 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 [main specification Repository](https://github.com/LukeHagar/plex-api-spec). 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 | | Language | Repository | Releases | Other |<br/>
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - | | Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - | | 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 | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) | | 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 | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - | | Ruby | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/releases">Releases</a> | - |<br/>
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | -<br/>
</Description> </Description>
</PropertyGroup> </PropertyGroup>

View File

@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System; using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/// <summary> /// <summary>
/// API Calls interacting with Plex Media Server Media<br/> /// API Calls interacting with Plex Media Server Media<br/>
@@ -90,19 +90,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.8.6"; private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.428.1"; private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.6 2.428.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Media(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Media(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -116,21 +109,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request); var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("markPlayed", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "markPlayed", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -190,7 +183,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -208,21 +205,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request); var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("markUnplayed", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "markUnplayed", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -282,7 +279,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -302,21 +303,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/:/progress", request); var urlString = URLBuilder.Build(baseUrl, "/:/progress", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("updatePlayProgress", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "updatePlayProgress", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -376,7 +377,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -390,21 +395,22 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("get-banner-image", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-banner-image", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -471,7 +477,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
@@ -485,21 +495,22 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("get-thumb-image", null, _securitySource); var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-thumb-image", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -566,7 +577,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.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 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("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,18 +12,18 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary> /// </summary>
public class GetMetaDataByRatingKeyBadRequest : Exception public class GetActorsLibraryBadRequest : Exception
{ {
[JsonProperty("errors")] [JsonProperty("errors")]
public List<GetMetaDataByRatingKeyErrors>? Errors { get; set; } public List<GetActorsLibraryErrors>? Errors { get; set; }
/// <summary> /// <summary>
/// Raw HTTP response; suitable for custom response parsing /// Raw HTTP response; suitable for custom response parsing

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetOnDeckLibraryErrors public class GetActorsLibraryErrors
{ {
[JsonProperty("code")] [JsonProperty("code")]

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetMetaDataByRatingKeyLibraryErrors public class GetActorsLibraryLibraryErrors
{ {
[JsonProperty("code")] [JsonProperty("code")]

View File

@@ -12,18 +12,18 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary> /// </summary>
public class GetMetaDataByRatingKeyUnauthorized : Exception public class GetActorsLibraryUnauthorized : Exception
{ {
[JsonProperty("errors")] [JsonProperty("errors")]
public List<GetMetaDataByRatingKeyLibraryErrors>? Errors { get; set; } public List<GetActorsLibraryLibraryErrors>? Errors { get; set; }
/// <summary> /// <summary>
/// Raw HTTP response; suitable for custom response parsing /// Raw HTTP response; suitable for custom response parsing

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -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 GetCountriesLibraryBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetCountriesLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetMetaDataByRatingKeyErrors public class GetCountriesLibraryErrors
{ {
[JsonProperty("code")] [JsonProperty("code")]

View File

@@ -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; }
}
}

View File

@@ -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>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetCountriesLibraryUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetCountriesLibraryLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -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; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetGenresLibraryErrors
{
[JsonProperty("code")]
public int? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public int? Status { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetGenresLibraryLibraryErrors
{
[JsonProperty("code")]
public int? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public int? Status { get; set; }
}
}

View File

@@ -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>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetGenresLibraryUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetGenresLibraryLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -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 GetLibrarySectionsAllBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetLibrarySectionsAllErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetLibrarySectionsAllErrors
{
[JsonProperty("code")]
public int? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public int? Status { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetLibrarySectionsAllLibraryErrors
{
[JsonProperty("code")]
public int? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public int? Status { get; set; }
}
}

View File

@@ -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>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetLibrarySectionsAllUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetLibrarySectionsAllLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -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 GetMediaMetaDataBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetMediaMetaDataErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetMediaMetaDataErrors
{
[JsonProperty("code")]
public int? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public int? Status { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetMediaMetaDataLibraryErrors
{
[JsonProperty("code")]
public int? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public int? Status { get; set; }
}
}

View File

@@ -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>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetMediaMetaDataUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetMediaMetaDataLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.

View File

@@ -12,9 +12,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Models.Errors; using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System;
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.

Some files were not shown because too many files have changed in this diff Show More