mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 20:47:49 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc02ecef34 |
File diff suppressed because one or more lines are too long
@@ -4,6 +4,7 @@ generation:
|
||||
maintainOpenAPIOrder: true
|
||||
usageSnippets:
|
||||
optionalPropertyRendering: withExample
|
||||
sdkInitStyle: constructor
|
||||
useClassNamesForArrayFields: true
|
||||
fixes:
|
||||
nameResolutionDec2023: true
|
||||
@@ -16,7 +17,7 @@ generation:
|
||||
oAuth2ClientCredentialsEnabled: true
|
||||
oAuth2PasswordEnabled: false
|
||||
csharp:
|
||||
version: 0.14.11
|
||||
version: 0.15.0
|
||||
additionalDependencies: []
|
||||
author: LukeHagar
|
||||
clientServerStatusCodesAsErrors: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.542.1
|
||||
speakeasyVersion: 1.555.2
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
@@ -16,19 +16,19 @@ sources:
|
||||
- main
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:37adc934a79841fb00cfe6ed569f5b1c88534b20202ecbde64b4e84828cee22a
|
||||
sourceBlobDigest: sha256:ffb5b8d288111a763e4d035c8c9e37f5c89690d146b7297493b43a71d8298e6c
|
||||
sourceRevisionDigest: sha256:78d07ad78ff60d0e9918696208d8c68a562e170d4e9c431797c02995fb8816d0
|
||||
sourceBlobDigest: sha256:d38dd2a36c1b2fd73409267f7b30c2d5d45d709616141803ea01db424ec68ae4
|
||||
tags:
|
||||
- latest
|
||||
- speakeasy-sdk-regen-1746404742
|
||||
- speakeasy-sdk-regen-1748996711
|
||||
targets:
|
||||
plexcsharp:
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:37adc934a79841fb00cfe6ed569f5b1c88534b20202ecbde64b4e84828cee22a
|
||||
sourceBlobDigest: sha256:ffb5b8d288111a763e4d035c8c9e37f5c89690d146b7297493b43a71d8298e6c
|
||||
sourceRevisionDigest: sha256:78d07ad78ff60d0e9918696208d8c68a562e170d4e9c431797c02995fb8816d0
|
||||
sourceBlobDigest: sha256:d38dd2a36c1b2fd73409267f7b30c2d5d45d709616141803ea01db424ec68ae4
|
||||
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
||||
codeSamplesRevisionDigest: sha256:7cb363d64d3faf7e2bf27b77c7bd75d20aa754c1d67c7d67122dd4fd190db66c
|
||||
codeSamplesRevisionDigest: sha256:5609267a659a1b1fdebdd8516758904fc983fb919b5b5a8bbd0044567e8bfa0f
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
|
||||
@@ -74,19 +74,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Activities(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Activities(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -97,21 +90,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/activities";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getServerActivities", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -201,21 +194,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "cancelServerActivities", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "cancelServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -95,19 +95,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
};
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Authentication(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Authentication(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -122,21 +115,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getTransientToken", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTransientToken", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -218,21 +211,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/security/resources", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getSourceConnectionInformation", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSourceConnectionInformation", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -316,21 +309,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/user";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getTokenDetails", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTokenDetails", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -422,7 +415,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/users/signin";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
|
||||
@@ -431,14 +424,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpRequest.Content = serializedBody;
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "post-users-sign-in-data", new List<string> { }, null);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "post-users-sign-in-data", new List<string> { }, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -101,19 +101,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Butler(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Butler(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -124,21 +117,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/butler";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getButlerTasks", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getButlerTasks", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -225,21 +218,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/butler";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "startAllTasks", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -318,21 +311,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/butler";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "stopAllTasks", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -414,21 +407,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "startTask", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startTask", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -510,21 +503,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "stopTask", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopTask", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -17,36 +17,47 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
|
||||
|
||||
public class HookContext
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; set; }
|
||||
public string BaseURL { get; set; } = "";
|
||||
public string OperationID { get; set; }
|
||||
public List<string>? Oauth2Scopes { get; set; }
|
||||
public Func<object>? SecuritySource { get; set; }
|
||||
|
||||
public HookContext(string baseURL, string operationID, List<string>? oauth2Scopes, Func<object>? securitySource)
|
||||
public HookContext(SDKConfig config, string baseURL, string operationID, List<string>? oauth2Scopes, Func<object>? securitySource)
|
||||
{
|
||||
SDKConfiguration = config;
|
||||
BaseURL = baseURL;
|
||||
OperationID = operationID;
|
||||
Oauth2Scopes = oauth2Scopes;
|
||||
SecuritySource = securitySource;
|
||||
}
|
||||
|
||||
public HookContext(HookContext hookCtx)
|
||||
{
|
||||
SDKConfiguration = hookCtx.SDKConfiguration;
|
||||
BaseURL = hookCtx.BaseURL;
|
||||
OperationID = hookCtx.OperationID;
|
||||
Oauth2Scopes = hookCtx.Oauth2Scopes;
|
||||
SecuritySource = hookCtx.SecuritySource;
|
||||
}
|
||||
}
|
||||
|
||||
public class BeforeRequestContext : HookContext
|
||||
{
|
||||
public BeforeRequestContext(HookContext hookCtx)
|
||||
: base(hookCtx.BaseURL, hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
|
||||
: base(hookCtx) { }
|
||||
}
|
||||
|
||||
public class AfterSuccessContext : HookContext
|
||||
{
|
||||
public AfterSuccessContext(HookContext hookCtx)
|
||||
: base(hookCtx.BaseURL, hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
|
||||
: base(hookCtx) { }
|
||||
}
|
||||
|
||||
public class AfterErrorContext : HookContext
|
||||
{
|
||||
public AfterErrorContext(HookContext hookCtx)
|
||||
: base(hookCtx.BaseURL, hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
|
||||
: base(hookCtx) { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
|
||||
{
|
||||
this.afterErrorHooks.Add(hook);
|
||||
}
|
||||
|
||||
|
||||
public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client)
|
||||
{
|
||||
var urlAndClient = (baseUrl, client);
|
||||
@@ -68,7 +68,7 @@ namespace LukeHagar.PlexAPI.SDK.Hooks
|
||||
}
|
||||
return urlAndClient;
|
||||
}
|
||||
|
||||
|
||||
public async Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request)
|
||||
{
|
||||
foreach (var hook in this.beforeRequestHooks)
|
||||
|
||||
@@ -73,19 +73,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 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;
|
||||
}
|
||||
|
||||
@@ -100,21 +93,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/hubs", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getGlobalHubs", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getGlobalHubs", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -200,21 +193,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-recently-added", new List<string> { }, _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);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -284,21 +277,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getLibraryHubs", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getLibraryHubs", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -154,14 +154,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// Get all media of library
|
||||
/// Get Library section media by tag ALL
|
||||
///
|
||||
/// <remarks>
|
||||
/// Retrieves a list of all general media data for this library.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetAllMediaLibraryResponse> GetAllMediaLibraryAsync(GetAllMediaLibraryRequest request);
|
||||
Task<GetLibrarySectionsAllResponse> GetLibrarySectionsAllAsync(GetLibrarySectionsAllRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// Refresh Metadata Of The Library
|
||||
@@ -244,7 +244,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Media Metadata
|
||||
///
|
||||
/// <remarks>
|
||||
/// This endpoint will return all the (meta)data of a library item specified with by the ratingKey.<br/>
|
||||
/// This endpoint will return all the (meta)data of one or more library items specified by the ratingKey.<br/>
|
||||
/// Multiple rating keys can be provided as a comma-separated list (e.g., "21119,21617").<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
@@ -304,7 +305,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null);
|
||||
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, GetTopWatchedContentQueryParamIncludeGuids? includeGuids = LukeHagar.PlexAPI.SDK.Models.Requests.GetTopWatchedContentQueryParamIncludeGuids.Disable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -318,19 +319,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Library(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Library(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -345,21 +339,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/hashes", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getFileHash", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getFileHash", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -437,21 +431,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-recently-added-library", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-recently-added-library", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -538,21 +532,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/library/sections";
|
||||
|
||||
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(baseUrl, "get-all-libraries", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-all-libraries", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -643,21 +637,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-library-details", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-library-details", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -747,21 +741,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "deleteLibrary", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "deleteLibrary", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -839,21 +833,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-library-items", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-library-items", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -933,27 +927,27 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetAllMediaLibraryResponse> GetAllMediaLibraryAsync(GetAllMediaLibraryRequest request)
|
||||
public async Task<GetLibrarySectionsAllResponse> GetLibrarySectionsAllAsync(GetLibrarySectionsAllRequest request)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/all", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-all-media-library", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-library-sections-all", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -986,8 +980,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetAllMediaLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var response = new GetAllMediaLibraryResponse()
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetLibrarySectionsAllResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var response = new GetLibrarySectionsAllResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
@@ -1003,7 +997,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetAllMediaLibraryBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetLibrarySectionsAllBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
@@ -1014,7 +1008,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetAllMediaLibraryUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetLibrarySectionsAllUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
@@ -1044,21 +1038,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/refresh", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-refresh-library-metadata", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-refresh-library-metadata", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1141,21 +1135,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/search", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-search-library", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-search-library", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1246,21 +1240,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/genre", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-genres-library", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-genres-library", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1351,21 +1345,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/country", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-countries-library", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-countries-library", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1456,21 +1450,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/actor", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-actors-library", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-actors-library", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1556,22 +1550,22 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/search", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-search-all-libraries", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-search-all-libraries", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1657,21 +1651,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-media-meta-data", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-media-meta-data", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1761,21 +1755,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/arts", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-media-arts", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-media-arts", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1845,7 +1839,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/arts", request);
|
||||
|
||||
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, "RequestBody", "raw", false, true);
|
||||
if (serializedBody != null)
|
||||
@@ -1853,19 +1847,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpRequest.Content = serializedBody;
|
||||
}
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "post-media-arts", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "post-media-arts", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1925,21 +1919,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/posters", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-media-posters", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-media-posters", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -2009,7 +2003,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/posters", request);
|
||||
|
||||
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, "RequestBody", "raw", false, true);
|
||||
if (serializedBody != null)
|
||||
@@ -2017,19 +2011,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpRequest.Content = serializedBody;
|
||||
}
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "post-media-poster", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "post-media-poster", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -2090,21 +2084,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/children", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getMetadataChildren", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getMetadataChildren", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -2184,7 +2178,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null)
|
||||
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, GetTopWatchedContentQueryParamIncludeGuids? includeGuids = LukeHagar.PlexAPI.SDK.Models.Requests.GetTopWatchedContentQueryParamIncludeGuids.Disable)
|
||||
{
|
||||
var request = new GetTopWatchedContentRequest()
|
||||
{
|
||||
@@ -2195,21 +2189,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/all/top", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getTopWatchedContent", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTopWatchedContent", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -94,19 +94,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Log(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Log(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -122,21 +115,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/log", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "logLine", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "logLine", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -215,7 +208,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/log";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string", false, false);
|
||||
if (serializedBody != null)
|
||||
@@ -223,19 +216,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
httpRequest.Content = serializedBody;
|
||||
}
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "logMultiLine", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "logMultiLine", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -314,21 +307,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/log/networked";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "enablePaperTrail", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "enablePaperTrail", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<IsPackable>true</IsPackable>
|
||||
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
||||
<Version>0.14.11</Version>
|
||||
<Version>0.15.0</Version>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Authors>LukeHagar</Authors>
|
||||
<Copyright>Copyright (c) LukeHagar 2025</Copyright>
|
||||
|
||||
@@ -90,19 +90,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Media(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Media(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -116,21 +109,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "markPlayed", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "markPlayed", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -212,21 +205,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "markUnplayed", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "markUnplayed", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -310,21 +303,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/:/progress", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "updatePlayProgress", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "updatePlayProgress", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -402,22 +395,22 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-banner-image", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-banner-image", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -502,22 +495,22 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-thumb-image", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-thumb-image", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
/// <summary>
|
||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||
/// </summary>
|
||||
public class GetAllMediaLibraryBadRequest : Exception
|
||||
public class GetLibrarySectionsAllBadRequest : Exception
|
||||
{
|
||||
|
||||
[JsonProperty("errors")]
|
||||
public List<GetAllMediaLibraryErrors>? Errors { get; set; }
|
||||
public List<GetLibrarySectionsAllErrors>? Errors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Raw HTTP response; suitable for custom response parsing
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryErrors
|
||||
public class GetLibrarySectionsAllErrors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryLibraryErrors
|
||||
public class GetLibrarySectionsAllLibraryErrors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
@@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
/// </summary>
|
||||
public class GetAllMediaLibraryUnauthorized : Exception
|
||||
public class GetLibrarySectionsAllUnauthorized : Exception
|
||||
{
|
||||
|
||||
[JsonProperty("errors")]
|
||||
public List<GetAllMediaLibraryLibraryErrors>? Errors { get; set; }
|
||||
public List<GetLibrarySectionsAllLibraryErrors>? Errors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Raw HTTP response; suitable for custom response parsing
|
||||
@@ -18,6 +18,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class Country
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier for the country.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
@@ -28,6 +36,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Tag { get; set; } = default!;
|
||||
|
||||
[JsonProperty("filter")]
|
||||
public string? Filter { get; set; }
|
||||
public string Filter { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class Director
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Unique identifier for the director.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The filter string used to query this director.
|
||||
/// </summary>
|
||||
[JsonProperty("filter")]
|
||||
public string Filter { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The role of Director
|
||||
/// </summary>
|
||||
[JsonProperty("tag")]
|
||||
public string Tag { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// A unique 24-character hexadecimal key associated with the director's tag, used for internal identification.
|
||||
/// </summary>
|
||||
[JsonProperty("tagKey")]
|
||||
public string TagKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The absolute URL of the thumbnail image for the director.
|
||||
/// </summary>
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class Genre
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier for the genre.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; } = default!;
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
[JsonProperty("filter")]
|
||||
public string Filter { get; set; } = default!;
|
||||
|
||||
@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,6 +30,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
Artist,
|
||||
[JsonProperty("album")]
|
||||
Album,
|
||||
[JsonProperty("track")]
|
||||
Track,
|
||||
[JsonProperty("photoalbum")]
|
||||
PhotoAlbum,
|
||||
[JsonProperty("photo")]
|
||||
Photo,
|
||||
[JsonProperty("collection")]
|
||||
Collection,
|
||||
}
|
||||
|
||||
public static class GetAllLibrariesTypeExtension
|
||||
|
||||
@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// The type of media content<br/>
|
||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
@@ -34,6 +34,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
Artist,
|
||||
[JsonProperty("album")]
|
||||
Album,
|
||||
[JsonProperty("track")]
|
||||
Track,
|
||||
[JsonProperty("photoalbum")]
|
||||
PhotoAlbum,
|
||||
[JsonProperty("photo")]
|
||||
Photo,
|
||||
[JsonProperty("collection")]
|
||||
Collection,
|
||||
}
|
||||
|
||||
public static class GetLibraryItemsLibraryTypeExtension
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string? LibrarySectionKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of media content<br/>
|
||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
|
||||
@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public enum GetAllMediaLibraryActiveDirection
|
||||
public enum GetLibrarySectionsAllActiveDirection
|
||||
{
|
||||
[JsonProperty("asc")]
|
||||
Ascending,
|
||||
@@ -28,16 +28,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
Descending,
|
||||
}
|
||||
|
||||
public static class GetAllMediaLibraryActiveDirectionExtension
|
||||
public static class GetLibrarySectionsAllActiveDirectionExtension
|
||||
{
|
||||
public static string Value(this GetAllMediaLibraryActiveDirection value)
|
||||
public static string Value(this GetLibrarySectionsAllActiveDirection value)
|
||||
{
|
||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
||||
}
|
||||
|
||||
public static GetAllMediaLibraryActiveDirection ToEnum(this string value)
|
||||
public static GetLibrarySectionsAllActiveDirection ToEnum(this string value)
|
||||
{
|
||||
foreach(var field in typeof(GetAllMediaLibraryActiveDirection).GetFields())
|
||||
foreach(var field in typeof(GetLibrarySectionsAllActiveDirection).GetFields())
|
||||
{
|
||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
@@ -50,14 +50,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
var enumVal = field.GetValue(null);
|
||||
|
||||
if (enumVal is GetAllMediaLibraryActiveDirection)
|
||||
if (enumVal is GetLibrarySectionsAllActiveDirection)
|
||||
{
|
||||
return (GetAllMediaLibraryActiveDirection)enumVal;
|
||||
return (GetLibrarySectionsAllActiveDirection)enumVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Unknown value {value} for enum GetAllMediaLibraryActiveDirection");
|
||||
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllActiveDirection");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryCollection
|
||||
public class GetLibrarySectionsAllCollection
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryCountry
|
||||
public class GetLibrarySectionsAllCountry
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -20,7 +20,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public enum GetAllMediaLibraryDefaultDirection
|
||||
public enum GetLibrarySectionsAllDefaultDirection
|
||||
{
|
||||
[JsonProperty("asc")]
|
||||
Ascending,
|
||||
@@ -28,16 +28,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
Descending,
|
||||
}
|
||||
|
||||
public static class GetAllMediaLibraryDefaultDirectionExtension
|
||||
public static class GetLibrarySectionsAllDefaultDirectionExtension
|
||||
{
|
||||
public static string Value(this GetAllMediaLibraryDefaultDirection value)
|
||||
public static string Value(this GetLibrarySectionsAllDefaultDirection value)
|
||||
{
|
||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
||||
}
|
||||
|
||||
public static GetAllMediaLibraryDefaultDirection ToEnum(this string value)
|
||||
public static GetLibrarySectionsAllDefaultDirection ToEnum(this string value)
|
||||
{
|
||||
foreach(var field in typeof(GetAllMediaLibraryDefaultDirection).GetFields())
|
||||
foreach(var field in typeof(GetLibrarySectionsAllDefaultDirection).GetFields())
|
||||
{
|
||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
@@ -50,14 +50,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
var enumVal = field.GetValue(null);
|
||||
|
||||
if (enumVal is GetAllMediaLibraryDefaultDirection)
|
||||
if (enumVal is GetLibrarySectionsAllDefaultDirection)
|
||||
{
|
||||
return (GetAllMediaLibraryDefaultDirection)enumVal;
|
||||
return (GetLibrarySectionsAllDefaultDirection)enumVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Unknown value {value} for enum GetAllMediaLibraryDefaultDirection");
|
||||
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllDefaultDirection");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryDirector
|
||||
public class GetLibrarySectionsAllDirector
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryField
|
||||
public class GetLibrarySectionsAllField
|
||||
{
|
||||
|
||||
[JsonProperty("key")]
|
||||
@@ -14,13 +14,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class GetAllMediaLibraryFieldType
|
||||
public class GetLibrarySectionsAllFieldType
|
||||
{
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; } = default!;
|
||||
|
||||
[JsonProperty("Operator")]
|
||||
public List<GetAllMediaLibraryOperator> Operator { get; set; } = default!;
|
||||
public List<GetLibrarySectionsAllOperator> Operator { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryFilter
|
||||
public class GetLibrarySectionsAllFilter
|
||||
{
|
||||
|
||||
[JsonProperty("filter")]
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryGenre
|
||||
public class GetLibrarySectionsAllGenre
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -12,17 +12,17 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryGuids
|
||||
public class GetLibrarySectionsAllGuids
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier for the Guid. Can be imdb://tt0286347, tmdb://1763, tvdb://2337<br/>
|
||||
/// The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
public string Id { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// <summary>
|
||||
/// Indicates if the part has a thumbnail.
|
||||
/// </summary>
|
||||
public enum GetAllMediaLibraryHasThumbnail
|
||||
public enum GetLibrarySectionsAllHasThumbnail
|
||||
{
|
||||
[JsonProperty("0")]
|
||||
False,
|
||||
@@ -24,16 +24,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
True,
|
||||
}
|
||||
|
||||
public static class GetAllMediaLibraryHasThumbnailExtension
|
||||
public static class GetLibrarySectionsAllHasThumbnailExtension
|
||||
{
|
||||
public static string Value(this GetAllMediaLibraryHasThumbnail value)
|
||||
public static string Value(this GetLibrarySectionsAllHasThumbnail value)
|
||||
{
|
||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
||||
}
|
||||
|
||||
public static GetAllMediaLibraryHasThumbnail ToEnum(this string value)
|
||||
public static GetLibrarySectionsAllHasThumbnail ToEnum(this string value)
|
||||
{
|
||||
foreach(var field in typeof(GetAllMediaLibraryHasThumbnail).GetFields())
|
||||
foreach(var field in typeof(GetLibrarySectionsAllHasThumbnail).GetFields())
|
||||
{
|
||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
@@ -46,14 +46,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
var enumVal = field.GetValue(null);
|
||||
|
||||
if (enumVal is GetAllMediaLibraryHasThumbnail)
|
||||
if (enumVal is GetLibrarySectionsAllHasThumbnail)
|
||||
{
|
||||
return (GetAllMediaLibraryHasThumbnail)enumVal;
|
||||
return (GetLibrarySectionsAllHasThumbnail)enumVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Unknown value {value} for enum GetAllMediaLibraryHasThumbnail");
|
||||
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllHasThumbnail");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryImage
|
||||
public class GetLibrarySectionsAllImage
|
||||
{
|
||||
|
||||
[JsonProperty("alt")]
|
||||
public string Alt { get; set; } = default!;
|
||||
|
||||
[JsonProperty("type")]
|
||||
public GetAllMediaLibraryLibraryResponseType Type { get; set; } = default!;
|
||||
public GetLibrarySectionsAllLibraryResponseType Type { get; set; } = default!;
|
||||
|
||||
[JsonProperty("url")]
|
||||
public string Url { get; set; } = default!;
|
||||
@@ -19,25 +19,25 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
public class GetAllMediaLibraryLibraryOptimizedForStreamingType
|
||||
public class GetLibrarySectionsAllLibraryOptimizedForStreamingType
|
||||
{
|
||||
private GetAllMediaLibraryLibraryOptimizedForStreamingType(string value) { Value = value; }
|
||||
private GetLibrarySectionsAllLibraryOptimizedForStreamingType(string value) { Value = value; }
|
||||
|
||||
public string Value { get; private set; }
|
||||
public static GetAllMediaLibraryLibraryOptimizedForStreamingType GetAllMediaLibraryOptimizedForStreaming1 { get { return new GetAllMediaLibraryLibraryOptimizedForStreamingType("get-all-media-library_optimizedForStreaming_1"); } }
|
||||
public static GetLibrarySectionsAllLibraryOptimizedForStreamingType GetLibrarySectionsAllOptimizedForStreaming1 { get { return new GetLibrarySectionsAllLibraryOptimizedForStreamingType("get-library-sections-all_optimizedForStreaming_1"); } }
|
||||
|
||||
public static GetAllMediaLibraryLibraryOptimizedForStreamingType Boolean { get { return new GetAllMediaLibraryLibraryOptimizedForStreamingType("boolean"); } }
|
||||
public static GetLibrarySectionsAllLibraryOptimizedForStreamingType Boolean { get { return new GetLibrarySectionsAllLibraryOptimizedForStreamingType("boolean"); } }
|
||||
|
||||
public static GetAllMediaLibraryLibraryOptimizedForStreamingType Null { get { return new GetAllMediaLibraryLibraryOptimizedForStreamingType("null"); } }
|
||||
public static GetLibrarySectionsAllLibraryOptimizedForStreamingType Null { get { return new GetLibrarySectionsAllLibraryOptimizedForStreamingType("null"); } }
|
||||
|
||||
public override string ToString() { return Value; }
|
||||
public static implicit operator String(GetAllMediaLibraryLibraryOptimizedForStreamingType v) { return v.Value; }
|
||||
public static GetAllMediaLibraryLibraryOptimizedForStreamingType FromString(string v) {
|
||||
public static implicit operator String(GetLibrarySectionsAllLibraryOptimizedForStreamingType v) { return v.Value; }
|
||||
public static GetLibrarySectionsAllLibraryOptimizedForStreamingType FromString(string v) {
|
||||
switch(v) {
|
||||
case "get-all-media-library_optimizedForStreaming_1": return GetAllMediaLibraryOptimizedForStreaming1;
|
||||
case "get-library-sections-all_optimizedForStreaming_1": return GetLibrarySectionsAllOptimizedForStreaming1;
|
||||
case "boolean": return Boolean;
|
||||
case "null": return Null;
|
||||
default: throw new ArgumentException("Invalid value for GetAllMediaLibraryLibraryOptimizedForStreamingType");
|
||||
default: throw new ArgumentException("Invalid value for GetLibrarySectionsAllLibraryOptimizedForStreamingType");
|
||||
}
|
||||
}
|
||||
public override bool Equals(object? obj)
|
||||
@@ -46,7 +46,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Value.Equals(((GetAllMediaLibraryLibraryOptimizedForStreamingType)obj).Value);
|
||||
return Value.Equals(((GetLibrarySectionsAllLibraryOptimizedForStreamingType)obj).Value);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
@@ -59,46 +59,46 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// <summary>
|
||||
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(GetAllMediaLibraryLibraryOptimizedForStreaming.GetAllMediaLibraryLibraryOptimizedForStreamingConverter))]
|
||||
public class GetAllMediaLibraryLibraryOptimizedForStreaming {
|
||||
public GetAllMediaLibraryLibraryOptimizedForStreaming(GetAllMediaLibraryLibraryOptimizedForStreamingType type) {
|
||||
[JsonConverter(typeof(GetLibrarySectionsAllLibraryOptimizedForStreaming.GetLibrarySectionsAllLibraryOptimizedForStreamingConverter))]
|
||||
public class GetLibrarySectionsAllLibraryOptimizedForStreaming {
|
||||
public GetLibrarySectionsAllLibraryOptimizedForStreaming(GetLibrarySectionsAllLibraryOptimizedForStreamingType type) {
|
||||
Type = type;
|
||||
}
|
||||
|
||||
[SpeakeasyMetadata("form:explode=true")]
|
||||
public GetAllMediaLibraryOptimizedForStreaming1? GetAllMediaLibraryOptimizedForStreaming1 { get; set; }
|
||||
public GetLibrarySectionsAllOptimizedForStreaming1? GetLibrarySectionsAllOptimizedForStreaming1 { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("form:explode=true")]
|
||||
public bool? Boolean { get; set; }
|
||||
|
||||
public GetAllMediaLibraryLibraryOptimizedForStreamingType Type { get; set; }
|
||||
public GetLibrarySectionsAllLibraryOptimizedForStreamingType Type { get; set; }
|
||||
|
||||
|
||||
public static GetAllMediaLibraryLibraryOptimizedForStreaming CreateGetAllMediaLibraryOptimizedForStreaming1(GetAllMediaLibraryOptimizedForStreaming1 getAllMediaLibraryOptimizedForStreaming1) {
|
||||
GetAllMediaLibraryLibraryOptimizedForStreamingType typ = GetAllMediaLibraryLibraryOptimizedForStreamingType.GetAllMediaLibraryOptimizedForStreaming1;
|
||||
public static GetLibrarySectionsAllLibraryOptimizedForStreaming CreateGetLibrarySectionsAllOptimizedForStreaming1(GetLibrarySectionsAllOptimizedForStreaming1 getLibrarySectionsAllOptimizedForStreaming1) {
|
||||
GetLibrarySectionsAllLibraryOptimizedForStreamingType typ = GetLibrarySectionsAllLibraryOptimizedForStreamingType.GetLibrarySectionsAllOptimizedForStreaming1;
|
||||
|
||||
GetAllMediaLibraryLibraryOptimizedForStreaming res = new GetAllMediaLibraryLibraryOptimizedForStreaming(typ);
|
||||
res.GetAllMediaLibraryOptimizedForStreaming1 = getAllMediaLibraryOptimizedForStreaming1;
|
||||
GetLibrarySectionsAllLibraryOptimizedForStreaming res = new GetLibrarySectionsAllLibraryOptimizedForStreaming(typ);
|
||||
res.GetLibrarySectionsAllOptimizedForStreaming1 = getLibrarySectionsAllOptimizedForStreaming1;
|
||||
return res;
|
||||
}
|
||||
|
||||
public static GetAllMediaLibraryLibraryOptimizedForStreaming CreateBoolean(bool boolean) {
|
||||
GetAllMediaLibraryLibraryOptimizedForStreamingType typ = GetAllMediaLibraryLibraryOptimizedForStreamingType.Boolean;
|
||||
public static GetLibrarySectionsAllLibraryOptimizedForStreaming CreateBoolean(bool boolean) {
|
||||
GetLibrarySectionsAllLibraryOptimizedForStreamingType typ = GetLibrarySectionsAllLibraryOptimizedForStreamingType.Boolean;
|
||||
|
||||
GetAllMediaLibraryLibraryOptimizedForStreaming res = new GetAllMediaLibraryLibraryOptimizedForStreaming(typ);
|
||||
GetLibrarySectionsAllLibraryOptimizedForStreaming res = new GetLibrarySectionsAllLibraryOptimizedForStreaming(typ);
|
||||
res.Boolean = boolean;
|
||||
return res;
|
||||
}
|
||||
|
||||
public static GetAllMediaLibraryLibraryOptimizedForStreaming CreateNull() {
|
||||
GetAllMediaLibraryLibraryOptimizedForStreamingType typ = GetAllMediaLibraryLibraryOptimizedForStreamingType.Null;
|
||||
return new GetAllMediaLibraryLibraryOptimizedForStreaming(typ);
|
||||
public static GetLibrarySectionsAllLibraryOptimizedForStreaming CreateNull() {
|
||||
GetLibrarySectionsAllLibraryOptimizedForStreamingType typ = GetLibrarySectionsAllLibraryOptimizedForStreamingType.Null;
|
||||
return new GetLibrarySectionsAllLibraryOptimizedForStreaming(typ);
|
||||
}
|
||||
|
||||
public class GetAllMediaLibraryLibraryOptimizedForStreamingConverter : JsonConverter
|
||||
public class GetLibrarySectionsAllLibraryOptimizedForStreamingConverter : JsonConverter
|
||||
{
|
||||
|
||||
public override bool CanConvert(System.Type objectType) => objectType == typeof(GetAllMediaLibraryLibraryOptimizedForStreaming);
|
||||
public override bool CanConvert(System.Type objectType) => objectType == typeof(GetLibrarySectionsAllLibraryOptimizedForStreaming);
|
||||
|
||||
public override bool CanRead => true;
|
||||
|
||||
@@ -114,14 +114,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
|
||||
try
|
||||
{
|
||||
return new GetAllMediaLibraryLibraryOptimizedForStreaming(GetAllMediaLibraryLibraryOptimizedForStreamingType.GetAllMediaLibraryOptimizedForStreaming1)
|
||||
return new GetLibrarySectionsAllLibraryOptimizedForStreaming(GetLibrarySectionsAllLibraryOptimizedForStreamingType.GetLibrarySectionsAllOptimizedForStreaming1)
|
||||
{
|
||||
GetAllMediaLibraryOptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<GetAllMediaLibraryOptimizedForStreaming1>(json)
|
||||
GetLibrarySectionsAllOptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<GetLibrarySectionsAllOptimizedForStreaming1>(json)
|
||||
};
|
||||
}
|
||||
catch (ResponseBodyDeserializer.MissingMemberException)
|
||||
{
|
||||
fallbackCandidates.Add((typeof(GetAllMediaLibraryOptimizedForStreaming1), new GetAllMediaLibraryLibraryOptimizedForStreaming(GetAllMediaLibraryLibraryOptimizedForStreamingType.GetAllMediaLibraryOptimizedForStreaming1), "GetAllMediaLibraryOptimizedForStreaming1"));
|
||||
fallbackCandidates.Add((typeof(GetLibrarySectionsAllOptimizedForStreaming1), new GetLibrarySectionsAllLibraryOptimizedForStreaming(GetLibrarySectionsAllLibraryOptimizedForStreamingType.GetLibrarySectionsAllOptimizedForStreaming1), "GetLibrarySectionsAllOptimizedForStreaming1"));
|
||||
}
|
||||
catch (ResponseBodyDeserializer.DeserializationException)
|
||||
{
|
||||
@@ -135,7 +135,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
try
|
||||
{
|
||||
var converted = Convert.ToBoolean(json);
|
||||
return new GetAllMediaLibraryLibraryOptimizedForStreaming(GetAllMediaLibraryLibraryOptimizedForStreamingType.Boolean)
|
||||
return new GetLibrarySectionsAllLibraryOptimizedForStreaming(GetLibrarySectionsAllLibraryOptimizedForStreamingType.Boolean)
|
||||
{
|
||||
Boolean = converted
|
||||
};
|
||||
@@ -174,15 +174,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
writer.WriteRawValue("null");
|
||||
return;
|
||||
}
|
||||
GetAllMediaLibraryLibraryOptimizedForStreaming res = (GetAllMediaLibraryLibraryOptimizedForStreaming)value;
|
||||
if (GetAllMediaLibraryLibraryOptimizedForStreamingType.FromString(res.Type).Equals(GetAllMediaLibraryLibraryOptimizedForStreamingType.Null))
|
||||
GetLibrarySectionsAllLibraryOptimizedForStreaming res = (GetLibrarySectionsAllLibraryOptimizedForStreaming)value;
|
||||
if (GetLibrarySectionsAllLibraryOptimizedForStreamingType.FromString(res.Type).Equals(GetLibrarySectionsAllLibraryOptimizedForStreamingType.Null))
|
||||
{
|
||||
writer.WriteRawValue("null");
|
||||
return;
|
||||
}
|
||||
if (res.GetAllMediaLibraryOptimizedForStreaming1 != null)
|
||||
if (res.GetLibrarySectionsAllOptimizedForStreaming1 != null)
|
||||
{
|
||||
writer.WriteRawValue(Utilities.SerializeJSON(res.GetAllMediaLibraryOptimizedForStreaming1));
|
||||
writer.WriteRawValue(Utilities.SerializeJSON(res.GetLibrarySectionsAllOptimizedForStreaming1));
|
||||
return;
|
||||
}
|
||||
if (res.Boolean != null)
|
||||
@@ -13,7 +13,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
public enum GetAllMediaLibraryLibraryResponseType
|
||||
public enum GetLibrarySectionsAllLibraryResponseType
|
||||
{
|
||||
[JsonProperty("coverPoster")]
|
||||
CoverPoster,
|
||||
@@ -25,16 +25,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
ClearLogo,
|
||||
}
|
||||
|
||||
public static class GetAllMediaLibraryLibraryResponseTypeExtension
|
||||
public static class GetLibrarySectionsAllLibraryResponseTypeExtension
|
||||
{
|
||||
public static string Value(this GetAllMediaLibraryLibraryResponseType value)
|
||||
public static string Value(this GetLibrarySectionsAllLibraryResponseType value)
|
||||
{
|
||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
||||
}
|
||||
|
||||
public static GetAllMediaLibraryLibraryResponseType ToEnum(this string value)
|
||||
public static GetLibrarySectionsAllLibraryResponseType ToEnum(this string value)
|
||||
{
|
||||
foreach(var field in typeof(GetAllMediaLibraryLibraryResponseType).GetFields())
|
||||
foreach(var field in typeof(GetLibrarySectionsAllLibraryResponseType).GetFields())
|
||||
{
|
||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
@@ -47,14 +47,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
var enumVal = field.GetValue(null);
|
||||
|
||||
if (enumVal is GetAllMediaLibraryLibraryResponseType)
|
||||
if (enumVal is GetLibrarySectionsAllLibraryResponseType)
|
||||
{
|
||||
return (GetAllMediaLibraryLibraryResponseType)enumVal;
|
||||
return (GetLibrarySectionsAllLibraryResponseType)enumVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Unknown value {value} for enum GetAllMediaLibraryLibraryResponseType");
|
||||
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllLibraryResponseType");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// The type of media content<br/>
|
||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public enum GetAllMediaLibraryLibraryType
|
||||
public enum GetLibrarySectionsAllLibraryType
|
||||
{
|
||||
[JsonProperty("movie")]
|
||||
Movie,
|
||||
@@ -34,18 +34,26 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
Artist,
|
||||
[JsonProperty("album")]
|
||||
Album,
|
||||
[JsonProperty("track")]
|
||||
Track,
|
||||
[JsonProperty("photoalbum")]
|
||||
PhotoAlbum,
|
||||
[JsonProperty("photo")]
|
||||
Photo,
|
||||
[JsonProperty("collection")]
|
||||
Collection,
|
||||
}
|
||||
|
||||
public static class GetAllMediaLibraryLibraryTypeExtension
|
||||
public static class GetLibrarySectionsAllLibraryTypeExtension
|
||||
{
|
||||
public static string Value(this GetAllMediaLibraryLibraryType value)
|
||||
public static string Value(this GetLibrarySectionsAllLibraryType value)
|
||||
{
|
||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
||||
}
|
||||
|
||||
public static GetAllMediaLibraryLibraryType ToEnum(this string value)
|
||||
public static GetLibrarySectionsAllLibraryType ToEnum(this string value)
|
||||
{
|
||||
foreach(var field in typeof(GetAllMediaLibraryLibraryType).GetFields())
|
||||
foreach(var field in typeof(GetLibrarySectionsAllLibraryType).GetFields())
|
||||
{
|
||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
@@ -58,14 +66,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
var enumVal = field.GetValue(null);
|
||||
|
||||
if (enumVal is GetAllMediaLibraryLibraryType)
|
||||
if (enumVal is GetLibrarySectionsAllLibraryType)
|
||||
{
|
||||
return (GetAllMediaLibraryLibraryType)enumVal;
|
||||
return (GetLibrarySectionsAllLibraryType)enumVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Unknown value {value} for enum GetAllMediaLibraryLibraryType");
|
||||
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllLibraryType");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class GetAllMediaLibraryMedia
|
||||
public class GetLibrarySectionsAllMedia
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -119,7 +119,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||
/// </summary>
|
||||
[JsonProperty("optimizedForStreaming")]
|
||||
public GetAllMediaLibraryOptimizedForStreaming? OptimizedForStreaming { get; set; }
|
||||
public GetLibrarySectionsAllOptimizedForStreaming? OptimizedForStreaming { get; set; }
|
||||
|
||||
[JsonProperty("has64bitOffsets")]
|
||||
public bool? Has64bitOffsets { get; set; }
|
||||
@@ -128,6 +128,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// An array of parts for this media item.
|
||||
/// </summary>
|
||||
[JsonProperty("Part")]
|
||||
public List<GetAllMediaLibraryPart>? Part { get; set; }
|
||||
public List<GetLibrarySectionsAllPart>? Part { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class GetAllMediaLibraryMediaContainer
|
||||
public class GetLibrarySectionsAllMediaContainer
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -127,12 +127,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("Meta")]
|
||||
public GetAllMediaLibraryMeta? Meta { get; set; }
|
||||
public GetLibrarySectionsAllMeta? Meta { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An array of metadata items.
|
||||
/// </summary>
|
||||
[JsonProperty("Metadata")]
|
||||
public List<GetAllMediaLibraryMetadata>? Metadata { get; set; }
|
||||
public List<GetLibrarySectionsAllMetadata>? Metadata { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -21,13 +21,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class GetAllMediaLibraryMeta
|
||||
public class GetLibrarySectionsAllMeta
|
||||
{
|
||||
|
||||
[JsonProperty("Type")]
|
||||
public List<GetAllMediaLibraryType>? Type { get; set; }
|
||||
public List<GetLibrarySectionsAllType>? Type { get; set; }
|
||||
|
||||
[JsonProperty("FieldType")]
|
||||
public List<GetAllMediaLibraryFieldType>? FieldType { get; set; }
|
||||
public List<GetLibrarySectionsAllFieldType>? FieldType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class GetAllMediaLibraryMetadata
|
||||
public class GetLibrarySectionsAllMetadata
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -56,7 +56,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string? Studio { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public GetAllMediaLibraryLibraryType Type { get; set; } = default!;
|
||||
public GetLibrarySectionsAllLibraryType Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The title of the media item.
|
||||
@@ -344,33 +344,33 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public float? UserRating { get; set; }
|
||||
|
||||
[JsonProperty("Image")]
|
||||
public List<GetAllMediaLibraryImage>? Image { get; set; }
|
||||
public List<GetLibrarySectionsAllImage>? Image { get; set; }
|
||||
|
||||
[JsonProperty("UltraBlurColors")]
|
||||
public GetAllMediaLibraryUltraBlurColors? UltraBlurColors { get; set; }
|
||||
|
||||
[JsonProperty("Media")]
|
||||
public List<GetAllMediaLibraryMedia>? Media { get; set; }
|
||||
|
||||
[JsonProperty("Genre")]
|
||||
public List<GetAllMediaLibraryGenre>? Genre { get; set; }
|
||||
|
||||
[JsonProperty("Country")]
|
||||
public List<GetAllMediaLibraryCountry>? Country { get; set; }
|
||||
|
||||
[JsonProperty("Director")]
|
||||
public List<GetAllMediaLibraryDirector>? Director { get; set; }
|
||||
|
||||
[JsonProperty("Writer")]
|
||||
public List<GetAllMediaLibraryWriter>? Writer { get; set; }
|
||||
|
||||
[JsonProperty("Role")]
|
||||
public List<GetAllMediaLibraryRole>? Role { get; set; }
|
||||
public GetLibrarySectionsAllUltraBlurColors? UltraBlurColors { get; set; }
|
||||
|
||||
[JsonProperty("Guid")]
|
||||
public List<GetAllMediaLibraryGuids>? Guids { get; set; }
|
||||
public List<GetLibrarySectionsAllGuids>? Guids { get; set; }
|
||||
|
||||
[JsonProperty("Media")]
|
||||
public List<GetLibrarySectionsAllMedia>? Media { get; set; }
|
||||
|
||||
[JsonProperty("Genre")]
|
||||
public List<GetLibrarySectionsAllGenre>? Genre { get; set; }
|
||||
|
||||
[JsonProperty("Country")]
|
||||
public List<GetLibrarySectionsAllCountry>? Country { get; set; }
|
||||
|
||||
[JsonProperty("Director")]
|
||||
public List<GetLibrarySectionsAllDirector>? Director { get; set; }
|
||||
|
||||
[JsonProperty("Writer")]
|
||||
public List<GetLibrarySectionsAllWriter>? Writer { get; set; }
|
||||
|
||||
[JsonProperty("Role")]
|
||||
public List<GetLibrarySectionsAllRole>? Role { get; set; }
|
||||
|
||||
[JsonProperty("Collection")]
|
||||
public List<GetAllMediaLibraryCollection>? Collection { get; set; }
|
||||
public List<GetLibrarySectionsAllCollection>? Collection { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryOperator
|
||||
public class GetLibrarySectionsAllOperator
|
||||
{
|
||||
|
||||
[JsonProperty("key")]
|
||||
@@ -19,25 +19,25 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
public class GetAllMediaLibraryOptimizedForStreamingType
|
||||
public class GetLibrarySectionsAllOptimizedForStreamingType
|
||||
{
|
||||
private GetAllMediaLibraryOptimizedForStreamingType(string value) { Value = value; }
|
||||
private GetLibrarySectionsAllOptimizedForStreamingType(string value) { Value = value; }
|
||||
|
||||
public string Value { get; private set; }
|
||||
public static GetAllMediaLibraryOptimizedForStreamingType OptimizedForStreaming1 { get { return new GetAllMediaLibraryOptimizedForStreamingType("optimizedForStreaming_1"); } }
|
||||
public static GetLibrarySectionsAllOptimizedForStreamingType OptimizedForStreaming1 { get { return new GetLibrarySectionsAllOptimizedForStreamingType("optimizedForStreaming_1"); } }
|
||||
|
||||
public static GetAllMediaLibraryOptimizedForStreamingType Boolean { get { return new GetAllMediaLibraryOptimizedForStreamingType("boolean"); } }
|
||||
public static GetLibrarySectionsAllOptimizedForStreamingType Boolean { get { return new GetLibrarySectionsAllOptimizedForStreamingType("boolean"); } }
|
||||
|
||||
public static GetAllMediaLibraryOptimizedForStreamingType Null { get { return new GetAllMediaLibraryOptimizedForStreamingType("null"); } }
|
||||
public static GetLibrarySectionsAllOptimizedForStreamingType Null { get { return new GetLibrarySectionsAllOptimizedForStreamingType("null"); } }
|
||||
|
||||
public override string ToString() { return Value; }
|
||||
public static implicit operator String(GetAllMediaLibraryOptimizedForStreamingType v) { return v.Value; }
|
||||
public static GetAllMediaLibraryOptimizedForStreamingType FromString(string v) {
|
||||
public static implicit operator String(GetLibrarySectionsAllOptimizedForStreamingType v) { return v.Value; }
|
||||
public static GetLibrarySectionsAllOptimizedForStreamingType FromString(string v) {
|
||||
switch(v) {
|
||||
case "optimizedForStreaming_1": return OptimizedForStreaming1;
|
||||
case "boolean": return Boolean;
|
||||
case "null": return Null;
|
||||
default: throw new ArgumentException("Invalid value for GetAllMediaLibraryOptimizedForStreamingType");
|
||||
default: throw new ArgumentException("Invalid value for GetLibrarySectionsAllOptimizedForStreamingType");
|
||||
}
|
||||
}
|
||||
public override bool Equals(object? obj)
|
||||
@@ -46,7 +46,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Value.Equals(((GetAllMediaLibraryOptimizedForStreamingType)obj).Value);
|
||||
return Value.Equals(((GetLibrarySectionsAllOptimizedForStreamingType)obj).Value);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
@@ -59,9 +59,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// <summary>
|
||||
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(GetAllMediaLibraryOptimizedForStreaming.GetAllMediaLibraryOptimizedForStreamingConverter))]
|
||||
public class GetAllMediaLibraryOptimizedForStreaming {
|
||||
public GetAllMediaLibraryOptimizedForStreaming(GetAllMediaLibraryOptimizedForStreamingType type) {
|
||||
[JsonConverter(typeof(GetLibrarySectionsAllOptimizedForStreaming.GetLibrarySectionsAllOptimizedForStreamingConverter))]
|
||||
public class GetLibrarySectionsAllOptimizedForStreaming {
|
||||
public GetLibrarySectionsAllOptimizedForStreaming(GetLibrarySectionsAllOptimizedForStreamingType type) {
|
||||
Type = type;
|
||||
}
|
||||
|
||||
@@ -71,34 +71,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
[SpeakeasyMetadata("form:explode=true")]
|
||||
public bool? Boolean { get; set; }
|
||||
|
||||
public GetAllMediaLibraryOptimizedForStreamingType Type { get; set; }
|
||||
public GetLibrarySectionsAllOptimizedForStreamingType Type { get; set; }
|
||||
|
||||
|
||||
public static GetAllMediaLibraryOptimizedForStreaming CreateOptimizedForStreaming1(OptimizedForStreaming1 optimizedForStreaming1) {
|
||||
GetAllMediaLibraryOptimizedForStreamingType typ = GetAllMediaLibraryOptimizedForStreamingType.OptimizedForStreaming1;
|
||||
public static GetLibrarySectionsAllOptimizedForStreaming CreateOptimizedForStreaming1(OptimizedForStreaming1 optimizedForStreaming1) {
|
||||
GetLibrarySectionsAllOptimizedForStreamingType typ = GetLibrarySectionsAllOptimizedForStreamingType.OptimizedForStreaming1;
|
||||
|
||||
GetAllMediaLibraryOptimizedForStreaming res = new GetAllMediaLibraryOptimizedForStreaming(typ);
|
||||
GetLibrarySectionsAllOptimizedForStreaming res = new GetLibrarySectionsAllOptimizedForStreaming(typ);
|
||||
res.OptimizedForStreaming1 = optimizedForStreaming1;
|
||||
return res;
|
||||
}
|
||||
|
||||
public static GetAllMediaLibraryOptimizedForStreaming CreateBoolean(bool boolean) {
|
||||
GetAllMediaLibraryOptimizedForStreamingType typ = GetAllMediaLibraryOptimizedForStreamingType.Boolean;
|
||||
public static GetLibrarySectionsAllOptimizedForStreaming CreateBoolean(bool boolean) {
|
||||
GetLibrarySectionsAllOptimizedForStreamingType typ = GetLibrarySectionsAllOptimizedForStreamingType.Boolean;
|
||||
|
||||
GetAllMediaLibraryOptimizedForStreaming res = new GetAllMediaLibraryOptimizedForStreaming(typ);
|
||||
GetLibrarySectionsAllOptimizedForStreaming res = new GetLibrarySectionsAllOptimizedForStreaming(typ);
|
||||
res.Boolean = boolean;
|
||||
return res;
|
||||
}
|
||||
|
||||
public static GetAllMediaLibraryOptimizedForStreaming CreateNull() {
|
||||
GetAllMediaLibraryOptimizedForStreamingType typ = GetAllMediaLibraryOptimizedForStreamingType.Null;
|
||||
return new GetAllMediaLibraryOptimizedForStreaming(typ);
|
||||
public static GetLibrarySectionsAllOptimizedForStreaming CreateNull() {
|
||||
GetLibrarySectionsAllOptimizedForStreamingType typ = GetLibrarySectionsAllOptimizedForStreamingType.Null;
|
||||
return new GetLibrarySectionsAllOptimizedForStreaming(typ);
|
||||
}
|
||||
|
||||
public class GetAllMediaLibraryOptimizedForStreamingConverter : JsonConverter
|
||||
public class GetLibrarySectionsAllOptimizedForStreamingConverter : JsonConverter
|
||||
{
|
||||
|
||||
public override bool CanConvert(System.Type objectType) => objectType == typeof(GetAllMediaLibraryOptimizedForStreaming);
|
||||
public override bool CanConvert(System.Type objectType) => objectType == typeof(GetLibrarySectionsAllOptimizedForStreaming);
|
||||
|
||||
public override bool CanRead => true;
|
||||
|
||||
@@ -114,14 +114,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
|
||||
try
|
||||
{
|
||||
return new GetAllMediaLibraryOptimizedForStreaming(GetAllMediaLibraryOptimizedForStreamingType.OptimizedForStreaming1)
|
||||
return new GetLibrarySectionsAllOptimizedForStreaming(GetLibrarySectionsAllOptimizedForStreamingType.OptimizedForStreaming1)
|
||||
{
|
||||
OptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<OptimizedForStreaming1>(json)
|
||||
};
|
||||
}
|
||||
catch (ResponseBodyDeserializer.MissingMemberException)
|
||||
{
|
||||
fallbackCandidates.Add((typeof(OptimizedForStreaming1), new GetAllMediaLibraryOptimizedForStreaming(GetAllMediaLibraryOptimizedForStreamingType.OptimizedForStreaming1), "OptimizedForStreaming1"));
|
||||
fallbackCandidates.Add((typeof(OptimizedForStreaming1), new GetLibrarySectionsAllOptimizedForStreaming(GetLibrarySectionsAllOptimizedForStreamingType.OptimizedForStreaming1), "OptimizedForStreaming1"));
|
||||
}
|
||||
catch (ResponseBodyDeserializer.DeserializationException)
|
||||
{
|
||||
@@ -135,7 +135,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
try
|
||||
{
|
||||
var converted = Convert.ToBoolean(json);
|
||||
return new GetAllMediaLibraryOptimizedForStreaming(GetAllMediaLibraryOptimizedForStreamingType.Boolean)
|
||||
return new GetLibrarySectionsAllOptimizedForStreaming(GetLibrarySectionsAllOptimizedForStreamingType.Boolean)
|
||||
{
|
||||
Boolean = converted
|
||||
};
|
||||
@@ -174,8 +174,8 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
writer.WriteRawValue("null");
|
||||
return;
|
||||
}
|
||||
GetAllMediaLibraryOptimizedForStreaming res = (GetAllMediaLibraryOptimizedForStreaming)value;
|
||||
if (GetAllMediaLibraryOptimizedForStreamingType.FromString(res.Type).Equals(GetAllMediaLibraryOptimizedForStreamingType.Null))
|
||||
GetLibrarySectionsAllOptimizedForStreaming res = (GetLibrarySectionsAllOptimizedForStreaming)value;
|
||||
if (GetLibrarySectionsAllOptimizedForStreamingType.FromString(res.Type).Equals(GetLibrarySectionsAllOptimizedForStreamingType.Null))
|
||||
{
|
||||
writer.WriteRawValue("null");
|
||||
return;
|
||||
@@ -11,7 +11,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
|
||||
public enum GetAllMediaLibraryOptimizedForStreaming1
|
||||
public enum GetLibrarySectionsAllOptimizedForStreaming1
|
||||
{
|
||||
Zero = 0,
|
||||
One = 1,
|
||||
@@ -15,7 +15,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class GetAllMediaLibraryPart
|
||||
public class GetLibrarySectionsAllPart
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -91,15 +91,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
|
||||
/// </summary>
|
||||
[JsonProperty("optimizedForStreaming")]
|
||||
public GetAllMediaLibraryLibraryOptimizedForStreaming? OptimizedForStreaming { get; set; }
|
||||
public GetLibrarySectionsAllLibraryOptimizedForStreaming? OptimizedForStreaming { get; set; }
|
||||
|
||||
[JsonProperty("hasThumbnail")]
|
||||
public GetAllMediaLibraryHasThumbnail? HasThumbnail { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetAllMediaLibraryHasThumbnail.False;
|
||||
public GetLibrarySectionsAllHasThumbnail? HasThumbnail { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibrarySectionsAllHasThumbnail.False;
|
||||
|
||||
/// <summary>
|
||||
/// An array of streams for this part.
|
||||
/// </summary>
|
||||
[JsonProperty("Stream")]
|
||||
public List<GetAllMediaLibraryStream>? Stream { get; set; }
|
||||
public List<GetLibrarySectionsAllStream>? Stream { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public enum GetAllMediaLibraryQueryParamIncludeMeta
|
||||
public enum GetLibrarySectionsAllQueryParamIncludeMeta
|
||||
{
|
||||
Disable = 0,
|
||||
Enable = 1,
|
||||
@@ -23,15 +23,17 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public enum GetAllMediaLibraryQueryParamType
|
||||
public enum GetLibrarySectionsAllQueryParamType
|
||||
{
|
||||
Movie = 1,
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
|
||||
public class GetAllMediaLibraryRequest
|
||||
public class GetLibrarySectionsAllRequest
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
|
||||
public GetAllMediaLibraryQueryParamType Type { get; set; } = default!;
|
||||
public GetLibrarySectionsAllQueryParamType Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the Meta object to the response<br/>
|
||||
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeMeta")]
|
||||
public GetAllMediaLibraryQueryParamIncludeMeta? IncludeMeta { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetAllMediaLibraryQueryParamIncludeMeta.Disable;
|
||||
public GetLibrarySectionsAllQueryParamIncludeMeta? IncludeMeta { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibrarySectionsAllQueryParamIncludeMeta.Disable;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the Guid object to the response<br/>
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
|
||||
public class GetAllMediaLibraryResponse
|
||||
public class GetLibrarySectionsAllResponse
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -35,6 +35,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// <summary>
|
||||
/// Successful response containing media container data.
|
||||
/// </summary>
|
||||
public GetAllMediaLibraryResponseBody? Object { get; set; }
|
||||
public GetLibrarySectionsAllResponseBody? Object { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,10 +16,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// <summary>
|
||||
/// Successful response containing media container data.
|
||||
/// </summary>
|
||||
public class GetAllMediaLibraryResponseBody
|
||||
public class GetLibrarySectionsAllResponseBody
|
||||
{
|
||||
|
||||
[JsonProperty("MediaContainer")]
|
||||
public GetAllMediaLibraryMediaContainer? MediaContainer { get; set; }
|
||||
public GetLibrarySectionsAllMediaContainer? MediaContainer { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryRole
|
||||
public class GetLibrarySectionsAllRole
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -13,7 +13,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibrarySort
|
||||
public class GetLibrarySectionsAllSort
|
||||
{
|
||||
|
||||
[JsonProperty("default")]
|
||||
@@ -30,7 +30,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("activeDirection")]
|
||||
public GetAllMediaLibraryActiveDirection? ActiveDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetAllMediaLibraryActiveDirection.Ascending;
|
||||
public GetLibrarySectionsAllActiveDirection? ActiveDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibrarySectionsAllActiveDirection.Ascending;
|
||||
|
||||
/// <summary>
|
||||
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
|
||||
@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("defaultDirection")]
|
||||
public GetAllMediaLibraryDefaultDirection? DefaultDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetAllMediaLibraryDefaultDirection.Ascending;
|
||||
public GetLibrarySectionsAllDefaultDirection? DefaultDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibrarySectionsAllDefaultDirection.Ascending;
|
||||
|
||||
[JsonProperty("descKey")]
|
||||
public string? DescKey { get; set; }
|
||||
@@ -13,7 +13,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryStream
|
||||
public class GetLibrarySectionsAllStream
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -33,7 +33,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("streamType")]
|
||||
public GetAllMediaLibraryStreamType StreamType { get; set; } = default!;
|
||||
public GetLibrarySectionsAllStreamType StreamType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Format of the stream (e.g., srt).
|
||||
@@ -21,7 +21,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public enum GetAllMediaLibraryStreamType
|
||||
public enum GetLibrarySectionsAllStreamType
|
||||
{
|
||||
Video = 1,
|
||||
Audio = 2,
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class GetAllMediaLibraryType
|
||||
public class GetLibrarySectionsAllType
|
||||
{
|
||||
|
||||
[JsonProperty("key")]
|
||||
@@ -33,12 +33,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public bool Active { get; set; } = default!;
|
||||
|
||||
[JsonProperty("Filter")]
|
||||
public List<GetAllMediaLibraryFilter>? Filter { get; set; }
|
||||
public List<GetLibrarySectionsAllFilter>? Filter { get; set; }
|
||||
|
||||
[JsonProperty("Sort")]
|
||||
public List<GetAllMediaLibrarySort>? Sort { get; set; }
|
||||
public List<GetLibrarySectionsAllSort>? Sort { get; set; }
|
||||
|
||||
[JsonProperty("Field")]
|
||||
public List<GetAllMediaLibraryField>? Field { get; set; }
|
||||
public List<GetLibrarySectionsAllField>? Field { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryUltraBlurColors
|
||||
public class GetLibrarySectionsAllUltraBlurColors
|
||||
{
|
||||
|
||||
[JsonProperty("topLeft")]
|
||||
@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class GetAllMediaLibraryWriter
|
||||
public class GetLibrarySectionsAllWriter
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -18,6 +18,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class GetMediaMetaDataCountry
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier for the country.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
@@ -28,6 +36,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Tag { get; set; } = default!;
|
||||
|
||||
[JsonProperty("filter")]
|
||||
public string? Filter { get; set; }
|
||||
public string Filter { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -34,13 +34,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Filter { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// A unique key associated with the director's tag, used for internal identification.
|
||||
/// A unique 24-character hexadecimal key associated with the director's tag, used for internal identification.
|
||||
/// </summary>
|
||||
[JsonProperty("tagKey")]
|
||||
public string? TagKey { get; set; }
|
||||
public string TagKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The URL of the thumbnail image for the director.
|
||||
/// The absolute URL of the thumbnail image for the director.
|
||||
/// </summary>
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
|
||||
@@ -18,8 +18,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class GetMediaMetaDataGenre
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier for the genre.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; } = default!;
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The genre name of this media-item<br/>
|
||||
|
||||
@@ -16,7 +16,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The GUID value.
|
||||
/// The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; } = default!;
|
||||
|
||||
@@ -367,6 +367,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
[JsonProperty("librarySectionKey")]
|
||||
public string LibrarySectionKey { get; set; } = default!;
|
||||
|
||||
[JsonProperty("Guid")]
|
||||
public List<GetMediaMetaDataGuids>? Guids { get; set; }
|
||||
|
||||
[JsonProperty("Media")]
|
||||
public List<GetMediaMetaDataMedia>? Media { get; set; }
|
||||
|
||||
@@ -388,9 +391,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
[JsonProperty("Role")]
|
||||
public List<GetMediaMetaDataRole>? Role { get; set; }
|
||||
|
||||
[JsonProperty("Guid")]
|
||||
public List<GetMediaMetaDataGuids>? Guids { get; set; }
|
||||
|
||||
[JsonProperty("Rating")]
|
||||
public List<Ratings>? Ratings { get; set; }
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// the id of the library item to return the children of.
|
||||
/// The id(s) of the library item(s) to return metadata for. Can be a single ID or comma-separated list of IDs.
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")]
|
||||
public long RatingKey { get; set; } = default!;
|
||||
public string RatingKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Include concerts data if set to true.
|
||||
|
||||
@@ -16,10 +16,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Unique identifier for the actor or role.
|
||||
/// The unique identifier for the role.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; } = default!;
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The display tag for the actor (typically the actor's name).
|
||||
@@ -40,13 +45,18 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Filter { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// A unique key associated with the actor's tag, used for internal identification.
|
||||
/// A 24-character hexadecimal unique key associated with the actor's tag, used for internal identification.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// NOTE: This is globally unique across all Plex Servers.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("tagKey")]
|
||||
public string? TagKey { get; set; }
|
||||
public string TagKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The URL of the thumbnail image for the actor.
|
||||
/// The absolute URL of the thumbnail image for the actor.
|
||||
/// </summary>
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// The type of media content<br/>
|
||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
@@ -34,6 +34,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
Artist,
|
||||
[JsonProperty("album")]
|
||||
Album,
|
||||
[JsonProperty("track")]
|
||||
Track,
|
||||
[JsonProperty("photoalbum")]
|
||||
PhotoAlbum,
|
||||
[JsonProperty("photo")]
|
||||
Photo,
|
||||
[JsonProperty("collection")]
|
||||
Collection,
|
||||
}
|
||||
|
||||
public static class GetMediaMetaDataTypeExtension
|
||||
|
||||
@@ -34,13 +34,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Filter { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The URL of the thumbnail image for the writer.
|
||||
/// The absolute URL of the thumbnail image for the writer.
|
||||
/// </summary>
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A unique key associated with the writers tag, used for internal identification.
|
||||
/// A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification.
|
||||
/// </summary>
|
||||
[JsonProperty("tagKey")]
|
||||
public string? TagKey { get; set; }
|
||||
|
||||
@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// The type of media content<br/>
|
||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
@@ -34,6 +34,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
Artist,
|
||||
[JsonProperty("album")]
|
||||
Album,
|
||||
[JsonProperty("track")]
|
||||
Track,
|
||||
[JsonProperty("photoalbum")]
|
||||
PhotoAlbum,
|
||||
[JsonProperty("photo")]
|
||||
Photo,
|
||||
[JsonProperty("collection")]
|
||||
Collection,
|
||||
}
|
||||
|
||||
public static class GetRecentlyAddedHubsTypeExtension
|
||||
|
||||
@@ -391,6 +391,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
[JsonProperty("UltraBlurColors")]
|
||||
public UltraBlurColors? UltraBlurColors { get; set; }
|
||||
|
||||
[JsonProperty("Guid")]
|
||||
public List<Guids>? Guids { get; set; }
|
||||
|
||||
[JsonProperty("Media")]
|
||||
public List<Models.Requests.Media>? Media { get; set; }
|
||||
|
||||
@@ -421,9 +424,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
[JsonProperty("Location")]
|
||||
public List<Location>? Location { get; set; }
|
||||
|
||||
[JsonProperty("Guid")]
|
||||
public List<Guids>? Guids { get; set; }
|
||||
|
||||
[JsonProperty("Collection")]
|
||||
public List<Collection>? Collection { get; set; }
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string? LibrarySectionKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of media content<br/>
|
||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// The type of media content<br/>
|
||||
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
@@ -34,6 +34,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
Artist,
|
||||
[JsonProperty("album")]
|
||||
Album,
|
||||
[JsonProperty("track")]
|
||||
Track,
|
||||
[JsonProperty("photoalbum")]
|
||||
PhotoAlbum,
|
||||
[JsonProperty("photo")]
|
||||
Photo,
|
||||
[JsonProperty("collection")]
|
||||
Collection,
|
||||
}
|
||||
|
||||
public static class GetSearchAllLibrariesTypeExtension
|
||||
|
||||
@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,20 +17,35 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class GetTopWatchedContentMediaContainer
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Number of media items returned in this response.
|
||||
/// </summary>
|
||||
[JsonProperty("size")]
|
||||
public int? Size { get; set; }
|
||||
public int Size { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether syncing is allowed.
|
||||
/// </summary>
|
||||
[JsonProperty("allowSync")]
|
||||
public bool? AllowSync { get; set; }
|
||||
public bool AllowSync { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// An plugin identifier for the media container.
|
||||
/// </summary>
|
||||
[JsonProperty("identifier")]
|
||||
public string? Identifier { get; set; }
|
||||
public string Identifier { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The prefix used for media tag resource paths.
|
||||
/// </summary>
|
||||
[JsonProperty("mediaTagPrefix")]
|
||||
public string? MediaTagPrefix { get; set; }
|
||||
public string MediaTagPrefix { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The version number for media tags.
|
||||
/// </summary>
|
||||
[JsonProperty("mediaTagVersion")]
|
||||
public int? MediaTagVersion { get; set; }
|
||||
public long MediaTagVersion { get; set; } = default!;
|
||||
|
||||
[JsonProperty("Metadata")]
|
||||
public List<GetTopWatchedContentMetadata>? Metadata { get; set; }
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the Guid object to the response<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public enum GetTopWatchedContentQueryParamIncludeGuids
|
||||
{
|
||||
Disable = 0,
|
||||
Enable = 1,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,16 +15,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class GetTopWatchedContentRequest
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Adds the Guids object to the response<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids")]
|
||||
public long? IncludeGuids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of media to retrieve or filter by.<br/>
|
||||
///
|
||||
@@ -39,5 +29,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
|
||||
public GetTopWatchedContentQueryParamType Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the Guid object to the response<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids")]
|
||||
public GetTopWatchedContentQueryParamIncludeGuids? IncludeGuids { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetTopWatchedContentQueryParamIncludeGuids.Disable;
|
||||
}
|
||||
}
|
||||
@@ -16,13 +16,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier for the Guid. Can be imdb://tt0286347, tmdb://1763, tvdb://2337<br/>
|
||||
/// The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
public string Id { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -34,13 +34,17 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Tag { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// A unique key associated with the producer's tag, used for internal identification.
|
||||
/// A 24-character hexadecimal unique key associated with the producer's tag, used for internal identification.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("tagKey")]
|
||||
public string? TagKey { get; set; }
|
||||
public string TagKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The URL of the thumbnail image for the actor.
|
||||
/// The absolute URL of the thumbnail image for the producer.
|
||||
/// </summary>
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
|
||||
@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,11 +18,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class Rating
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The URL for the rating image, for example from IMDb.
|
||||
/// </summary>
|
||||
[JsonProperty("image")]
|
||||
public string Image { get; set; } = default!;
|
||||
|
||||
[JsonProperty("value")]
|
||||
public double Value { get; set; } = default!;
|
||||
public float Value { get; set; } = default!;
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; } = default!;
|
||||
|
||||
@@ -16,10 +16,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Unique identifier for the actor or role.
|
||||
/// The unique identifier for the role.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; } = default!;
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
|
||||
@@ -34,10 +39,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Tag { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// A unique key associated with the actor's tag, used for internal identification.
|
||||
/// A 24-character hexadecimal unique key associated with the actor's tag, used for internal identification.<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// NOTE: This is globally unique across all Plex Servers.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[JsonProperty("tagKey")]
|
||||
public string? TagKey { get; set; }
|
||||
public string TagKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The role played by the actor in the media item.
|
||||
@@ -46,7 +56,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string? RoleValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The URL of the thumbnail image for the actor.
|
||||
/// The absolute URL of the thumbnail image for the actor.
|
||||
/// </summary>
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; } = default!;
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
[JsonProperty("filter")]
|
||||
public string Filter { get; set; } = default!;
|
||||
|
||||
@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
TvShow = 2,
|
||||
Season = 3,
|
||||
Episode = 4,
|
||||
Audio = 8,
|
||||
Album = 9,
|
||||
Track = 10,
|
||||
Artist = 5,
|
||||
Album = 6,
|
||||
Track = 7,
|
||||
PhotoAlbum = 8,
|
||||
Photo = 9,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,9 +34,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Tag { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// A unique key associated with the writers tag, used for internal identification.
|
||||
/// A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification.
|
||||
/// </summary>
|
||||
[JsonProperty("tagKey")]
|
||||
public string? TagKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The absolute URL of the thumbnail image for the writer.
|
||||
/// </summary>
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -146,19 +146,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Playlists(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Playlists(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -168,21 +161,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "createPlaylist", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createPlaylist", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -273,21 +266,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getPlaylists", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getPlaylists", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -377,21 +370,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getPlaylist", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getPlaylist", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -481,21 +474,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "deletePlaylist", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "deletePlaylist", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -579,21 +572,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Put, 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(baseUrl, "updatePlaylist", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "updatePlaylist", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -676,21 +669,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}/items", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getPlaylistContents", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getPlaylistContents", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -780,21 +773,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}/items", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "clearPlaylistContents", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "clearPlaylistContents", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -878,21 +871,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/{playlistID}/items", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Put, 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(baseUrl, "addPlaylistContents", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "addPlaylistContents", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -984,21 +977,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists/upload", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "uploadPlaylist", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "uploadPlaylist", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -143,19 +143,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
};
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Plex(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Plex(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -171,21 +164,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/companions";
|
||||
|
||||
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(baseUrl, "getCompanionsData", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getCompanionsData", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -277,21 +270,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/friends";
|
||||
|
||||
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(baseUrl, "getUserFriends", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getUserFriends", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -383,16 +376,16 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/geoip";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getGeoData", new List<string> { }, null);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getGeoData", new List<string> { }, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -479,21 +472,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/home";
|
||||
|
||||
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(baseUrl, "getHomeData", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getHomeData", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -591,22 +584,22 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/resources", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-server-resources", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-server-resources", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -697,17 +690,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/pins", request);
|
||||
|
||||
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 hookCtx = new HookContext(baseUrl, "getPin", new List<string> { }, null);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getPin", new List<string> { }, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -787,17 +780,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/pins/{pinID}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getTokenByPinId", new List<string> { }, null);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTokenByPinId", new List<string> { }, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -255,41 +255,6 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
public IUsers Users { get; }
|
||||
}
|
||||
|
||||
public class SDKConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// List of server URLs available to the SDK.
|
||||
/// </summary>
|
||||
public static readonly string[] ServerList = {
|
||||
"https://10.10.10.47:32400",
|
||||
};
|
||||
|
||||
public string ServerUrl = "";
|
||||
public int ServerIndex = 0;
|
||||
public List<Dictionary<string, string>> ServerDefaults = new List<Dictionary<string, string>>();
|
||||
public SDKHooks Hooks = new SDKHooks();
|
||||
public RetryConfig? RetryConfig = null;
|
||||
|
||||
public string GetTemplatedServerUrl()
|
||||
{
|
||||
if (!String.IsNullOrEmpty(this.ServerUrl))
|
||||
{
|
||||
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary<string, string>());
|
||||
}
|
||||
return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], this.ServerDefaults[this.ServerIndex]);
|
||||
}
|
||||
|
||||
public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client)
|
||||
{
|
||||
string preHooksUrl = GetTemplatedServerUrl();
|
||||
var (postHooksUrl, postHooksClient) = this.Hooks.SDKInit(preHooksUrl, client);
|
||||
if (preHooksUrl != postHooksUrl)
|
||||
{
|
||||
this.ServerUrl = postHooksUrl;
|
||||
}
|
||||
return postHooksClient;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
@@ -327,14 +292,9 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private int _serverIndex = 0;
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
public IServer Server { get; private set; }
|
||||
public IMedia Media { get; private set; }
|
||||
public IVideo Video { get; private set; }
|
||||
@@ -353,6 +313,46 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
public IUpdater Updater { get; private set; }
|
||||
public IUsers Users { get; private set; }
|
||||
|
||||
public PlexAPI(SDKConfig config)
|
||||
{
|
||||
SDKConfiguration = config;
|
||||
InitHooks();
|
||||
|
||||
Server = new Server(SDKConfiguration);
|
||||
|
||||
Media = new Media(SDKConfiguration);
|
||||
|
||||
Video = new Video(SDKConfiguration);
|
||||
|
||||
Activities = new Activities(SDKConfiguration);
|
||||
|
||||
Butler = new Butler(SDKConfiguration);
|
||||
|
||||
Plex = new Plex(SDKConfiguration);
|
||||
|
||||
Hubs = new Hubs(SDKConfiguration);
|
||||
|
||||
Search = new Search(SDKConfiguration);
|
||||
|
||||
Library = new Library(SDKConfiguration);
|
||||
|
||||
Watchlist = new Watchlist(SDKConfiguration);
|
||||
|
||||
Log = new Log(SDKConfiguration);
|
||||
|
||||
Playlists = new Playlists(SDKConfiguration);
|
||||
|
||||
Authentication = new Authentication(SDKConfiguration);
|
||||
|
||||
Statistics = new Statistics(SDKConfiguration);
|
||||
|
||||
Sessions = new Sessions(SDKConfiguration);
|
||||
|
||||
Updater = new Updater(SDKConfiguration);
|
||||
|
||||
Users = new Users(SDKConfiguration);
|
||||
}
|
||||
|
||||
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
if (serverIndex != null)
|
||||
@@ -361,7 +361,6 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
throw new Exception($"Invalid server index {serverIndex.Value}");
|
||||
}
|
||||
_serverIndex = serverIndex.Value;
|
||||
}
|
||||
|
||||
if (serverUrl != null)
|
||||
@@ -370,19 +369,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
serverUrl = Utilities.TemplateUrl(serverUrl, urlParams);
|
||||
}
|
||||
_serverUrl = serverUrl;
|
||||
}
|
||||
List<Dictionary<string, string>> serverDefaults = new List<Dictionary<string, string>>()
|
||||
{
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"protocol", protocol == null ? "https" : ServerProtocolExtension.Value(protocol.Value)},
|
||||
{"ip", ip == null ? "10.10.10.47" : ip},
|
||||
{"port", port == null ? "32400" : port},
|
||||
},
|
||||
};
|
||||
|
||||
_client = client ?? new SpeakeasyHttpClient();
|
||||
Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource = null;
|
||||
|
||||
if(accessTokenSource != null)
|
||||
{
|
||||
@@ -393,66 +381,154 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
_securitySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { AccessToken = accessToken };
|
||||
}
|
||||
|
||||
SDKConfiguration = new SDKConfig()
|
||||
SDKConfiguration = new SDKConfig(client)
|
||||
{
|
||||
ServerDefaults = serverDefaults,
|
||||
ServerIndex = _serverIndex,
|
||||
ServerUrl = _serverUrl,
|
||||
ServerIndex = serverIndex == null ? 0 : serverIndex.Value,
|
||||
ServerUrl = serverUrl == null ? "" : serverUrl,
|
||||
SecuritySource = _securitySource,
|
||||
RetryConfig = retryConfig
|
||||
};
|
||||
|
||||
_client = SDKConfiguration.InitHooks(_client);
|
||||
if (protocol != null)
|
||||
{
|
||||
SDKConfiguration.SetServerVariable("protocol", ServerProtocolExtension.Value(protocol.Value));
|
||||
}
|
||||
|
||||
if (ip != null)
|
||||
{
|
||||
SDKConfiguration.SetServerVariable("ip", ip);
|
||||
}
|
||||
|
||||
Server = new Server(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
if (port != null)
|
||||
{
|
||||
SDKConfiguration.SetServerVariable("port", port);
|
||||
}
|
||||
|
||||
InitHooks();
|
||||
|
||||
Media = new Media(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Server = new Server(SDKConfiguration);
|
||||
|
||||
Media = new Media(SDKConfiguration);
|
||||
|
||||
Video = new Video(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Video = new Video(SDKConfiguration);
|
||||
|
||||
Activities = new Activities(SDKConfiguration);
|
||||
|
||||
Activities = new Activities(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Butler = new Butler(SDKConfiguration);
|
||||
|
||||
Plex = new Plex(SDKConfiguration);
|
||||
|
||||
Butler = new Butler(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Hubs = new Hubs(SDKConfiguration);
|
||||
|
||||
Search = new Search(SDKConfiguration);
|
||||
|
||||
Plex = new Plex(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Library = new Library(SDKConfiguration);
|
||||
|
||||
Watchlist = new Watchlist(SDKConfiguration);
|
||||
|
||||
Hubs = new Hubs(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Log = new Log(SDKConfiguration);
|
||||
|
||||
Playlists = new Playlists(SDKConfiguration);
|
||||
|
||||
Search = new Search(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Authentication = new Authentication(SDKConfiguration);
|
||||
|
||||
Statistics = new Statistics(SDKConfiguration);
|
||||
|
||||
Library = new Library(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Sessions = new Sessions(SDKConfiguration);
|
||||
|
||||
Updater = new Updater(SDKConfiguration);
|
||||
|
||||
Watchlist = new Watchlist(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Log = new Log(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Playlists = new Playlists(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Authentication = new Authentication(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Statistics = new Statistics(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Sessions = new Sessions(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Updater = new Updater(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
|
||||
|
||||
Users = new Users(_client, _securitySource, _serverUrl, SDKConfiguration);
|
||||
Users = new Users(SDKConfiguration);
|
||||
}
|
||||
|
||||
private void InitHooks()
|
||||
{
|
||||
string preHooksUrl = SDKConfiguration.GetTemplatedServerUrl();
|
||||
var (postHooksUrl, postHooksClient) = SDKConfiguration.Hooks.SDKInit(preHooksUrl, SDKConfiguration.Client);
|
||||
var config = SDKConfiguration;
|
||||
if (preHooksUrl != postHooksUrl)
|
||||
{
|
||||
config.ServerUrl = postHooksUrl;
|
||||
}
|
||||
config.Client = postHooksClient;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public class SDKBuilder
|
||||
{
|
||||
private SDKConfig _sdkConfig = new SDKConfig(client: new SpeakeasyHttpClient());
|
||||
|
||||
public SDKBuilder() { }
|
||||
|
||||
public SDKBuilder WithServerIndex(int serverIndex)
|
||||
{
|
||||
if (serverIndex < 0 || serverIndex >= SDKConfig.ServerList.Length)
|
||||
{
|
||||
throw new Exception($"Invalid server index {serverIndex}");
|
||||
}
|
||||
_sdkConfig.ServerIndex = serverIndex;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithProtocol(ServerProtocol protocol)
|
||||
{
|
||||
_sdkConfig.SetServerVariable("protocol", ServerProtocolExtension.Value(protocol));
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithIp(string ip)
|
||||
{
|
||||
_sdkConfig.SetServerVariable("ip", ip);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithPort(string port)
|
||||
{
|
||||
_sdkConfig.SetServerVariable("port", port);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithServerUrl(string serverUrl, Dictionary<string, string>? serverVariables = null)
|
||||
{
|
||||
if (serverVariables != null)
|
||||
{
|
||||
serverUrl = Utilities.TemplateUrl(serverUrl, serverVariables);
|
||||
}
|
||||
_sdkConfig.ServerUrl = serverUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithAccessTokenSource(Func<string> accessTokenSource)
|
||||
{
|
||||
_sdkConfig.SecuritySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { AccessToken = accessTokenSource() };
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithAccessToken(string accessToken)
|
||||
{
|
||||
_sdkConfig.SecuritySource = () => new LukeHagar.PlexAPI.SDK.Models.Components.Security() { AccessToken = accessToken };
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithClient(ISpeakeasyHttpClient client)
|
||||
{
|
||||
_sdkConfig.Client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDKBuilder WithRetryConfig(RetryConfig retryConfig)
|
||||
{
|
||||
_sdkConfig.RetryConfig = retryConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PlexAPI Build()
|
||||
{
|
||||
return new PlexAPI(_sdkConfig);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static SDKBuilder Builder() => new SDKBuilder();
|
||||
}
|
||||
}
|
||||
78
LukeHagar/PlexAPI/SDK/SDKConfig.cs
Normal file
78
LukeHagar/PlexAPI/SDK/SDKConfig.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Hooks;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using LukeHagar.PlexAPI.SDK.Utils.Retries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public struct SDKConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// List of server URLs available to the SDK.
|
||||
/// </summary>
|
||||
public static readonly string[] ServerList = {
|
||||
"{protocol}://{ip}:{port}",
|
||||
};
|
||||
|
||||
public ISpeakeasyHttpClient Client;
|
||||
public string ServerUrl;
|
||||
public int ServerIndex;
|
||||
public List<Dictionary<string, string>> ServerVariables;
|
||||
public string UserAgent;
|
||||
public Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? SecuritySource;
|
||||
public SDKHooks Hooks;
|
||||
public RetryConfig? RetryConfig;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the SDKConfig struct with default values.
|
||||
/// </summary>
|
||||
public SDKConfig(ISpeakeasyHttpClient? client = null)
|
||||
{
|
||||
Client = client ?? new SpeakeasyHttpClient();
|
||||
ServerUrl = "";
|
||||
ServerIndex = 0;
|
||||
ServerVariables = new List<Dictionary<string, string>>()
|
||||
{
|
||||
new Dictionary<string, string>()
|
||||
{
|
||||
{"protocol", "https"},
|
||||
{"ip", "10.10.10.47"},
|
||||
{"port", "32400"},
|
||||
},
|
||||
};
|
||||
UserAgent = "speakeasy-sdk/csharp 0.15.0 2.620.2 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
SecuritySource = null;
|
||||
Hooks = new SDKHooks();
|
||||
RetryConfig = null;
|
||||
}
|
||||
|
||||
public void SetServerVariable(string key, string value)
|
||||
{
|
||||
foreach (var serverVariables in this.ServerVariables.Where(dict => dict.ContainsKey(key)))
|
||||
{
|
||||
serverVariables[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetTemplatedServerUrl()
|
||||
{
|
||||
if (!String.IsNullOrEmpty(this.ServerUrl))
|
||||
{
|
||||
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary<string, string>());
|
||||
}
|
||||
return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], this.ServerVariables[this.ServerIndex]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,19 +87,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Search(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Search(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -115,21 +108,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/search", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "performSearch", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "performSearch", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -213,21 +206,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/search/voice", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "performVoiceSearch", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "performVoiceSearch", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -309,21 +302,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/search", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getSearchResults", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSearchResults", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -126,19 +126,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Server(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Server(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -149,21 +142,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/";
|
||||
|
||||
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(baseUrl, "getServerCapabilities", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerCapabilities", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -250,21 +243,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/:/prefs";
|
||||
|
||||
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(baseUrl, "getServerPreferences", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerPreferences", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -351,21 +344,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/clients";
|
||||
|
||||
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(baseUrl, "getAvailableClients", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getAvailableClients", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -452,21 +445,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/devices";
|
||||
|
||||
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(baseUrl, "getDevices", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getDevices", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -553,16 +546,16 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/identity";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-server-identity", new List<string> { }, null);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-server-identity", new List<string> { }, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 408 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -638,21 +631,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/myplex/account";
|
||||
|
||||
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(baseUrl, "getMyPlexAccount", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getMyPlexAccount", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -738,21 +731,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/photo/:/transcode", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getResizedPhoto", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getResizedPhoto", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -835,22 +828,22 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/media/providers";
|
||||
|
||||
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(baseUrl, "get-media-providers", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-media-providers", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -937,21 +930,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/servers";
|
||||
|
||||
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(baseUrl, "getServerList", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerList", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -80,19 +80,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Sessions(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Sessions(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -103,21 +96,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/status/sessions";
|
||||
|
||||
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(baseUrl, "getSessions", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSessions", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -210,21 +203,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/status/sessions/history/all", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getSessionHistory", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSessionHistory", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -311,21 +304,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/transcode/sessions";
|
||||
|
||||
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(baseUrl, "getTranscodeSessions", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTranscodeSessions", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -415,21 +408,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/transcode/sessions/{sessionKey}", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "stopTranscodeSession", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopTranscodeSession", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -71,19 +71,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Statistics(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Statistics(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -97,21 +90,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/statistics/media", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getStatistics", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getStatistics", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -201,21 +194,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/statistics/resources", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getResourcesStatistics", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getResourcesStatistics", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -305,21 +298,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/statistics/bandwidth", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getBandwidthStatistics", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getBandwidthStatistics", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -74,19 +74,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Updater(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Updater(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -97,21 +90,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/updater/status";
|
||||
|
||||
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(baseUrl, "getUpdateStatus", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getUpdateStatus", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -201,21 +194,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/updater/check", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Put, 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(baseUrl, "checkForUpdates", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "checkForUpdates", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -298,21 +291,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/updater/apply", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Put, 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(baseUrl, "applyUpdates", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "applyUpdates", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -45,19 +45,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
};
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Users(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Users(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -73,17 +66,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = baseUrl + "/users";
|
||||
|
||||
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);
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "get-users", new List<string> { }, null);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-users", new List<string> { }, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -62,19 +62,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.14.11";
|
||||
private const string _sdkGenVersion = "2.597.9";
|
||||
private const string _sdkVersion = "0.15.0";
|
||||
private const string _sdkGenVersion = "2.620.2";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.14.11 2.597.9 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
|
||||
public Video(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
|
||||
public Video(SDKConfig config)
|
||||
{
|
||||
_client = client;
|
||||
_securitySource = securitySource;
|
||||
_serverUrl = serverUrl;
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
@@ -84,21 +77,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/:/timeline", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "getTimeline", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTimeline", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -176,21 +169,21 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var urlString = URLBuilder.Build(baseUrl, "/video/:/transcode/universal/start.mpd", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
|
||||
|
||||
if (_securitySource != null)
|
||||
if (SDKConfiguration.SecuritySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext(baseUrl, "startUniversalTranscode", new List<string> { }, _securitySource);
|
||||
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startUniversalTranscode", new List<string> { }, SDKConfiguration.SecuritySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user