Compare commits

...

22 Commits

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

3
.gitignore vendored
View File

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

File diff suppressed because one or more lines are too long

View File

@@ -4,18 +4,27 @@ generation:
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
sdkInitStyle: constructor
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: true
nameResolutionFeb2025: false
parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true
securityFeb2025: false
sharedErrorComponentsApr2025: false
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
csharp:
version: 0.12.0
version: 0.16.0
additionalDependencies: []
author: LukeHagar
baseErrorName: PlexAPIError
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKException
disableNamespacePascalCasingApr2024: true

View File

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

View File

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

View File

@@ -74,19 +74,12 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.12.0";
private const string _sdkGenVersion = "2.483.1";
private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.12.0 2.483.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;
}
@@ -97,21 +90,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/activities";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getServerActivities", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -179,7 +172,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -197,21 +194,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("cancelServerActivities", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "cancelServerActivities", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -271,7 +268,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

View File

@@ -95,19 +95,12 @@ namespace LukeHagar.PlexAPI.SDK
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.12.0";
private const string _sdkGenVersion = "2.483.1";
private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.12.0 2.483.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;
}
@@ -122,21 +115,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getTransientToken", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTransientToken", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -196,7 +189,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -214,21 +211,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/security/resources", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSourceConnectionInformation", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -288,7 +285,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -308,21 +309,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/user";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getTokenDetails", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTokenDetails", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -390,7 +391,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -410,7 +415,7 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/users/signin";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
@@ -419,14 +424,14 @@ namespace LukeHagar.PlexAPI.SDK
httpRequest.Content = serializedBody;
}
var hookCtx = new HookContext("post-users-sign-in-data", null, null);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "post-users-sign-in-data", new List<string> { }, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -494,7 +499,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

View File

@@ -17,7 +17,9 @@ namespace LukeHagar.PlexAPI.SDK
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
@@ -101,19 +103,12 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.12.0";
private const string _sdkGenVersion = "2.483.1";
private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.12.0 2.483.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;
}
@@ -124,21 +119,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getButlerTasks", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getButlerTasks", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -206,7 +201,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -221,21 +220,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("startAllTasks", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -295,7 +294,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -310,21 +313,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("stopAllTasks", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopAllTasks", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -384,7 +387,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -402,21 +409,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("startTask", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "startTask", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -476,7 +483,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -494,21 +505,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("stopTask", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "stopTask", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -568,7 +579,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

View File

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

View File

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

View File

@@ -73,19 +73,12 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.12.0";
private const string _sdkGenVersion = "2.483.1";
private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.12.0 2.483.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;
}
@@ -100,21 +93,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/hubs", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getGlobalHubs", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getGlobalHubs", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -182,7 +175,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -196,21 +193,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("get-recently-added", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-recently-added", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -256,7 +253,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode == 401 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode == 400 || responseStatusCode == 401 || responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -276,21 +277,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getLibraryHubs", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getLibraryHubs", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -358,7 +359,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -3,10 +3,10 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.12.0</Version>
<Version>0.16.0</Version>
<TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2024</Copyright>
<Copyright>Copyright (c) LukeHagar 2025</Copyright>
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Plex Media Server SDK</PackageTags>

View File

@@ -90,19 +90,12 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.12.0";
private const string _sdkGenVersion = "2.483.1";
private const string _sdkVersion = "0.16.0";
private const string _sdkGenVersion = "2.674.1";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.12.0 2.483.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;
}
@@ -116,21 +109,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("markPlayed", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "markPlayed", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -190,7 +183,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -208,21 +205,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("markUnplayed", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "markUnplayed", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -282,7 +279,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -302,21 +303,21 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/:/progress", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("updatePlayProgress", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "updatePlayProgress", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -376,7 +377,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -390,22 +395,22 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("get-banner-image", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-banner-image", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -472,7 +477,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
@@ -486,22 +495,22 @@ namespace LukeHagar.PlexAPI.SDK
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null)
if (SDKConfiguration.SecuritySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
}
var hookCtx = new HookContext("get-thumb-image", null, _securitySource);
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-thumb-image", new List<string> { }, SDKConfiguration.SecuritySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -568,7 +577,11 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
else if(responseStatusCode >= 400 && responseStatusCode < 500)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

View File

@@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
/// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary>
public class GetMetaDataByRatingKeyBadRequest : Exception
public class GetActorsLibraryBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetMetaDataByRatingKeyErrors>? Errors { get; set; }
public List<GetActorsLibraryErrors>? Errors { get; set; }
/// <summary>
/// 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 Newtonsoft.Json;
public class GetOnDeckLibraryErrors
public class GetActorsLibraryErrors
{
[JsonProperty("code")]

View File

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

View File

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

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
/// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary>
public class GetCountriesLibraryBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetCountriesLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

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

View File

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

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetCountriesLibraryUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetCountriesLibraryLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
/// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary>
public class GetGenresLibraryBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetGenresLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

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

View File

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

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetGenresLibraryUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetGenresLibraryLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
/// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary>
public class GetLibrarySectionsAllBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetLibrarySectionsAllErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

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

View File

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

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetLibrarySectionsAllUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetLibrarySectionsAllLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
/// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary>
public class GetMediaMetaDataBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetMediaMetaDataErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

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

View File

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

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetMediaMetaDataUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetMediaMetaDataLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
/// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary>
public class GetOnDeckBadRequest : Exception
public class GetUsersBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetOnDeckErrors>? Errors { get; set; }
public List<GetUsersErrors>? Errors { get; set; }
/// <summary>
/// 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 Newtonsoft.Json;
public class GetOnDeckErrors
public class GetUsersErrors
{
[JsonProperty("code")]

View File

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

View File

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

View File

@@ -0,0 +1,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;
/// <summary>
/// Indicates if the user has access to all libraries.
/// </summary>
public enum AllLibraries
{
Disable = 0,
Enable = 1,
}
}

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;
/// <summary>
/// Indicates if the user is allowed to upload from a camera.
/// </summary>
public enum AllowCameraUpload
{
Disable = 0,
Enable = 1,
}
}

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;
/// <summary>
/// Indicates if the user has access to channels.
/// </summary>
public enum AllowChannels
{
Disable = 0,
Enable = 1,
}
}

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;
/// <summary>
/// Indicates if the user can manage subtitles.
/// </summary>
public enum AllowSubtitleAdmin
{
Disable = 0,
Enable = 1,
}
}

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;
/// <summary>
/// Indicates if the user is allowed to sync media.
/// </summary>
public enum AllowSync
{
Disable = 0,
Enable = 1,
}
}

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;
/// <summary>
/// Indicates if the user is allowed to use tuners.
/// </summary>
public enum AllowTuners
{
Disable = 0,
Enable = 1,
}
}

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

@@ -12,25 +12,28 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetMetaDataByRatingKeyRole
/// <summary>
/// The thumbnail for the chapter
/// </summary>
public class Chapter
{
[JsonProperty("id")]
public int? Id { get; set; }
public long Id { get; set; } = default!;
[JsonProperty("filter")]
public string? Filter { get; set; }
public string Filter { get; set; } = default!;
[JsonProperty("tag")]
public string? Tag { get; set; }
[JsonProperty("index")]
public long Index { get; set; } = default!;
[JsonProperty("tagKey")]
public string? TagKey { get; set; }
[JsonProperty("startTimeOffset")]
public long StartTimeOffset { get; set; } = default!;
[JsonProperty("role")]
public string? Role { get; set; }
[JsonProperty("endTimeOffset")]
public long EndTimeOffset { get; set; } = default!;
[JsonProperty("thumb")]
public string? Thumb { get; set; }
public string Thumb { get; set; } = default!;
}
}

View File

@@ -15,7 +15,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class Collection
{
/// <summary>
/// The user-made collection this media item belongs to
/// </summary>
[JsonProperty("tag")]
public string? Tag { get; set; }
public string Tag { get; set; } = default!;
}
}

View File

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

View File

@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// type of playlist to create
/// </summary>
public enum CreatePlaylistQueryParamType
[JsonConverter(typeof(OpenEnumConverter))]
public class CreatePlaylistQueryParamType : IEquatable<CreatePlaylistQueryParamType>
{
[JsonProperty("audio")]
Audio,
[JsonProperty("video")]
Video,
[JsonProperty("photo")]
Photo,
}
public static readonly CreatePlaylistQueryParamType Audio = new CreatePlaylistQueryParamType("audio");
public static readonly CreatePlaylistQueryParamType Video = new CreatePlaylistQueryParamType("video");
public static readonly CreatePlaylistQueryParamType Photo = new CreatePlaylistQueryParamType("photo");
public static class CreatePlaylistQueryParamTypeExtension
{
public static string Value(this CreatePlaylistQueryParamType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static CreatePlaylistQueryParamType ToEnum(this string value)
{
foreach(var field in typeof(CreatePlaylistQueryParamType).GetFields())
private static readonly Dictionary <string, CreatePlaylistQueryParamType> _knownValues =
new Dictionary <string, CreatePlaylistQueryParamType> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["audio"] = Audio,
["video"] = Video,
["photo"] = Photo
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, CreatePlaylistQueryParamType> _values =
new ConcurrentDictionary<string, CreatePlaylistQueryParamType>(_knownValues);
if (enumVal is CreatePlaylistQueryParamType)
{
return (CreatePlaylistQueryParamType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum CreatePlaylistQueryParamType");
private CreatePlaylistQueryParamType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static CreatePlaylistQueryParamType Of(string value)
{
return _values.GetOrAdd(value, _ => new CreatePlaylistQueryParamType(value));
}
public static implicit operator CreatePlaylistQueryParamType(string value) => Of(value);
public static implicit operator string(CreatePlaylistQueryParamType createplaylistqueryparamtype) => createplaylistqueryparamtype.Value;
public static CreatePlaylistQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as CreatePlaylistQueryParamType);
public bool Equals(CreatePlaylistQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -11,6 +11,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class CreatePlaylistRequest
{

View File

@@ -15,7 +15,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class Director
{
/// <summary>
/// Unique identifier for the director.
/// </summary>
[JsonProperty("id")]
public int Id { get; set; } = default!;
/// <summary>
/// The filter string used to query this director.
/// </summary>
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
/// <summary>
/// The role of Director
/// </summary>
[JsonProperty("tag")]
public string? Tag { get; set; }
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

@@ -12,51 +12,69 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Filter
/// </summary>
public enum Filter
[JsonConverter(typeof(OpenEnumConverter))]
public class Filter : IEquatable<Filter>
{
[JsonProperty("all")]
All,
[JsonProperty("available")]
Available,
[JsonProperty("released")]
Released,
}
public static readonly Filter All = new Filter("all");
public static readonly Filter Available = new Filter("available");
public static readonly Filter Released = new Filter("released");
public static class FilterExtension
{
public static string Value(this Filter value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Filter ToEnum(this string value)
{
foreach(var field in typeof(Filter).GetFields())
private static readonly Dictionary <string, Filter> _knownValues =
new Dictionary <string, Filter> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["all"] = All,
["available"] = Available,
["released"] = Released
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, Filter> _values =
new ConcurrentDictionary<string, Filter>(_knownValues);
if (enumVal is Filter)
{
return (Filter)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Filter");
private Filter(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static Filter Of(string value)
{
return _values.GetOrAdd(value, _ => new Filter(value));
}
public static implicit operator Filter(string value) => Of(value);
public static implicit operator string(Filter filter) => filter.Value;
public static Filter[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as Filter);
public bool Equals(Filter? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,46 +12,73 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum FlattenSeasons
{
[JsonProperty("0")]
False,
[JsonProperty("1")]
True,
}
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public static class FlattenSeasonsExtension
/// <summary>
/// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonConverter(typeof(OpenEnumConverter))]
public class FlattenSeasons : IEquatable<FlattenSeasons>
{
public static string Value(this FlattenSeasons value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static readonly FlattenSeasons LibraryDefault = new FlattenSeasons("-1");
public static readonly FlattenSeasons Hide = new FlattenSeasons("0");
public static readonly FlattenSeasons Show = new FlattenSeasons("1");
public static FlattenSeasons ToEnum(this string value)
{
foreach(var field in typeof(FlattenSeasons).GetFields())
private static readonly Dictionary <string, FlattenSeasons> _knownValues =
new Dictionary <string, FlattenSeasons> ()
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
["-1"] = LibraryDefault,
["0"] = Hide,
["1"] = Show
};
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
private static readonly ConcurrentDictionary<string, FlattenSeasons> _values =
new ConcurrentDictionary<string, FlattenSeasons>(_knownValues);
if (enumVal is FlattenSeasons)
{
return (FlattenSeasons)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum FlattenSeasons");
private FlattenSeasons(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static FlattenSeasons Of(string value)
{
return _values.GetOrAdd(value, _ => new FlattenSeasons(value));
}
public static implicit operator FlattenSeasons(string value) => Of(value);
public static implicit operator string(FlattenSeasons flattenseasons) => flattenseasons.Value;
public static FlattenSeasons[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as FlattenSeasons);
public bool Equals(FlattenSeasons? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -12,7 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class Friend
{

View File

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

View File

@@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <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 GetActorsLibraryDirectory
{
/// <summary>
/// A fast lookup key for the actor relative url.
/// </summary>
[JsonProperty("fastKey")]
public string FastKey { get; set; } = default!;
/// <summary>
/// URL for the thumbnail image of the actor.
/// </summary>
[JsonProperty("thumb")]
public string Thumb { get; set; } = default!;
/// <summary>
/// A unique key representing the actor.
/// </summary>
[JsonProperty("key")]
public string Key { get; set; } = default!;
/// <summary>
/// The name of the actor.
/// </summary>
[JsonProperty("title")]
public string Title { get; set; } = default!;
}
}

View File

@@ -0,0 +1,98 @@
//------------------------------------------------------------------------------
// <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 GetActorsLibraryMediaContainer
{
/// <summary>
/// Number of media items returned in this response.
/// </summary>
[JsonProperty("size")]
public int Size { get; set; } = default!;
/// <summary>
/// Indicates whether syncing is allowed.
/// </summary>
[JsonProperty("allowSync")]
public bool AllowSync { get; set; } = default!;
/// <summary>
/// URL for the background artwork of the media container.
/// </summary>
[JsonProperty("art")]
public string Art { get; set; } = default!;
/// <summary>
/// An plugin identifier for the media container.
/// </summary>
[JsonProperty("identifier")]
public string Identifier { get; set; } = default!;
/// <summary>
/// The prefix used for media tag resource paths.
/// </summary>
[JsonProperty("mediaTagPrefix")]
public string MediaTagPrefix { get; set; } = default!;
/// <summary>
/// The version number for media tags.
/// </summary>
[JsonProperty("mediaTagVersion")]
public long MediaTagVersion { get; set; } = default!;
/// <summary>
/// Specifies whether caching is disabled.
/// </summary>
[JsonProperty("nocache")]
public bool Nocache { get; set; } = default!;
/// <summary>
/// URL for the thumbnail image of the media container.
/// </summary>
[JsonProperty("thumb")]
public string Thumb { get; set; } = default!;
/// <summary>
/// The primary title of the media container.
/// </summary>
[JsonProperty("title1")]
public string Title1 { get; set; } = default!;
/// <summary>
/// The secondary title of the media container.
/// </summary>
[JsonProperty("title2")]
public string Title2 { get; set; } = default!;
/// <summary>
/// Identifier for the view group layout.
/// </summary>
[JsonProperty("viewGroup")]
public string ViewGroup { get; set; } = default!;
/// <summary>
/// Identifier for the view mode.
/// </summary>
[JsonProperty("viewMode")]
public string? ViewMode { get; set; }
/// <summary>
/// An array of actor entries for media items.
/// </summary>
[JsonProperty("Directory")]
public List<GetActorsLibraryDirectory>? Directory { get; set; }
}
}

View File

@@ -0,0 +1,100 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
/// <remarks>
/// 1 = movie<br/>
/// 2 = show<br/>
/// 3 = season<br/>
/// 4 = episode<br/>
/// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/>
///
/// </remarks>
/// </summary>
[JsonConverter(typeof(OpenEnumConverter))]
public class GetActorsLibraryQueryParamType : IEquatable<GetActorsLibraryQueryParamType>
{
public static readonly GetActorsLibraryQueryParamType Movie = new GetActorsLibraryQueryParamType(1);
public static readonly GetActorsLibraryQueryParamType TvShow = new GetActorsLibraryQueryParamType(2);
public static readonly GetActorsLibraryQueryParamType Season = new GetActorsLibraryQueryParamType(3);
public static readonly GetActorsLibraryQueryParamType Episode = new GetActorsLibraryQueryParamType(4);
public static readonly GetActorsLibraryQueryParamType Artist = new GetActorsLibraryQueryParamType(5);
public static readonly GetActorsLibraryQueryParamType Album = new GetActorsLibraryQueryParamType(6);
public static readonly GetActorsLibraryQueryParamType Track = new GetActorsLibraryQueryParamType(7);
public static readonly GetActorsLibraryQueryParamType PhotoAlbum = new GetActorsLibraryQueryParamType(8);
public static readonly GetActorsLibraryQueryParamType Photo = new GetActorsLibraryQueryParamType(9);
private static readonly Dictionary <long, GetActorsLibraryQueryParamType> _knownValues =
new Dictionary <long, GetActorsLibraryQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetActorsLibraryQueryParamType> _values =
new ConcurrentDictionary<long, GetActorsLibraryQueryParamType>(_knownValues);
private GetActorsLibraryQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetActorsLibraryQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetActorsLibraryQueryParamType(value));
}
public static implicit operator GetActorsLibraryQueryParamType(long value) => Of(value);
public static implicit operator long(GetActorsLibraryQueryParamType getactorslibraryqueryparamtype) => getactorslibraryqueryparamtype.Value;
public static GetActorsLibraryQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetActorsLibraryQueryParamType);
public bool Equals(GetActorsLibraryQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -0,0 +1,49 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetActorsLibraryRequest
{
/// <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>
/// The type of media to retrieve or filter by.<br/>
///
/// <remarks>
/// 1 = movie<br/>
/// 2 = show<br/>
/// 3 = season<br/>
/// 4 = episode<br/>
/// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
public GetActorsLibraryQueryParamType Type { 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 GetActorsLibraryResponse
{
/// <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>
/// Successful response containing media container data.
/// </summary>
public GetActorsLibraryResponseBody? 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>
/// Successful response containing media container data.
/// </summary>
public class GetActorsLibraryResponseBody
{
[JsonProperty("MediaContainer")]
public GetActorsLibraryMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -12,47 +12,86 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetAllLibrariesDirectory
{
/// <summary>
/// Indicates whether syncing is allowed.
/// </summary>
[JsonProperty("allowSync")]
public bool AllowSync { get; set; } = default!;
/// <summary>
/// URL for the background artwork of the media container.
/// </summary>
[JsonProperty("art")]
public string Art { get; set; } = default!;
/// <summary>
/// The relative path to the composite media item.
/// </summary>
[JsonProperty("composite")]
public string Composite { get; set; } = default!;
/// <summary>
/// UNKNOWN
/// </summary>
[JsonProperty("filters")]
public bool Filters { get; set; } = default!;
/// <summary>
/// Indicates whether the library is currently being refreshed or updated
/// </summary>
[JsonProperty("refreshing")]
public bool Refreshing { get; set; } = default!;
/// <summary>
/// URL for the thumbnail image of the media container.
/// </summary>
[JsonProperty("thumb")]
public string Thumb { get; set; } = default!;
/// <summary>
/// The library key representing the unique identifier
/// </summary>
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("type")]
public string Type { get; set; } = default!;
public GetAllLibrariesType Type { get; set; } = default!;
/// <summary>
/// The title of the library
/// </summary>
[JsonProperty("title")]
public string Title { get; set; } = default!;
/// <summary>
/// The Plex agent used to match and retrieve media metadata.
/// </summary>
[JsonProperty("agent")]
public string Agent { get; set; } = default!;
/// <summary>
/// UNKNOWN
/// </summary>
[JsonProperty("scanner")]
public string Scanner { get; set; } = default!;
/// <summary>
/// The Plex library language that has been set
/// </summary>
[JsonProperty("language")]
public string Language { get; set; } = default!;
/// <summary>
/// The universally unique identifier for the library.
/// </summary>
[JsonProperty("uuid")]
public string Uuid { get; set; } = default!;
@@ -62,11 +101,8 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("updatedAt")]
public long UpdatedAt { get; set; } = default!;
/// <summary>
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("createdAt")]
public long CreatedAt { get; set; } = default!;
public long? CreatedAt { get; set; }
/// <summary>
/// Unix epoch datetime in seconds
@@ -74,20 +110,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("scannedAt")]
public long ScannedAt { get; set; } = default!;
/// <summary>
/// UNKNOWN
/// </summary>
[JsonProperty("content")]
public bool Content { get; set; } = default!;
/// <summary>
/// UNKNOWN
/// </summary>
[JsonProperty("directory")]
public bool Directory { get; set; } = default!;
/// <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>
[JsonProperty("contentChangedAt")]
public long ContentChangedAt { get; set; } = default!;
/// <summary>
/// The Plex library visibility setting
/// </summary>
[JsonProperty("hidden")]
public int Hidden { get; set; } = default!;
public Hidden? Hidden { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.Hidden.Visible;
[JsonProperty("Location")]
public List<GetAllLibrariesLocation> Location { get; set; } = default!;

View File

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

View File

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

View File

@@ -0,0 +1,94 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The library type
/// </summary>
[JsonConverter(typeof(OpenEnumConverter))]
public class GetAllLibrariesType : IEquatable<GetAllLibrariesType>
{
public static readonly GetAllLibrariesType Movie = new GetAllLibrariesType("movie");
public static readonly GetAllLibrariesType TvShow = new GetAllLibrariesType("show");
public static readonly GetAllLibrariesType Season = new GetAllLibrariesType("season");
public static readonly GetAllLibrariesType Episode = new GetAllLibrariesType("episode");
public static readonly GetAllLibrariesType Artist = new GetAllLibrariesType("artist");
public static readonly GetAllLibrariesType Album = new GetAllLibrariesType("album");
public static readonly GetAllLibrariesType Track = new GetAllLibrariesType("track");
public static readonly GetAllLibrariesType PhotoAlbum = new GetAllLibrariesType("photoalbum");
public static readonly GetAllLibrariesType Photo = new GetAllLibrariesType("photo");
public static readonly GetAllLibrariesType Collection = new GetAllLibrariesType("collection");
private static readonly Dictionary <string, GetAllLibrariesType> _knownValues =
new Dictionary <string, GetAllLibrariesType> ()
{
["movie"] = Movie,
["show"] = TvShow,
["season"] = Season,
["episode"] = Episode,
["artist"] = Artist,
["album"] = Album,
["track"] = Track,
["photoalbum"] = PhotoAlbum,
["photo"] = Photo,
["collection"] = Collection
};
private static readonly ConcurrentDictionary<string, GetAllLibrariesType> _values =
new ConcurrentDictionary<string, GetAllLibrariesType>(_knownValues);
private GetAllLibrariesType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static GetAllLibrariesType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetAllLibrariesType(value));
}
public static implicit operator GetAllLibrariesType(string value) => Of(value);
public static implicit operator string(GetAllLibrariesType getalllibrariestype) => getalllibrariestype.Value;
public static GetAllLibrariesType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetAllLibrariesType);
public bool Equals(GetAllLibrariesType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetCountriesLibraryDirectory
{
[JsonProperty("fastKey")]
public string FastKey { get; set; } = default!;
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
}
}

View File

@@ -0,0 +1,95 @@
//------------------------------------------------------------------------------
// <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 GetCountriesLibraryMediaContainer
{
/// <summary>
/// Number of media items returned in this response.
/// </summary>
[JsonProperty("size")]
public int Size { get; set; } = default!;
/// <summary>
/// Indicates whether syncing is allowed.
/// </summary>
[JsonProperty("allowSync")]
public bool AllowSync { get; set; } = default!;
/// <summary>
/// URL for the background artwork of the media container.
/// </summary>
[JsonProperty("art")]
public string Art { get; set; } = default!;
/// <summary>
/// The content type or mode.
/// </summary>
[JsonProperty("content")]
public string Content { get; set; } = default!;
/// <summary>
/// An plugin identifier for the media container.
/// </summary>
[JsonProperty("identifier")]
public string Identifier { get; set; } = default!;
/// <summary>
/// The prefix used for media tag resource paths.
/// </summary>
[JsonProperty("mediaTagPrefix")]
public string MediaTagPrefix { get; set; } = default!;
/// <summary>
/// The version number for media tags.
/// </summary>
[JsonProperty("mediaTagVersion")]
public long MediaTagVersion { get; set; } = default!;
/// <summary>
/// Specifies whether caching is disabled.
/// </summary>
[JsonProperty("nocache")]
public bool Nocache { get; set; } = default!;
/// <summary>
/// URL for the thumbnail image of the media container.
/// </summary>
[JsonProperty("thumb")]
public string Thumb { get; set; } = default!;
/// <summary>
/// The primary title of the media container.
/// </summary>
[JsonProperty("title1")]
public string Title1 { get; set; } = default!;
/// <summary>
/// The secondary title of the media container.
/// </summary>
[JsonProperty("title2")]
public string Title2 { get; set; } = default!;
/// <summary>
/// Identifier for the view group layout.
/// </summary>
[JsonProperty("viewGroup")]
public string ViewGroup { get; set; } = default!;
[JsonProperty("Directory")]
public List<GetCountriesLibraryDirectory>? Directory { get; set; }
}
}

View File

@@ -0,0 +1,100 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
/// <remarks>
/// 1 = movie<br/>
/// 2 = show<br/>
/// 3 = season<br/>
/// 4 = episode<br/>
/// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/>
///
/// </remarks>
/// </summary>
[JsonConverter(typeof(OpenEnumConverter))]
public class GetCountriesLibraryQueryParamType : IEquatable<GetCountriesLibraryQueryParamType>
{
public static readonly GetCountriesLibraryQueryParamType Movie = new GetCountriesLibraryQueryParamType(1);
public static readonly GetCountriesLibraryQueryParamType TvShow = new GetCountriesLibraryQueryParamType(2);
public static readonly GetCountriesLibraryQueryParamType Season = new GetCountriesLibraryQueryParamType(3);
public static readonly GetCountriesLibraryQueryParamType Episode = new GetCountriesLibraryQueryParamType(4);
public static readonly GetCountriesLibraryQueryParamType Artist = new GetCountriesLibraryQueryParamType(5);
public static readonly GetCountriesLibraryQueryParamType Album = new GetCountriesLibraryQueryParamType(6);
public static readonly GetCountriesLibraryQueryParamType Track = new GetCountriesLibraryQueryParamType(7);
public static readonly GetCountriesLibraryQueryParamType PhotoAlbum = new GetCountriesLibraryQueryParamType(8);
public static readonly GetCountriesLibraryQueryParamType Photo = new GetCountriesLibraryQueryParamType(9);
private static readonly Dictionary <long, GetCountriesLibraryQueryParamType> _knownValues =
new Dictionary <long, GetCountriesLibraryQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetCountriesLibraryQueryParamType> _values =
new ConcurrentDictionary<long, GetCountriesLibraryQueryParamType>(_knownValues);
private GetCountriesLibraryQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetCountriesLibraryQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetCountriesLibraryQueryParamType(value));
}
public static implicit operator GetCountriesLibraryQueryParamType(long value) => Of(value);
public static implicit operator long(GetCountriesLibraryQueryParamType getcountrieslibraryqueryparamtype) => getcountrieslibraryqueryparamtype.Value;
public static GetCountriesLibraryQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetCountriesLibraryQueryParamType);
public bool Equals(GetCountriesLibraryQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -0,0 +1,49 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetCountriesLibraryRequest
{
/// <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>
/// The type of media to retrieve or filter by.<br/>
///
/// <remarks>
/// 1 = movie<br/>
/// 2 = show<br/>
/// 3 = season<br/>
/// 4 = episode<br/>
/// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
public GetCountriesLibraryQueryParamType Type { 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 GetCountriesLibraryResponse
{
/// <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>
/// Successful response containing media container data.
/// </summary>
public GetCountriesLibraryResponseBody? 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>
/// Successful response containing media container data.
/// </summary>
public class GetCountriesLibraryResponseBody
{
[JsonProperty("MediaContainer")]
public GetCountriesLibraryMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <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 GetGenresLibraryDirectory
{
[JsonProperty("fastKey")]
public string FastKey { get; set; } = default!;
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
[JsonProperty("type")]
public string Type { get; set; } = default!;
}
}

View File

@@ -0,0 +1,95 @@
//------------------------------------------------------------------------------
// <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 GetGenresLibraryMediaContainer
{
/// <summary>
/// Number of media items returned in this response.
/// </summary>
[JsonProperty("size")]
public int Size { get; set; } = default!;
/// <summary>
/// Indicates whether syncing is allowed.
/// </summary>
[JsonProperty("allowSync")]
public bool AllowSync { get; set; } = default!;
/// <summary>
/// URL for the background artwork of the media container.
/// </summary>
[JsonProperty("art")]
public string Art { get; set; } = default!;
/// <summary>
/// The content type or mode.
/// </summary>
[JsonProperty("content")]
public string Content { get; set; } = default!;
/// <summary>
/// An plugin identifier for the media container.
/// </summary>
[JsonProperty("identifier")]
public string Identifier { get; set; } = default!;
/// <summary>
/// The prefix used for media tag resource paths.
/// </summary>
[JsonProperty("mediaTagPrefix")]
public string MediaTagPrefix { get; set; } = default!;
/// <summary>
/// The version number for media tags.
/// </summary>
[JsonProperty("mediaTagVersion")]
public long MediaTagVersion { get; set; } = default!;
/// <summary>
/// Specifies whether caching is disabled.
/// </summary>
[JsonProperty("nocache")]
public bool Nocache { get; set; } = default!;
/// <summary>
/// URL for the thumbnail image of the media container.
/// </summary>
[JsonProperty("thumb")]
public string Thumb { get; set; } = default!;
/// <summary>
/// The primary title of the media container.
/// </summary>
[JsonProperty("title1")]
public string Title1 { get; set; } = default!;
/// <summary>
/// The secondary title of the media container.
/// </summary>
[JsonProperty("title2")]
public string Title2 { get; set; } = default!;
/// <summary>
/// Identifier for the view group layout.
/// </summary>
[JsonProperty("viewGroup")]
public string ViewGroup { get; set; } = default!;
[JsonProperty("Directory")]
public List<GetGenresLibraryDirectory>? Directory { get; set; }
}
}

View File

@@ -0,0 +1,100 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The type of media to retrieve or filter by.<br/>
///
/// <remarks>
/// 1 = movie<br/>
/// 2 = show<br/>
/// 3 = season<br/>
/// 4 = episode<br/>
/// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/>
///
/// </remarks>
/// </summary>
[JsonConverter(typeof(OpenEnumConverter))]
public class GetGenresLibraryQueryParamType : IEquatable<GetGenresLibraryQueryParamType>
{
public static readonly GetGenresLibraryQueryParamType Movie = new GetGenresLibraryQueryParamType(1);
public static readonly GetGenresLibraryQueryParamType TvShow = new GetGenresLibraryQueryParamType(2);
public static readonly GetGenresLibraryQueryParamType Season = new GetGenresLibraryQueryParamType(3);
public static readonly GetGenresLibraryQueryParamType Episode = new GetGenresLibraryQueryParamType(4);
public static readonly GetGenresLibraryQueryParamType Artist = new GetGenresLibraryQueryParamType(5);
public static readonly GetGenresLibraryQueryParamType Album = new GetGenresLibraryQueryParamType(6);
public static readonly GetGenresLibraryQueryParamType Track = new GetGenresLibraryQueryParamType(7);
public static readonly GetGenresLibraryQueryParamType PhotoAlbum = new GetGenresLibraryQueryParamType(8);
public static readonly GetGenresLibraryQueryParamType Photo = new GetGenresLibraryQueryParamType(9);
private static readonly Dictionary <long, GetGenresLibraryQueryParamType> _knownValues =
new Dictionary <long, GetGenresLibraryQueryParamType> ()
{
[1] = Movie,
[2] = TvShow,
[3] = Season,
[4] = Episode,
[5] = Artist,
[6] = Album,
[7] = Track,
[8] = PhotoAlbum,
[9] = Photo
};
private static readonly ConcurrentDictionary<long, GetGenresLibraryQueryParamType> _values =
new ConcurrentDictionary<long, GetGenresLibraryQueryParamType>(_knownValues);
private GetGenresLibraryQueryParamType(long value)
{
Value = value;
}
public long Value { get; }
public static GetGenresLibraryQueryParamType Of(long value)
{
return _values.GetOrAdd(value, _ => new GetGenresLibraryQueryParamType(value));
}
public static implicit operator GetGenresLibraryQueryParamType(long value) => Of(value);
public static implicit operator long(GetGenresLibraryQueryParamType getgenreslibraryqueryparamtype) => getgenreslibraryqueryparamtype.Value;
public static GetGenresLibraryQueryParamType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetGenresLibraryQueryParamType);
public bool Equals(GetGenresLibraryQueryParamType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -0,0 +1,49 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetGenresLibraryRequest
{
/// <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>
/// The type of media to retrieve or filter by.<br/>
///
/// <remarks>
/// 1 = movie<br/>
/// 2 = show<br/>
/// 3 = season<br/>
/// 4 = episode<br/>
/// E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
public GetGenresLibraryQueryParamType Type { 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 GetGenresLibraryResponse
{
/// <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>
/// Successful response containing media container data.
/// </summary>
public GetGenresLibraryResponseBody? 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>
/// Successful response containing media container data.
/// </summary>
public class GetGenresLibraryResponseBody
{
[JsonProperty("MediaContainer")]
public GetGenresLibraryMediaContainer? MediaContainer { get; set; }
}
}

View File

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

View File

@@ -15,7 +15,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetLibraryItemsCollection
{
/// <summary>
/// The user-made collection this media item belongs to
/// </summary>
[JsonProperty("tag")]
public string? Tag { get; set; }
public string Tag { get; set; } = default!;
}
}

View File

@@ -15,7 +15,21 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetLibraryItemsCountry
{
/// <summary>
/// The unique identifier for the country.<br/>
///
/// <remarks>
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("id")]
public int Id { get; set; } = default!;
/// <summary>
/// The country of origin of this media item
/// </summary>
[JsonProperty("tag")]
public string? Tag { get; set; }
public string Tag { get; set; } = default!;
}
}

View File

@@ -15,7 +15,22 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetLibraryItemsDirector
{
/// <summary>
/// Unique identifier for the director.
/// </summary>
[JsonProperty("id")]
public int Id { get; set; } = default!;
/// <summary>
/// The role of Director
/// </summary>
[JsonProperty("tag")]
public string? Tag { get; set; }
public string Tag { get; set; } = default!;
/// <summary>
/// The absolute URL of the thumbnail image for the director.
/// </summary>
[JsonProperty("thumb")]
public string? Thumb { get; set; }
}
}

View File

@@ -15,7 +15,25 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetLibraryItemsGenre
{
/// <summary>
/// The unique identifier for the genre.<br/>
///
/// <remarks>
/// NOTE: This is different for each Plex server and is not globally unique.<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("id")]
public int Id { get; set; } = default!;
/// <summary>
/// The genre name of this media-item<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("tag")]
public string? Tag { get; set; }
public string Tag { get; set; } = default!;
}
}

View File

@@ -12,14 +12,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class MediaGuid
public class GetLibraryItemsGuids
{
/// <summary>
/// Can be one of the following formats:<br/>
/// The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb://<br/>
///
/// <remarks>
/// imdb://tt13015952, tmdb://2434012, tvdb://7945991<br/>
///
/// </remarks>
/// </summary>

View File

@@ -13,6 +13,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using Newtonsoft.Json;
using System;
/// <summary>
/// Indicates if the part has a thumbnail.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsHasThumbnail
{
[JsonProperty("0")]

View File

@@ -12,6 +12,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
public class GetLibraryItemsImage
{
@@ -20,7 +24,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string Alt { get; set; } = default!;
[JsonProperty("type")]
public GetLibraryItemsLibraryResponse200Type Type { get; set; } = default!;
public GetLibraryItemsLibraryResponseType Type { get; set; } = default!;
[JsonProperty("url")]
public string Url { get; set; } = default!;

View File

@@ -0,0 +1,203 @@
//------------------------------------------------------------------------------
// <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 Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Reflection;
public class GetLibraryItemsLibraryOptimizedForStreamingType
{
private GetLibraryItemsLibraryOptimizedForStreamingType(string value) { Value = value; }
public string Value { get; private set; }
public static GetLibraryItemsLibraryOptimizedForStreamingType GetLibraryItemsOptimizedForStreaming1 { get { return new GetLibraryItemsLibraryOptimizedForStreamingType("get-library-items_optimizedForStreaming_1"); } }
public static GetLibraryItemsLibraryOptimizedForStreamingType Boolean { get { return new GetLibraryItemsLibraryOptimizedForStreamingType("boolean"); } }
public static GetLibraryItemsLibraryOptimizedForStreamingType Null { get { return new GetLibraryItemsLibraryOptimizedForStreamingType("null"); } }
public override string ToString() { return Value; }
public static implicit operator String(GetLibraryItemsLibraryOptimizedForStreamingType v) { return v.Value; }
public static GetLibraryItemsLibraryOptimizedForStreamingType FromString(string v) {
switch(v) {
case "get-library-items_optimizedForStreaming_1": return GetLibraryItemsOptimizedForStreaming1;
case "boolean": return Boolean;
case "null": return Null;
default: throw new ArgumentException("Invalid value for GetLibraryItemsLibraryOptimizedForStreamingType");
}
}
public override bool Equals(object? obj)
{
if (obj == null || GetType() != obj.GetType())
{
return false;
}
return Value.Equals(((GetLibraryItemsLibraryOptimizedForStreamingType)obj).Value);
}
public override int GetHashCode()
{
return Value.GetHashCode();
}
}
/// <summary>
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonConverter(typeof(GetLibraryItemsLibraryOptimizedForStreaming.GetLibraryItemsLibraryOptimizedForStreamingConverter))]
public class GetLibraryItemsLibraryOptimizedForStreaming {
public GetLibraryItemsLibraryOptimizedForStreaming(GetLibraryItemsLibraryOptimizedForStreamingType type) {
Type = type;
}
[SpeakeasyMetadata("form:explode=true")]
public GetLibraryItemsOptimizedForStreaming1? GetLibraryItemsOptimizedForStreaming1 { get; set; }
[SpeakeasyMetadata("form:explode=true")]
public bool? Boolean { get; set; }
public GetLibraryItemsLibraryOptimizedForStreamingType Type { get; set; }
public static GetLibraryItemsLibraryOptimizedForStreaming CreateGetLibraryItemsOptimizedForStreaming1(GetLibraryItemsOptimizedForStreaming1 getLibraryItemsOptimizedForStreaming1) {
GetLibraryItemsLibraryOptimizedForStreamingType typ = GetLibraryItemsLibraryOptimizedForStreamingType.GetLibraryItemsOptimizedForStreaming1;
GetLibraryItemsLibraryOptimizedForStreaming res = new GetLibraryItemsLibraryOptimizedForStreaming(typ);
res.GetLibraryItemsOptimizedForStreaming1 = getLibraryItemsOptimizedForStreaming1;
return res;
}
public static GetLibraryItemsLibraryOptimizedForStreaming CreateBoolean(bool boolean) {
GetLibraryItemsLibraryOptimizedForStreamingType typ = GetLibraryItemsLibraryOptimizedForStreamingType.Boolean;
GetLibraryItemsLibraryOptimizedForStreaming res = new GetLibraryItemsLibraryOptimizedForStreaming(typ);
res.Boolean = boolean;
return res;
}
public static GetLibraryItemsLibraryOptimizedForStreaming CreateNull() {
GetLibraryItemsLibraryOptimizedForStreamingType typ = GetLibraryItemsLibraryOptimizedForStreamingType.Null;
return new GetLibraryItemsLibraryOptimizedForStreaming(typ);
}
public class GetLibraryItemsLibraryOptimizedForStreamingConverter : JsonConverter
{
public override bool CanConvert(System.Type objectType) => objectType == typeof(GetLibraryItemsLibraryOptimizedForStreaming);
public override bool CanRead => true;
public override object? ReadJson(JsonReader reader, System.Type objectType, object? existingValue, JsonSerializer serializer)
{
var json = JRaw.Create(reader).ToString();
if (json == "null")
{
return null;
}
var fallbackCandidates = new List<(System.Type, object, string)>();
try
{
return new GetLibraryItemsLibraryOptimizedForStreaming(GetLibraryItemsLibraryOptimizedForStreamingType.GetLibraryItemsOptimizedForStreaming1)
{
GetLibraryItemsOptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<GetLibraryItemsOptimizedForStreaming1>(json)
};
}
catch (ResponseBodyDeserializer.MissingMemberException)
{
fallbackCandidates.Add((typeof(GetLibraryItemsOptimizedForStreaming1), new GetLibraryItemsLibraryOptimizedForStreaming(GetLibraryItemsLibraryOptimizedForStreamingType.GetLibraryItemsOptimizedForStreaming1), "GetLibraryItemsOptimizedForStreaming1"));
}
catch (ResponseBodyDeserializer.DeserializationException)
{
// try next option
}
catch (Exception)
{
throw;
}
try
{
var converted = Convert.ToBoolean(json);
return new GetLibraryItemsLibraryOptimizedForStreaming(GetLibraryItemsLibraryOptimizedForStreamingType.Boolean)
{
Boolean = converted
};
}
catch (System.FormatException)
{
// try next option
}
if (fallbackCandidates.Count > 0)
{
fallbackCandidates.Sort((a, b) => ResponseBodyDeserializer.CompareFallbackCandidates(a.Item1, b.Item1, json));
foreach(var (deserializationType, returnObject, propertyName) in fallbackCandidates)
{
try
{
return ResponseBodyDeserializer.DeserializeUndiscriminatedUnionFallback(deserializationType, returnObject, propertyName, json);
}
catch (ResponseBodyDeserializer.DeserializationException)
{
// try next fallback option
}
catch (Exception)
{
throw;
}
}
}
throw new InvalidOperationException("Could not deserialize into any supported types.");
}
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
if (value == null) {
writer.WriteRawValue("null");
return;
}
GetLibraryItemsLibraryOptimizedForStreaming res = (GetLibraryItemsLibraryOptimizedForStreaming)value;
if (GetLibraryItemsLibraryOptimizedForStreamingType.FromString(res.Type).Equals(GetLibraryItemsLibraryOptimizedForStreamingType.Null))
{
writer.WriteRawValue("null");
return;
}
if (res.GetLibraryItemsOptimizedForStreaming1 != null)
{
writer.WriteRawValue(Utilities.SerializeJSON(res.GetLibraryItemsOptimizedForStreaming1));
return;
}
if (res.Boolean != null)
{
writer.WriteRawValue(Utilities.SerializeJSON(res.Boolean));
return;
}
}
}
}
}

View File

@@ -9,33 +9,71 @@
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
public class GetLibraryItemsLibraryResponseType
using System.Linq;
[JsonConverter(typeof(OpenEnumConverter))]
public class GetLibraryItemsLibraryResponseType : IEquatable<GetLibraryItemsLibraryResponseType>
{
public static readonly GetLibraryItemsLibraryResponseType CoverPoster = new GetLibraryItemsLibraryResponseType("coverPoster");
public static readonly GetLibraryItemsLibraryResponseType Background = new GetLibraryItemsLibraryResponseType("background");
public static readonly GetLibraryItemsLibraryResponseType Snapshot = new GetLibraryItemsLibraryResponseType("snapshot");
public static readonly GetLibraryItemsLibraryResponseType ClearLogo = new GetLibraryItemsLibraryResponseType("clearLogo");
[JsonProperty("key")]
public string Key { get; set; } = default!;
private static readonly Dictionary <string, GetLibraryItemsLibraryResponseType> _knownValues =
new Dictionary <string, GetLibraryItemsLibraryResponseType> ()
{
["coverPoster"] = CoverPoster,
["background"] = Background,
["snapshot"] = Snapshot,
["clearLogo"] = ClearLogo
};
[JsonProperty("type")]
public string Type { get; set; } = default!;
private static readonly ConcurrentDictionary<string, GetLibraryItemsLibraryResponseType> _values =
new ConcurrentDictionary<string, GetLibraryItemsLibraryResponseType>(_knownValues);
[JsonProperty("title")]
public string Title { get; set; } = default!;
private GetLibraryItemsLibraryResponseType(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
[JsonProperty("active")]
public bool Active { get; set; } = default!;
public string Value { get; }
[JsonProperty("Filter")]
public List<GetLibraryItemsLibraryFilter>? Filter { get; set; }
public static GetLibraryItemsLibraryResponseType Of(string value)
{
return _values.GetOrAdd(value, _ => new GetLibraryItemsLibraryResponseType(value));
}
[JsonProperty("Sort")]
public List<GetLibraryItemsLibrarySort>? Sort { get; set; }
public static implicit operator GetLibraryItemsLibraryResponseType(string value) => Of(value);
public static implicit operator string(GetLibraryItemsLibraryResponseType getlibraryitemslibraryresponsetype) => getlibraryitemslibraryresponsetype.Value;
[JsonProperty("Field")]
public List<GetLibraryItemsLibraryField>? Field { get; set; }
public static GetLibraryItemsLibraryResponseType[] Values()
{
return _values.Values.ToArray();
}
public override string ToString() => Value.ToString();
public bool IsKnown()
{
return _knownValues.ContainsKey(Value);
}
public override bool Equals(object? obj) => Equals(obj as GetLibraryItemsLibraryResponseType);
public bool Equals(GetLibraryItemsLibraryResponseType? other)
{
if (ReferenceEquals(this, other)) return true;
if (other is null) return false;
return string.Equals(Value, other.Value);
}
public override int GetHashCode() => Value.GetHashCode();
}
}

View File

@@ -9,60 +9,33 @@
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
/// <summary>
/// The type of media content<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsLibraryType
public class GetLibraryItemsLibraryType
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("type")]
public string Type { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
[JsonProperty("active")]
public bool Active { get; set; } = default!;
[JsonProperty("Filter")]
public List<GetLibraryItemsFilter>? Filter { get; set; }
[JsonProperty("Sort")]
public List<GetLibraryItemsSort>? Sort { get; set; }
[JsonProperty("Field")]
public List<GetLibraryItemsField>? Field { get; set; }
}
public static class GetLibraryItemsLibraryTypeExtension
{
public static string Value(this GetLibraryItemsLibraryType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsLibraryType ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsLibraryType).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 GetLibraryItemsLibraryType)
{
return (GetLibraryItemsLibraryType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsLibraryType");
}
}
}

View File

@@ -12,10 +12,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// The folder path for the media item.
/// </summary>
public class GetLibraryItemsLocation
{
[JsonProperty("path")]
public string? Path { get; set; }
public string Path { get; set; } = default!;
}
}

View File

@@ -9,6 +9,7 @@
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
@@ -17,58 +18,121 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetLibraryItemsMedia
{
/// <summary>
/// Unique media identifier.
/// </summary>
[JsonProperty("id")]
public int Id { get; set; } = default!;
public long Id { get; set; } = default!;
/// <summary>
/// Duration of the media in milliseconds.
/// </summary>
[JsonProperty("duration")]
public int? Duration { get; set; }
/// <summary>
/// Bitrate in bits per second.
/// </summary>
[JsonProperty("bitrate")]
public int? Bitrate { get; set; }
/// <summary>
/// Video width in pixels.
/// </summary>
[JsonProperty("width")]
public int? Width { get; set; }
/// <summary>
/// Video height in pixels.
/// </summary>
[JsonProperty("height")]
public int? Height { get; set; }
/// <summary>
/// Aspect ratio of the video.
/// </summary>
[JsonProperty("aspectRatio")]
public double? AspectRatio { get; set; }
[JsonProperty("audioProfile")]
public string? AudioProfile { get; set; }
public float? AspectRatio { get; set; }
/// <summary>
/// Number of audio channels.
/// </summary>
[JsonProperty("audioChannels")]
public int? AudioChannels { get; set; }
[JsonProperty("displayOffset")]
public int? DisplayOffset { get; set; }
/// <summary>
/// Audio codec used.
/// </summary>
[JsonProperty("audioCodec")]
public string? AudioCodec { get; set; }
/// <summary>
/// Video codec used.
/// </summary>
[JsonProperty("videoCodec")]
public string? VideoCodec { get; set; }
/// <summary>
/// Video resolution (e.g., 4k).
/// </summary>
[JsonProperty("videoResolution")]
public string? VideoResolution { get; set; }
/// <summary>
/// Container format of the media.
/// </summary>
[JsonProperty("container")]
public string Container { get; set; } = default!;
public string? Container { get; set; }
/// <summary>
/// Frame rate of the video. Values found include NTSC, PAL, 24p<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("videoFrameRate")]
public string? VideoFrameRate { get; set; }
/// <summary>
/// Video profile (e.g., main 10).
/// </summary>
[JsonProperty("videoProfile")]
public string? VideoProfile { get; set; }
/// <summary>
/// Indicates whether voice activity is detected.
/// </summary>
[JsonProperty("hasVoiceActivity")]
public bool? HasVoiceActivity { get; set; }
[JsonProperty("optimizedForStreaming")]
public GetLibraryItemsOptimizedForStreaming? OptimizedForStreaming { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsOptimizedForStreaming.Disable;
/// <summary>
/// The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
/// </summary>
[JsonProperty("audioProfile")]
public string? AudioProfile { get; set; }
/// <summary>
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// </summary>
[JsonProperty("optimizedForStreaming")]
public GetLibraryItemsOptimizedForStreaming? OptimizedForStreaming { get; set; }
/// <summary>
/// Indicates whether the media has 64-bit offsets.<br/>
///
/// <remarks>
/// This is relevant for media files that may require larger offsets than what 32-bit integers can provide.<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("Part")]
public List<GetLibraryItemsPart> Part { get; set; } = default!;
public List<GetLibraryItemsPart>? Part { get; set; }
}
}

View File

@@ -14,81 +14,128 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class GetLibraryItemsMediaContainer
{
[JsonProperty("Type")]
public List<GetLibraryItemsType>? Type { get; set; }
[JsonProperty("FieldType")]
public List<GetLibraryItemsFieldType>? FieldType { get; set; }
/// <summary>
/// Number of media items returned in this response.
/// </summary>
[JsonProperty("size")]
public int Size { get; set; } = default!;
/// <summary>
/// Total number of media items in the library.
/// </summary>
[JsonProperty("totalSize")]
public int TotalSize { get; set; } = default!;
/// <summary>
/// Offset value for pagination.
/// </summary>
[JsonProperty("offset")]
public int Offset { get; set; } = default!;
public long Offset { get; set; } = default!;
/// <summary>
/// The content type or mode.
/// </summary>
[JsonProperty("content")]
public string Content { get; set; } = default!;
/// <summary>
/// Indicates whether syncing is allowed.
/// </summary>
[JsonProperty("allowSync")]
public bool AllowSync { get; set; } = default!;
/// <summary>
/// Specifies whether caching is disabled.
/// </summary>
[JsonProperty("nocache")]
public bool? Nocache { get; set; }
public bool Nocache { get; set; } = default!;
/// <summary>
/// URL for the background artwork of the media container.
/// </summary>
[JsonProperty("art")]
public string Art { get; set; } = default!;
/// <summary>
/// An plugin identifier for the media container.
/// </summary>
[JsonProperty("identifier")]
public string Identifier { get; set; } = default!;
/// <summary>
/// The unique identifier for the library section.
/// </summary>
[JsonProperty("librarySectionID")]
public long LibrarySectionID { get; set; } = default!;
public long? LibrarySectionID { get; set; }
/// <summary>
/// The title of the library section.
/// </summary>
[JsonProperty("librarySectionTitle")]
public string LibrarySectionTitle { get; set; } = default!;
public string? LibrarySectionTitle { get; set; }
/// <summary>
/// The universally unique identifier for the library section.
/// </summary>
[JsonProperty("librarySectionUUID")]
public string LibrarySectionUUID { get; set; } = default!;
public string? LibrarySectionUUID { get; set; }
/// <summary>
/// The prefix used for media tag resource paths.
/// </summary>
[JsonProperty("mediaTagPrefix")]
public string MediaTagPrefix { get; set; } = default!;
/// <summary>
/// The version number for media tags.
/// </summary>
[JsonProperty("mediaTagVersion")]
public int MediaTagVersion { get; set; } = default!;
public long MediaTagVersion { get; set; } = default!;
/// <summary>
/// URL for the thumbnail image of the media container.
/// </summary>
[JsonProperty("thumb")]
public string Thumb { get; set; } = default!;
/// <summary>
/// The primary title of the media container.
/// </summary>
[JsonProperty("title1")]
public string Title1 { get; set; } = default!;
/// <summary>
/// The secondary title of the media container.
/// </summary>
[JsonProperty("title2")]
public string Title2 { get; set; } = default!;
/// <summary>
/// Identifier for the view group layout.
/// </summary>
[JsonProperty("viewGroup")]
public string ViewGroup { get; set; } = default!;
/// <summary>
/// Identifier for the view mode.
/// </summary>
[JsonProperty("viewMode")]
public int? ViewMode { get; set; }
public string? ViewMode { get; set; }
/// <summary>
/// Indicates if the media container has mixed parents.
/// </summary>
[JsonProperty("mixedParents")]
public bool? MixedParents { get; set; }
/// <summary>
/// An array of metadata items.
/// </summary>
[JsonProperty("Metadata")]
public List<GetLibraryItemsMetadata>? Metadata { get; set; }
public List<GetLibraryItemsMetadata> Metadata { get; set; } = default!;
/// <summary>
/// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/>

View File

@@ -25,9 +25,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
[JsonProperty("Type")]
public List<GetLibraryItemsLibraryResponseType>? Type { get; set; }
public List<GetLibraryItemsLibraryType>? Type { get; set; }
[JsonProperty("FieldType")]
public List<GetLibraryItemsLibraryFieldType>? FieldType { get; set; }
public List<GetLibraryItemsFieldType>? FieldType { get; set; }
}
}

View File

@@ -13,116 +13,168 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using NodaTime;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Unknown<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class GetLibraryItemsMetadata
{
/// <summary>
/// The rating key (Media ID) of this media item.<br/>
///
/// <remarks>
/// Note: This is always an integer, but is represented as a string in the API.<br/>
///
/// </remarks>
/// 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>
[JsonProperty("ratingKey")]
public string RatingKey { get; set; } = default!;
/// <summary>
/// The unique key for the media item.
/// </summary>
[JsonProperty("key")]
public string Key { get; set; } = default!;
/// <summary>
/// The globally unique identifier for the media item.
/// </summary>
[JsonProperty("guid")]
public string Guid { get; set; } = default!;
/// <summary>
/// A URLfriendly version of the media title.
/// </summary>
[JsonProperty("slug")]
public string Slug { get; set; } = default!;
/// <summary>
/// The studio that produced the media item.
/// </summary>
[JsonProperty("studio")]
public string? Studio { get; set; }
[JsonProperty("skipChildren")]
public bool? SkipChildren { get; set; }
[JsonProperty("librarySectionID")]
public long? LibrarySectionID { get; set; }
[JsonProperty("librarySectionTitle")]
public string? LibrarySectionTitle { get; set; }
[JsonProperty("librarySectionKey")]
public string? LibrarySectionKey { get; set; }
[JsonProperty("type")]
public GetLibraryItemsType Type { get; set; } = default!;
/// <summary>
/// The type of media content<br/>
///
/// <remarks>
///
/// </remarks>
/// The title of the media item.
/// </summary>
[JsonProperty("type")]
public GetLibraryItemsLibraryType Type { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
[JsonProperty("slug")]
public string? Slug { get; set; }
/// <summary>
/// The banner image URL for the media item.
/// </summary>
[JsonProperty("banner")]
public string Banner { get; set; } = default!;
/// <summary>
/// The sort title used for ordering media items.
/// </summary>
[JsonProperty("titleSort")]
public string TitleSort { get; set; } = default!;
/// <summary>
/// The content rating for the media item.
/// </summary>
[JsonProperty("contentRating")]
public string? ContentRating { get; set; }
/// <summary>
/// A synopsis of the media item.
/// </summary>
[JsonProperty("summary")]
public string Summary { get; set; } = default!;
/// <summary>
/// The critic rating for the media item.
/// </summary>
[JsonProperty("rating")]
public double? Rating { get; set; }
public float Rating { get; set; } = default!;
/// <summary>
/// The audience rating for the media item.
/// </summary>
[JsonProperty("audienceRating")]
public double? AudienceRating { get; set; }
public double AudienceRating { get; set; } = default!;
/// <summary>
/// The release year of the media item.
/// </summary>
[JsonProperty("year")]
public int? Year { get; set; }
[JsonProperty("seasonCount")]
public int? SeasonCount { get; set; }
/// <summary>
/// A brief tagline for the media item.
/// </summary>
[JsonProperty("tagline")]
public string? Tagline { get; set; }
[JsonProperty("flattenSeasons")]
public GetLibraryItemsFlattenSeasons? FlattenSeasons { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsFlattenSeasons.False;
public string Tagline { get; set; } = default!;
/// <summary>
/// Setting that indicates the episode ordering for the show<br/>
///
/// <remarks>
/// None = Library default,<br/>
/// tmdbAiring = The Movie Database (Aired),<br/>
/// tvdbAiring = TheTVDB (Aired),<br/>
/// tvdbDvd = TheTVDB (DVD),<br/>
/// tvdbAbsolute = TheTVDB (Absolute)).<br/>
///
/// </remarks>
/// The thumbnail image URL for the media item.
/// </summary>
[JsonProperty("showOrdering")]
public GetLibraryItemsShowOrdering? ShowOrdering { get; set; }
[JsonProperty("thumb")]
public string? Thumb { get; set; }
public string Thumb { get; set; } = default!;
/// <summary>
/// The art image URL for the media item.
/// </summary>
[JsonProperty("art")]
public string? Art { get; set; }
public string Art { get; set; } = default!;
[JsonProperty("banner")]
public string? Banner { get; set; }
/// <summary>
/// The theme URL for the media item.
/// </summary>
[JsonProperty("theme")]
public string Theme { get; set; } = default!;
/// <summary>
/// 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>
[JsonProperty("duration")]
public int? Duration { get; set; }
public int Duration { get; set; } = default!;
/// <summary>
/// The original release date of the media item.
/// </summary>
[JsonProperty("originallyAvailableAt")]
public LocalDate? OriginallyAvailableAt { get; set; }
/// <summary>
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("addedAt")]
public long AddedAt { get; set; } = default!;
@@ -132,52 +184,233 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("updatedAt")]
public long? UpdatedAt { get; set; }
/// <summary>
/// The URL for the audience rating image.
/// </summary>
[JsonProperty("audienceRatingImage")]
public string? AudienceRatingImage { get; set; }
/// <summary>
/// The source from which chapter data is derived.
/// </summary>
[JsonProperty("chapterSource")]
public string? ChapterSource { get; set; }
/// <summary>
/// The primary extra key associated with this media item.
/// </summary>
[JsonProperty("primaryExtraKey")]
public string? PrimaryExtraKey { get; set; }
[JsonProperty("ratingImage")]
public string? RatingImage { get; set; }
/// <summary>
/// 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; }
[JsonProperty("grandparentKey")]
public string? GrandparentKey { get; set; }
[JsonProperty("grandparentTitle")]
public string? GrandparentTitle { get; set; }
[JsonProperty("grandparentThumb")]
public string? GrandparentThumb { get; set; }
[JsonProperty("parentSlug")]
public string? ParentSlug { get; set; }
/// <summary>
/// The slug for the grandparent media item.
/// </summary>
[JsonProperty("grandparentSlug")]
public string? GrandparentSlug { get; set; }
[JsonProperty("grandparentArt")]
public string? GrandparentArt { 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>
[JsonProperty("grandparentThumb")]
public string? GrandparentThumb { get; set; }
/// <summary>
/// The theme URL for the grandparent media item.
/// </summary>
[JsonProperty("grandparentTheme")]
public string? GrandparentTheme { get; set; }
/// <summary>
/// The Media object is only included when type query is `4` or higher.<br/>
/// The art URL for the grandparent media item.
/// </summary>
[JsonProperty("grandparentArt")]
public string? GrandparentArt { get; set; }
/// <summary>
/// The title of the parent media item.
/// </summary>
[JsonProperty("parentTitle")]
public string? ParentTitle { get; set; }
/// <summary>
/// The index position of the parent media item.
/// </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")]
public List<GetLibraryItemsImage>? Image { get; set; }
[JsonProperty("UltraBlurColors")]
public GetLibraryItemsUltraBlurColors? UltraBlurColors { get; set; }
[JsonProperty("Guid")]
public List<GetLibraryItemsGuids>? Guids { get; set; }
/// <summary>
/// The identifier for the library section.
/// </summary>
[JsonProperty("librarySectionID")]
public long? LibrarySectionID { get; set; }
/// <summary>
/// The title of the library section.
/// </summary>
[JsonProperty("librarySectionTitle")]
public string? LibrarySectionTitle { get; set; }
/// <summary>
/// The key corresponding to the library section.
/// </summary>
[JsonProperty("librarySectionKey")]
public string? LibrarySectionKey { get; set; }
/// <summary>
/// Setting that indicates the episode ordering for the show.<br/>
///
/// <remarks>
/// Options:<br/>
/// - None = Library default<br/>
/// - tmdbAiring = The Movie Database (Aired)<br/>
/// - aired = TheTVDB (Aired)<br/>
/// - dvd = TheTVDB (DVD)<br/>
/// - absolute = TheTVDB (Absolute)<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("showOrdering")]
public ShowOrdering? ShowOrdering { get; set; }
/// <summary>
/// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("flattenSeasons")]
public FlattenSeasons? FlattenSeasons { get; set; }
/// <summary>
/// Indicates whether child items should be skipped.
/// </summary>
[JsonProperty("skipChildren")]
public bool? SkipChildren { get; set; }
[JsonProperty("Media")]
public List<GetLibraryItemsMedia>? Media { get; set; }
@@ -193,105 +426,31 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("Writer")]
public List<GetLibraryItemsWriter>? Writer { get; set; }
[JsonProperty("Producer")]
public List<GetLibraryItemsProducer>? Producer { get; set; }
[JsonProperty("Collection")]
public List<GetLibraryItemsCollection>? Collection { get; set; }
[JsonProperty("Role")]
public List<GetLibraryItemsRole>? Role { get; set; }
[JsonProperty("Rating")]
public List<Ratings>? Ratings { get; set; }
[JsonProperty("Similar")]
public List<GetLibraryItemsSimilar>? Similar { get; set; }
[JsonProperty("Location")]
public List<GetLibraryItemsLocation>? Location { get; set; }
/// <summary>
/// The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("Guid")]
public List<GetLibraryItemsMediaGuid>? MediaGuid { get; set; }
[JsonProperty("Chapter")]
public List<Chapter>? Chapter { get; set; }
[JsonProperty("UltraBlurColors")]
public GetLibraryItemsUltraBlurColors? UltraBlurColors { get; set; }
[JsonProperty("Marker")]
public List<Marker>? Marker { get; set; }
[JsonProperty("Rating")]
public List<GetLibraryItemsMetaDataRating>? MetaDataRating { get; set; }
[JsonProperty("Image")]
public List<GetLibraryItemsImage>? Image { get; set; }
[JsonProperty("titleSort")]
public string? TitleSort { get; set; }
[JsonProperty("viewCount")]
public int? ViewCount { get; set; }
[JsonProperty("lastViewedAt")]
public int? LastViewedAt { get; set; }
[JsonProperty("originalTitle")]
public string? OriginalTitle { get; set; }
[JsonProperty("viewOffset")]
public int? ViewOffset { get; set; }
[JsonProperty("skipCount")]
public int? SkipCount { get; set; }
[JsonProperty("index")]
public int? Index { get; set; }
[JsonProperty("theme")]
public string? Theme { get; set; }
[JsonProperty("leafCount")]
public int? LeafCount { get; set; }
[JsonProperty("viewedLeafCount")]
public int? ViewedLeafCount { get; set; }
[JsonProperty("childCount")]
public int? ChildCount { get; set; }
[JsonProperty("hasPremiumExtras")]
public string? HasPremiumExtras { get; set; }
[JsonProperty("hasPremiumPrimaryExtra")]
public string? HasPremiumPrimaryExtra { get; set; }
/// <summary>
/// The rating key of the parent item.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("parentRatingKey")]
public string? ParentRatingKey { get; set; }
[JsonProperty("parentGuid")]
public string? ParentGuid { get; set; }
[JsonProperty("parentStudio")]
public string? ParentStudio { get; set; }
[JsonProperty("parentKey")]
public string? ParentKey { get; set; }
[JsonProperty("parentTitle")]
public string? ParentTitle { get; set; }
[JsonProperty("parentIndex")]
public int? ParentIndex { get; set; }
[JsonProperty("parentYear")]
public int? ParentYear { get; set; }
[JsonProperty("parentThumb")]
public string? ParentThumb { get; set; }
[JsonProperty("parentTheme")]
public string? ParentTheme { get; set; }
[JsonProperty("Extras")]
public Extras? Extras { get; set; }
}
}

View File

@@ -9,12 +9,191 @@
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Reflection;
public enum GetLibraryItemsOptimizedForStreaming
public class GetLibraryItemsOptimizedForStreamingType
{
Disable = 0,
Enable = 1,
private GetLibraryItemsOptimizedForStreamingType(string value) { Value = value; }
public string Value { get; private set; }
public static GetLibraryItemsOptimizedForStreamingType OptimizedForStreaming1 { get { return new GetLibraryItemsOptimizedForStreamingType("optimizedForStreaming_1"); } }
public static GetLibraryItemsOptimizedForStreamingType Boolean { get { return new GetLibraryItemsOptimizedForStreamingType("boolean"); } }
public static GetLibraryItemsOptimizedForStreamingType Null { get { return new GetLibraryItemsOptimizedForStreamingType("null"); } }
public override string ToString() { return Value; }
public static implicit operator String(GetLibraryItemsOptimizedForStreamingType v) { return v.Value; }
public static GetLibraryItemsOptimizedForStreamingType FromString(string v) {
switch(v) {
case "optimizedForStreaming_1": return OptimizedForStreaming1;
case "boolean": return Boolean;
case "null": return Null;
default: throw new ArgumentException("Invalid value for GetLibraryItemsOptimizedForStreamingType");
}
}
public override bool Equals(object? obj)
{
if (obj == null || GetType() != obj.GetType())
{
return false;
}
return Value.Equals(((GetLibraryItemsOptimizedForStreamingType)obj).Value);
}
public override int GetHashCode()
{
return Value.GetHashCode();
}
}
/// <summary>
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true
/// </summary>
[JsonConverter(typeof(GetLibraryItemsOptimizedForStreaming.GetLibraryItemsOptimizedForStreamingConverter))]
public class GetLibraryItemsOptimizedForStreaming {
public GetLibraryItemsOptimizedForStreaming(GetLibraryItemsOptimizedForStreamingType type) {
Type = type;
}
[SpeakeasyMetadata("form:explode=true")]
public OptimizedForStreaming1? OptimizedForStreaming1 { get; set; }
[SpeakeasyMetadata("form:explode=true")]
public bool? Boolean { get; set; }
public GetLibraryItemsOptimizedForStreamingType Type { get; set; }
public static GetLibraryItemsOptimizedForStreaming CreateOptimizedForStreaming1(OptimizedForStreaming1 optimizedForStreaming1) {
GetLibraryItemsOptimizedForStreamingType typ = GetLibraryItemsOptimizedForStreamingType.OptimizedForStreaming1;
GetLibraryItemsOptimizedForStreaming res = new GetLibraryItemsOptimizedForStreaming(typ);
res.OptimizedForStreaming1 = optimizedForStreaming1;
return res;
}
public static GetLibraryItemsOptimizedForStreaming CreateBoolean(bool boolean) {
GetLibraryItemsOptimizedForStreamingType typ = GetLibraryItemsOptimizedForStreamingType.Boolean;
GetLibraryItemsOptimizedForStreaming res = new GetLibraryItemsOptimizedForStreaming(typ);
res.Boolean = boolean;
return res;
}
public static GetLibraryItemsOptimizedForStreaming CreateNull() {
GetLibraryItemsOptimizedForStreamingType typ = GetLibraryItemsOptimizedForStreamingType.Null;
return new GetLibraryItemsOptimizedForStreaming(typ);
}
public class GetLibraryItemsOptimizedForStreamingConverter : JsonConverter
{
public override bool CanConvert(System.Type objectType) => objectType == typeof(GetLibraryItemsOptimizedForStreaming);
public override bool CanRead => true;
public override object? ReadJson(JsonReader reader, System.Type objectType, object? existingValue, JsonSerializer serializer)
{
var json = JRaw.Create(reader).ToString();
if (json == "null")
{
return null;
}
var fallbackCandidates = new List<(System.Type, object, string)>();
try
{
return new GetLibraryItemsOptimizedForStreaming(GetLibraryItemsOptimizedForStreamingType.OptimizedForStreaming1)
{
OptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<OptimizedForStreaming1>(json)
};
}
catch (ResponseBodyDeserializer.MissingMemberException)
{
fallbackCandidates.Add((typeof(OptimizedForStreaming1), new GetLibraryItemsOptimizedForStreaming(GetLibraryItemsOptimizedForStreamingType.OptimizedForStreaming1), "OptimizedForStreaming1"));
}
catch (ResponseBodyDeserializer.DeserializationException)
{
// try next option
}
catch (Exception)
{
throw;
}
try
{
var converted = Convert.ToBoolean(json);
return new GetLibraryItemsOptimizedForStreaming(GetLibraryItemsOptimizedForStreamingType.Boolean)
{
Boolean = converted
};
}
catch (System.FormatException)
{
// try next option
}
if (fallbackCandidates.Count > 0)
{
fallbackCandidates.Sort((a, b) => ResponseBodyDeserializer.CompareFallbackCandidates(a.Item1, b.Item1, json));
foreach(var (deserializationType, returnObject, propertyName) in fallbackCandidates)
{
try
{
return ResponseBodyDeserializer.DeserializeUndiscriminatedUnionFallback(deserializationType, returnObject, propertyName, json);
}
catch (ResponseBodyDeserializer.DeserializationException)
{
// try next fallback option
}
catch (Exception)
{
throw;
}
}
}
throw new InvalidOperationException("Could not deserialize into any supported types.");
}
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
if (value == null) {
writer.WriteRawValue("null");
return;
}
GetLibraryItemsOptimizedForStreaming res = (GetLibraryItemsOptimizedForStreaming)value;
if (GetLibraryItemsOptimizedForStreamingType.FromString(res.Type).Equals(GetLibraryItemsOptimizedForStreamingType.Null))
{
writer.WriteRawValue("null");
return;
}
if (res.OptimizedForStreaming1 != null)
{
writer.WriteRawValue(Utilities.SerializeJSON(res.OptimizedForStreaming1));
return;
}
if (res.Boolean != null)
{
writer.WriteRawValue(Utilities.SerializeJSON(res.Boolean));
return;
}
}
}
}
}

View File

@@ -10,12 +10,11 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetSearchAllLibrariesCollection
public enum GetLibraryItemsOptimizedForStreaming1
{
[JsonProperty("tag")]
public string? Tag { get; set; }
Zero = 0,
One = 1,
}
}

View File

@@ -9,58 +9,94 @@
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class GetLibraryItemsPart
{
/// <summary>
/// Indicates if the part is accessible.
/// </summary>
[JsonProperty("accessible")]
public bool? Accessible { get; set; }
/// <summary>
/// Indicates if the part exists.
/// </summary>
[JsonProperty("exists")]
public bool? Exists { get; set; }
/// <summary>
/// Unique part identifier.
/// </summary>
[JsonProperty("id")]
public int Id { get; set; } = default!;
public long Id { get; set; } = default!;
/// <summary>
/// Key to access this part.
/// </summary>
[JsonProperty("key")]
public string Key { get; set; } = default!;
public string? Key { get; set; }
[JsonProperty("indexes")]
public string? Indexes { get; set; }
/// <summary>
/// Duration of the part in milliseconds.
/// </summary>
[JsonProperty("duration")]
public int? Duration { get; set; }
/// <summary>
/// File path for the part.
/// </summary>
[JsonProperty("file")]
public string File { get; set; } = default!;
[JsonProperty("size")]
public long Size { get; set; } = default!;
public string? File { get; set; }
/// <summary>
/// The container format of the media file.<br/>
///
/// <remarks>
///
/// </remarks>
/// File size in bytes.
/// </summary>
[JsonProperty("size")]
public long? Size { get; set; }
[JsonProperty("packetLength")]
public int? PacketLength { get; set; }
/// <summary>
/// Container format of the part.
/// </summary>
[JsonProperty("container")]
public string Container { get; set; } = default!;
public string? Container { get; set; }
/// <summary>
/// Video profile for the part.
/// </summary>
[JsonProperty("videoProfile")]
public string? VideoProfile { get; set; }
/// <summary>
/// The audio profile used for the media (e.g., DTS, Dolby Digital, etc.).
/// </summary>
[JsonProperty("audioProfile")]
public string? AudioProfile { get; set; }
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
/// <summary>
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("optimizedForStreaming")]
public bool? OptimizedForStreaming { get; set; }
[JsonProperty("videoProfile")]
public string? VideoProfile { get; set; }
[JsonProperty("indexes")]
public string? Indexes { get; set; }
public GetLibraryItemsLibraryOptimizedForStreaming? OptimizedForStreaming { get; set; }
[JsonProperty("hasThumbnail")]
public GetLibraryItemsHasThumbnail? HasThumbnail { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsHasThumbnail.False;
[JsonProperty("Stream")]
public List<GetLibraryItemsStream>? Stream { get; set; }
}
}

View File

@@ -0,0 +1,54 @@
//------------------------------------------------------------------------------
// <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 GetLibraryItemsProducer
{
/// <summary>
/// The unique role identifier.
/// </summary>
[JsonProperty("id")]
public long Id { get; set; } = default!;
/// <summary>
/// The filter string for the role.
/// </summary>
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
/// <summary>
/// The actor&apos;s name.
/// </summary>
[JsonProperty("tag")]
public string Tag { get; set; } = default!;
/// <summary>
/// A key associated with the actor tag.
/// </summary>
[JsonProperty("tagKey")]
public string TagKey { get; set; } = default!;
/// <summary>
/// The character name or role.
/// </summary>
[JsonProperty("role")]
public string? Role { get; set; }
/// <summary>
/// URL for the role thumbnail image.
/// </summary>
[JsonProperty("thumb")]
public string? Thumb { get; set; }
}
}

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