Compare commits

...

14 Commits

Author SHA1 Message Date
speakeasybot
92be5b3a91 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 11:11:07 +00:00
speakeasybot
a183f389bc ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 10:46:38 +00:00
speakeasybot
4a443f6f2e ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 09:49:57 +00:00
speakeasybot
b9b7cd1146 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.4 2024-09-30 17:36:49 +00:00
speakeasybot
81c55cb08b ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.4 2024-09-30 17:23:32 +00:00
speakeasybot
860991f2a0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-30 08:47:49 +00:00
Jason Landbridge
d25639db53 Added dotnet_version directly 2024-09-30 10:42:22 +02:00
speakeasybot
227e2351d5 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-30 00:23:16 +00:00
JasonLandbridge
3bd4f51297 Merge remote-tracking branch 'origin/main' 2024-09-29 09:09:51 +02:00
speakeasybot
4828de2345 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-29 00:24:39 +00:00
JasonLandbridge
2beb707ed5 make project intelij compatible 2024-09-28 10:01:25 +02:00
speakeasybot
affe5d5a8c ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-28 00:21:51 +00:00
speakeasybot
d16abdad70 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.402.14 2024-09-26 00:22:14 +00:00
speakeasybot
3e9ae76433 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.402.14 2024-09-25 15:33:47 +00:00
348 changed files with 11908 additions and 3261 deletions

View File

@@ -24,6 +24,7 @@ jobs:
mode: direct mode: direct
set_version: ${{ github.event.inputs.set_version }} set_version: ${{ github.event.inputs.set_version }}
speakeasy_version: latest speakeasy_version: latest
dotnet_version: "8.x"
secrets: secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }} github_access_token: ${{ secrets.GITHUB_TOKEN }}
nuget_api_key: ${{ secrets.NUGET_API_KEY }} nuget_api_key: ${{ secrets.NUGET_API_KEY }}

View File

@@ -0,0 +1 @@
LukeHagar.PlexAPI.SDK

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="3" />
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,7 @@ generation:
auth: auth:
oAuth2ClientCredentialsEnabled: true oAuth2ClientCredentialsEnabled: true
csharp: csharp:
version: 0.7.1 version: 0.9.2
additionalDependencies: [] additionalDependencies: []
author: LukeHagar author: LukeHagar
clientServerStatusCodesAsErrors: true clientServerStatusCodesAsErrors: true

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.401.2 speakeasyVersion: 1.405.8
sources: sources:
my-source: my-source:
sourceNamespace: my-source sourceNamespace: my-source
@@ -16,8 +16,8 @@ sources:
- main - main
plexapi: plexapi:
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:fc6eebe661455e23b1aa352a91c14ef773fa72331330ec4caeddc2c460dc16bb sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
sourceBlobDigest: sha256:2e81e86c83d7f4e8842efca0d43a2db84a4932534c8439e3737e1f65c873f855 sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
tags: tags:
- latest - latest
- main - main
@@ -25,10 +25,10 @@ targets:
plexcsharp: plexcsharp:
source: plexapi source: plexapi
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:fc6eebe661455e23b1aa352a91c14ef773fa72331330ec4caeddc2c460dc16bb sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
sourceBlobDigest: sha256:2e81e86c83d7f4e8842efca0d43a2db84a4932534c8439e3737e1f65c873f855 sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
codeSamplesNamespace: code-samples-csharp-plexcsharp codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:73fbbcf9508835f4d05e9b21d6ae3a250052b663c2759008884a6d0d826a50fd codeSamplesRevisionDigest: sha256:92500227f7e52cdceac29cb2915dfe637ad1432c312c69dd3acb197b357a3577
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: latest speakeasyVersion: latest

View File

@@ -45,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Server Activities /// Get Server Activities
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetServerActivitiesResponse> GetServerActivitiesAsync(); Task<GetServerActivitiesResponse> GetServerActivitiesAsync(RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Cancel Server Activities /// Cancel Server Activities
@@ -54,7 +54,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Cancel Server Activities /// Cancel Server Activities
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID); Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID, RetryConfig? retryConfig = null);
} }
/// <summary> /// <summary>
@@ -74,10 +74,10 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.7.1"; private const string _sdkVersion = "0.9.2";
private const string _sdkGenVersion = "2.421.3"; private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -90,7 +90,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync() public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync(RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -107,11 +107,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getServerActivities", null, _securitySource); var hookCtx = new HookContext("getServerActivities", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -187,7 +220,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID) public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID, RetryConfig? retryConfig = null)
{ {
var request = new CancelServerActivitiesRequest() var request = new CancelServerActivitiesRequest()
{ {
@@ -207,11 +240,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("cancelServerActivities", null, _securitySource); var hookCtx = new HookContext("cancelServerActivities", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope); Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Source Connection Information /// Get Source Connection Information
@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source); Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Token Details /// Get Token Details
@@ -60,7 +60,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get the User data from the provided X-Plex-Token /// Get the User data from the provided X-Plex-Token
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null); Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get User Sign In Data /// Get User Sign In Data
@@ -69,7 +69,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Sign in user with username and password and return user data with Plex authentication token /// Sign in user with username and password and return user data with Plex authentication token
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequestBody? request = null, string? serverUrl = null); Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null);
} }
/// <summary> /// <summary>
@@ -85,20 +85,20 @@ namespace LukeHagar.PlexAPI.SDK
/// List of server URLs available for the getTokenDetails operation. /// List of server URLs available for the getTokenDetails operation.
/// </summary> /// </summary>
public static readonly string[] GetTokenDetailsServerList = { public static readonly string[] GetTokenDetailsServerList = {
"https://plex.tv/api/v2/", "https://plex.tv/api/v2",
}; };
/// <summary> /// <summary>
/// List of server URLs available for the post-users-sign-in-data operation. /// List of server URLs available for the post-users-sign-in-data operation.
/// </summary> /// </summary>
public static readonly string[] PostUsersSignInDataServerList = { public static readonly string[] PostUsersSignInDataServerList = {
"https://plex.tv/api/v2/", "https://plex.tv/api/v2",
}; };
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.7.1"; private const string _sdkVersion = "0.9.2";
private const string _sdkGenVersion = "2.421.3"; private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -111,7 +111,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope) public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope, RetryConfig? retryConfig = null)
{ {
var request = new GetTransientTokenRequest() var request = new GetTransientTokenRequest()
{ {
@@ -132,11 +132,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getTransientToken", null, _securitySource); var hookCtx = new HookContext("getTransientToken", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -204,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source) public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source, RetryConfig? retryConfig = null)
{ {
var request = new GetSourceConnectionInformationRequest() var request = new GetSourceConnectionInformationRequest()
{ {
@@ -224,11 +257,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource); var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -296,7 +362,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null) public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null, RetryConfig? retryConfig = null)
{ {
string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary<string, string>(){ string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary<string, string>(){
}); });
@@ -318,11 +384,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getTokenDetails", null, _securitySource); var hookCtx = new HookContext("getTokenDetails", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -398,8 +497,14 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequestBody? request = null, string? serverUrl = null) public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null)
{ {
request.ClientID ??= SDKConfiguration.ClientID;
request.ClientName ??= SDKConfiguration.ClientName;
request.ClientVersion ??= SDKConfiguration.ClientVersion;
request.Platform ??= SDKConfiguration.Platform;
request.DeviceNickname ??= SDKConfiguration.DeviceNickname;
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){ string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
}); });
if (serverUrl != null) if (serverUrl != null)
@@ -411,8 +516,9 @@ namespace LukeHagar.PlexAPI.SDK
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "form", false, true); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
if (serializedBody != null) if (serializedBody != null)
{ {
httpRequest.Content = serializedBody; httpRequest.Content = serializedBody;
@@ -421,11 +527,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("post-users-sign-in-data", null, null); var hookCtx = new HookContext("post-users-sign-in-data", null, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Returns a list of butler tasks /// Returns a list of butler tasks
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetButlerTasksResponse> GetButlerTasksAsync(); Task<GetButlerTasksResponse> GetButlerTasksAsync(RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Start all Butler tasks /// Start all Butler tasks
@@ -53,7 +53,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<StartAllTasksResponse> StartAllTasksAsync(); Task<StartAllTasksResponse> StartAllTasksAsync(RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Stop all Butler tasks /// Stop all Butler tasks
@@ -63,7 +63,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<StopAllTasksResponse> StopAllTasksAsync(); Task<StopAllTasksResponse> StopAllTasksAsync(RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Start a single Butler task /// Start a single Butler task
@@ -77,7 +77,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<StartTaskResponse> StartTaskAsync(TaskName taskName); Task<StartTaskResponse> StartTaskAsync(TaskName taskName, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Stop a single Butler task /// Stop a single Butler task
@@ -87,7 +87,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName); Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName, RetryConfig? retryConfig = null);
} }
/// <summary> /// <summary>
@@ -101,10 +101,10 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.7.1"; private const string _sdkVersion = "0.9.2";
private const string _sdkGenVersion = "2.421.3"; private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -117,7 +117,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetButlerTasksResponse> GetButlerTasksAsync() public async Task<GetButlerTasksResponse> GetButlerTasksAsync(RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -134,11 +134,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getButlerTasks", null, _securitySource); var hookCtx = new HookContext("getButlerTasks", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -214,7 +247,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<StartAllTasksResponse> StartAllTasksAsync() public async Task<StartAllTasksResponse> StartAllTasksAsync(RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -231,11 +264,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("startAllTasks", null, _securitySource); var hookCtx = new HookContext("startAllTasks", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -303,7 +369,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<StopAllTasksResponse> StopAllTasksAsync() public async Task<StopAllTasksResponse> StopAllTasksAsync(RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -320,11 +386,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("stopAllTasks", null, _securitySource); var hookCtx = new HookContext("stopAllTasks", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -392,7 +491,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName) public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName, RetryConfig? retryConfig = null)
{ {
var request = new StartTaskRequest() var request = new StartTaskRequest()
{ {
@@ -412,11 +511,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("startTask", null, _securitySource); var hookCtx = new HookContext("startTask", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -484,7 +616,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName) public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName, RetryConfig? retryConfig = null)
{ {
var request = new StopTaskRequest() var request = new StopTaskRequest()
{ {
@@ -504,11 +636,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("stopTask", null, _securitySource); var hookCtx = new HookContext("stopTask", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,17 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Global Hubs filtered by the parameters provided. /// Get Global Hubs filtered by the parameters provided.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null); Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Recently Added
///
/// <remarks>
/// This endpoint will return the recently added content.<br/>
///
/// </remarks>
/// </summary>
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get library specific hubs /// Get library specific hubs
@@ -49,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null); Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null);
} }
/// <summary> /// <summary>
@@ -63,10 +73,10 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.7.1"; private const string _sdkVersion = "0.9.2";
private const string _sdkGenVersion = "2.421.3"; private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -79,7 +89,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null) public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null)
{ {
var request = new GetGlobalHubsRequest() var request = new GetGlobalHubsRequest()
{ {
@@ -100,11 +110,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getGlobalHubs", null, _securitySource); var hookCtx = new HookContext("getGlobalHubs", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -180,7 +223,114 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null) public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
if (_securitySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var hookCtx = new HookContext("get-recently-added", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetRecentlyAddedResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode == 401 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null)
{ {
var request = new GetLibraryHubsRequest() var request = new GetLibraryHubsRequest()
{ {
@@ -202,11 +352,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getLibraryHubs", null, _securitySource); var hookCtx = new HookContext("getLibraryHubs", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This resource returns hash values for local files /// This resource returns hash values for local files
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null); Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Recently Added /// Get Recently Added
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexContainerStart = null, int? xPlexContainerSize = null); Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get All Libraries /// Get All Libraries
@@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetAllLibrariesResponse> GetAllLibrariesAsync(); Task<GetAllLibrariesResponse> GetAllLibrariesAsync(RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Library Details /// Get Library Details
@@ -112,7 +112,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null); Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Delete Library Section /// Delete Library Section
@@ -121,7 +121,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Delete a library using a specific section id /// Delete a library using a specific section id
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey); Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Library Items /// Get Library Items
@@ -150,7 +150,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request); Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Refresh Metadata Of The Library /// Refresh Metadata Of The Library
@@ -160,7 +160,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null); Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Search Library /// Search Library
@@ -187,7 +187,17 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, QueryParamType type); Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null);
/// <summary>
/// Search All Libraries
///
/// <remarks>
/// Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.<br/>
///
/// </remarks>
/// </summary>
Task<GetSearchAllLibrariesResponse> GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Metadata by RatingKey /// Get Metadata by RatingKey
@@ -197,7 +207,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey); Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Items Children /// Get Items Children
@@ -207,7 +217,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null); Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Top Watched Content /// Get Top Watched Content
@@ -217,7 +227,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null); Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get On Deck /// Get On Deck
@@ -227,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetOnDeckResponse> GetOnDeckAsync(); Task<GetOnDeckResponse> GetOnDeckAsync(RetryConfig? retryConfig = null);
} }
/// <summary> /// <summary>
@@ -241,10 +251,10 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.7.1"; private const string _sdkVersion = "0.9.2";
private const string _sdkGenVersion = "2.421.3"; private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -257,7 +267,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null) public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null)
{ {
var request = new GetFileHashRequest() var request = new GetFileHashRequest()
{ {
@@ -278,11 +288,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getFileHash", null, _securitySource); var hookCtx = new HookContext("getFileHash", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -350,13 +393,8 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexContainerStart = null, int? xPlexContainerSize = null) public async Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null)
{ {
var request = new GetRecentlyAddedRequest()
{
XPlexContainerStart = xPlexContainerStart,
XPlexContainerSize = xPlexContainerSize,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request); var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request);
@@ -368,14 +406,47 @@ namespace LukeHagar.PlexAPI.SDK
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getRecentlyAdded", null, _securitySource); var hookCtx = new HookContext("get-recently-added-library", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -408,8 +479,8 @@ namespace LukeHagar.PlexAPI.SDK
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetRecentlyAddedResponse() var response = new GetRecentlyAddedLibraryResponse()
{ {
StatusCode = responseStatusCode, StatusCode = responseStatusCode,
ContentType = contentType, ContentType = contentType,
@@ -425,7 +496,7 @@ namespace LukeHagar.PlexAPI.SDK
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedLibraryBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse; obj!.RawResponse = httpResponse;
throw obj!; throw obj!;
} }
@@ -436,7 +507,7 @@ namespace LukeHagar.PlexAPI.SDK
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedLibraryUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse; obj!.RawResponse = httpResponse;
throw obj!; throw obj!;
} }
@@ -451,7 +522,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync() public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync(RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -468,11 +539,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-all-libraries", null, _securitySource); var hookCtx = new HookContext("get-all-libraries", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -548,7 +652,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null) public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null)
{ {
var request = new GetLibraryDetailsRequest() var request = new GetLibraryDetailsRequest()
{ {
@@ -569,11 +673,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-library-details", null, _securitySource); var hookCtx = new HookContext("get-library-details", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -649,7 +786,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey) public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null)
{ {
var request = new DeleteLibraryRequest() var request = new DeleteLibraryRequest()
{ {
@@ -669,11 +806,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("deleteLibrary", null, _securitySource); var hookCtx = new HookContext("deleteLibrary", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -741,7 +911,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request) public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request);
@@ -757,11 +927,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-library-items", null, _securitySource); var hookCtx = new HookContext("get-library-items", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -837,7 +1040,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null) public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null)
{ {
var request = new GetRefreshLibraryMetadataRequest() var request = new GetRefreshLibraryMetadataRequest()
{ {
@@ -858,11 +1061,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-refresh-library-metadata", null, _securitySource); var hookCtx = new HookContext("get-refresh-library-metadata", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -930,7 +1166,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, QueryParamType type) public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null)
{ {
var request = new GetSearchLibraryRequest() var request = new GetSearchLibraryRequest()
{ {
@@ -951,11 +1187,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-search-library", null, _securitySource); var hookCtx = new HookContext("get-search-library", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1031,7 +1300,143 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey) public async Task<GetSearchAllLibrariesResponse> GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request, RetryConfig? retryConfig = null)
{
if (request == null)
{
request = new GetSearchAllLibrariesRequest();
}
request.ClientID ??= SDKConfiguration.ClientID;
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/search", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var hookCtx = new HookContext("get-search-all-libraries", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetSearchAllLibrariesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetSearchAllLibrariesResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetSearchAllLibrariesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetSearchAllLibrariesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
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)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null)
{ {
var request = new GetMetaDataByRatingKeyRequest() var request = new GetMetaDataByRatingKeyRequest()
{ {
@@ -1051,11 +1456,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-meta-data-by-rating-key", null, _securitySource); var hookCtx = new HookContext("get-meta-data-by-rating-key", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1131,7 +1569,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null) public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null)
{ {
var request = new GetMetadataChildrenRequest() var request = new GetMetadataChildrenRequest()
{ {
@@ -1152,11 +1590,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getMetadataChildren", null, _securitySource); var hookCtx = new HookContext("getMetadataChildren", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1232,7 +1703,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null) public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null)
{ {
var request = new GetTopWatchedContentRequest() var request = new GetTopWatchedContentRequest()
{ {
@@ -1253,11 +1724,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getTopWatchedContent", null, _securitySource); var hookCtx = new HookContext("getTopWatchedContent", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1333,7 +1837,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetOnDeckResponse> GetOnDeckAsync() public async Task<GetOnDeckResponse> GetOnDeckAsync(RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -1350,11 +1854,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getOnDeck", null, _securitySource); var hookCtx = new HookContext("getOnDeck", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<LogLineResponse> LogLineAsync(Level level, string message, string source); Task<LogLineResponse> LogLineAsync(Level level, string message, string source, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Logging a multi-line message /// Logging a multi-line message
@@ -70,7 +70,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<LogMultiLineResponse> LogMultiLineAsync(string request); Task<LogMultiLineResponse> LogMultiLineAsync(string request, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Enabling Papertrail /// Enabling Papertrail
@@ -80,7 +80,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<EnablePaperTrailResponse> EnablePaperTrailAsync(); Task<EnablePaperTrailResponse> EnablePaperTrailAsync(RetryConfig? retryConfig = null);
} }
/// <summary> /// <summary>
@@ -94,10 +94,10 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.7.1"; private const string _sdkVersion = "0.9.2";
private const string _sdkGenVersion = "2.421.3"; private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -110,7 +110,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<LogLineResponse> LogLineAsync(Level level, string message, string source) public async Task<LogLineResponse> LogLineAsync(Level level, string message, string source, RetryConfig? retryConfig = null)
{ {
var request = new LogLineRequest() var request = new LogLineRequest()
{ {
@@ -132,11 +132,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("logLine", null, _securitySource); var hookCtx = new HookContext("logLine", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -204,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request) public async Task<LogMultiLineResponse> LogMultiLineAsync(string request, RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -227,11 +260,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("logMultiLine", null, _securitySource); var hookCtx = new HookContext("logMultiLine", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -299,7 +365,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync() public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync(RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -316,11 +382,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("enablePaperTrail", null, _securitySource); var hookCtx = new HookContext("enablePaperTrail", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -3,14 +3,38 @@
<PropertyGroup> <PropertyGroup>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId> <PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.7.1</Version> <Version>0.9.2</Version>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors> <Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2024</Copyright> <Copyright>Copyright (c) LukeHagar 2024</Copyright>
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl> <RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<PackageTags>Plex Media Server SDK</PackageTags> <PackageTags>Plex Media Server SDK</PackageTags>
<Description>Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server</Description> <Description># Plex Media Server OpenAPI Specification
An Open Source OpenAPI Specification for Plex Media Server
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
## Documentation
[API Documentation](https://plexapi.dev)
## SDKs
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
| Language | Repository | Releases | Other |
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
</Description>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will mark the provided media key as Played. /// This will mark the provided media key as Played.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<MarkPlayedResponse> MarkPlayedAsync(double key); Task<MarkPlayedResponse> MarkPlayedAsync(double key, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Mark Media Unplayed /// Mark Media Unplayed
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will mark the provided media key as Unplayed. /// This will mark the provided media key as Unplayed.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<MarkUnplayedResponse> MarkUnplayedAsync(double key); Task<MarkUnplayedResponse> MarkUnplayedAsync(double key, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Update Media Play Progress /// Update Media Play Progress
@@ -58,7 +58,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state); Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Banner Image /// Get Banner Image
@@ -67,7 +67,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Gets the banner image of the media item /// Gets the banner image of the media item
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request); Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request, RetryConfig? retryConfig = null);
/// <summary> /// <summary>
/// Get Thumb Image /// Get Thumb Image
@@ -76,7 +76,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Gets the thumbnail image of the media item /// Gets the thumbnail image of the media item
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request); Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request, RetryConfig? retryConfig = null);
} }
/// <summary> /// <summary>
@@ -90,10 +90,10 @@ namespace LukeHagar.PlexAPI.SDK
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.7.1"; private const string _sdkVersion = "0.9.2";
private const string _sdkGenVersion = "2.421.3"; private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -106,7 +106,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<MarkPlayedResponse> MarkPlayedAsync(double key) public async Task<MarkPlayedResponse> MarkPlayedAsync(double key, RetryConfig? retryConfig = null)
{ {
var request = new MarkPlayedRequest() var request = new MarkPlayedRequest()
{ {
@@ -126,11 +126,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("markPlayed", null, _securitySource); var hookCtx = new HookContext("markPlayed", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -198,7 +231,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key) public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key, RetryConfig? retryConfig = null)
{ {
var request = new MarkUnplayedRequest() var request = new MarkUnplayedRequest()
{ {
@@ -218,11 +251,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("markUnplayed", null, _securitySource); var hookCtx = new HookContext("markUnplayed", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -290,7 +356,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state) public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state, RetryConfig? retryConfig = null)
{ {
var request = new UpdatePlayProgressRequest() var request = new UpdatePlayProgressRequest()
{ {
@@ -312,11 +378,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("updatePlayProgress", null, _securitySource); var hookCtx = new HookContext("updatePlayProgress", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -384,13 +483,14 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request) public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request, RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null) if (_securitySource != null)
{ {
@@ -400,11 +500,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-banner-image", null, _securitySource); var hookCtx = new HookContext("get-banner-image", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -479,13 +612,14 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request) public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request, RetryConfig? retryConfig = null)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null) if (_securitySource != null)
{ {
@@ -495,11 +629,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-thumb-image", null, _securitySource); var hookCtx = new HookContext("get-thumb-image", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse; HttpResponseMessage httpResponse;
try try
{ {
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -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.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary>
public class GetRecentlyAddedLibraryBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetRecentlyAddedLibraryErrors>? 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 GetRecentlyAddedLibraryLibraryErrors
{
[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.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetRecentlyAddedLibraryUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetRecentlyAddedLibraryLibraryErrors>? 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> /// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly. /// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary> /// </summary>
public class GetRecentlyAddedBadRequest : Exception public class GetSearchAllLibrariesBadRequest : Exception
{ {
[JsonProperty("errors")] [JsonProperty("errors")]
public List<GetRecentlyAddedErrors>? Errors { get; set; } public List<GetSearchAllLibrariesErrors>? Errors { get; set; }
/// <summary> /// <summary>
/// Raw HTTP response; suitable for custom response parsing /// Raw HTTP response; suitable for custom response parsing

View File

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

View File

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

View File

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

View File

@@ -1,171 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum Features
{
[JsonProperty("Android - Dolby Vision")]
AndroidDolbyVision,
[JsonProperty("Android - PiP")]
AndroidPiP,
[JsonProperty("CU Sunset")]
CUSunset,
[JsonProperty("HRK_enable_EUR")]
HRKEnableEUR,
[JsonProperty("TREBLE-show-features")]
TREBLEShowFeatures,
[JsonProperty("ad-countdown-timer")]
AdCountdownTimer,
[JsonProperty("adaptive_bitrate")]
AdaptiveBitrate,
[JsonProperty("amazon-loop-debug")]
AmazonLoopDebug,
[JsonProperty("avod-ad-analysis")]
AvodAdAnalysis,
[JsonProperty("avod-new-media")]
AvodNewMedia,
[JsonProperty("blacklist_get_signin")]
BlacklistGetSignin,
[JsonProperty("client-radio-stations")]
ClientRadioStations,
[JsonProperty("cloudflare-turnstile-required")]
CloudflareTurnstileRequired,
[JsonProperty("collections")]
Collections,
[JsonProperty("comments_and_replies_push_notifications")]
CommentsAndRepliesPushNotifications,
[JsonProperty("community_access_plex_tv")]
CommunityAccessPlexTv,
[JsonProperty("companions_sonos")]
CompanionsSonos,
[JsonProperty("custom-home-removal")]
CustomHomeRemoval,
[JsonProperty("disable_home_user_friendships")]
DisableHomeUserFriendships,
[JsonProperty("disable_sharing_friendships")]
DisableSharingFriendships,
[JsonProperty("drm_support")]
DrmSupport,
[JsonProperty("exclude restrictions")]
ExcludeRestrictions,
[JsonProperty("federated-auth")]
FederatedAuth,
[JsonProperty("friend_request_push_notifications")]
FriendRequestPushNotifications,
[JsonProperty("guided-upgrade")]
GuidedUpgrade,
[JsonProperty("home")]
Home,
[JsonProperty("increase-password-complexity")]
IncreasePasswordComplexity,
[JsonProperty("ios14-privacy-banner")]
Ios14PrivacyBanner,
[JsonProperty("iterable-notification-tokens")]
IterableNotificationTokens,
[JsonProperty("keep-payment-method")]
KeepPaymentMethod,
[JsonProperty("kevin-bacon")]
KevinBacon,
[JsonProperty("korea-consent")]
KoreaConsent,
[JsonProperty("le_isrg_root_x1")]
LeIsrgRootX1,
[JsonProperty("lets_encrypt")]
LetsEncrypt,
[JsonProperty("lightning-dvr-pivot")]
LightningDvrPivot,
[JsonProperty("live-tv-support-incomplete-segments")]
LiveTvSupportIncompleteSegments,
[JsonProperty("livetv")]
Livetv,
[JsonProperty("metadata_search")]
MetadataSearch,
[JsonProperty("new_plex_pass_prices")]
NewPlexPassPrices,
[JsonProperty("news-provider-sunset-modal")]
NewsProviderSunsetModal,
[JsonProperty("photos-favorites")]
PhotosFavorites,
[JsonProperty("photos-metadata-edition")]
PhotosMetadataEdition,
[JsonProperty("pms_health")]
PmsHealth,
[JsonProperty("radio")]
Radio,
[JsonProperty("rate-limit-client-token")]
RateLimitClientToken,
[JsonProperty("scrobbling-service-plex-tv")]
ScrobblingServicePlexTv,
[JsonProperty("shared_server_notification")]
SharedServerNotification,
[JsonProperty("shared_source_notification")]
SharedSourceNotification,
[JsonProperty("signin_with_apple")]
SigninWithApple,
[JsonProperty("spring_serve_ad_provider")]
SpringServeAdProvider,
[JsonProperty("transcoder_cache")]
TranscoderCache,
[JsonProperty("tuner-sharing")]
TunerSharing,
[JsonProperty("two-factor-authentication")]
TwoFactorAuthentication,
[JsonProperty("unsupportedtuners")]
Unsupportedtuners,
[JsonProperty("upgrade-3ds2")]
Upgrade3ds2,
[JsonProperty("vod-schema")]
VodSchema,
[JsonProperty("vod_cloudflare")]
VodCloudflare,
[JsonProperty("watch-together-invite")]
WatchTogetherInvite,
[JsonProperty("web_server_dashboard")]
WebServerDashboard,
}
public static class FeaturesExtension
{
public static string Value(this Features value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Features ToEnum(this string value)
{
foreach(var field in typeof(Features).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 Features)
{
return (Features)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Features");
}
}
}

View File

@@ -16,13 +16,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
[JsonProperty("key")] [JsonProperty("key")]
public string? Key { get; set; } public string Key { get; set; } = default!;
[JsonProperty("title")] [JsonProperty("title")]
public string? Title { get; set; } public string Title { get; set; } = default!;
[JsonProperty("type")] [JsonProperty("type")]
public string? Type { get; set; } public string Type { get; set; } = default!;
[JsonProperty("subType")] [JsonProperty("subType")]
public string? SubType { get; set; } public string? SubType { get; set; }

View File

@@ -18,9 +18,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
[JsonProperty("type")] [JsonProperty("type")]
public string? Type { get; set; } public string Type { get; set; } = default!;
[JsonProperty("Operator")] [JsonProperty("Operator")]
public List<Operator>? Operator { get; set; } public List<Operator> Operator { get; set; } = default!;
} }
} }

View File

@@ -80,13 +80,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("directory")] [JsonProperty("directory")]
public bool Directory { get; set; } = default!; public bool Directory { get; set; } = default!;
/// <summary>
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("contentChangedAt")] [JsonProperty("contentChangedAt")]
public int ContentChangedAt { get; set; } = default!; public long ContentChangedAt { get; set; } = default!;
[JsonProperty("hidden")] [JsonProperty("hidden")]
public int Hidden { get; set; } = default!; public int Hidden { get; set; } = default!;
[JsonProperty("Location")] [JsonProperty("Location")]
public List<Location> Location { get; set; } = default!; public List<GetAllLibrariesLocation> Location { get; set; } = default!;
} }
} }

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 GetAllLibrariesLocation
{
[JsonProperty("id")]
public int Id { get; set; } = default!;
[JsonProperty("path")]
public string Path { get; set; } = default!;
}
}

View File

@@ -33,9 +33,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public long Upscale { get; set; } = default!; public long Upscale { get; set; } = default!;
/// <summary> /// <summary>
/// Plex Authentication Token /// An authentication token, obtained from plex.tv
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token")] [SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")]
public string XPlexToken { get; set; } = default!; public string XPlexToken { get; set; } = default!;
} }
} }

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 GetLibraryDetailsField
{
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("type")]
public string? Type { get; set; }
[JsonProperty("subType")]
public string? SubType { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <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 GetLibraryDetailsFieldType
{
[JsonProperty("type")]
public string? Type { get; set; }
[JsonProperty("Operator")]
public List<GetLibraryDetailsOperator>? Operator { get; set; }
}
}

View File

@@ -60,6 +60,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public List<GetLibraryDetailsType>? Type { get; set; } public List<GetLibraryDetailsType>? Type { get; set; }
[JsonProperty("FieldType")] [JsonProperty("FieldType")]
public List<FieldType>? FieldType { get; set; } public List<GetLibraryDetailsFieldType>? FieldType { 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 GetLibraryDetailsOperator
{
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("title")]
public string? Title { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <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 GetLibraryDetailsSort
{
[JsonProperty("default")]
public string? Default { get; set; }
[JsonProperty("defaultDirection")]
public string? DefaultDirection { get; set; }
[JsonProperty("descKey")]
public string? DescKey { get; set; }
[JsonProperty("firstCharacterKey")]
public string? FirstCharacterKey { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("title")]
public string? Title { get; set; }
}
}

View File

@@ -33,9 +33,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public List<GetLibraryDetailsFilter>? Filter { get; set; } public List<GetLibraryDetailsFilter>? Filter { get; set; }
[JsonProperty("Sort")] [JsonProperty("Sort")]
public List<Sort>? Sort { get; set; } public List<GetLibraryDetailsSort>? Sort { get; set; }
[JsonProperty("Field")] [JsonProperty("Field")]
public List<Field>? Field { get; set; } public List<GetLibraryDetailsField>? Field { get; set; }
} }
} }

View File

@@ -0,0 +1,64 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsActiveDirection
{
[JsonProperty("asc")]
Ascending,
[JsonProperty("desc")]
Descending,
}
public static class GetLibraryItemsActiveDirectionExtension
{
public static string Value(this GetLibraryItemsActiveDirection value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsActiveDirection ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsActiveDirection).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 GetLibraryItemsActiveDirection)
{
return (GetLibraryItemsActiveDirection)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsActiveDirection");
}
}
}

View File

@@ -0,0 +1,21 @@
//------------------------------------------------------------------------------
// <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 GetLibraryItemsCollection
{
[JsonProperty("tag")]
public string? Tag { get; set; }
}
}

View File

@@ -0,0 +1,64 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsDefaultDirection
{
[JsonProperty("asc")]
Ascending,
[JsonProperty("desc")]
Descending,
}
public static class GetLibraryItemsDefaultDirectionExtension
{
public static string Value(this GetLibraryItemsDefaultDirection value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsDefaultDirection ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsDefaultDirection).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 GetLibraryItemsDefaultDirection)
{
return (GetLibraryItemsDefaultDirection)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsDefaultDirection");
}
}
}

View File

@@ -0,0 +1,57 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetLibraryItemsFlattenSeasons
{
[JsonProperty("0")]
False,
[JsonProperty("1")]
True,
}
public static class GetLibraryItemsFlattenSeasonsExtension
{
public static string Value(this GetLibraryItemsFlattenSeasons value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsFlattenSeasons ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsFlattenSeasons).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 GetLibraryItemsFlattenSeasons)
{
return (GetLibraryItemsFlattenSeasons)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsFlattenSeasons");
}
}
}

View File

@@ -0,0 +1,57 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetLibraryItemsHasThumbnail
{
[JsonProperty("0")]
False,
[JsonProperty("1")]
True,
}
public static class GetLibraryItemsHasThumbnailExtension
{
public static string Value(this GetLibraryItemsHasThumbnail value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsHasThumbnail ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsHasThumbnail).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 GetLibraryItemsHasThumbnail)
{
return (GetLibraryItemsHasThumbnail)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsHasThumbnail");
}
}
}

View File

@@ -20,7 +20,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string Alt { get; set; } = default!; public string Alt { get; set; } = default!;
[JsonProperty("type")] [JsonProperty("type")]
public GetLibraryItemsLibraryResponseType Type { get; set; } = default!; public GetLibraryItemsLibraryResponse200Type Type { get; set; } = default!;
[JsonProperty("url")] [JsonProperty("url")]
public string Url { get; set; } = default!; public string Url { get; set; } = default!;

View File

@@ -0,0 +1,64 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsLibraryActiveDirection
{
[JsonProperty("asc")]
Ascending,
[JsonProperty("desc")]
Descending,
}
public static class GetLibraryItemsLibraryActiveDirectionExtension
{
public static string Value(this GetLibraryItemsLibraryActiveDirection value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsLibraryActiveDirection ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsLibraryActiveDirection).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 GetLibraryItemsLibraryActiveDirection)
{
return (GetLibraryItemsLibraryActiveDirection)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsLibraryActiveDirection");
}
}
}

View File

@@ -0,0 +1,64 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsLibraryDefaultDirection
{
[JsonProperty("asc")]
Ascending,
[JsonProperty("desc")]
Descending,
}
public static class GetLibraryItemsLibraryDefaultDirectionExtension
{
public static string Value(this GetLibraryItemsLibraryDefaultDirection value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsLibraryDefaultDirection ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsLibraryDefaultDirection).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 GetLibraryItemsLibraryDefaultDirection)
{
return (GetLibraryItemsLibraryDefaultDirection)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsLibraryDefaultDirection");
}
}
}

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 GetLibraryItemsLibraryField
{
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
[JsonProperty("type")]
public string Type { get; set; } = default!;
[JsonProperty("subType")]
public string? SubType { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <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 GetLibraryItemsLibraryFieldType
{
[JsonProperty("type")]
public string Type { get; set; } = default!;
[JsonProperty("Operator")]
public List<GetLibraryItemsLibraryOperator> Operator { get; set; } = default!;
}
}

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;
public class GetLibraryItemsLibraryFilter
{
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
[JsonProperty("filterType")]
public string FilterType { 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,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 GetLibraryItemsLibraryOperator
{
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
}
}

View File

@@ -0,0 +1,61 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetLibraryItemsLibraryResponse200Type
{
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
public static class GetLibraryItemsLibraryResponse200TypeExtension
{
public static string Value(this GetLibraryItemsLibraryResponse200Type value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsLibraryResponse200Type ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsLibraryResponse200Type).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 GetLibraryItemsLibraryResponse200Type)
{
return (GetLibraryItemsLibraryResponse200Type)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsLibraryResponse200Type");
}
}
}

View File

@@ -9,53 +9,33 @@
#nullable enable #nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System.Collections.Generic;
public enum GetLibraryItemsLibraryResponseType public class GetLibraryItemsLibraryResponseType
{ {
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
public static class GetLibraryItemsLibraryResponseTypeExtension [JsonProperty("key")]
{ public string Key { get; set; } = default!;
public static string Value(this GetLibraryItemsLibraryResponseType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsLibraryResponseType ToEnum(this string value) [JsonProperty("type")]
{ public string Type { get; set; } = default!;
foreach(var field in typeof(GetLibraryItemsLibraryResponseType).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute; [JsonProperty("title")]
if (attribute != null && attribute.PropertyName == value) public string Title { get; set; } = default!;
{
var enumVal = field.GetValue(null);
if (enumVal is GetLibraryItemsLibraryResponseType) [JsonProperty("active")]
{ public bool Active { get; set; } = default!;
return (GetLibraryItemsLibraryResponseType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsLibraryResponseType"); [JsonProperty("Filter")]
} public List<GetLibraryItemsLibraryFilter>? Filter { get; set; }
}
[JsonProperty("Sort")]
public List<GetLibraryItemsLibrarySort>? Sort { get; set; }
[JsonProperty("Field")]
public List<GetLibraryItemsLibraryField>? Field { get; set; }
}
} }

View File

@@ -0,0 +1,57 @@
//------------------------------------------------------------------------------
// <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;
public class GetLibraryItemsLibrarySort
{
[JsonProperty("default")]
public string? Default { get; set; }
[JsonProperty("active")]
public bool? Active { get; set; }
/// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("activeDirection")]
public GetLibraryItemsLibraryActiveDirection? ActiveDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsLibraryActiveDirection.Ascending;
/// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("defaultDirection")]
public GetLibraryItemsLibraryDefaultDirection? DefaultDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsLibraryDefaultDirection.Ascending;
[JsonProperty("descKey")]
public string? DescKey { get; set; }
[JsonProperty("firstCharacterKey")]
public string? FirstCharacterKey { get; set; }
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
}
}

View File

@@ -9,33 +9,60 @@
#nullable enable #nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic; using System;
public class GetLibraryItemsLibraryType /// <summary>
/// The type of media content<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsLibraryType
{ {
[JsonProperty("movie")]
[JsonProperty("key")] Movie,
public string Key { get; set; } = default!; [JsonProperty("show")]
TvShow,
[JsonProperty("type")] [JsonProperty("season")]
public string Type { get; set; } = default!; Season,
[JsonProperty("episode")]
[JsonProperty("title")] Episode,
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

@@ -0,0 +1,21 @@
//------------------------------------------------------------------------------
// <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 GetLibraryItemsLocation
{
[JsonProperty("path")]
public string? Path { get; set; }
}
}

View File

@@ -21,47 +21,53 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public int Id { get; set; } = default!; public int Id { get; set; } = default!;
[JsonProperty("duration")] [JsonProperty("duration")]
public int Duration { get; set; } = default!; public int? Duration { get; set; }
[JsonProperty("bitrate")] [JsonProperty("bitrate")]
public int Bitrate { get; set; } = default!; public int? Bitrate { get; set; }
[JsonProperty("width")] [JsonProperty("width")]
public int Width { get; set; } = default!; public int? Width { get; set; }
[JsonProperty("height")] [JsonProperty("height")]
public int Height { get; set; } = default!; public int? Height { get; set; }
[JsonProperty("aspectRatio")] [JsonProperty("aspectRatio")]
public double AspectRatio { get; set; } = default!; public double? AspectRatio { get; set; }
[JsonProperty("audioProfile")] [JsonProperty("audioProfile")]
public string? AudioProfile { get; set; } public string? AudioProfile { get; set; }
[JsonProperty("audioChannels")] [JsonProperty("audioChannels")]
public int AudioChannels { get; set; } = default!; public int? AudioChannels { get; set; }
[JsonProperty("audioCodec")] [JsonProperty("audioCodec")]
public string AudioCodec { get; set; } = default!; public string? AudioCodec { get; set; }
[JsonProperty("videoCodec")] [JsonProperty("videoCodec")]
public string VideoCodec { get; set; } = default!; public string? VideoCodec { get; set; }
[JsonProperty("videoResolution")] [JsonProperty("videoResolution")]
public string VideoResolution { get; set; } = default!; public string? VideoResolution { get; set; }
[JsonProperty("container")] [JsonProperty("container")]
public string Container { get; set; } = default!; public string Container { get; set; } = default!;
[JsonProperty("videoFrameRate")] [JsonProperty("videoFrameRate")]
public string VideoFrameRate { get; set; } = default!; public string? VideoFrameRate { get; set; }
[JsonProperty("videoProfile")] [JsonProperty("videoProfile")]
public string VideoProfile { get; set; } = default!; public string? VideoProfile { get; set; }
[JsonProperty("hasVoiceActivity")] [JsonProperty("hasVoiceActivity")]
public bool? HasVoiceActivity { get; set; } public bool? HasVoiceActivity { get; set; }
[JsonProperty("optimizedForStreaming")]
public GetLibraryItemsOptimizedForStreaming? OptimizedForStreaming { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsOptimizedForStreaming.Disable;
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("Part")] [JsonProperty("Part")]
public List<GetLibraryItemsPart> Part { get; set; } = default!; public List<GetLibraryItemsPart> Part { get; set; } = default!;
} }

View File

@@ -9,15 +9,27 @@
#nullable enable #nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic; 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 public class GetLibraryItemsMediaContainer
{ {
[JsonProperty("Type")]
public List<GetLibraryItemsType>? Type { get; set; }
[JsonProperty("FieldType")]
public List<GetLibraryItemsFieldType>? FieldType { get; set; }
[JsonProperty("size")] [JsonProperty("size")]
public int Size { get; set; } = default!; public int Size { get; set; } = default!;
@@ -43,7 +55,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string Identifier { get; set; } = default!; public string Identifier { get; set; } = default!;
[JsonProperty("librarySectionID")] [JsonProperty("librarySectionID")]
public LibrarySectionID LibrarySectionID { get; set; } = default!; public long LibrarySectionID { get; set; } = default!;
[JsonProperty("librarySectionTitle")] [JsonProperty("librarySectionTitle")]
public string LibrarySectionTitle { get; set; } = default!; public string LibrarySectionTitle { get; set; } = default!;
@@ -86,6 +98,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("Meta")] [JsonProperty("Meta")]
public Meta? Meta { get; set; } public GetLibraryItemsMeta? Meta { get; set; }
} }
} }

View File

@@ -0,0 +1,29 @@
//------------------------------------------------------------------------------
// <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 GetLibraryItemsMediaGuid
{
/// <summary>
/// Can be one of the following formats:<br/>
///
/// <remarks>
/// imdb://tt13015952, tmdb://2434012, tvdb://7945991<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("id")]
public string Id { get; set; } = default!;
}
}

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.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
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 GetLibraryItemsMeta
{
[JsonProperty("Type")]
public List<GetLibraryItemsLibraryResponseType>? Type { get; set; }
[JsonProperty("FieldType")]
public List<GetLibraryItemsLibraryFieldType>? FieldType { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <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 GetLibraryItemsMetaDataRating
{
/// <summary>
/// A URI or path to the rating image.
/// </summary>
[JsonProperty("image")]
public string Image { get; set; } = default!;
/// <summary>
/// The value of the rating.
/// </summary>
[JsonProperty("value")]
public float Value { get; set; } = default!;
/// <summary>
/// The type of rating (e.g., audience, critic).
/// </summary>
[JsonProperty("type")]
public string Type { get; set; } = default!;
}
}

View File

@@ -41,6 +41,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("skipChildren")] [JsonProperty("skipChildren")]
public bool? SkipChildren { get; set; } 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; }
/// <summary> /// <summary>
/// The type of media content<br/> /// The type of media content<br/>
/// ///
@@ -49,7 +58,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("type")] [JsonProperty("type")]
public GetLibraryItemsType Type { get; set; } = default!; public GetLibraryItemsLibraryType Type { get; set; } = default!;
[JsonProperty("title")] [JsonProperty("title")]
public string Title { get; set; } = default!; public string Title { get; set; } = default!;
@@ -79,7 +88,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string? Tagline { get; set; } public string? Tagline { get; set; }
[JsonProperty("flattenSeasons")] [JsonProperty("flattenSeasons")]
public FlattenSeasons? FlattenSeasons { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.FlattenSeasons.False; public GetLibraryItemsFlattenSeasons? FlattenSeasons { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsFlattenSeasons.False;
/// <summary> /// <summary>
/// Setting that indicates the episode ordering for the show <br/> /// Setting that indicates the episode ordering for the show <br/>
@@ -94,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("showOrdering")] [JsonProperty("showOrdering")]
public ShowOrdering? ShowOrdering { get; set; } public GetLibraryItemsShowOrdering? ShowOrdering { get; set; }
[JsonProperty("thumb")] [JsonProperty("thumb")]
public string? Thumb { get; set; } public string? Thumb { get; set; }
@@ -150,6 +159,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("grandparentThumb")] [JsonProperty("grandparentThumb")]
public string? GrandparentThumb { get; set; } public string? GrandparentThumb { get; set; }
[JsonProperty("parentSlug")]
public string? ParentSlug { get; set; }
[JsonProperty("grandparentSlug")] [JsonProperty("grandparentSlug")]
public string? GrandparentSlug { get; set; } public string? GrandparentSlug { get; set; }
@@ -182,11 +194,14 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public List<GetLibraryItemsWriter>? Writer { get; set; } public List<GetLibraryItemsWriter>? Writer { get; set; }
[JsonProperty("Collection")] [JsonProperty("Collection")]
public List<Collection>? Collection { get; set; } public List<GetLibraryItemsCollection>? Collection { get; set; }
[JsonProperty("Role")] [JsonProperty("Role")]
public List<GetLibraryItemsRole>? Role { get; set; } public List<GetLibraryItemsRole>? Role { get; set; }
[JsonProperty("Location")]
public List<GetLibraryItemsLocation>? Location { get; set; }
/// <summary> /// <summary>
/// The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/> /// The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/>
/// ///
@@ -195,10 +210,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("Guid")] [JsonProperty("Guid")]
public List<MediaGuid>? MediaGuid { get; set; } public List<GetLibraryItemsMediaGuid>? MediaGuid { get; set; }
[JsonProperty("UltraBlurColors")] [JsonProperty("UltraBlurColors")]
public UltraBlurColors? UltraBlurColors { get; set; } public GetLibraryItemsUltraBlurColors? UltraBlurColors { get; set; }
[JsonProperty("Rating")]
public List<GetLibraryItemsMetaDataRating>? MetaDataRating { get; set; }
[JsonProperty("Image")] [JsonProperty("Image")]
public List<GetLibraryItemsImage>? Image { get; set; } public List<GetLibraryItemsImage>? Image { get; set; }

View File

@@ -0,0 +1,20 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
public enum GetLibraryItemsOptimizedForStreaming
{
Disable = 0,
Enable = 1,
}
}

View File

@@ -12,6 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic;
public class GetLibraryItemsPart public class GetLibraryItemsPart
{ {
@@ -23,7 +24,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string Key { get; set; } = default!; public string Key { get; set; } = default!;
[JsonProperty("duration")] [JsonProperty("duration")]
public int Duration { get; set; } = default!; public int? Duration { get; set; }
[JsonProperty("file")] [JsonProperty("file")]
public string File { get; set; } = default!; public string File { get; set; } = default!;
@@ -44,13 +45,22 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("audioProfile")] [JsonProperty("audioProfile")]
public string? AudioProfile { get; set; } public string? AudioProfile { get; set; }
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("optimizedForStreaming")]
public bool? OptimizedForStreaming { get; set; }
[JsonProperty("videoProfile")] [JsonProperty("videoProfile")]
public string VideoProfile { get; set; } = default!; public string? VideoProfile { get; set; }
[JsonProperty("indexes")] [JsonProperty("indexes")]
public string? Indexes { get; set; } public string? Indexes { get; set; }
[JsonProperty("hasThumbnail")] [JsonProperty("hasThumbnail")]
public HasThumbnail? HasThumbnail { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.HasThumbnail.False; 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,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
/// <summary>
/// Adds the Meta object to the response<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsQueryParamIncludeMeta
{
Disable = 0,
Enable = 1,
}
}

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.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
/// <summary>
/// The type of media to retrieve.<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>
public enum GetLibraryItemsQueryParamType
{
Movie = 1,
TvShow = 2,
Season = 3,
Episode = 4,
}
}

View File

@@ -15,6 +15,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetLibraryItemsRequest public class GetLibraryItemsRequest
{ {
/// <summary>
/// A key representing a specific tag within the section.
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tag")]
public Tag Tag { get; set; } = default!;
/// <summary> /// <summary>
/// The unique key of the Plex library. <br/> /// The unique key of the Plex library. <br/>
/// ///
@@ -26,12 +32,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")] [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")]
public int SectionKey { get; set; } = default!; public int SectionKey { get; set; } = default!;
/// <summary>
/// A key representing a specific tag within the section.
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tag")]
public Tag Tag { get; set; } = default!;
/// <summary> /// <summary>
/// Adds the Guids object to the response<br/> /// Adds the Guids object to the response<br/>
/// ///
@@ -42,16 +42,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids")]
public IncludeGuids? IncludeGuids { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeGuids.Disable; public IncludeGuids? IncludeGuids { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeGuids.Disable;
/// <summary>
/// Adds the Meta object to the response<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeMeta")]
public IncludeMeta? IncludeMeta { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeMeta.Disable;
/// <summary> /// <summary>
/// The type of media to retrieve.<br/> /// The type of media to retrieve.<br/>
/// ///
@@ -65,7 +55,17 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
public Models.Requests.Type? Type { get; set; } public GetLibraryItemsQueryParamType? Type { get; set; }
/// <summary>
/// Adds the Meta object to the response<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeMeta")]
public GetLibraryItemsQueryParamIncludeMeta? IncludeMeta { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsQueryParamIncludeMeta.Disable;
/// <summary> /// <summary>
/// The index of the first item to return. If not specified, the first item will be returned.<br/> /// The index of the first item to return. If not specified, the first item will be returned.<br/>

View File

@@ -15,7 +15,40 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetLibraryItemsRole public class GetLibraryItemsRole
{ {
/// <summary>
/// The ID of the tag or actor.
/// </summary>
[JsonProperty("id")]
public long? Id { get; set; }
/// <summary>
/// The filter used to find the actor or tag.
/// </summary>
[JsonProperty("filter")]
public string? Filter { get; set; }
/// <summary>
/// The thumbnail of the actor
/// </summary>
[JsonProperty("thumb")]
public string? Thumb { get; set; }
/// <summary>
/// The name of the tag or actor.
/// </summary>
[JsonProperty("tag")] [JsonProperty("tag")]
public string? Tag { get; set; } public string? Tag { get; set; }
/// <summary>
/// Unique identifier for the tag.
/// </summary>
[JsonProperty("tagKey")]
public string? TagKey { get; set; }
/// <summary>
/// The role of the actor or tag in the media.
/// </summary>
[JsonProperty("role")]
public string? Role { get; set; }
} }
} }

View File

@@ -0,0 +1,75 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// Setting that indicates the episode ordering for the show <br/>
///
/// <remarks>
/// None = Library default, <br/>
/// tmdbAiring = The Movie Database (Aired), <br/>
/// aired = TheTVDB (Aired), <br/>
/// dvd = TheTVDB (DVD), <br/>
/// absolute = TheTVDB (Absolute)).<br/>
///
/// </remarks>
/// </summary>
public enum GetLibraryItemsShowOrdering
{
[JsonProperty("None")]
None,
[JsonProperty("tmdbAiring")]
TmdbAiring,
[JsonProperty("aired")]
Aired,
[JsonProperty("dvd")]
Dvd,
[JsonProperty("absolute")]
Absolute,
}
public static class GetLibraryItemsShowOrderingExtension
{
public static string Value(this GetLibraryItemsShowOrdering value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetLibraryItemsShowOrdering ToEnum(this string value)
{
foreach(var field in typeof(GetLibraryItemsShowOrdering).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 GetLibraryItemsShowOrdering)
{
return (GetLibraryItemsShowOrdering)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetLibraryItemsShowOrdering");
}
}
}

View File

@@ -30,7 +30,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("activeDirection")] [JsonProperty("activeDirection")]
public ActiveDirection? ActiveDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.ActiveDirection.Ascending; public GetLibraryItemsActiveDirection? ActiveDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsActiveDirection.Ascending;
/// <summary> /// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/> /// The direction of the sort. Can be either `asc` or `desc`.<br/>
@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[JsonProperty("defaultDirection")] [JsonProperty("defaultDirection")]
public DefaultDirection? DefaultDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.DefaultDirection.Ascending; public GetLibraryItemsDefaultDirection? DefaultDirection { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsDefaultDirection.Ascending;
[JsonProperty("descKey")] [JsonProperty("descKey")]
public string? DescKey { get; set; } public string? DescKey { get; set; }

View File

@@ -0,0 +1,234 @@
//------------------------------------------------------------------------------
// <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 GetLibraryItemsStream
{
[JsonProperty("id")]
public long Id { get; set; } = default!;
/// <summary>
/// Type of stream (1 = video, 2 = audio, 3 = subtitle)
/// </summary>
[JsonProperty("streamType")]
public long StreamType { get; set; } = default!;
/// <summary>
/// Indicates if this is the default stream
/// </summary>
[JsonProperty("default")]
public bool? Default { get; set; }
/// <summary>
/// Indicates if the stream is selected
/// </summary>
[JsonProperty("selected")]
public bool? Selected { get; set; }
/// <summary>
/// Codec used by the stream
/// </summary>
[JsonProperty("codec")]
public string Codec { get; set; } = default!;
/// <summary>
/// The index of the stream
/// </summary>
[JsonProperty("index")]
public long Index { get; set; } = default!;
/// <summary>
/// The bitrate of the stream in kbps
/// </summary>
[JsonProperty("bitrate")]
public long? Bitrate { get; set; }
/// <summary>
/// The color primaries of the video stream
/// </summary>
[JsonProperty("colorPrimaries")]
public string? ColorPrimaries { get; set; }
/// <summary>
/// The color range of the video stream
/// </summary>
[JsonProperty("colorRange")]
public string? ColorRange { get; set; }
/// <summary>
/// The color space of the video stream
/// </summary>
[JsonProperty("colorSpace")]
public string? ColorSpace { get; set; }
/// <summary>
/// The transfer characteristics (TRC) of the video stream
/// </summary>
[JsonProperty("colorTrc")]
public string? ColorTrc { get; set; }
/// <summary>
/// The bit depth of the video stream
/// </summary>
[JsonProperty("bitDepth")]
public long? BitDepth { get; set; }
/// <summary>
/// The chroma location of the video stream
/// </summary>
[JsonProperty("chromaLocation")]
public string? ChromaLocation { get; set; }
/// <summary>
/// The identifier of the video stream
/// </summary>
[JsonProperty("streamIdentifier")]
public string? StreamIdentifier { get; set; }
/// <summary>
/// The chroma subsampling format
/// </summary>
[JsonProperty("chromaSubsampling")]
public string? ChromaSubsampling { get; set; }
/// <summary>
/// The coded height of the video stream
/// </summary>
[JsonProperty("codedHeight")]
public long? CodedHeight { get; set; }
/// <summary>
/// The coded width of the video stream
/// </summary>
[JsonProperty("codedWidth")]
public long? CodedWidth { get; set; }
/// <summary>
/// The frame rate of the video stream
/// </summary>
[JsonProperty("frameRate")]
public double? FrameRate { get; set; }
/// <summary>
/// Indicates if the stream has a scaling matrix
/// </summary>
[JsonProperty("hasScalingMatrix")]
public bool? HasScalingMatrix { get; set; }
[JsonProperty("hearingImpaired")]
public bool? HearingImpaired { get; set; }
[JsonProperty("closedCaptions")]
public bool? ClosedCaptions { get; set; }
[JsonProperty("embeddedInVideo")]
public string? EmbeddedInVideo { get; set; }
/// <summary>
/// The height of the video stream
/// </summary>
[JsonProperty("height")]
public long? Height { get; set; }
/// <summary>
/// The level of the video codec
/// </summary>
[JsonProperty("level")]
public long? Level { get; set; }
/// <summary>
/// The profile of the video codec
/// </summary>
[JsonProperty("profile")]
public string? Profile { get; set; }
/// <summary>
/// Number of reference frames
/// </summary>
[JsonProperty("refFrames")]
public long? RefFrames { get; set; }
/// <summary>
/// The scan type (progressive or interlaced)
/// </summary>
[JsonProperty("scanType")]
public string? ScanType { get; set; }
/// <summary>
/// The width of the video stream
/// </summary>
[JsonProperty("width")]
public long? Width { get; set; }
/// <summary>
/// Display title of the stream
/// </summary>
[JsonProperty("displayTitle")]
public string? DisplayTitle { get; set; }
/// <summary>
/// Extended display title of the stream
/// </summary>
[JsonProperty("extendedDisplayTitle")]
public string? ExtendedDisplayTitle { get; set; }
/// <summary>
/// Number of audio channels (for audio streams)
/// </summary>
[JsonProperty("channels")]
public long? Channels { get; set; }
/// <summary>
/// The language of the stream (for audio/subtitle streams)
/// </summary>
[JsonProperty("language")]
public string? Language { get; set; }
/// <summary>
/// Language tag of the stream
/// </summary>
[JsonProperty("languageTag")]
public string? LanguageTag { get; set; }
/// <summary>
/// Language code of the stream
/// </summary>
[JsonProperty("languageCode")]
public string? LanguageCode { get; set; }
/// <summary>
/// The audio channel layout
/// </summary>
[JsonProperty("audioChannelLayout")]
public string? AudioChannelLayout { get; set; }
/// <summary>
/// Sampling rate of the audio stream in Hz
/// </summary>
[JsonProperty("samplingRate")]
public long? SamplingRate { get; set; }
/// <summary>
/// Title of the subtitle track (for subtitle streams)
/// </summary>
[JsonProperty("title")]
public string? Title { get; set; }
/// <summary>
/// Indicates if the subtitle stream can auto-sync
/// </summary>
[JsonProperty("canAutoSync")]
public bool? CanAutoSync { get; set; }
}
}

View File

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

View File

@@ -15,9 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
/// <summary> /// <summary>
/// Plex Authentication Token /// An authentication token, obtained from plex.tv
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token")] [SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")]
public string XPlexToken { get; set; } = default!; public string XPlexToken { get; set; } = default!;
} }
} }

View File

@@ -48,6 +48,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string? VideoProfile { get; set; } public string? VideoProfile { get; set; }
[JsonProperty("Stream")] [JsonProperty("Stream")]
public List<Stream>? Stream { get; set; } public List<GetMetaDataByRatingKeyStream>? Stream { get; set; }
} }
} }

View File

@@ -0,0 +1,114 @@
//------------------------------------------------------------------------------
// <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 GetMetaDataByRatingKeyStream
{
[JsonProperty("id")]
public int? Id { get; set; }
[JsonProperty("streamType")]
public int? StreamType { get; set; }
[JsonProperty("default")]
public bool? Default { get; set; }
[JsonProperty("codec")]
public string? Codec { get; set; }
[JsonProperty("index")]
public int? Index { get; set; }
[JsonProperty("bitrate")]
public int? Bitrate { get; set; }
[JsonProperty("bitDepth")]
public int? BitDepth { get; set; }
[JsonProperty("chromaLocation")]
public string? ChromaLocation { get; set; }
[JsonProperty("chromaSubsampling")]
public string? ChromaSubsampling { get; set; }
[JsonProperty("codedHeight")]
public int? CodedHeight { get; set; }
[JsonProperty("codedWidth")]
public int? CodedWidth { get; set; }
[JsonProperty("colorPrimaries")]
public string? ColorPrimaries { get; set; }
[JsonProperty("colorRange")]
public string? ColorRange { get; set; }
[JsonProperty("colorSpace")]
public string? ColorSpace { get; set; }
[JsonProperty("colorTrc")]
public string? ColorTrc { get; set; }
[JsonProperty("frameRate")]
public int? FrameRate { get; set; }
[JsonProperty("hasScalingMatrix")]
public bool? HasScalingMatrix { get; set; }
[JsonProperty("height")]
public int? Height { get; set; }
[JsonProperty("level")]
public int? Level { get; set; }
[JsonProperty("profile")]
public string? Profile { get; set; }
[JsonProperty("refFrames")]
public int? RefFrames { get; set; }
[JsonProperty("scanType")]
public string? ScanType { get; set; }
[JsonProperty("streamIdentifier")]
public string? StreamIdentifier { get; set; }
[JsonProperty("width")]
public int? Width { get; set; }
[JsonProperty("displayTitle")]
public string? DisplayTitle { get; set; }
[JsonProperty("extendedDisplayTitle")]
public string? ExtendedDisplayTitle { get; set; }
[JsonProperty("selected")]
public bool? Selected { get; set; }
[JsonProperty("channels")]
public int? Channels { get; set; }
[JsonProperty("language")]
public string? Language { get; set; }
[JsonProperty("languageTag")]
public string? LanguageTag { get; set; }
[JsonProperty("languageCode")]
public string? LanguageCode { get; set; }
[JsonProperty("samplingRate")]
public int? SamplingRate { get; set; }
}
}

View File

@@ -26,16 +26,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=strong")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=strong")]
public bool? Strong { get; set; } = false; public bool? Strong { get; set; } = false;
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product")] /// <summary>
/// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
public string? ClientID { get; set; }
/// <summary>
/// The name of the client application. (Plex Web, Plex Media Server, etc.)
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product")]
public string? ClientName { get; set; } public string? ClientName { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device")] /// <summary>
public string? DeviceName { get; set; } /// A relatively friendly name for the client device
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device")]
public string? DeviceNickname { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version")] /// <summary>
/// The version of the client application.
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version")]
public string? ClientVersion { get; set; } public string? ClientVersion { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform")] /// <summary>
public string? ClientPlatform { get; set; } /// The platform of the client application.
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform")]
public string? Platform { get; set; }
} }
} }

View File

@@ -0,0 +1,64 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetRecentlyAddedActiveDirection
{
[JsonProperty("asc")]
Ascending,
[JsonProperty("desc")]
Descending,
}
public static class GetRecentlyAddedActiveDirectionExtension
{
public static string Value(this GetRecentlyAddedActiveDirection value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetRecentlyAddedActiveDirection ToEnum(this string value)
{
foreach(var field in typeof(GetRecentlyAddedActiveDirection).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 GetRecentlyAddedActiveDirection)
{
return (GetRecentlyAddedActiveDirection)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetRecentlyAddedActiveDirection");
}
}
}

View File

@@ -0,0 +1,64 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The direction of the sort. Can be either `asc` or `desc`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetRecentlyAddedDefaultDirection
{
[JsonProperty("asc")]
Ascending,
[JsonProperty("desc")]
Descending,
}
public static class GetRecentlyAddedDefaultDirectionExtension
{
public static string Value(this GetRecentlyAddedDefaultDirection value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetRecentlyAddedDefaultDirection ToEnum(this string value)
{
foreach(var field in typeof(GetRecentlyAddedDefaultDirection).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 GetRecentlyAddedDefaultDirection)
{
return (GetRecentlyAddedDefaultDirection)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetRecentlyAddedDefaultDirection");
}
}
}

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 GetRecentlyAddedField
{
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
[JsonProperty("type")]
public string Type { get; set; } = default!;
[JsonProperty("subType")]
public string? SubType { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <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 GetRecentlyAddedFieldType
{
[JsonProperty("type")]
public string Type { get; set; } = default!;
[JsonProperty("Operator")]
public List<GetRecentlyAddedOperator> Operator { get; set; } = default!;
}
}

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;
public class GetRecentlyAddedFilter
{
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
[JsonProperty("filterType")]
public string FilterType { 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,61 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
public enum GetRecentlyAddedHubsResponseType
{
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
public static class GetRecentlyAddedHubsResponseTypeExtension
{
public static string Value(this GetRecentlyAddedHubsResponseType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetRecentlyAddedHubsResponseType ToEnum(this string value)
{
foreach(var field in typeof(GetRecentlyAddedHubsResponseType).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 GetRecentlyAddedHubsResponseType)
{
return (GetRecentlyAddedHubsResponseType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetRecentlyAddedHubsResponseType");
}
}
}

View File

@@ -0,0 +1,68 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The type of media content<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public enum GetRecentlyAddedHubsType
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
}
public static class GetRecentlyAddedHubsTypeExtension
{
public static string Value(this GetRecentlyAddedHubsType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetRecentlyAddedHubsType ToEnum(this string value)
{
foreach(var field in typeof(GetRecentlyAddedHubsType).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 GetRecentlyAddedHubsType)
{
return (GetRecentlyAddedHubsType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetRecentlyAddedHubsType");
}
}
}

View File

@@ -0,0 +1,28 @@
//------------------------------------------------------------------------------
// <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;
public class GetRecentlyAddedImage
{
[JsonProperty("alt")]
public string Alt { get; set; } = default!;
[JsonProperty("type")]
public GetRecentlyAddedHubsResponseType Type { get; set; } = default!;
[JsonProperty("url")]
public string Url { get; set; } = default!;
}
}

View File

@@ -0,0 +1,21 @@
//------------------------------------------------------------------------------
// <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 GetRecentlyAddedLibraryCountry
{
[JsonProperty("tag")]
public string? Tag { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
//------------------------------------------------------------------------------
// <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 GetRecentlyAddedLibraryDirector
{
[JsonProperty("tag")]
public string? Tag { get; set; }
}
}

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;
public class GetRecentlyAddedLibraryFilter
{
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
[JsonProperty("filterType")]
public string FilterType { 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,21 @@
//------------------------------------------------------------------------------
// <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 GetRecentlyAddedLibraryGenre
{
[JsonProperty("tag")]
public string? Tag { get; set; }
}
}

View File

@@ -0,0 +1,68 @@
//------------------------------------------------------------------------------
// <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 GetRecentlyAddedLibraryMedia
{
[JsonProperty("id")]
public double? Id { get; set; }
[JsonProperty("duration")]
public double? Duration { get; set; }
[JsonProperty("bitrate")]
public double? Bitrate { get; set; }
[JsonProperty("width")]
public double? Width { get; set; }
[JsonProperty("height")]
public double? Height { get; set; }
[JsonProperty("aspectRatio")]
public double? AspectRatio { get; set; }
[JsonProperty("audioChannels")]
public double? AudioChannels { get; set; }
[JsonProperty("audioCodec")]
public string? AudioCodec { get; set; }
[JsonProperty("videoCodec")]
public string? VideoCodec { get; set; }
[JsonProperty("videoResolution")]
public double? VideoResolution { get; set; }
[JsonProperty("container")]
public string? Container { get; set; }
[JsonProperty("videoFrameRate")]
public string? VideoFrameRate { get; set; }
[JsonProperty("optimizedForStreaming")]
public double? OptimizedForStreaming { get; set; }
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("videoProfile")]
public string? VideoProfile { get; set; }
[JsonProperty("Part")]
public List<GetRecentlyAddedLibraryPart>? Part { 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.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
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 GetRecentlyAddedLibraryMediaContainer
{
[JsonProperty("Type")]
public List<GetRecentlyAddedLibraryType>? Type { get; set; }
[JsonProperty("FieldType")]
public List<FieldType>? FieldType { get; set; }
[JsonProperty("size")]
public double? Size { get; set; }
[JsonProperty("allowSync")]
public bool? AllowSync { get; set; }
[JsonProperty("identifier")]
public string? Identifier { get; set; }
[JsonProperty("mediaTagPrefix")]
public string? MediaTagPrefix { get; set; }
[JsonProperty("mediaTagVersion")]
public double? MediaTagVersion { get; set; }
[JsonProperty("mixedParents")]
public bool? MixedParents { get; set; }
[JsonProperty("Metadata")]
public List<GetRecentlyAddedLibraryMetadata>? Metadata { get; set; }
}
}

View File

@@ -0,0 +1,117 @@
//------------------------------------------------------------------------------
// <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;
using System;
public class GetRecentlyAddedLibraryMetadata
{
[JsonProperty("allowSync")]
public bool? AllowSync { get; set; }
[JsonProperty("librarySectionID")]
public double? LibrarySectionID { get; set; }
[JsonProperty("librarySectionTitle")]
public string? LibrarySectionTitle { get; set; }
[JsonProperty("librarySectionUUID")]
public string? LibrarySectionUUID { get; set; }
[JsonProperty("ratingKey")]
public double? RatingKey { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("guid")]
public string? Guid { get; set; }
[JsonProperty("studio")]
public string? Studio { get; set; }
[JsonProperty("type")]
public string? Type { get; set; }
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("contentRating")]
public string? ContentRating { get; set; }
[JsonProperty("summary")]
public string? Summary { get; set; }
[JsonProperty("rating")]
public double? Rating { get; set; }
[JsonProperty("audienceRating")]
public double? AudienceRating { get; set; }
[JsonProperty("year")]
public double? Year { get; set; }
[JsonProperty("tagline")]
public string? Tagline { get; set; }
[JsonProperty("thumb")]
public string? Thumb { get; set; }
[JsonProperty("art")]
public string? Art { get; set; }
[JsonProperty("duration")]
public double? Duration { get; set; }
[JsonProperty("originallyAvailableAt")]
public DateTime? OriginallyAvailableAt { get; set; }
[JsonProperty("addedAt")]
public double? AddedAt { get; set; }
[JsonProperty("updatedAt")]
public double? UpdatedAt { get; set; }
[JsonProperty("audienceRatingImage")]
public string? AudienceRatingImage { get; set; }
[JsonProperty("chapterSource")]
public string? ChapterSource { get; set; }
[JsonProperty("primaryExtraKey")]
public string? PrimaryExtraKey { get; set; }
[JsonProperty("ratingImage")]
public string? RatingImage { get; set; }
[JsonProperty("Media")]
public List<GetRecentlyAddedLibraryMedia>? Media { get; set; }
[JsonProperty("Genre")]
public List<GetRecentlyAddedLibraryGenre>? Genre { get; set; }
[JsonProperty("Director")]
public List<GetRecentlyAddedLibraryDirector>? Director { get; set; }
[JsonProperty("Writer")]
public List<GetRecentlyAddedLibraryWriter>? Writer { get; set; }
[JsonProperty("Country")]
public List<GetRecentlyAddedLibraryCountry>? Country { get; set; }
[JsonProperty("Role")]
public List<GetRecentlyAddedLibraryRole>? Role { get; set; }
}
}

View File

@@ -0,0 +1,48 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetRecentlyAddedLibraryPart
{
[JsonProperty("id")]
public double? Id { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("duration")]
public double? Duration { get; set; }
[JsonProperty("file")]
public string? File { get; set; }
[JsonProperty("size")]
public double? Size { get; set; }
[JsonProperty("container")]
public string? Container { get; set; }
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("hasThumbnail")]
public double? HasThumbnail { get; set; }
[JsonProperty("optimizedForStreaming")]
public bool? OptimizedForStreaming { get; set; }
[JsonProperty("videoProfile")]
public string? VideoProfile { get; set; }
}
}

View File

@@ -0,0 +1,80 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using System.Collections.Generic;
public class GetRecentlyAddedLibraryRequest
{
/// <summary>
/// The type of media to retrieve.<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 QueryParamType Type { get; set; } = default!;
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=contentDirectoryID")]
public long? ContentDirectoryID { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=pinnedContentDirectoryID")]
public List<long>? PinnedContentDirectoryID { get; set; }
/// <summary>
/// The library section ID for filtering content.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=sectionID")]
public long? SectionID { get; set; }
/// <summary>
/// Adds the Meta object to the response<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeMeta")]
public QueryParamIncludeMeta? IncludeMeta { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.QueryParamIncludeMeta.Disable;
/// <summary>
/// The index of the first item to return. If not specified, the first item will be returned.<br/>
///
/// <remarks>
/// If the number of items exceeds the limit, the response will be paginated.<br/>
/// By default this is 0<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Container-Start")]
public int? XPlexContainerStart { get; set; } = 0;
/// <summary>
/// The number of items to return. If not specified, all items will be returned.<br/>
///
/// <remarks>
/// If the number of items exceeds the limit, the response will be paginated.<br/>
/// By default this is 50<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Container-Size")]
public int? XPlexContainerSize { get; set; } = 50;
}
}

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.Net.Http;
using System;
public class GetRecentlyAddedLibraryResponse
{
/// <summary>
/// HTTP response content type for this operation
/// </summary>
public string? ContentType { get; set; } = default!;
/// <summary>
/// HTTP response status code for this operation
/// </summary>
public int StatusCode { get; set; } = default!;
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
public HttpResponseMessage RawResponse { get; set; } = default!;
/// <summary>
/// The recently added content
/// </summary>
public GetRecentlyAddedLibraryResponseBody? Object { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
/// <summary>
/// The recently added content
/// </summary>
public class GetRecentlyAddedLibraryResponseBody
{
[JsonProperty("MediaContainer")]
public GetRecentlyAddedLibraryMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
//------------------------------------------------------------------------------
// <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 GetRecentlyAddedLibraryRole
{
[JsonProperty("tag")]
public string? Tag { get; set; }
}
}

View File

@@ -0,0 +1,41 @@
//------------------------------------------------------------------------------
// <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 GetRecentlyAddedLibraryType
{
[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<GetRecentlyAddedLibraryFilter>? Filter { get; set; }
[JsonProperty("Sort")]
public List<Sort>? Sort { get; set; }
[JsonProperty("Field")]
public List<Field>? Field { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
//------------------------------------------------------------------------------
// <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 GetRecentlyAddedLibraryWriter
{
[JsonProperty("tag")]
public string? Tag { get; set; }
}
}

View File

@@ -18,22 +18,29 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
[JsonProperty("size")] [JsonProperty("size")]
public double? Size { get; set; } public double Size { get; set; } = default!;
[JsonProperty("allowSync")] [JsonProperty("offset")]
public bool? AllowSync { get; set; } public int? Offset { get; set; }
[JsonProperty("totalSize")]
public int? TotalSize { get; set; }
[JsonProperty("identifier")] [JsonProperty("identifier")]
public string? Identifier { get; set; } public string? Identifier { get; set; }
[JsonProperty("mediaTagPrefix")] [JsonProperty("allowSync")]
public string? MediaTagPrefix { get; set; } public bool? AllowSync { get; set; }
[JsonProperty("mediaTagVersion")] /// <summary>
public double? MediaTagVersion { get; set; } /// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/>
///
[JsonProperty("mixedParents")] /// <remarks>
public bool? MixedParents { get; set; } ///
/// </remarks>
/// </summary>
[JsonProperty("Meta")]
public Meta? Meta { get; set; }
[JsonProperty("Metadata")] [JsonProperty("Metadata")]
public List<GetRecentlyAddedMetadata>? Metadata { get; set; } public List<GetRecentlyAddedMetadata>? Metadata { get; set; }

View File

@@ -12,47 +12,65 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using LukeHagar.PlexAPI.SDK.Models.Requests; using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using NodaTime;
using System.Collections.Generic; using System.Collections.Generic;
using System;
public class GetRecentlyAddedMetadata public class GetRecentlyAddedMetadata
{ {
[JsonProperty("allowSync")] /// <summary>
public bool? AllowSync { get; set; } /// The rating key (Media ID) of this media item.<br/>
///
[JsonProperty("librarySectionID")] /// <remarks>
public double? LibrarySectionID { get; set; } /// Note: This is always an integer, but is represented as a string in the API.<br/>
///
[JsonProperty("librarySectionTitle")] /// </remarks>
public string? LibrarySectionTitle { get; set; } /// </summary>
[JsonProperty("librarySectionUUID")]
public string? LibrarySectionUUID { get; set; }
[JsonProperty("ratingKey")] [JsonProperty("ratingKey")]
public double? RatingKey { get; set; } public string RatingKey { get; set; } = default!;
[JsonProperty("key")] [JsonProperty("key")]
public string? Key { get; set; } public string Key { get; set; } = default!;
[JsonProperty("guid")] [JsonProperty("guid")]
public string? Guid { get; set; } public string Guid { get; set; } = default!;
[JsonProperty("studio")] [JsonProperty("studio")]
public string? Studio { get; set; } 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; }
/// <summary>
/// The type of media content<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("type")] [JsonProperty("type")]
public string? Type { get; set; } public GetRecentlyAddedHubsType Type { get; set; } = default!;
[JsonProperty("title")] [JsonProperty("title")]
public string? Title { get; set; } public string Title { get; set; } = default!;
[JsonProperty("slug")]
public string? Slug { get; set; }
[JsonProperty("contentRating")] [JsonProperty("contentRating")]
public string? ContentRating { get; set; } public string? ContentRating { get; set; }
[JsonProperty("summary")] [JsonProperty("summary")]
public string? Summary { get; set; } public string Summary { get; set; } = default!;
[JsonProperty("rating")] [JsonProperty("rating")]
public double? Rating { get; set; } public double? Rating { get; set; }
@@ -61,28 +79,58 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public double? AudienceRating { get; set; } public double? AudienceRating { get; set; }
[JsonProperty("year")] [JsonProperty("year")]
public double? Year { get; set; } public int? Year { get; set; }
[JsonProperty("seasonCount")]
public int? SeasonCount { get; set; }
[JsonProperty("tagline")] [JsonProperty("tagline")]
public string? Tagline { get; set; } public string? Tagline { get; set; }
[JsonProperty("flattenSeasons")]
public FlattenSeasons? FlattenSeasons { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.FlattenSeasons.False;
/// <summary>
/// Setting that indicates the episode ordering for the show <br/>
///
/// <remarks>
/// 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; }
[JsonProperty("thumb")] [JsonProperty("thumb")]
public string? Thumb { get; set; } public string? Thumb { get; set; }
[JsonProperty("art")] [JsonProperty("art")]
public string? Art { get; set; } public string? Art { get; set; }
[JsonProperty("banner")]
public string? Banner { get; set; }
[JsonProperty("duration")] [JsonProperty("duration")]
public double? Duration { get; set; } public int? Duration { get; set; }
[JsonProperty("originallyAvailableAt")] [JsonProperty("originallyAvailableAt")]
public DateTime? OriginallyAvailableAt { get; set; } public LocalDate? OriginallyAvailableAt { get; set; }
/// <summary>
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("addedAt")] [JsonProperty("addedAt")]
public double? AddedAt { get; set; } public long AddedAt { get; set; } = default!;
/// <summary>
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("updatedAt")] [JsonProperty("updatedAt")]
public double? UpdatedAt { get; set; } public long? UpdatedAt { get; set; }
[JsonProperty("audienceRatingImage")] [JsonProperty("audienceRatingImage")]
public string? AudienceRatingImage { get; set; } public string? AudienceRatingImage { get; set; }
@@ -96,22 +144,154 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("ratingImage")] [JsonProperty("ratingImage")]
public string? RatingImage { get; set; } public string? RatingImage { get; set; }
[JsonProperty("grandparentRatingKey")]
public string? GrandparentRatingKey { get; set; }
[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; }
[JsonProperty("grandparentSlug")]
public string? GrandparentSlug { get; set; }
[JsonProperty("grandparentArt")]
public string? GrandparentArt { get; set; }
[JsonProperty("grandparentTheme")]
public string? GrandparentTheme { get; set; }
/// <summary>
/// The Media object is only included when type query is `4` or higher.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("Media")] [JsonProperty("Media")]
public List<Models.Requests.Media>? Media { get; set; } public List<Models.Requests.Media>? Media { get; set; }
[JsonProperty("Genre")] [JsonProperty("Genre")]
public List<Genre>? Genre { get; set; } public List<Genre>? Genre { get; set; }
[JsonProperty("Country")]
public List<Country>? Country { get; set; }
[JsonProperty("Director")] [JsonProperty("Director")]
public List<Director>? Director { get; set; } public List<Director>? Director { get; set; }
[JsonProperty("Writer")] [JsonProperty("Writer")]
public List<Writer>? Writer { get; set; } public List<Writer>? Writer { get; set; }
[JsonProperty("Country")] [JsonProperty("Collection")]
public List<Country>? Country { get; set; } public List<Collection>? Collection { get; set; }
[JsonProperty("Role")] [JsonProperty("Role")]
public List<Role>? Role { get; set; } public List<Role>? Role { get; set; }
[JsonProperty("Location")]
public List<Location>? 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<MediaGuid>? MediaGuid { get; set; }
[JsonProperty("UltraBlurColors")]
public UltraBlurColors? UltraBlurColors { get; set; }
[JsonProperty("Rating")]
public List<MetaDataRating>? MetaDataRating { get; set; }
[JsonProperty("Image")]
public List<GetRecentlyAddedImage>? 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; }
} }
} }

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 GetRecentlyAddedOperator
{
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
}
}

View File

@@ -9,11 +9,55 @@
#nullable enable #nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests namespace LukeHagar.PlexAPI.SDK.Models.Requests
{ {
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils; using LukeHagar.PlexAPI.SDK.Utils;
public class GetRecentlyAddedRequest public class GetRecentlyAddedRequest
{ {
/// <summary>
/// The content directory ID.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=contentDirectoryID")]
public long ContentDirectoryID { get; set; } = default!;
/// <summary>
/// The type of media to retrieve.<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 Models.Requests.Type Type { get; set; } = default!;
/// <summary>
/// Comma-separated list of pinned content directory IDs.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=pinnedContentDirectoryID")]
public string? PinnedContentDirectoryID { get; set; }
/// <summary>
/// The library section ID for filtering content.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=sectionID")]
public long? SectionID { get; set; }
/// <summary>
/// Adds the Meta object to the response<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeMeta")]
public IncludeMeta? IncludeMeta { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeMeta.Disable;
/// <summary> /// <summary>
/// The index of the first item to return. If not specified, the first item will be returned.<br/> /// The index of the first item to return. If not specified, the first item will be returned.<br/>
/// ///

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