Compare commits

...

7 Commits

Author SHA1 Message Date
speakeasybot
bc02ecef34 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.555.2 2025-06-04 00:26:20 +00:00
speakeasybot
55b5c2b3dd ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.542.1 2025-05-05 00:26:49 +00:00
speakeasybot
67a53e72d5 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.541.2 2025-05-01 00:28:06 +00:00
speakeasybot
9ccab7b22d ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-19 00:24:30 +00:00
speakeasybot
eb2f6e54a2 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-14 00:26:56 +00:00
speakeasybot
4b798cbb85 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.529.1 2025-04-06 00:25:51 +00:00
speakeasybot
a89870d526 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.528.1 2025-04-03 00:23:53 +00:00
283 changed files with 5275 additions and 2856 deletions

3
.gitignore vendored
View File

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

File diff suppressed because one or more lines are too long

View File

@@ -4,6 +4,7 @@ generation:
maintainOpenAPIOrder: true maintainOpenAPIOrder: true
usageSnippets: usageSnippets:
optionalPropertyRendering: withExample optionalPropertyRendering: withExample
sdkInitStyle: constructor
useClassNamesForArrayFields: true useClassNamesForArrayFields: true
fixes: fixes:
nameResolutionDec2023: true nameResolutionDec2023: true
@@ -11,11 +12,12 @@ generation:
parameterOrderingFeb2024: true parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true requestResponseComponentNamesFeb2024: true
securityFeb2025: false securityFeb2025: false
sharedErrorComponentsApr2025: false
auth: auth:
oAuth2ClientCredentialsEnabled: true oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false oAuth2PasswordEnabled: false
csharp: csharp:
version: 0.14.3 version: 0.15.0
additionalDependencies: [] additionalDependencies: []
author: LukeHagar author: LukeHagar
clientServerStatusCodesAsErrors: true clientServerStatusCodesAsErrors: true

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.526.6 speakeasyVersion: 1.555.2
sources: sources:
my-source: my-source:
sourceNamespace: my-source sourceNamespace: my-source
@@ -16,19 +16,19 @@ sources:
- main - main
plexapi: plexapi:
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf sourceRevisionDigest: sha256:78d07ad78ff60d0e9918696208d8c68a562e170d4e9c431797c02995fb8816d0
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351 sourceBlobDigest: sha256:d38dd2a36c1b2fd73409267f7b30c2d5d45d709616141803ea01db424ec68ae4
tags: tags:
- latest - latest
- speakeasy-sdk-regen-1743440848 - speakeasy-sdk-regen-1748996711
targets: targets:
plexcsharp: plexcsharp:
source: plexapi source: plexapi
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf sourceRevisionDigest: sha256:78d07ad78ff60d0e9918696208d8c68a562e170d4e9c431797c02995fb8816d0
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351 sourceBlobDigest: sha256:d38dd2a36c1b2fd73409267f7b30c2d5d45d709616141803ea01db424ec68ae4
codeSamplesNamespace: code-samples-csharp-plexcsharp codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:36679bc4a33eb1818b5319c430b0df8bb509889279a83bc67d878bddc99f4798 codeSamplesRevisionDigest: sha256:5609267a659a1b1fdebdd8516758904fc983fb919b5b5a8bbd0044567e8bfa0f
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: latest speakeasyVersion: latest

View File

@@ -74,19 +74,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.14.3"; private const string _sdkVersion = "0.15.0";
private const string _sdkGenVersion = "2.563.1"; private const string _sdkGenVersion = "2.620.2";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.14.3 2.563.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Activities(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Activities(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -97,21 +90,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/activities"; var urlString = baseUrl + "/activities";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -201,21 +194,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request); var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -95,19 +95,12 @@ namespace LukeHagar.PlexAPI.SDK
}; };
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.14.3"; private const string _sdkVersion = "0.15.0";
private const string _sdkGenVersion = "2.563.1"; private const string _sdkGenVersion = "2.620.2";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.14.3 2.563.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Authentication(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Authentication(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -122,21 +115,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/security/token", request); var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -218,21 +211,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/security/resources", request); var urlString = URLBuilder.Build(baseUrl, "/security/resources", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -316,21 +309,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/user"; var urlString = baseUrl + "/user";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -422,7 +415,7 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/users/signin"; var urlString = baseUrl + "/users/signin";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request); HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
@@ -431,14 +424,14 @@ namespace LukeHagar.PlexAPI.SDK
httpRequest.Content = serializedBody; 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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -101,19 +101,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.14.3"; private const string _sdkVersion = "0.15.0";
private const string _sdkGenVersion = "2.563.1"; private const string _sdkGenVersion = "2.620.2";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.14.3 2.563.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Butler(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Butler(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -124,21 +117,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/butler"; var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -225,21 +218,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/butler"; var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -318,21 +311,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/butler"; var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -414,21 +407,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request); var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -510,21 +503,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request); var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

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

View File

@@ -73,19 +73,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.14.3"; private const string _sdkVersion = "0.15.0";
private const string _sdkGenVersion = "2.563.1"; private const string _sdkGenVersion = "2.620.2";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.14.3 2.563.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Hubs(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Hubs(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -100,21 +93,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/hubs", request); var urlString = URLBuilder.Build(baseUrl, "/hubs", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -200,21 +193,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request); var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -284,21 +277,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request); var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -154,14 +154,14 @@ namespace LukeHagar.PlexAPI.SDK
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request); Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request);
/// <summary> /// <summary>
/// Get all media of library /// Get Library section media by tag ALL
/// ///
/// <remarks> /// <remarks>
/// Retrieves a list of all general media data for this library.<br/> /// Retrieves a list of all general media data for this library.<br/>
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetAllMediaLibraryResponse> GetAllMediaLibraryAsync(GetAllMediaLibraryRequest request); Task<GetLibrarySectionsAllResponse> GetLibrarySectionsAllAsync(GetLibrarySectionsAllRequest request);
/// <summary> /// <summary>
/// Refresh Metadata Of The Library /// Refresh Metadata Of The Library
@@ -244,12 +244,49 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Media Metadata /// Get Media Metadata
/// ///
/// <remarks> /// <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., &quot;21119,21617&quot;).<br/>
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetMediaMetaDataResponse> GetMediaMetaDataAsync(GetMediaMetaDataRequest request); Task<GetMediaMetaDataResponse> GetMediaMetaDataAsync(GetMediaMetaDataRequest request);
/// <summary>
/// Get Media Background Artwork
///
/// <remarks>
/// Returns the background artwork for a library item.
/// </remarks>
/// </summary>
Task<GetMediaArtsResponse> GetMediaArtsAsync(long ratingKey);
/// <summary>
/// Upload Media Background Artwork
///
/// <remarks>
/// Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
/// </remarks>
/// </summary>
Task<PostMediaArtsResponse> PostMediaArtsAsync(long ratingKey, string? url = null, byte[]? requestBody = null);
/// <summary>
/// Get Media Posters
///
/// <remarks>
/// Returns the available posters for a library item.
/// </remarks>
/// </summary>
Task<GetMediaPostersResponse> GetMediaPostersAsync(long ratingKey);
/// <summary>
/// Upload Media Poster
///
/// <remarks>
/// Uploads a poster to a library item, either from a local file or a remote URL
/// </remarks>
/// </summary>
Task<PostMediaPosterResponse> PostMediaPosterAsync(long ratingKey, string? url = null, byte[]? requestBody = null);
/// <summary> /// <summary>
/// Get Items Children /// Get Items Children
/// ///
@@ -268,7 +305,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null); Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, GetTopWatchedContentQueryParamIncludeGuids? includeGuids = LukeHagar.PlexAPI.SDK.Models.Requests.GetTopWatchedContentQueryParamIncludeGuids.Disable);
} }
/// <summary> /// <summary>
@@ -282,19 +319,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.14.3"; private const string _sdkVersion = "0.15.0";
private const string _sdkGenVersion = "2.563.1"; private const string _sdkGenVersion = "2.620.2";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.14.3 2.563.1 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; SDKConfiguration = config;
} }
@@ -309,21 +339,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/hashes", request); var urlString = URLBuilder.Build(baseUrl, "/library/hashes", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -401,21 +431,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request); var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -502,21 +532,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/library/sections"; var urlString = baseUrl + "/library/sections";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -607,21 +637,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -711,21 +741,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -803,21 +833,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -897,27 +927,27 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetAllMediaLibraryResponse> GetAllMediaLibraryAsync(GetAllMediaLibraryRequest request) public async Task<GetLibrarySectionsAllResponse> GetLibrarySectionsAllAsync(GetLibrarySectionsAllRequest request)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/all", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/all", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -950,8 +980,8 @@ namespace LukeHagar.PlexAPI.SDK
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<GetAllMediaLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var obj = ResponseBodyDeserializer.Deserialize<GetLibrarySectionsAllResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetAllMediaLibraryResponse() var response = new GetLibrarySectionsAllResponse()
{ {
StatusCode = responseStatusCode, StatusCode = responseStatusCode,
ContentType = contentType, ContentType = contentType,
@@ -967,7 +997,7 @@ namespace LukeHagar.PlexAPI.SDK
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) 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; obj!.RawResponse = httpResponse;
throw obj!; throw obj!;
} }
@@ -978,7 +1008,7 @@ namespace LukeHagar.PlexAPI.SDK
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) 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; obj!.RawResponse = httpResponse;
throw obj!; throw obj!;
} }
@@ -1008,21 +1038,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/refresh", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/refresh", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1105,21 +1135,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/search", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/search", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1210,21 +1240,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/genre", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/genre", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1315,21 +1345,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/country", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/country", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1420,21 +1450,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/actor", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/actor", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1520,22 +1550,22 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/search", request); var urlString = URLBuilder.Build(baseUrl, "/library/search", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request); HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1621,21 +1651,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}", request); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1715,6 +1745,334 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetMediaArtsResponse> GetMediaArtsAsync(long ratingKey)
{
var request = new GetMediaArtsRequest()
{
RatingKey = ratingKey,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/arts", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-media-arts", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetMediaArtsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetMediaArtsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<PostMediaArtsResponse> PostMediaArtsAsync(long ratingKey, string? url = null, byte[]? requestBody = null)
{
var request = new PostMediaArtsRequest()
{
RatingKey = ratingKey,
Url = url,
RequestBody = requestBody,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/arts", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "raw", false, true);
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
}
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
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 SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new PostMediaArtsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMediaPostersResponse> GetMediaPostersAsync(long ratingKey)
{
var request = new GetMediaPostersRequest()
{
RatingKey = ratingKey,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/posters", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-media-posters", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetMediaPostersResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetMediaPostersResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<PostMediaPosterResponse> PostMediaPosterAsync(long ratingKey, string? url = null, byte[]? requestBody = null)
{
var request = new PostMediaPosterRequest()
{
RatingKey = ratingKey,
Url = url,
RequestBody = requestBody,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/posters", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "raw", false, true);
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
}
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
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 SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new PostMediaPosterResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null) public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null)
{ {
var request = new GetMetadataChildrenRequest() var request = new GetMetadataChildrenRequest()
@@ -1726,21 +2084,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/children", request); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/children", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1820,7 +2178,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<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() var request = new GetTopWatchedContentRequest()
{ {
@@ -1831,21 +2189,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/all/top", request); var urlString = URLBuilder.Build(baseUrl, "/library/all/top", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -94,19 +94,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.14.3"; private const string _sdkVersion = "0.15.0";
private const string _sdkGenVersion = "2.563.1"; private const string _sdkGenVersion = "2.620.2";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.14.3 2.563.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Log(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Log(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -122,21 +115,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/log", request); var urlString = URLBuilder.Build(baseUrl, "/log", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -215,7 +208,7 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/log"; var urlString = baseUrl + "/log";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string", false, false); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "string", false, false);
if (serializedBody != null) if (serializedBody != null)
@@ -223,19 +216,19 @@ namespace LukeHagar.PlexAPI.SDK
httpRequest.Content = serializedBody; httpRequest.Content = serializedBody;
} }
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -314,21 +307,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/log/networked"; var urlString = baseUrl + "/log/networked";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId> <PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.14.3</Version> <Version>0.15.0</Version>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors> <Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2025</Copyright> <Copyright>Copyright (c) LukeHagar 2025</Copyright>

View File

@@ -90,19 +90,12 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.14.3"; private const string _sdkVersion = "0.15.0";
private const string _sdkGenVersion = "2.563.1"; private const string _sdkGenVersion = "2.620.2";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.14.3 2.563.1 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Media(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Media(SDKConfig config)
{ {
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config; SDKConfiguration = config;
} }
@@ -116,21 +109,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request); var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -212,21 +205,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request); var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -310,21 +303,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/:/progress", request); var urlString = URLBuilder.Build(baseUrl, "/:/progress", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null) if (SDKConfiguration.SecuritySource != null)
{ {
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
} }
var hookCtx = new HookContext(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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -402,22 +395,22 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request); 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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -502,22 +495,22 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request); 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); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
/// <summary> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary> /// </summary>
public class GetAllMediaLibraryBadRequest : Exception public class GetLibrarySectionsAllBadRequest : Exception
{ {
[JsonProperty("errors")] [JsonProperty("errors")]
public List<GetAllMediaLibraryErrors>? Errors { get; set; } public List<GetLibrarySectionsAllErrors>? Errors { get; set; }
/// <summary> /// <summary>
/// Raw HTTP response; suitable for custom response parsing /// Raw HTTP response; suitable for custom response parsing

View File

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

View File

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

View File

@@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary> /// </summary>
public class GetAllMediaLibraryUnauthorized : Exception public class GetLibrarySectionsAllUnauthorized : Exception
{ {
[JsonProperty("errors")] [JsonProperty("errors")]
public List<GetAllMediaLibraryLibraryErrors>? Errors { get; set; } public List<GetLibrarySectionsAllLibraryErrors>? Errors { get; set; }
/// <summary> /// <summary>
/// Raw HTTP response; suitable for custom response parsing /// Raw HTTP response; suitable for custom response parsing

View File

@@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <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;
using Newtonsoft.Json;
/// <summary>
/// Attributes associated with the marker.
/// </summary>
public class Attributes
{
/// <summary>
/// The identifier for the attributes.
/// </summary>
[JsonProperty("id")]
public long Id { get; set; } = default!;
/// <summary>
/// The version number of the marker attributes.
/// </summary>
[JsonProperty("version")]
public long? Version { get; set; }
}
}

View File

@@ -0,0 +1,39 @@
//------------------------------------------------------------------------------
// <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;
using Newtonsoft.Json;
/// <summary>
/// The thumbnail for the chapter
/// </summary>
public class Chapter
{
[JsonProperty("id")]
public long Id { get; set; } = default!;
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
[JsonProperty("index")]
public long Index { get; set; } = default!;
[JsonProperty("startTimeOffset")]
public long StartTimeOffset { get; set; } = default!;
[JsonProperty("endTimeOffset")]
public long EndTimeOffset { get; set; } = default!;
[JsonProperty("thumb")]
public string Thumb { get; set; } = default!;
}
}

View File

@@ -18,8 +18,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class Country 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")] [JsonProperty("id")]
public long Id { get; set; } = default!; public int Id { get; set; } = default!;
/// <summary> /// <summary>
/// The country of origin of this media item /// The country of origin of this media item
@@ -28,6 +36,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string Tag { get; set; } = default!; public string Tag { get; set; } = default!;
[JsonProperty("filter")] [JsonProperty("filter")]
public string? Filter { get; set; } public string Filter { get; set; } = default!;
} }
} }

View File

@@ -15,10 +15,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class Director 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> /// <summary>
/// The role of Director /// The role of Director
/// </summary> /// </summary>
[JsonProperty("tag")] [JsonProperty("tag")]
public string Tag { get; set; } = default!; public string Tag { get; set; } = default!;
/// <summary>
/// A unique 24-character hexadecimal key associated with the director&apos;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; }
} }
} }

View File

@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <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;
using Newtonsoft.Json;
public class Extras
{
/// <summary>
/// The size of the extras.
/// </summary>
[JsonProperty("size")]
public long? Size { get; set; }
}
}

View File

@@ -18,8 +18,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class Genre 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")] [JsonProperty("id")]
public long Id { get; set; } = default!; public int Id { get; set; } = default!;
[JsonProperty("filter")] [JsonProperty("filter")]
public string Filter { get; set; } = default!; public string Filter { get; set; } = default!;

View File

@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8, Artist = 5,
Album = 9, Album = 6,
Track = 10, Track = 7,
PhotoAlbum = 8,
Photo = 9,
} }
} }

View File

@@ -17,42 +17,78 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetAllLibrariesDirectory public class GetAllLibrariesDirectory
{ {
/// <summary>
/// Indicates whether syncing is allowed.
/// </summary>
[JsonProperty("allowSync")] [JsonProperty("allowSync")]
public bool AllowSync { get; set; } = default!; public bool AllowSync { get; set; } = default!;
/// <summary>
/// URL for the background artwork of the media container.
/// </summary>
[JsonProperty("art")] [JsonProperty("art")]
public string Art { get; set; } = default!; public string Art { get; set; } = default!;
/// <summary>
/// The relative path to the composite media item.
/// </summary>
[JsonProperty("composite")] [JsonProperty("composite")]
public string Composite { get; set; } = default!; public string Composite { get; set; } = default!;
/// <summary>
/// UNKNOWN
/// </summary>
[JsonProperty("filters")] [JsonProperty("filters")]
public bool Filters { get; set; } = default!; public bool Filters { get; set; } = default!;
/// <summary>
/// Indicates whether the library is currently being refreshed or updated
/// </summary>
[JsonProperty("refreshing")] [JsonProperty("refreshing")]
public bool Refreshing { get; set; } = default!; public bool Refreshing { get; set; } = default!;
/// <summary>
/// URL for the thumbnail image of the media container.
/// </summary>
[JsonProperty("thumb")] [JsonProperty("thumb")]
public string Thumb { get; set; } = default!; public string Thumb { get; set; } = default!;
/// <summary>
/// The library key representing the unique identifier
/// </summary>
[JsonProperty("key")] [JsonProperty("key")]
public string Key { get; set; } = default!; public string Key { get; set; } = default!;
[JsonProperty("type")] [JsonProperty("type")]
public string Type { get; set; } = default!; public GetAllLibrariesType Type { get; set; } = default!;
/// <summary>
/// The title of the library
/// </summary>
[JsonProperty("title")] [JsonProperty("title")]
public string Title { get; set; } = default!; public string Title { get; set; } = default!;
/// <summary>
/// The Plex agent used to match and retrieve media metadata.
/// </summary>
[JsonProperty("agent")] [JsonProperty("agent")]
public string Agent { get; set; } = default!; public string Agent { get; set; } = default!;
/// <summary>
/// UNKNOWN
/// </summary>
[JsonProperty("scanner")] [JsonProperty("scanner")]
public string Scanner { get; set; } = default!; public string Scanner { get; set; } = default!;
/// <summary>
/// The Plex library language that has been set
/// </summary>
[JsonProperty("language")] [JsonProperty("language")]
public string Language { get; set; } = default!; public string Language { get; set; } = default!;
/// <summary>
/// The universally unique identifier for the library.
/// </summary>
[JsonProperty("uuid")] [JsonProperty("uuid")]
public string Uuid { get; set; } = default!; public string Uuid { get; set; } = default!;
@@ -62,11 +98,8 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("updatedAt")] [JsonProperty("updatedAt")]
public long UpdatedAt { get; set; } = default!; public long UpdatedAt { get; set; } = default!;
/// <summary>
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("createdAt")] [JsonProperty("createdAt")]
public long CreatedAt { get; set; } = default!; public long? CreatedAt { get; set; }
/// <summary> /// <summary>
/// Unix epoch datetime in seconds /// Unix epoch datetime in seconds
@@ -74,20 +107,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("scannedAt")] [JsonProperty("scannedAt")]
public long ScannedAt { get; set; } = default!; public long ScannedAt { get; set; } = default!;
/// <summary>
/// UNKNOWN
/// </summary>
[JsonProperty("content")] [JsonProperty("content")]
public bool Content { get; set; } = default!; public bool Content { get; set; } = default!;
/// <summary>
/// UNKNOWN
/// </summary>
[JsonProperty("directory")] [JsonProperty("directory")]
public bool Directory { get; set; } = default!; public bool Directory { get; set; } = default!;
/// <summary> /// <summary>
/// Unix epoch datetime in seconds /// Timestamp (in seconds) representing the last time the content was modified.<br/>
///
/// <remarks>
/// NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64<br/>
///
/// </remarks>
/// </summary> /// </summary>
[JsonProperty("contentChangedAt")] [JsonProperty("contentChangedAt")]
public long ContentChangedAt { get; set; } = default!; public long ContentChangedAt { get; set; } = default!;
/// <summary>
/// The Plex library visibility setting
/// </summary>
[JsonProperty("hidden")] [JsonProperty("hidden")]
public int Hidden { get; set; } = default!; public Hidden? Hidden { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.Hidden.Visible;
[JsonProperty("Location")] [JsonProperty("Location")]
public List<GetAllLibrariesLocation> Location { get; set; } = default!; public List<GetAllLibrariesLocation> Location { get; set; } = default!;

View File

@@ -15,9 +15,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetAllLibrariesLocation public class GetAllLibrariesLocation
{ {
/// <summary>
/// The ID of the location.
/// </summary>
[JsonProperty("id")] [JsonProperty("id")]
public int Id { get; set; } = default!; public int Id { get; set; } = default!;
/// <summary>
/// The path to the media item.
/// </summary>
[JsonProperty("path")] [JsonProperty("path")]
public string Path { get; set; } = default!; public string Path { get; set; } = default!;
} }

View File

@@ -17,16 +17,25 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetAllLibrariesMediaContainer public class GetAllLibrariesMediaContainer
{ {
/// <summary>
/// Number of media items returned in this response.
/// </summary>
[JsonProperty("size")] [JsonProperty("size")]
public int Size { get; set; } = default!; public int Size { get; set; } = default!;
/// <summary>
/// Indicates whether syncing is allowed.
/// </summary>
[JsonProperty("allowSync")] [JsonProperty("allowSync")]
public bool AllowSync { get; set; } = default!; public bool AllowSync { get; set; } = default!;
/// <summary>
/// The primary title of the media container.
/// </summary>
[JsonProperty("title1")] [JsonProperty("title1")]
public string Title1 { get; set; } = default!; public string Title1 { get; set; } = default!;
[JsonProperty("Directory")] [JsonProperty("Directory")]
public List<GetAllLibrariesDirectory> Directory { get; set; } = default!; public List<GetAllLibrariesDirectory>? Directory { get; set; }
} }
} }

View File

@@ -20,6 +20,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
[JsonProperty("MediaContainer")] [JsonProperty("MediaContainer")]
public GetAllLibrariesMediaContainer MediaContainer { get; set; } = default!; public GetAllLibrariesMediaContainer? MediaContainer { get; set; }
} }
} }

View File

@@ -14,13 +14,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using System; using System;
/// <summary> /// <summary>
/// The type of media content<br/> /// The library type
///
/// <remarks>
///
/// </remarks>
/// </summary> /// </summary>
public enum GetAllMediaLibraryLibraryType public enum GetAllLibrariesType
{ {
[JsonProperty("movie")] [JsonProperty("movie")]
Movie, Movie,
@@ -34,18 +30,26 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Artist, Artist,
[JsonProperty("album")] [JsonProperty("album")]
Album, Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
} }
public static class GetAllMediaLibraryLibraryTypeExtension public static class GetAllLibrariesTypeExtension
{ {
public static string Value(this GetAllMediaLibraryLibraryType value) public static string Value(this GetAllLibrariesType value)
{ {
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); 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 GetAllLibrariesType ToEnum(this string value)
{ {
foreach(var field in typeof(GetAllMediaLibraryLibraryType).GetFields()) foreach(var field in typeof(GetAllLibrariesType).GetFields())
{ {
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0) if (attributes.Length == 0)
@@ -58,14 +62,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
var enumVal = field.GetValue(null); var enumVal = field.GetValue(null);
if (enumVal is GetAllMediaLibraryLibraryType) if (enumVal is GetAllLibrariesType)
{ {
return (GetAllMediaLibraryLibraryType)enumVal; return (GetAllLibrariesType)enumVal;
} }
} }
} }
throw new Exception($"Unknown value {value} for enum GetAllMediaLibraryLibraryType"); throw new Exception($"Unknown value {value} for enum GetAllLibrariesType");
} }
} }

View File

@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8, Artist = 5,
Album = 9, Album = 6,
Track = 10, Track = 7,
PhotoAlbum = 8,
Photo = 9,
} }
} }

View File

@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8, Artist = 5,
Album = 9, Album = 6,
Track = 10, Track = 7,
PhotoAlbum = 8,
Photo = 9,
} }
} }

View File

@@ -15,17 +15,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetLibraryDetailsRequest public class GetLibraryDetailsRequest
{ {
/// <summary>
/// The unique key of the Plex library. <br/>
///
/// <remarks>
/// Note: This is unique in the context of the Plex server.<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")]
public int SectionKey { get; set; } = default!;
/// <summary> /// <summary>
/// Whether or not to include details for a section (types, filters, and sorts).<br/> /// Whether or not to include details for a section (types, filters, and sorts).<br/>
/// ///
@@ -36,5 +25,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDetails")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeDetails")]
public IncludeDetails? IncludeDetails { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeDetails.Zero; public IncludeDetails? IncludeDetails { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeDetails.Zero;
/// <summary>
/// The unique key of the Plex library. <br/>
///
/// <remarks>
/// Note: This is unique in the context of the Plex server.<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")]
public int SectionKey { get; set; } = default!;
} }
} }

View File

@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using System; using System;
/// <summary> /// <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>
/// ///
@@ -34,6 +34,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Artist, Artist,
[JsonProperty("album")] [JsonProperty("album")]
Album, Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
} }
public static class GetLibraryItemsLibraryTypeExtension public static class GetLibraryItemsLibraryTypeExtension

View File

@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string? LibrarySectionKey { get; set; } public string? LibrarySectionKey { get; set; }
/// <summary> /// <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>
/// ///

View File

@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8, Artist = 5,
Album = 9, Album = 6,
Track = 10, Track = 7,
PhotoAlbum = 8,
Photo = 9,
} }
} }

View File

@@ -20,7 +20,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
public enum GetAllMediaLibraryActiveDirection public enum GetLibrarySectionsAllActiveDirection
{ {
[JsonProperty("asc")] [JsonProperty("asc")]
Ascending, Ascending,
@@ -28,16 +28,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Descending, 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(); 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); var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0) if (attributes.Length == 0)
@@ -50,14 +50,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
var enumVal = field.GetValue(null); 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");
} }
} }

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryCollection public class GetLibrarySectionsAllCollection
{ {
/// <summary> /// <summary>

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryCountry public class GetLibrarySectionsAllCountry
{ {
/// <summary> /// <summary>

View File

@@ -20,7 +20,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
public enum GetAllMediaLibraryDefaultDirection public enum GetLibrarySectionsAllDefaultDirection
{ {
[JsonProperty("asc")] [JsonProperty("asc")]
Ascending, Ascending,
@@ -28,16 +28,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Descending, 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(); 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); var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0) if (attributes.Length == 0)
@@ -50,14 +50,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
var enumVal = field.GetValue(null); 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");
} }
} }

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryDirector public class GetLibrarySectionsAllDirector
{ {
/// <summary> /// <summary>

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryField public class GetLibrarySectionsAllField
{ {
[JsonProperty("key")] [JsonProperty("key")]

View File

@@ -14,13 +14,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic; using System.Collections.Generic;
public class GetAllMediaLibraryFieldType public class GetLibrarySectionsAllFieldType
{ {
[JsonProperty("type")] [JsonProperty("type")]
public string Type { get; set; } = default!; public string Type { get; set; } = default!;
[JsonProperty("Operator")] [JsonProperty("Operator")]
public List<GetAllMediaLibraryOperator> Operator { get; set; } = default!; public List<GetLibrarySectionsAllOperator> Operator { get; set; } = default!;
} }
} }

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryFilter public class GetLibrarySectionsAllFilter
{ {
[JsonProperty("filter")] [JsonProperty("filter")]

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryGenre public class GetLibrarySectionsAllGenre
{ {
/// <summary> /// <summary>

View File

@@ -12,17 +12,17 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryGuids public class GetLibrarySectionsAllGuids
{ {
/// <summary> /// <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>
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("id")] [JsonProperty("id")]
public string? Id { get; set; } public string Id { get; set; } = default!;
} }
} }

View File

@@ -16,7 +16,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// <summary> /// <summary>
/// Indicates if the part has a thumbnail. /// Indicates if the part has a thumbnail.
/// </summary> /// </summary>
public enum GetAllMediaLibraryHasThumbnail public enum GetLibrarySectionsAllHasThumbnail
{ {
[JsonProperty("0")] [JsonProperty("0")]
False, False,
@@ -24,16 +24,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
True, 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(); 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); var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0) if (attributes.Length == 0)
@@ -46,14 +46,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
var enumVal = field.GetValue(null); 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");
} }
} }

View File

@@ -13,14 +13,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryImage public class GetLibrarySectionsAllImage
{ {
[JsonProperty("alt")] [JsonProperty("alt")]
public string Alt { get; set; } = default!; public string Alt { get; set; } = default!;
[JsonProperty("type")] [JsonProperty("type")]
public GetAllMediaLibraryLibraryResponseType Type { get; set; } = default!; public GetLibrarySectionsAllLibraryResponseType Type { get; set; } = default!;
[JsonProperty("url")] [JsonProperty("url")]
public string Url { get; set; } = default!; public string Url { get; set; } = default!;

View File

@@ -19,25 +19,25 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using System.Reflection; 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 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 override string ToString() { return Value; }
public static implicit operator String(GetAllMediaLibraryLibraryOptimizedForStreamingType v) { return v.Value; } public static implicit operator String(GetLibrarySectionsAllLibraryOptimizedForStreamingType v) { return v.Value; }
public static GetAllMediaLibraryLibraryOptimizedForStreamingType FromString(string v) { public static GetLibrarySectionsAllLibraryOptimizedForStreamingType FromString(string v) {
switch(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 "boolean": return Boolean;
case "null": return Null; 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) public override bool Equals(object? obj)
@@ -46,7 +46,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
return false; return false;
} }
return Value.Equals(((GetAllMediaLibraryLibraryOptimizedForStreamingType)obj).Value); return Value.Equals(((GetLibrarySectionsAllLibraryOptimizedForStreamingType)obj).Value);
} }
public override int GetHashCode() public override int GetHashCode()
@@ -59,46 +59,46 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// <summary> /// <summary>
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true /// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// </summary> /// </summary>
[JsonConverter(typeof(GetAllMediaLibraryLibraryOptimizedForStreaming.GetAllMediaLibraryLibraryOptimizedForStreamingConverter))] [JsonConverter(typeof(GetLibrarySectionsAllLibraryOptimizedForStreaming.GetLibrarySectionsAllLibraryOptimizedForStreamingConverter))]
public class GetAllMediaLibraryLibraryOptimizedForStreaming { public class GetLibrarySectionsAllLibraryOptimizedForStreaming {
public GetAllMediaLibraryLibraryOptimizedForStreaming(GetAllMediaLibraryLibraryOptimizedForStreamingType type) { public GetLibrarySectionsAllLibraryOptimizedForStreaming(GetLibrarySectionsAllLibraryOptimizedForStreamingType type) {
Type = type; Type = type;
} }
[SpeakeasyMetadata("form:explode=true")] [SpeakeasyMetadata("form:explode=true")]
public GetAllMediaLibraryOptimizedForStreaming1? GetAllMediaLibraryOptimizedForStreaming1 { get; set; } public GetLibrarySectionsAllOptimizedForStreaming1? GetLibrarySectionsAllOptimizedForStreaming1 { get; set; }
[SpeakeasyMetadata("form:explode=true")] [SpeakeasyMetadata("form:explode=true")]
public bool? Boolean { get; set; } public bool? Boolean { get; set; }
public GetAllMediaLibraryLibraryOptimizedForStreamingType Type { get; set; } public GetLibrarySectionsAllLibraryOptimizedForStreamingType Type { get; set; }
public static GetAllMediaLibraryLibraryOptimizedForStreaming CreateGetAllMediaLibraryOptimizedForStreaming1(GetAllMediaLibraryOptimizedForStreaming1 getAllMediaLibraryOptimizedForStreaming1) { public static GetLibrarySectionsAllLibraryOptimizedForStreaming CreateGetLibrarySectionsAllOptimizedForStreaming1(GetLibrarySectionsAllOptimizedForStreaming1 getLibrarySectionsAllOptimizedForStreaming1) {
GetAllMediaLibraryLibraryOptimizedForStreamingType typ = GetAllMediaLibraryLibraryOptimizedForStreamingType.GetAllMediaLibraryOptimizedForStreaming1; GetLibrarySectionsAllLibraryOptimizedForStreamingType typ = GetLibrarySectionsAllLibraryOptimizedForStreamingType.GetLibrarySectionsAllOptimizedForStreaming1;
GetAllMediaLibraryLibraryOptimizedForStreaming res = new GetAllMediaLibraryLibraryOptimizedForStreaming(typ); GetLibrarySectionsAllLibraryOptimizedForStreaming res = new GetLibrarySectionsAllLibraryOptimizedForStreaming(typ);
res.GetAllMediaLibraryOptimizedForStreaming1 = getAllMediaLibraryOptimizedForStreaming1; res.GetLibrarySectionsAllOptimizedForStreaming1 = getLibrarySectionsAllOptimizedForStreaming1;
return res; return res;
} }
public static GetAllMediaLibraryLibraryOptimizedForStreaming CreateBoolean(bool boolean) { public static GetLibrarySectionsAllLibraryOptimizedForStreaming CreateBoolean(bool boolean) {
GetAllMediaLibraryLibraryOptimizedForStreamingType typ = GetAllMediaLibraryLibraryOptimizedForStreamingType.Boolean; GetLibrarySectionsAllLibraryOptimizedForStreamingType typ = GetLibrarySectionsAllLibraryOptimizedForStreamingType.Boolean;
GetAllMediaLibraryLibraryOptimizedForStreaming res = new GetAllMediaLibraryLibraryOptimizedForStreaming(typ); GetLibrarySectionsAllLibraryOptimizedForStreaming res = new GetLibrarySectionsAllLibraryOptimizedForStreaming(typ);
res.Boolean = boolean; res.Boolean = boolean;
return res; return res;
} }
public static GetAllMediaLibraryLibraryOptimizedForStreaming CreateNull() { public static GetLibrarySectionsAllLibraryOptimizedForStreaming CreateNull() {
GetAllMediaLibraryLibraryOptimizedForStreamingType typ = GetAllMediaLibraryLibraryOptimizedForStreamingType.Null; GetLibrarySectionsAllLibraryOptimizedForStreamingType typ = GetLibrarySectionsAllLibraryOptimizedForStreamingType.Null;
return new GetAllMediaLibraryLibraryOptimizedForStreaming(typ); 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; public override bool CanRead => true;
@@ -114,14 +114,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
try try
{ {
return new GetAllMediaLibraryLibraryOptimizedForStreaming(GetAllMediaLibraryLibraryOptimizedForStreamingType.GetAllMediaLibraryOptimizedForStreaming1) return new GetLibrarySectionsAllLibraryOptimizedForStreaming(GetLibrarySectionsAllLibraryOptimizedForStreamingType.GetLibrarySectionsAllOptimizedForStreaming1)
{ {
GetAllMediaLibraryOptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<GetAllMediaLibraryOptimizedForStreaming1>(json) GetLibrarySectionsAllOptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<GetLibrarySectionsAllOptimizedForStreaming1>(json)
}; };
} }
catch (ResponseBodyDeserializer.MissingMemberException) catch (ResponseBodyDeserializer.MissingMemberException)
{ {
fallbackCandidates.Add((typeof(GetAllMediaLibraryOptimizedForStreaming1), new GetAllMediaLibraryLibraryOptimizedForStreaming(GetAllMediaLibraryLibraryOptimizedForStreamingType.GetAllMediaLibraryOptimizedForStreaming1), "GetAllMediaLibraryOptimizedForStreaming1")); fallbackCandidates.Add((typeof(GetLibrarySectionsAllOptimizedForStreaming1), new GetLibrarySectionsAllLibraryOptimizedForStreaming(GetLibrarySectionsAllLibraryOptimizedForStreamingType.GetLibrarySectionsAllOptimizedForStreaming1), "GetLibrarySectionsAllOptimizedForStreaming1"));
} }
catch (ResponseBodyDeserializer.DeserializationException) catch (ResponseBodyDeserializer.DeserializationException)
{ {
@@ -135,7 +135,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
try try
{ {
var converted = Convert.ToBoolean(json); var converted = Convert.ToBoolean(json);
return new GetAllMediaLibraryLibraryOptimizedForStreaming(GetAllMediaLibraryLibraryOptimizedForStreamingType.Boolean) return new GetLibrarySectionsAllLibraryOptimizedForStreaming(GetLibrarySectionsAllLibraryOptimizedForStreamingType.Boolean)
{ {
Boolean = converted Boolean = converted
}; };
@@ -174,15 +174,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
writer.WriteRawValue("null"); writer.WriteRawValue("null");
return; return;
} }
GetAllMediaLibraryLibraryOptimizedForStreaming res = (GetAllMediaLibraryLibraryOptimizedForStreaming)value; GetLibrarySectionsAllLibraryOptimizedForStreaming res = (GetLibrarySectionsAllLibraryOptimizedForStreaming)value;
if (GetAllMediaLibraryLibraryOptimizedForStreamingType.FromString(res.Type).Equals(GetAllMediaLibraryLibraryOptimizedForStreamingType.Null)) if (GetLibrarySectionsAllLibraryOptimizedForStreamingType.FromString(res.Type).Equals(GetLibrarySectionsAllLibraryOptimizedForStreamingType.Null))
{ {
writer.WriteRawValue("null"); writer.WriteRawValue("null");
return; return;
} }
if (res.GetAllMediaLibraryOptimizedForStreaming1 != null) if (res.GetLibrarySectionsAllOptimizedForStreaming1 != null)
{ {
writer.WriteRawValue(Utilities.SerializeJSON(res.GetAllMediaLibraryOptimizedForStreaming1)); writer.WriteRawValue(Utilities.SerializeJSON(res.GetLibrarySectionsAllOptimizedForStreaming1));
return; return;
} }
if (res.Boolean != null) if (res.Boolean != null)

View File

@@ -0,0 +1,61 @@
//------------------------------------------------------------------------------
// <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;
using Newtonsoft.Json;
using System;
public enum GetLibrarySectionsAllLibraryResponseType
{
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
public static class GetLibrarySectionsAllLibraryResponseTypeExtension
{
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 GetLibrarySectionsAllLibraryResponseType ToEnum(this string value)
{
foreach(var field in typeof(GetLibrarySectionsAllLibraryResponseType).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is GetLibrarySectionsAllLibraryResponseType)
{
return (GetLibrarySectionsAllLibraryResponseType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllLibraryResponseType");
}
}
}

View File

@@ -0,0 +1,80 @@
//------------------------------------------------------------------------------
// <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;
using Newtonsoft.Json;
using System;
/// <summary>
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetLibrarySectionsAllLibraryType
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
[JsonProperty("artist")]
Artist,
[JsonProperty("album")]
Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
}
public static class GetLibrarySectionsAllLibraryTypeExtension
{
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 GetLibrarySectionsAllLibraryType ToEnum(this string value)
{
foreach(var field in typeof(GetLibrarySectionsAllLibraryType).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is GetLibrarySectionsAllLibraryType)
{
return (GetLibrarySectionsAllLibraryType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibrarySectionsAllLibraryType");
}
}
}

View File

@@ -15,7 +15,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic; using System.Collections.Generic;
public class GetAllMediaLibraryMedia public class GetLibrarySectionsAllMedia
{ {
/// <summary> /// <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 /// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// </summary> /// </summary>
[JsonProperty("optimizedForStreaming")] [JsonProperty("optimizedForStreaming")]
public GetAllMediaLibraryOptimizedForStreaming? OptimizedForStreaming { get; set; } public GetLibrarySectionsAllOptimizedForStreaming? OptimizedForStreaming { get; set; }
[JsonProperty("has64bitOffsets")] [JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; } public bool? Has64bitOffsets { get; set; }
@@ -128,6 +128,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// An array of parts for this media item. /// An array of parts for this media item.
/// </summary> /// </summary>
[JsonProperty("Part")] [JsonProperty("Part")]
public List<GetAllMediaLibraryPart>? Part { get; set; } public List<GetLibrarySectionsAllPart>? Part { get; set; }
} }
} }

View File

@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic; using System.Collections.Generic;
public class GetAllMediaLibraryMediaContainer public class GetLibrarySectionsAllMediaContainer
{ {
/// <summary> /// <summary>
@@ -127,12 +127,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("Meta")] [JsonProperty("Meta")]
public GetAllMediaLibraryMeta? Meta { get; set; } public GetLibrarySectionsAllMeta? Meta { get; set; }
/// <summary> /// <summary>
/// An array of metadata items. /// An array of metadata items.
/// </summary> /// </summary>
[JsonProperty("Metadata")] [JsonProperty("Metadata")]
public List<GetAllMediaLibraryMetadata>? Metadata { get; set; } public List<GetLibrarySectionsAllMetadata>? Metadata { get; set; }
} }
} }

View File

@@ -21,13 +21,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
public class GetAllMediaLibraryMeta public class GetLibrarySectionsAllMeta
{ {
[JsonProperty("Type")] [JsonProperty("Type")]
public List<GetAllMediaLibraryType>? Type { get; set; } public List<GetLibrarySectionsAllType>? Type { get; set; }
[JsonProperty("FieldType")] [JsonProperty("FieldType")]
public List<GetAllMediaLibraryFieldType>? FieldType { get; set; } public List<GetLibrarySectionsAllFieldType>? FieldType { get; set; }
} }
} }

View File

@@ -22,7 +22,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
public class GetAllMediaLibraryMetadata public class GetLibrarySectionsAllMetadata
{ {
/// <summary> /// <summary>
@@ -56,7 +56,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string? Studio { get; set; } public string? Studio { get; set; }
[JsonProperty("type")] [JsonProperty("type")]
public GetAllMediaLibraryLibraryType Type { get; set; } = default!; public GetLibrarySectionsAllLibraryType Type { get; set; } = default!;
/// <summary> /// <summary>
/// The title of the media item. /// The title of the media item.
@@ -344,33 +344,33 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public float? UserRating { get; set; } public float? UserRating { get; set; }
[JsonProperty("Image")] [JsonProperty("Image")]
public List<GetAllMediaLibraryImage>? Image { get; set; } public List<GetLibrarySectionsAllImage>? Image { get; set; }
[JsonProperty("UltraBlurColors")] [JsonProperty("UltraBlurColors")]
public GetAllMediaLibraryUltraBlurColors? UltraBlurColors { get; set; } public GetLibrarySectionsAllUltraBlurColors? 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; }
[JsonProperty("Guid")] [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")] [JsonProperty("Collection")]
public List<GetAllMediaLibraryCollection>? Collection { get; set; } public List<GetLibrarySectionsAllCollection>? Collection { get; set; }
} }
} }

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryOperator public class GetLibrarySectionsAllOperator
{ {
[JsonProperty("key")] [JsonProperty("key")]

View File

@@ -19,25 +19,25 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using System.Reflection; 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 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 override string ToString() { return Value; }
public static implicit operator String(GetAllMediaLibraryOptimizedForStreamingType v) { return v.Value; } public static implicit operator String(GetLibrarySectionsAllOptimizedForStreamingType v) { return v.Value; }
public static GetAllMediaLibraryOptimizedForStreamingType FromString(string v) { public static GetLibrarySectionsAllOptimizedForStreamingType FromString(string v) {
switch(v) { switch(v) {
case "optimizedForStreaming_1": return OptimizedForStreaming1; case "optimizedForStreaming_1": return OptimizedForStreaming1;
case "boolean": return Boolean; case "boolean": return Boolean;
case "null": return Null; 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) public override bool Equals(object? obj)
@@ -46,7 +46,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
return false; return false;
} }
return Value.Equals(((GetAllMediaLibraryOptimizedForStreamingType)obj).Value); return Value.Equals(((GetLibrarySectionsAllOptimizedForStreamingType)obj).Value);
} }
public override int GetHashCode() public override int GetHashCode()
@@ -59,9 +59,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// <summary> /// <summary>
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true /// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// </summary> /// </summary>
[JsonConverter(typeof(GetAllMediaLibraryOptimizedForStreaming.GetAllMediaLibraryOptimizedForStreamingConverter))] [JsonConverter(typeof(GetLibrarySectionsAllOptimizedForStreaming.GetLibrarySectionsAllOptimizedForStreamingConverter))]
public class GetAllMediaLibraryOptimizedForStreaming { public class GetLibrarySectionsAllOptimizedForStreaming {
public GetAllMediaLibraryOptimizedForStreaming(GetAllMediaLibraryOptimizedForStreamingType type) { public GetLibrarySectionsAllOptimizedForStreaming(GetLibrarySectionsAllOptimizedForStreamingType type) {
Type = type; Type = type;
} }
@@ -71,34 +71,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[SpeakeasyMetadata("form:explode=true")] [SpeakeasyMetadata("form:explode=true")]
public bool? Boolean { get; set; } public bool? Boolean { get; set; }
public GetAllMediaLibraryOptimizedForStreamingType Type { get; set; } public GetLibrarySectionsAllOptimizedForStreamingType Type { get; set; }
public static GetAllMediaLibraryOptimizedForStreaming CreateOptimizedForStreaming1(OptimizedForStreaming1 optimizedForStreaming1) { public static GetLibrarySectionsAllOptimizedForStreaming CreateOptimizedForStreaming1(OptimizedForStreaming1 optimizedForStreaming1) {
GetAllMediaLibraryOptimizedForStreamingType typ = GetAllMediaLibraryOptimizedForStreamingType.OptimizedForStreaming1; GetLibrarySectionsAllOptimizedForStreamingType typ = GetLibrarySectionsAllOptimizedForStreamingType.OptimizedForStreaming1;
GetAllMediaLibraryOptimizedForStreaming res = new GetAllMediaLibraryOptimizedForStreaming(typ); GetLibrarySectionsAllOptimizedForStreaming res = new GetLibrarySectionsAllOptimizedForStreaming(typ);
res.OptimizedForStreaming1 = optimizedForStreaming1; res.OptimizedForStreaming1 = optimizedForStreaming1;
return res; return res;
} }
public static GetAllMediaLibraryOptimizedForStreaming CreateBoolean(bool boolean) { public static GetLibrarySectionsAllOptimizedForStreaming CreateBoolean(bool boolean) {
GetAllMediaLibraryOptimizedForStreamingType typ = GetAllMediaLibraryOptimizedForStreamingType.Boolean; GetLibrarySectionsAllOptimizedForStreamingType typ = GetLibrarySectionsAllOptimizedForStreamingType.Boolean;
GetAllMediaLibraryOptimizedForStreaming res = new GetAllMediaLibraryOptimizedForStreaming(typ); GetLibrarySectionsAllOptimizedForStreaming res = new GetLibrarySectionsAllOptimizedForStreaming(typ);
res.Boolean = boolean; res.Boolean = boolean;
return res; return res;
} }
public static GetAllMediaLibraryOptimizedForStreaming CreateNull() { public static GetLibrarySectionsAllOptimizedForStreaming CreateNull() {
GetAllMediaLibraryOptimizedForStreamingType typ = GetAllMediaLibraryOptimizedForStreamingType.Null; GetLibrarySectionsAllOptimizedForStreamingType typ = GetLibrarySectionsAllOptimizedForStreamingType.Null;
return new GetAllMediaLibraryOptimizedForStreaming(typ); 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; public override bool CanRead => true;
@@ -114,14 +114,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
try try
{ {
return new GetAllMediaLibraryOptimizedForStreaming(GetAllMediaLibraryOptimizedForStreamingType.OptimizedForStreaming1) return new GetLibrarySectionsAllOptimizedForStreaming(GetLibrarySectionsAllOptimizedForStreamingType.OptimizedForStreaming1)
{ {
OptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<OptimizedForStreaming1>(json) OptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<OptimizedForStreaming1>(json)
}; };
} }
catch (ResponseBodyDeserializer.MissingMemberException) catch (ResponseBodyDeserializer.MissingMemberException)
{ {
fallbackCandidates.Add((typeof(OptimizedForStreaming1), new GetAllMediaLibraryOptimizedForStreaming(GetAllMediaLibraryOptimizedForStreamingType.OptimizedForStreaming1), "OptimizedForStreaming1")); fallbackCandidates.Add((typeof(OptimizedForStreaming1), new GetLibrarySectionsAllOptimizedForStreaming(GetLibrarySectionsAllOptimizedForStreamingType.OptimizedForStreaming1), "OptimizedForStreaming1"));
} }
catch (ResponseBodyDeserializer.DeserializationException) catch (ResponseBodyDeserializer.DeserializationException)
{ {
@@ -135,7 +135,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
try try
{ {
var converted = Convert.ToBoolean(json); var converted = Convert.ToBoolean(json);
return new GetAllMediaLibraryOptimizedForStreaming(GetAllMediaLibraryOptimizedForStreamingType.Boolean) return new GetLibrarySectionsAllOptimizedForStreaming(GetLibrarySectionsAllOptimizedForStreamingType.Boolean)
{ {
Boolean = converted Boolean = converted
}; };
@@ -174,8 +174,8 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
writer.WriteRawValue("null"); writer.WriteRawValue("null");
return; return;
} }
GetAllMediaLibraryOptimizedForStreaming res = (GetAllMediaLibraryOptimizedForStreaming)value; GetLibrarySectionsAllOptimizedForStreaming res = (GetLibrarySectionsAllOptimizedForStreaming)value;
if (GetAllMediaLibraryOptimizedForStreamingType.FromString(res.Type).Equals(GetAllMediaLibraryOptimizedForStreamingType.Null)) if (GetLibrarySectionsAllOptimizedForStreamingType.FromString(res.Type).Equals(GetLibrarySectionsAllOptimizedForStreamingType.Null))
{ {
writer.WriteRawValue("null"); writer.WriteRawValue("null");
return; return;

View File

@@ -11,7 +11,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
public enum GetAllMediaLibraryOptimizedForStreaming1 public enum GetLibrarySectionsAllOptimizedForStreaming1
{ {
Zero = 0, Zero = 0,
One = 1, One = 1,

View File

@@ -15,7 +15,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic; using System.Collections.Generic;
public class GetAllMediaLibraryPart public class GetLibrarySectionsAllPart
{ {
/// <summary> /// <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 /// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// </summary> /// </summary>
[JsonProperty("optimizedForStreaming")] [JsonProperty("optimizedForStreaming")]
public GetAllMediaLibraryLibraryOptimizedForStreaming? OptimizedForStreaming { get; set; } public GetLibrarySectionsAllLibraryOptimizedForStreaming? OptimizedForStreaming { get; set; }
[JsonProperty("hasThumbnail")] [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> /// <summary>
/// An array of streams for this part. /// An array of streams for this part.
/// </summary> /// </summary>
[JsonProperty("Stream")] [JsonProperty("Stream")]
public List<GetAllMediaLibraryStream>? Stream { get; set; } public List<GetLibrarySectionsAllStream>? Stream { get; set; }
} }
} }

View File

@@ -18,7 +18,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
public enum GetAllMediaLibraryQueryParamIncludeMeta public enum GetLibrarySectionsAllQueryParamIncludeMeta
{ {
Disable = 0, Disable = 0,
Enable = 1, Enable = 1,

View File

@@ -23,15 +23,17 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
public enum GetAllMediaLibraryQueryParamType public enum GetLibrarySectionsAllQueryParamType
{ {
Movie = 1, Movie = 1,
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8, Artist = 5,
Album = 9, Album = 6,
Track = 10, Track = 7,
PhotoAlbum = 8,
Photo = 9,
} }
} }

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
public class GetAllMediaLibraryRequest public class GetLibrarySectionsAllRequest
{ {
/// <summary> /// <summary>
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
public GetAllMediaLibraryQueryParamType Type { get; set; } = default!; public GetLibrarySectionsAllQueryParamType Type { get; set; } = default!;
/// <summary> /// <summary>
/// Adds the Meta object to the response<br/> /// Adds the Meta object to the response<br/>
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeMeta")] [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> /// <summary>
/// Adds the Guid object to the response<br/> /// Adds the Guid object to the response<br/>

View File

@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using System; using System;
using System.Net.Http; using System.Net.Http;
public class GetAllMediaLibraryResponse public class GetLibrarySectionsAllResponse
{ {
/// <summary> /// <summary>
@@ -35,6 +35,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// <summary> /// <summary>
/// Successful response containing media container data. /// Successful response containing media container data.
/// </summary> /// </summary>
public GetAllMediaLibraryResponseBody? Object { get; set; } public GetLibrarySectionsAllResponseBody? Object { get; set; }
} }
} }

View File

@@ -16,10 +16,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// <summary> /// <summary>
/// Successful response containing media container data. /// Successful response containing media container data.
/// </summary> /// </summary>
public class GetAllMediaLibraryResponseBody public class GetLibrarySectionsAllResponseBody
{ {
[JsonProperty("MediaContainer")] [JsonProperty("MediaContainer")]
public GetAllMediaLibraryMediaContainer? MediaContainer { get; set; } public GetLibrarySectionsAllMediaContainer? MediaContainer { get; set; }
} }
} }

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryRole public class GetLibrarySectionsAllRole
{ {
/// <summary> /// <summary>

View File

@@ -13,7 +13,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibrarySort public class GetLibrarySectionsAllSort
{ {
[JsonProperty("default")] [JsonProperty("default")]
@@ -30,7 +30,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("activeDirection")] [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> /// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/> /// The direction of the sort. Can be either `asc` or `desc`.<br/>
@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("defaultDirection")] [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")] [JsonProperty("descKey")]
public string? DescKey { get; set; } public string? DescKey { get; set; }

View File

@@ -9,10 +9,11 @@
#nullable enable #nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryStream public class GetLibrarySectionsAllStream
{ {
/// <summary> /// <summary>
@@ -22,10 +23,23 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public long Id { get; set; } = default!; public long Id { get; set; } = default!;
/// <summary> /// <summary>
/// Stream type (1=video, 2=audio, 3=subtitle). /// Stream type:<br/>
///
/// <remarks>
/// - 1 = video<br/>
/// - 2 = audio<br/>
/// - 3 = subtitle<br/>
///
/// </remarks>
/// </summary> /// </summary>
[JsonProperty("streamType")] [JsonProperty("streamType")]
public int StreamType { get; set; } = default!; public GetLibrarySectionsAllStreamType StreamType { get; set; } = default!;
/// <summary>
/// Format of the stream (e.g., srt).
/// </summary>
[JsonProperty("format")]
public string? Format { get; set; }
/// <summary> /// <summary>
/// Indicates if this stream is default. /// Indicates if this stream is default.
@@ -43,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// Index of the stream. /// Index of the stream.
/// </summary> /// </summary>
[JsonProperty("index")] [JsonProperty("index")]
public int Index { get; set; } = default!; public int? Index { get; set; }
/// <summary> /// <summary>
/// Bitrate of the stream. /// Bitrate of the stream.
@@ -186,6 +200,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("frameRate")] [JsonProperty("frameRate")]
public float? FrameRate { get; set; } public float? FrameRate { get; set; }
/// <summary>
/// Key to access this stream part.
/// </summary>
[JsonProperty("key")]
public string? Key { get; set; }
/// <summary> /// <summary>
/// Height of the video stream. /// Height of the video stream.
/// </summary> /// </summary>

View File

@@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
// <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>
/// Stream type:<br/>
///
/// <remarks>
/// - 1 = video<br/>
/// - 2 = audio<br/>
/// - 3 = subtitle<br/>
///
/// </remarks>
/// </summary>
public enum GetLibrarySectionsAllStreamType
{
Video = 1,
Audio = 2,
Subtitle = 3,
}
}

View File

@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic; using System.Collections.Generic;
public class GetAllMediaLibraryType public class GetLibrarySectionsAllType
{ {
[JsonProperty("key")] [JsonProperty("key")]
@@ -33,12 +33,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public bool Active { get; set; } = default!; public bool Active { get; set; } = default!;
[JsonProperty("Filter")] [JsonProperty("Filter")]
public List<GetAllMediaLibraryFilter>? Filter { get; set; } public List<GetLibrarySectionsAllFilter>? Filter { get; set; }
[JsonProperty("Sort")] [JsonProperty("Sort")]
public List<GetAllMediaLibrarySort>? Sort { get; set; } public List<GetLibrarySectionsAllSort>? Sort { get; set; }
[JsonProperty("Field")] [JsonProperty("Field")]
public List<GetAllMediaLibraryField>? Field { get; set; } public List<GetLibrarySectionsAllField>? Field { get; set; }
} }
} }

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryUltraBlurColors public class GetLibrarySectionsAllUltraBlurColors
{ {
[JsonProperty("topLeft")] [JsonProperty("topLeft")]

View File

@@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetAllMediaLibraryWriter public class GetLibrarySectionsAllWriter
{ {
/// <summary> /// <summary>

View File

@@ -0,0 +1,47 @@
//------------------------------------------------------------------------------
// <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.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class GetMediaArtsMediaContainer
{
/// <summary>
/// Number of media items returned in this response.
/// </summary>
[JsonProperty("size")]
public int Size { get; set; } = default!;
/// <summary>
/// The version number for media tags.
/// </summary>
[JsonProperty("mediaTagVersion")]
public long MediaTagVersion { get; set; } = default!;
/// <summary>
/// The prefix used for media tag resource paths.
/// </summary>
[JsonProperty("mediaTagPrefix")]
public string MediaTagPrefix { get; set; } = default!;
/// <summary>
/// An plugin identifier for the media container.
/// </summary>
[JsonProperty("identifier")]
public string Identifier { get; set; } = default!;
[JsonProperty("Metadata")]
public List<GetMediaArtsMetadata> Metadata { get; set; } = default!;
}
}

View File

@@ -0,0 +1,48 @@
//------------------------------------------------------------------------------
// <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;
using Newtonsoft.Json;
public class GetMediaArtsMetadata
{
/// <summary>
/// The URL of the artwork.
/// </summary>
[JsonProperty("key")]
public string Key { get; set; } = default!;
/// <summary>
/// The provider of the artwork.
/// </summary>
[JsonProperty("provider")]
public string? Provider { get; set; }
/// <summary>
/// The URL of the artwork.
/// </summary>
[JsonProperty("ratingKey")]
public string RatingKey { get; set; } = default!;
/// <summary>
/// Whether this is the selected artwork.
/// </summary>
[JsonProperty("selected")]
public bool Selected { get; set; } = default!;
/// <summary>
/// The URL of the artwork thumbnail.
/// </summary>
[JsonProperty("thumb")]
public string Thumb { get; set; } = default!;
}
}

View File

@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <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;
public class GetMediaArtsRequest
{
/// <summary>
/// the id of the library item to return the artwork of.
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")]
public long RatingKey { get; set; } = default!;
}
}

View File

@@ -0,0 +1,40 @@
//------------------------------------------------------------------------------
// <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.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using System;
using System.Net.Http;
public class GetMediaArtsResponse
{
/// <summary>
/// HTTP response content type for this operation
/// </summary>
public string? ContentType { get; set; } = default!;
/// <summary>
/// HTTP response status code for this operation
/// </summary>
public int StatusCode { get; set; } = default!;
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
public HttpResponseMessage RawResponse { get; set; } = default!;
/// <summary>
/// The available background artwork for the library item.
/// </summary>
public GetMediaArtsResponseBody? Object { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <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.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// The available background artwork for the library item.
/// </summary>
public class GetMediaArtsResponseBody
{
[JsonProperty("MediaContainer")]
public GetMediaArtsMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -12,25 +12,30 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
/// <summary>
/// The filter query string for country media items.
/// </summary>
public class GetMediaMetaDataCountry public class GetMediaMetaDataCountry
{ {
/// <summary> /// <summary>
/// The unique country identifier. /// The unique identifier for the country.<br/>
///
/// <remarks>
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
///
/// </remarks>
/// </summary> /// </summary>
[JsonProperty("id")] [JsonProperty("id")]
public int Id { get; set; } = default!; public int Id { get; set; } = default!;
/// <summary> /// <summary>
/// The filter string for the country. /// The country of origin of this media item
/// </summary>
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
/// <summary>
/// The country name.
/// </summary> /// </summary>
[JsonProperty("tag")] [JsonProperty("tag")]
public string Tag { get; set; } = default!; public string Tag { get; set; } = default!;
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
} }
} }

View File

@@ -16,37 +16,31 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
/// <summary> /// <summary>
/// The unique role identifier. /// Unique identifier for the director.
/// </summary> /// </summary>
[JsonProperty("id")] [JsonProperty("id")]
public long Id { get; set; } = default!; public int Id { get; set; } = default!;
/// <summary> /// <summary>
/// The filter string for the role. /// The role of Director
/// </summary>
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
/// <summary>
/// The actor&apos;s name.
/// </summary> /// </summary>
[JsonProperty("tag")] [JsonProperty("tag")]
public string Tag { get; set; } = default!; public string Tag { get; set; } = default!;
/// <summary> /// <summary>
/// A key associated with the actor tag. /// The filter string used to query this director.
/// </summary>
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
/// <summary>
/// A unique 24-character hexadecimal key associated with the director&apos;s tag, used for internal identification.
/// </summary> /// </summary>
[JsonProperty("tagKey")] [JsonProperty("tagKey")]
public string TagKey { get; set; } = default!; public string TagKey { get; set; } = default!;
/// <summary> /// <summary>
/// The character name or role. /// The absolute URL of the thumbnail image for the director.
/// </summary>
[JsonProperty("role")]
public string? Role { get; set; }
/// <summary>
/// URL for the role thumbnail image.
/// </summary> /// </summary>
[JsonProperty("thumb")] [JsonProperty("thumb")]
public string? Thumb { get; set; } public string? Thumb { get; set; }

View File

@@ -12,25 +12,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
/// <summary>
/// The filter query string for similar items.
/// </summary>
public class GetMediaMetaDataGenre public class GetMediaMetaDataGenre
{ {
/// <summary> /// <summary>
/// The unique genre identifier. /// The unique identifier for the genre.<br/>
///
/// <remarks>
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
///
/// </remarks>
/// </summary> /// </summary>
[JsonProperty("id")] [JsonProperty("id")]
public long Id { get; set; } = default!; public int Id { get; set; } = default!;
/// <summary> /// <summary>
/// The filter string for the genre. /// The genre name of this media-item<br/>
/// </summary> ///
[JsonProperty("filter")] /// <remarks>
public string Filter { get; set; } = default!; ///
/// </remarks>
/// <summary>
/// The genre name.
/// </summary> /// </summary>
[JsonProperty("tag")] [JsonProperty("tag")]
public string Tag { get; set; } = default!; public string Tag { get; set; } = default!;
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
} }
} }

View File

@@ -16,7 +16,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
/// <summary> /// <summary>
/// The GUID value. /// The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary> /// </summary>
[JsonProperty("id")] [JsonProperty("id")]
public string Id { get; set; } = default!; public string Id { get; set; } = default!;

View File

@@ -9,27 +9,19 @@
#nullable enable #nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
public class GetMediaMetaDataImage public class GetMediaMetaDataImage
{ {
/// <summary>
/// Alternate text for the image.
/// </summary>
[JsonProperty("alt")] [JsonProperty("alt")]
public string Alt { get; set; } = default!; public string Alt { get; set; } = default!;
/// <summary>
/// The type of image (e.g., coverPoster, background, clearLogo).
/// </summary>
[JsonProperty("type")] [JsonProperty("type")]
public string Type { get; set; } = default!; public GetMediaMetaDataLibraryType Type { get; set; } = default!;
/// <summary>
/// The URL of the image.
/// </summary>
[JsonProperty("url")] [JsonProperty("url")]
public string Url { get; set; } = default!; public string Url { get; set; } = default!;
} }

View File

@@ -13,7 +13,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
public enum GetAllMediaLibraryLibraryResponseType public enum GetMediaMetaDataLibraryType
{ {
[JsonProperty("coverPoster")] [JsonProperty("coverPoster")]
CoverPoster, CoverPoster,
@@ -25,16 +25,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
ClearLogo, ClearLogo,
} }
public static class GetAllMediaLibraryLibraryResponseTypeExtension public static class GetMediaMetaDataLibraryTypeExtension
{ {
public static string Value(this GetAllMediaLibraryLibraryResponseType value) public static string Value(this GetMediaMetaDataLibraryType value)
{ {
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); 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 GetMediaMetaDataLibraryType ToEnum(this string value)
{ {
foreach(var field in typeof(GetAllMediaLibraryLibraryResponseType).GetFields()) foreach(var field in typeof(GetMediaMetaDataLibraryType).GetFields())
{ {
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0) if (attributes.Length == 0)
@@ -47,14 +47,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
var enumVal = field.GetValue(null); var enumVal = field.GetValue(null);
if (enumVal is GetAllMediaLibraryLibraryResponseType) if (enumVal is GetMediaMetaDataLibraryType)
{ {
return (GetAllMediaLibraryLibraryResponseType)enumVal; return (GetMediaMetaDataLibraryType)enumVal;
} }
} }
} }
throw new Exception($"Unknown value {value} for enum GetAllMediaLibraryLibraryResponseType"); throw new Exception($"Unknown value {value} for enum GetMediaMetaDataLibraryType");
} }
} }

View File

@@ -15,254 +15,165 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using NodaTime; using NodaTime;
using System.Collections.Generic; using System.Collections.Generic;
/// <summary>
/// Unknown<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class GetMediaMetaDataMetadata public class GetMediaMetaDataMetadata
{ {
/// <summary> /// <summary>
/// The rating key of the metadata item. /// The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API.
/// </summary> /// </summary>
[JsonProperty("ratingKey")] [JsonProperty("ratingKey")]
public string RatingKey { get; set; } = default!; public string RatingKey { get; set; } = default!;
/// <summary> /// <summary>
/// The rating key of the parent of this metadata item. /// The unique key for the media item.
/// </summary>
[JsonProperty("parentRatingKey")]
public string? ParentRatingKey { get; set; }
/// <summary>
/// The rating key of the grandparent of this metadata item.
/// </summary>
[JsonProperty("grandparentRatingKey")]
public string? GrandparentRatingKey { get; set; }
/// <summary>
/// A GUID identifying the parent entity (e.g., season) for the item.
/// </summary>
[JsonProperty("parentGuid")]
public string? ParentGuid { get; set; }
/// <summary>
/// A GUID identifying the grandparent entity (e.g., show).
/// </summary>
[JsonProperty("grandparentGuid")]
public string? GrandparentGuid { get; set; }
/// <summary>
/// A URL-friendly identifier (slug) for the grandparent entity.
/// </summary>
[JsonProperty("grandparentSlug")]
public string? GrandparentSlug { get; set; }
/// <summary>
/// A key identifying the grandparent metadata in the library.
/// </summary>
[JsonProperty("grandparentKey")]
public string? GrandparentKey { get; set; }
/// <summary>
/// A key identifying the parent metadata in the library.
/// </summary>
[JsonProperty("parentKey")]
public string? ParentKey { get; set; }
/// <summary>
/// The API key to access metadata details.
/// </summary> /// </summary>
[JsonProperty("key")] [JsonProperty("key")]
public string Key { get; set; } = default!; public string Key { get; set; } = default!;
/// <summary> /// <summary>
/// The globally unique identifier for the item. /// The globally unique identifier for the media item.
/// </summary> /// </summary>
[JsonProperty("guid")] [JsonProperty("guid")]
public string Guid { get; set; } = default!; public string Guid { get; set; } = default!;
/// <summary> /// <summary>
/// A URL-friendly identifier for the item. /// A URLfriendly version of the media title.
/// </summary> /// </summary>
[JsonProperty("slug")] [JsonProperty("slug")]
public string? Slug { get; set; } public string Slug { get; set; } = default!;
/// <summary> /// <summary>
/// The studio that produced the content. /// The studio that produced the media item.
/// </summary> /// </summary>
[JsonProperty("studio")] [JsonProperty("studio")]
public string? Studio { get; set; } public string? Studio { get; set; }
/// <summary>
/// The type of content (e.g., show, movie).
/// </summary>
[JsonProperty("type")] [JsonProperty("type")]
public string Type { get; set; } = default!; public GetMediaMetaDataType Type { get; set; } = default!;
/// <summary> /// <summary>
/// The title of the content. /// The title of the media item.
/// </summary> /// </summary>
[JsonProperty("title")] [JsonProperty("title")]
public string Title { get; set; } = default!; public string Title { get; set; } = default!;
/// <summary> /// <summary>
/// The original title of the content. /// The sort title used for ordering media items.
/// </summary> /// </summary>
[JsonProperty("originalTitle")] [JsonProperty("titleSort")]
public string? OriginalTitle { get; set; } public string TitleSort { get; set; } = default!;
/// <summary> /// <summary>
/// The title of the library section. /// The content rating for the media item.
/// </summary>
[JsonProperty("librarySectionTitle")]
public string LibrarySectionTitle { get; set; } = default!;
/// <summary>
/// The ID of the library section.
/// </summary>
[JsonProperty("librarySectionID")]
public long LibrarySectionID { get; set; } = default!;
/// <summary>
/// The key of the library section.
/// </summary>
[JsonProperty("librarySectionKey")]
public string LibrarySectionKey { get; set; } = default!;
/// <summary>
/// The content rating (e.g., TV-MA).
/// </summary> /// </summary>
[JsonProperty("contentRating")] [JsonProperty("contentRating")]
public string? ContentRating { get; set; } public string? ContentRating { get; set; }
/// <summary> /// <summary>
/// A summary of the content. /// A synopsis of the media item.
/// </summary> /// </summary>
[JsonProperty("summary")] [JsonProperty("summary")]
public string Summary { get; set; } = default!; public string Summary { get; set; } = default!;
/// <summary> /// <summary>
/// The index or order of the item. /// The critic rating for the media item.
/// </summary>
[JsonProperty("index")]
public long? Index { get; set; }
/// <summary>
/// The title of the grandparent entity (typically the show&apos;s title).
/// </summary>
[JsonProperty("grandparentTitle")]
public string? GrandparentTitle { get; set; }
/// <summary>
/// The title of the parent entity (typically the season&apos;s title).
/// </summary>
[JsonProperty("parentTitle")]
public string? ParentTitle { get; set; }
/// <summary>
/// The audience rating for the content.
/// </summary>
[JsonProperty("audienceRating")]
public float? AudienceRating { get; set; }
/// <summary>
/// The number of times the item has been viewed.
/// </summary>
[JsonProperty("viewCount")]
public long? ViewCount { get; set; }
/// <summary>
/// The number of times the item has been skipped.
/// </summary>
[JsonProperty("skipCount")]
public long? SkipCount { get; set; }
/// <summary>
/// Unix timestamp of when the item was last viewed.
/// </summary>
[JsonProperty("lastViewedAt")]
public long? LastViewedAt { get; set; }
/// <summary>
/// The release year.
/// </summary>
[JsonProperty("year")]
public int Year { get; set; } = default!;
/// <summary>
/// The general rating
/// </summary> /// </summary>
[JsonProperty("rating")] [JsonProperty("rating")]
public float? Rating { get; set; } public float Rating { get; set; } = default!;
/// <summary> /// <summary>
/// The URL or identifier for the rating image (e.g., Rotten Tomatoes rating image). /// The audience rating for the media item.
/// </summary> /// </summary>
[JsonProperty("ratingImage")] [JsonProperty("audienceRating")]
public string? RatingImage { get; set; } public double AudienceRating { get; set; } = default!;
/// <summary> /// <summary>
/// The tagline of the content. /// The release year of the media item.
/// </summary>
[JsonProperty("year")]
public int? Year { get; set; }
/// <summary>
/// A brief tagline for the media item.
/// </summary> /// </summary>
[JsonProperty("tagline")] [JsonProperty("tagline")]
public string? Tagline { get; set; } public string Tagline { get; set; } = default!;
[JsonProperty("chapterSource")]
public string? ChapterSource { get; set; }
[JsonProperty("primaryExtraKey")]
public string? PrimaryExtraKey { get; set; }
/// <summary> /// <summary>
/// URL of the thumbnail image. /// The thumbnail image URL for the media item.
/// </summary> /// </summary>
[JsonProperty("thumb")] [JsonProperty("thumb")]
public string Thumb { get; set; } = default!; public string Thumb { get; set; } = default!;
/// <summary> /// <summary>
/// URL of the art image. /// The art image URL for the media item.
/// </summary> /// </summary>
[JsonProperty("art")] [JsonProperty("art")]
public string Art { get; set; } = default!; public string Art { get; set; } = default!;
/// <summary> /// <summary>
/// URL of the theme image. /// The theme URL for the media item.
/// </summary> /// </summary>
[JsonProperty("theme")] [JsonProperty("theme")]
public string? Theme { get; set; } public string Theme { get; set; } = default!;
/// <summary> /// <summary>
/// Duration of the content in milliseconds. /// The index position of the media item.
/// </summary>
[JsonProperty("index")]
public int Index { get; set; } = default!;
/// <summary>
/// The number of leaf items (end nodes) under this media item.
/// </summary>
[JsonProperty("leafCount")]
public int? LeafCount { get; set; }
/// <summary>
/// The number of leaf items that have been viewed.
/// </summary>
[JsonProperty("viewedLeafCount")]
public int? ViewedLeafCount { get; set; }
/// <summary>
/// The number of child items associated with this media item.
/// </summary>
[JsonProperty("childCount")]
public int ChildCount { get; set; } = default!;
/// <summary>
/// The total number of seasons (for TV shows).
/// </summary>
[JsonProperty("seasonCount")]
public int SeasonCount { get; set; } = default!;
/// <summary>
/// The duration of the media item in milliseconds.
/// </summary> /// </summary>
[JsonProperty("duration")] [JsonProperty("duration")]
public int Duration { get; set; } = default!; public int Duration { get; set; } = default!;
/// <summary> /// <summary>
/// The original release date. /// The original release date of the media item.
/// </summary> /// </summary>
[JsonProperty("originallyAvailableAt")] [JsonProperty("originallyAvailableAt")]
public LocalDate? OriginallyAvailableAt { get; set; } public LocalDate OriginallyAvailableAt { get; set; } = default!;
/// <summary>
/// The total number of episodes (or leaves).
/// </summary>
[JsonProperty("leafCount")]
public long? LeafCount { get; set; }
/// <summary>
/// The number of episodes that have been viewed.
/// </summary>
[JsonProperty("viewedLeafCount")]
public long? ViewedLeafCount { get; set; }
/// <summary>
/// The number of child items.
/// </summary>
[JsonProperty("childCount")]
public int? ChildCount { get; set; }
[JsonProperty("addedAt")] [JsonProperty("addedAt")]
public long AddedAt { get; set; } = default!; public long AddedAt { get; set; } = default!;
/// <summary>
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("updatedAt")] [JsonProperty("updatedAt")]
public long UpdatedAt { get; set; } = default!; public long? UpdatedAt { get; set; }
/// <summary> /// <summary>
/// The URL for the audience rating image. /// The URL for the audience rating image.
@@ -271,99 +182,231 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string? AudienceRatingImage { get; set; } public string? AudienceRatingImage { get; set; }
/// <summary> /// <summary>
/// The index number of the parent entity, which could indicate its order or position. /// The source from which chapter data is derived.
/// </summary> /// </summary>
[JsonProperty("parentIndex")] [JsonProperty("chapterSource")]
public long? ParentIndex { get; set; } public string? ChapterSource { get; set; }
/// <summary> /// <summary>
/// The URL of the parent&apos;s thumbnail image. /// The primary extra key associated with this media item.
/// </summary> /// </summary>
[JsonProperty("parentThumb")] [JsonProperty("primaryExtraKey")]
public string? ParentThumb { get; set; } public string? PrimaryExtraKey { get; set; }
/// <summary> /// <summary>
/// The URL of the grandparent&apos;s thumbnail image. /// The original title of the media item (if different).
/// </summary>
[JsonProperty("originalTitle")]
public string? OriginalTitle { get; set; }
/// <summary>
/// The rating key of the parent media item.
/// </summary>
[JsonProperty("parentRatingKey")]
public string? ParentRatingKey { get; set; }
/// <summary>
/// The rating key of the grandparent media item.
/// </summary>
[JsonProperty("grandparentRatingKey")]
public string? GrandparentRatingKey { get; set; }
/// <summary>
/// The GUID of the parent media item.
/// </summary>
[JsonProperty("parentGuid")]
public string? ParentGuid { get; set; }
/// <summary>
/// The GUID of the grandparent media item.
/// </summary>
[JsonProperty("grandparentGuid")]
public string? GrandparentGuid { get; set; }
/// <summary>
/// The slug for the grandparent media item.
/// </summary>
[JsonProperty("grandparentSlug")]
public string? GrandparentSlug { get; set; }
/// <summary>
/// The key of the grandparent media item.
/// </summary>
[JsonProperty("grandparentKey")]
public string? GrandparentKey { get; set; }
/// <summary>
/// The key of the parent media item.
/// </summary>
[JsonProperty("parentKey")]
public string? ParentKey { get; set; }
/// <summary>
/// The title of the grandparent media item.
/// </summary>
[JsonProperty("grandparentTitle")]
public string? GrandparentTitle { get; set; }
/// <summary>
/// The thumbnail URL for the grandparent media item.
/// </summary> /// </summary>
[JsonProperty("grandparentThumb")] [JsonProperty("grandparentThumb")]
public string? GrandparentThumb { get; set; } public string? GrandparentThumb { get; set; }
/// <summary> /// <summary>
/// The URL of the grandparent&apos;s art image. /// The theme URL for the grandparent media item.
/// </summary>
[JsonProperty("grandparentTheme")]
public string? GrandparentTheme { get; set; }
/// <summary>
/// The art URL for the grandparent media item.
/// </summary> /// </summary>
[JsonProperty("grandparentArt")] [JsonProperty("grandparentArt")]
public string? GrandparentArt { get; set; } public string? GrandparentArt { get; set; }
[JsonProperty("Media")] /// <summary>
public List<GetMediaMetaDataMedia>? Media { get; set; } /// The title of the parent media item.
/// </summary>
[JsonProperty("parentTitle")]
public string? ParentTitle { get; set; }
/// <summary> /// <summary>
/// An array of image objects. /// The index position of the parent media item.
/// </summary> /// </summary>
[JsonProperty("parentIndex")]
public int? ParentIndex { get; set; }
/// <summary>
/// The thumbnail URL for the parent media item.
/// </summary>
[JsonProperty("parentThumb")]
public string? ParentThumb { get; set; }
/// <summary>
/// The URL for the rating image.
/// </summary>
[JsonProperty("ratingImage")]
public string? RatingImage { get; set; }
/// <summary>
/// The number of times this media item has been viewed.
/// </summary>
[JsonProperty("viewCount")]
public int? ViewCount { get; set; }
/// <summary>
/// The current playback offset (in milliseconds).
/// </summary>
[JsonProperty("viewOffset")]
public int? ViewOffset { get; set; }
/// <summary>
/// The number of times this media item has been skipped.
/// </summary>
[JsonProperty("skipCount")]
public int? SkipCount { get; set; }
/// <summary>
/// A classification that further describes the type of media item. For example, &apos;clip&apos; indicates that the item is a short video clip.
/// </summary>
[JsonProperty("subtype")]
public string? Subtype { get; set; }
/// <summary>
/// The Unix timestamp representing the last time the item was rated.
/// </summary>
[JsonProperty("lastRatedAt")]
public long? LastRatedAt { get; set; }
/// <summary>
/// The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, &apos;epoch,local&apos; means both epoch and local time formats are available).
/// </summary>
[JsonProperty("createdAtAccuracy")]
public string? CreatedAtAccuracy { get; set; }
/// <summary>
/// The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC.
/// </summary>
[JsonProperty("createdAtTZOffset")]
public string? CreatedAtTZOffset { get; set; }
/// <summary>
/// Unix timestamp for when the media item was last viewed.
/// </summary>
[JsonProperty("lastViewedAt")]
public int? LastViewedAt { get; set; }
/// <summary>
/// The rating provided by a user for the item. This value is expressed as a decimal number.
/// </summary>
[JsonProperty("userRating")]
public float? UserRating { get; set; }
[JsonProperty("Image")] [JsonProperty("Image")]
public List<GetMediaMetaDataImage> Image { get; set; } = default!; public List<GetMediaMetaDataImage>? Image { get; set; }
[JsonProperty("UltraBlurColors")] [JsonProperty("UltraBlurColors")]
public GetMediaMetaDataUltraBlurColors UltraBlurColors { get; set; } = default!; public GetMediaMetaDataUltraBlurColors? UltraBlurColors { get; set; }
/// <summary> /// <summary>
/// An array of genre tags. /// The identifier for the library section.
/// </summary> /// </summary>
[JsonProperty("Genre")] [JsonProperty("librarySectionID")]
public List<GetMediaMetaDataGenre>? Genre { get; set; } public long LibrarySectionID { get; set; } = default!;
/// <summary> /// <summary>
/// An array of country tags. /// The title of the library section.
/// </summary> /// </summary>
[JsonProperty("Country")] [JsonProperty("librarySectionTitle")]
public List<GetMediaMetaDataCountry>? Country { get; set; } public string LibrarySectionTitle { get; set; } = default!;
/// <summary> /// <summary>
/// An array of GUID objects. /// The key corresponding to the library section.
/// </summary> /// </summary>
[JsonProperty("librarySectionKey")]
public string LibrarySectionKey { get; set; } = default!;
[JsonProperty("Guid")] [JsonProperty("Guid")]
public List<GetMediaMetaDataGuids>? Guids { get; set; } public List<GetMediaMetaDataGuids>? Guids { get; set; }
/// <summary> [JsonProperty("Media")]
/// An array of rating objects. public List<GetMediaMetaDataMedia>? Media { get; set; }
/// </summary>
[JsonProperty("Rating")]
public List<Ratings>? Ratings { get; set; }
/// <summary> [JsonProperty("Genre")]
/// An array of Actor roles. public List<GetMediaMetaDataGenre>? Genre { get; set; }
/// </summary>
[JsonProperty("Role")] [JsonProperty("Country")]
public List<GetMediaMetaDataRole>? Role { get; set; } public List<GetMediaMetaDataCountry>? Country { get; set; }
/// <summary>
/// An array of Director roles.
/// </summary>
[JsonProperty("Director")] [JsonProperty("Director")]
public List<GetMediaMetaDataDirector>? Director { get; set; } public List<GetMediaMetaDataDirector>? Director { get; set; }
/// <summary>
/// An array of Writer roles.
/// </summary>
[JsonProperty("Writer")] [JsonProperty("Writer")]
public List<GetMediaMetaDataWriter>? Writer { get; set; } public List<GetMediaMetaDataWriter>? Writer { get; set; }
/// <summary>
/// An array of Writer roles.
/// </summary>
[JsonProperty("Producer")] [JsonProperty("Producer")]
public List<GetMediaMetaDataProducer>? Producer { get; set; } public List<GetMediaMetaDataProducer>? Producer { get; set; }
/// <summary> [JsonProperty("Role")]
/// An array of similar content objects. public List<GetMediaMetaDataRole>? Role { get; set; }
/// </summary>
[JsonProperty("Rating")]
public List<Ratings>? Ratings { get; set; }
[JsonProperty("Similar")] [JsonProperty("Similar")]
public List<GetMediaMetaDataSimilar>? Similar { get; set; } public List<GetMediaMetaDataSimilar>? Similar { get; set; }
/// <summary>
/// An array of location objects.
/// </summary>
[JsonProperty("Location")] [JsonProperty("Location")]
public List<GetMediaMetaDataLocation>? Location { get; set; } public List<GetMediaMetaDataLocation>? Location { get; set; }
[JsonProperty("Chapter")]
public List<Chapter>? Chapter { get; set; }
[JsonProperty("Marker")]
public List<Marker>? Marker { get; set; }
[JsonProperty("Extras")]
public Extras? Extras { get; set; }
} }
} }

View File

@@ -15,10 +15,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
/// <summary> /// <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> /// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")] [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")]
public long RatingKey { get; set; } = default!; public string RatingKey { get; set; } = default!;
/// <summary> /// <summary>
/// Include concerts data if set to true. /// Include concerts data if set to true.

View File

@@ -16,37 +16,47 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
/// <summary> /// <summary>
/// The unique role identifier. /// The unique identifier for the role.<br/>
///
/// <remarks>
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
///
/// </remarks>
/// </summary> /// </summary>
[JsonProperty("id")] [JsonProperty("id")]
public long Id { get; set; } = default!; public int Id { get; set; } = default!;
/// <summary> /// <summary>
/// The filter string for the role. /// The display tag for the actor (typically the actor&apos;s name).
/// </summary>
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
/// <summary>
/// The actor&apos;s name.
/// </summary> /// </summary>
[JsonProperty("tag")] [JsonProperty("tag")]
public string Tag { get; set; } = default!; public string Tag { get; set; } = default!;
/// <summary> /// <summary>
/// A key associated with the actor tag. /// The role played by the actor in the media item.
/// </summary>
[JsonProperty("tagKey")]
public string TagKey { get; set; } = default!;
/// <summary>
/// The character name or role.
/// </summary> /// </summary>
[JsonProperty("role")] [JsonProperty("role")]
public string? Role { get; set; } public string? Role { get; set; }
/// <summary> /// <summary>
/// URL for the role thumbnail image. /// The filter string used to query this actor. For example, it may indicate that this is an actor with a given key.
/// </summary>
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
/// <summary>
/// A 24-character hexadecimal unique key associated with the actor&apos;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; } = default!;
/// <summary>
/// The absolute URL of the thumbnail image for the actor.
/// </summary> /// </summary>
[JsonProperty("thumb")] [JsonProperty("thumb")]
public string? Thumb { get; set; } public string? Thumb { get; set; }

View File

@@ -9,6 +9,7 @@
#nullable enable #nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
@@ -22,10 +23,23 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public long Id { get; set; } = default!; public long Id { get; set; } = default!;
/// <summary> /// <summary>
/// Stream type (1=video, 2=audio, 3=subtitle). /// Stream type:<br/>
///
/// <remarks>
/// - 1 = video<br/>
/// - 2 = audio<br/>
/// - 3 = subtitle<br/>
///
/// </remarks>
/// </summary> /// </summary>
[JsonProperty("streamType")] [JsonProperty("streamType")]
public int StreamType { get; set; } = default!; public GetMediaMetaDataStreamType StreamType { get; set; } = default!;
/// <summary>
/// Format of the stream (e.g., srt).
/// </summary>
[JsonProperty("format")]
public string? Format { get; set; }
/// <summary> /// <summary>
/// Indicates if this stream is default. /// Indicates if this stream is default.
@@ -43,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// Index of the stream. /// Index of the stream.
/// </summary> /// </summary>
[JsonProperty("index")] [JsonProperty("index")]
public int Index { get; set; } = default!; public int? Index { get; set; }
/// <summary> /// <summary>
/// Bitrate of the stream. /// Bitrate of the stream.
@@ -186,6 +200,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("frameRate")] [JsonProperty("frameRate")]
public float? FrameRate { get; set; } public float? FrameRate { get; set; }
/// <summary>
/// Key to access this stream part.
/// </summary>
[JsonProperty("key")]
public string? Key { get; set; }
/// <summary> /// <summary>
/// Height of the video stream. /// Height of the video stream.
/// </summary> /// </summary>

View File

@@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
// <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>
/// Stream type:<br/>
///
/// <remarks>
/// - 1 = video<br/>
/// - 2 = audio<br/>
/// - 3 = subtitle<br/>
///
/// </remarks>
/// </summary>
public enum GetMediaMetaDataStreamType
{
Video = 1,
Audio = 2,
Subtitle = 3,
}
}

View File

@@ -0,0 +1,80 @@
//------------------------------------------------------------------------------
// <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;
using Newtonsoft.Json;
using System;
/// <summary>
/// The type of media content in the Plex library. This can represent videos, music, or photos.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetMediaMetaDataType
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
[JsonProperty("artist")]
Artist,
[JsonProperty("album")]
Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
}
public static class GetMediaMetaDataTypeExtension
{
public static string Value(this GetMediaMetaDataType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetMediaMetaDataType ToEnum(this string value)
{
foreach(var field in typeof(GetMediaMetaDataType).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is GetMediaMetaDataType)
{
return (GetMediaMetaDataType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetMediaMetaDataType");
}
}
}

View File

@@ -15,27 +15,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetMediaMetaDataUltraBlurColors public class GetMediaMetaDataUltraBlurColors
{ {
/// <summary>
/// The top-left color value.
/// </summary>
[JsonProperty("topLeft")] [JsonProperty("topLeft")]
public string TopLeft { get; set; } = default!; public string TopLeft { get; set; } = default!;
/// <summary>
/// The top-right color value.
/// </summary>
[JsonProperty("topRight")] [JsonProperty("topRight")]
public string TopRight { get; set; } = default!; public string TopRight { get; set; } = default!;
/// <summary>
/// The bottom-right color value.
/// </summary>
[JsonProperty("bottomRight")] [JsonProperty("bottomRight")]
public string BottomRight { get; set; } = default!; public string BottomRight { get; set; } = default!;
/// <summary>
/// The bottom-left color value.
/// </summary>
[JsonProperty("bottomLeft")] [JsonProperty("bottomLeft")]
public string BottomLeft { get; set; } = default!; public string BottomLeft { get; set; } = default!;
} }

View File

@@ -16,39 +16,33 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
/// <summary> /// <summary>
/// The unique role identifier. /// Unique identifier for the writer.
/// </summary> /// </summary>
[JsonProperty("id")] [JsonProperty("id")]
public long Id { get; set; } = default!; public int Id { get; set; } = default!;
/// <summary> /// <summary>
/// The filter string for the role. /// The role of Writer
/// </summary>
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
/// <summary>
/// The actor&apos;s name.
/// </summary> /// </summary>
[JsonProperty("tag")] [JsonProperty("tag")]
public string Tag { get; set; } = default!; public string Tag { get; set; } = default!;
/// <summary> /// <summary>
/// A key associated with the actor tag. /// The filter string used to query this writer.
/// </summary> /// </summary>
[JsonProperty("tagKey")] [JsonProperty("filter")]
public string TagKey { get; set; } = default!; public string Filter { get; set; } = default!;
/// <summary> /// <summary>
/// The character name or role. /// The absolute URL of the thumbnail image for the writer.
/// </summary>
[JsonProperty("role")]
public string? Role { get; set; }
/// <summary>
/// URL for the role thumbnail image.
/// </summary> /// </summary>
[JsonProperty("thumb")] [JsonProperty("thumb")]
public string? Thumb { get; set; } public string? Thumb { get; set; }
/// <summary>
/// A 24-character hexadecimal unique key associated with the writers tag, used for internal identification.
/// </summary>
[JsonProperty("tagKey")]
public string? TagKey { get; set; }
} }
} }

View File

@@ -0,0 +1,47 @@
//------------------------------------------------------------------------------
// <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.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class GetMediaPostersMediaContainer
{
/// <summary>
/// Number of media items returned in this response.
/// </summary>
[JsonProperty("size")]
public int Size { get; set; } = default!;
/// <summary>
/// The version number for media tags.
/// </summary>
[JsonProperty("mediaTagVersion")]
public long MediaTagVersion { get; set; } = default!;
/// <summary>
/// The prefix used for media tag resource paths.
/// </summary>
[JsonProperty("mediaTagPrefix")]
public string MediaTagPrefix { get; set; } = default!;
/// <summary>
/// An plugin identifier for the media container.
/// </summary>
[JsonProperty("identifier")]
public string Identifier { get; set; } = default!;
[JsonProperty("Metadata")]
public List<GetMediaPostersMetadata> Metadata { get; set; } = default!;
}
}

View File

@@ -0,0 +1,48 @@
//------------------------------------------------------------------------------
// <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;
using Newtonsoft.Json;
public class GetMediaPostersMetadata
{
/// <summary>
/// The URL of the poster.
/// </summary>
[JsonProperty("key")]
public string Key { get; set; } = default!;
/// <summary>
/// The provider of the poster.
/// </summary>
[JsonProperty("provider")]
public string? Provider { get; set; }
/// <summary>
/// The URL of the poster.
/// </summary>
[JsonProperty("ratingKey")]
public string RatingKey { get; set; } = default!;
/// <summary>
/// Whether this is the selected poster.
/// </summary>
[JsonProperty("selected")]
public bool Selected { get; set; } = default!;
/// <summary>
/// The URL of the poster thumbnail.
/// </summary>
[JsonProperty("thumb")]
public string Thumb { get; set; } = default!;
}
}

View File

@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <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;
public class GetMediaPostersRequest
{
/// <summary>
/// the id of the library item to return the posters of.
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey")]
public long RatingKey { get; set; } = default!;
}
}

View File

@@ -0,0 +1,40 @@
//------------------------------------------------------------------------------
// <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.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using System;
using System.Net.Http;
public class GetMediaPostersResponse
{
/// <summary>
/// HTTP response content type for this operation
/// </summary>
public string? ContentType { get; set; } = default!;
/// <summary>
/// HTTP response status code for this operation
/// </summary>
public int StatusCode { get; set; } = default!;
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
public HttpResponseMessage RawResponse { get; set; } = default!;
/// <summary>
/// The available posters for the library item.
/// </summary>
public GetMediaPostersResponseBody? Object { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <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.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// The available posters for the library item.
/// </summary>
public class GetMediaPostersResponseBody
{
[JsonProperty("MediaContainer")]
public GetMediaPostersMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -29,9 +29,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8, Artist = 5,
Album = 9, Album = 6,
Track = 10, Track = 7,
PhotoAlbum = 8,
Photo = 9,
} }
} }

View File

@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using System; using System;
/// <summary> /// <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>
/// ///
@@ -34,6 +34,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Artist, Artist,
[JsonProperty("album")] [JsonProperty("album")]
Album, Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
} }
public static class GetRecentlyAddedHubsTypeExtension public static class GetRecentlyAddedHubsTypeExtension

View File

@@ -391,6 +391,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("UltraBlurColors")] [JsonProperty("UltraBlurColors")]
public UltraBlurColors? UltraBlurColors { get; set; } public UltraBlurColors? UltraBlurColors { get; set; }
[JsonProperty("Guid")]
public List<Guids>? Guids { get; set; }
[JsonProperty("Media")] [JsonProperty("Media")]
public List<Models.Requests.Media>? Media { get; set; } public List<Models.Requests.Media>? Media { get; set; }
@@ -421,9 +424,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("Location")] [JsonProperty("Location")]
public List<Location>? Location { get; set; } public List<Location>? Location { get; set; }
[JsonProperty("Guid")]
public List<Guids>? Guids { get; set; }
[JsonProperty("Collection")] [JsonProperty("Collection")]
public List<Collection>? Collection { get; set; } public List<Collection>? Collection { get; set; }
} }

View File

@@ -15,6 +15,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetRefreshLibraryMetadataRequest public class GetRefreshLibraryMetadataRequest
{ {
/// <summary>
/// Force the refresh even if the library is already being refreshed.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=force")]
public Force? Force { get; set; }
/// <summary> /// <summary>
/// The unique key of the Plex library. <br/> /// The unique key of the Plex library. <br/>
/// ///
@@ -25,11 +31,5 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary> /// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")] [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")]
public int SectionKey { get; set; } = default!; public int SectionKey { get; set; } = default!;
/// <summary>
/// Force the refresh even if the library is already being refreshed.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=force")]
public Force? Force { get; set; }
} }
} }

View File

@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string? LibrarySectionKey { get; set; } public string? LibrarySectionKey { get; set; }
/// <summary> /// <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>
/// ///

View File

@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using System; using System;
/// <summary> /// <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>
/// ///
@@ -34,6 +34,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Artist, Artist,
[JsonProperty("album")] [JsonProperty("album")]
Album, Album,
[JsonProperty("track")]
Track,
[JsonProperty("photoalbum")]
PhotoAlbum,
[JsonProperty("photo")]
Photo,
[JsonProperty("collection")]
Collection,
} }
public static class GetSearchAllLibrariesTypeExtension public static class GetSearchAllLibrariesTypeExtension

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