Compare commits

...

5 Commits

Author SHA1 Message Date
speakeasybot
14e54fa017 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.3 2024-11-14 00:22:09 +00:00
speakeasybot
61492e5dad ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.1 2024-11-12 00:21:43 +00:00
speakeasybot
f099c01940 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.406.0 2024-10-03 12:26:13 +00:00
speakeasybot
92be5b3a91 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 11:11:07 +00:00
speakeasybot
a183f389bc ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 10:46:38 +00:00
152 changed files with 3112 additions and 4488 deletions

File diff suppressed because one or more lines are too long

View File

@@ -11,15 +11,18 @@ generation:
requestResponseComponentNamesFeb2024: true requestResponseComponentNamesFeb2024: true
auth: auth:
oAuth2ClientCredentialsEnabled: true oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
csharp: csharp:
version: 0.9.0 version: 0.11.1
additionalDependencies: [] additionalDependencies: []
author: LukeHagar author: LukeHagar
clientServerStatusCodesAsErrors: true clientServerStatusCodesAsErrors: true
defaultErrorName: SDKException
disableNamespacePascalCasingApr2024: true disableNamespacePascalCasingApr2024: true
dotnetVersion: net8.0 dotnetVersion: net8.0
enableSourceLink: true enableSourceLink: true
flattenGlobalSecurity: true flattenGlobalSecurity: true
flatteningOrder: ""
imports: imports:
option: openapi option: openapi
paths: paths:
@@ -31,6 +34,7 @@ csharp:
includeDebugSymbols: true includeDebugSymbols: true
inputModelSuffix: input inputModelSuffix: input
maxMethodParams: 4 maxMethodParams: 4
methodArguments: infer-optional-args
outputModelSuffix: output outputModelSuffix: output
packageName: LukeHagar.PlexAPI.SDK packageName: LukeHagar.PlexAPI.SDK
packageTags: Plex Media Server SDK packageTags: Plex Media Server SDK

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.405.8 speakeasyVersion: 1.438.3
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:b1e231bd781f352738612b0158382ba51cfac32e97c23d9e4913aab5501e9529 sourceRevisionDigest: sha256:37c6bfb15f4154eb89b112465107f20757411f22bd1cc7d0a04335df7127fcb4
sourceBlobDigest: sha256:8ce05d5965182eb3fe9376715c269b9e1c7f3e2d90273c175a4181735f41daa0 sourceBlobDigest: sha256:290473ebc909cada80ff428c685b897f4621cf121397e1417355e06d334e7206
tags: tags:
- latest - latest
- main - main
@@ -25,10 +25,10 @@ targets:
plexcsharp: plexcsharp:
source: plexapi source: plexapi
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:b1e231bd781f352738612b0158382ba51cfac32e97c23d9e4913aab5501e9529 sourceRevisionDigest: sha256:37c6bfb15f4154eb89b112465107f20757411f22bd1cc7d0a04335df7127fcb4
sourceBlobDigest: sha256:8ce05d5965182eb3fe9376715c269b9e1c7f3e2d90273c175a4181735f41daa0 sourceBlobDigest: sha256:290473ebc909cada80ff428c685b897f4621cf121397e1417355e06d334e7206
codeSamplesNamespace: code-samples-csharp-plexcsharp codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:58fe70fa1a5c905723a25f3e8c72551cc91f8227b052f13d826b5a6b25eb7049 codeSamplesRevisionDigest: sha256:edc0ca575be34ae34b4a81817b5c5ed0dc783b63aab0763b04993d20abf47bbb
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(RetryConfig? retryConfig = null); Task<GetServerActivitiesResponse> GetServerActivitiesAsync();
/// <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, RetryConfig? retryConfig = null); Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID);
} }
/// <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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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(RetryConfig? retryConfig = null) public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -107,44 +107,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -220,7 +187,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, RetryConfig? retryConfig = null) public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
{ {
var request = new CancelServerActivitiesRequest() var request = new CancelServerActivitiesRequest()
{ {
@@ -240,44 +207,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope, RetryConfig? retryConfig = null); Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope);
/// <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, RetryConfig? retryConfig = null); Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source);
/// <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, RetryConfig? retryConfig = null); Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = 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(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null); Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null);
} }
/// <summary> /// <summary>
@@ -95,10 +95,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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, RetryConfig? retryConfig = null) public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope)
{ {
var request = new GetTransientTokenRequest() var request = new GetTransientTokenRequest()
{ {
@@ -132,44 +132,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -237,7 +204,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, RetryConfig? retryConfig = null) public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
{ {
var request = new GetSourceConnectionInformationRequest() var request = new GetSourceConnectionInformationRequest()
{ {
@@ -257,44 +224,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -362,7 +296,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, RetryConfig? retryConfig = null) public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null)
{ {
string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary<string, string>(){ string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary<string, string>(){
}); });
@@ -384,44 +318,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -497,7 +398,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<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null) public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null)
{ {
request.ClientID ??= SDKConfiguration.ClientID; request.ClientID ??= SDKConfiguration.ClientID;
request.ClientName ??= SDKConfiguration.ClientName; request.ClientName ??= SDKConfiguration.ClientName;
@@ -527,44 +428,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -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(RetryConfig? retryConfig = null); Task<GetButlerTasksResponse> GetButlerTasksAsync();
/// <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(RetryConfig? retryConfig = null); Task<StartAllTasksResponse> StartAllTasksAsync();
/// <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(RetryConfig? retryConfig = null); Task<StopAllTasksResponse> StopAllTasksAsync();
/// <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, RetryConfig? retryConfig = null); Task<StartTaskResponse> StartTaskAsync(TaskName taskName);
/// <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, RetryConfig? retryConfig = null); Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName);
} }
/// <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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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(RetryConfig? retryConfig = null) public async Task<GetButlerTasksResponse> GetButlerTasksAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -134,44 +134,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -247,7 +214,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(RetryConfig? retryConfig = null) public async Task<StartAllTasksResponse> StartAllTasksAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -264,44 +231,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -369,7 +303,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(RetryConfig? retryConfig = null) public async Task<StopAllTasksResponse> StopAllTasksAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -386,44 +320,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -491,7 +392,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, RetryConfig? retryConfig = null) public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
{ {
var request = new StartTaskRequest() var request = new StartTaskRequest()
{ {
@@ -511,44 +412,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -616,7 +484,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, RetryConfig? retryConfig = null) public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
{ {
var request = new StopTaskRequest() var request = new StopTaskRequest()
{ {
@@ -636,44 +504,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ 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, RetryConfig? retryConfig = null); Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null);
/// <summary> /// <summary>
/// Get Recently Added /// Get Recently Added
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null); Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request);
/// <summary> /// <summary>
/// Get library specific hubs /// Get library specific hubs
@@ -59,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null); Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null);
} }
/// <summary> /// <summary>
@@ -73,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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;
@@ -89,7 +89,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null) public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null)
{ {
var request = new GetGlobalHubsRequest() var request = new GetGlobalHubsRequest()
{ {
@@ -110,44 +110,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -223,7 +190,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<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null) public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request); var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
@@ -239,44 +206,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-recently-added", null, _securitySource); var hookCtx = new HookContext("get-recently-added", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -330,7 +264,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<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null) public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
{ {
var request = new GetLibraryHubsRequest() var request = new GetLibraryHubsRequest()
{ {
@@ -352,44 +286,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -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, RetryConfig? retryConfig = null); Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null);
/// <summary> /// <summary>
/// Get Recently Added /// Get Recently Added
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null); Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request);
/// <summary> /// <summary>
/// Get All Libraries /// Get All Libraries
@@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetAllLibrariesResponse> GetAllLibrariesAsync(RetryConfig? retryConfig = null); Task<GetAllLibrariesResponse> GetAllLibrariesAsync();
/// <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, RetryConfig? retryConfig = null); Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = 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, RetryConfig? retryConfig = null); Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey);
/// <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, RetryConfig? retryConfig = null); Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request);
/// <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, RetryConfig? retryConfig = null); Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null);
/// <summary> /// <summary>
/// Search Library /// Search Library
@@ -187,7 +187,17 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null); Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type);
/// <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);
/// <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, RetryConfig? retryConfig = null); Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey);
/// <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, RetryConfig? retryConfig = null); Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = 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, RetryConfig? retryConfig = null); Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null);
/// <summary> /// <summary>
/// Get On Deck /// Get On Deck
@@ -227,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetOnDeckResponse> GetOnDeckAsync(RetryConfig? retryConfig = null); Task<GetOnDeckResponse> GetOnDeckAsync();
} }
/// <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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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, RetryConfig? retryConfig = null) public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null)
{ {
var request = new GetFileHashRequest() var request = new GetFileHashRequest()
{ {
@@ -278,44 +288,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -383,7 +360,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<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null) public async Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request)
{ {
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);
@@ -399,44 +376,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-recently-added-library", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -512,7 +456,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(RetryConfig? retryConfig = null) public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -529,44 +473,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -642,7 +553,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, RetryConfig? retryConfig = null) public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null)
{ {
var request = new GetLibraryDetailsRequest() var request = new GetLibraryDetailsRequest()
{ {
@@ -663,44 +574,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -776,7 +654,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, RetryConfig? retryConfig = null) public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey)
{ {
var request = new DeleteLibraryRequest() var request = new DeleteLibraryRequest()
{ {
@@ -796,44 +674,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -901,7 +746,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, RetryConfig? retryConfig = null) public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request)
{ {
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);
@@ -917,44 +762,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1030,7 +842,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, RetryConfig? retryConfig = null) public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null)
{ {
var request = new GetRefreshLibraryMetadataRequest() var request = new GetRefreshLibraryMetadataRequest()
{ {
@@ -1051,44 +863,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1156,7 +935,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, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null) public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type)
{ {
var request = new GetSearchLibraryRequest() var request = new GetSearchLibraryRequest()
{ {
@@ -1177,44 +956,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1290,7 +1036,110 @@ 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, RetryConfig? retryConfig = null) public async Task<GetSearchAllLibrariesResponse> GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request)
{
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);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
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)
{ {
var request = new GetMetaDataByRatingKeyRequest() var request = new GetMetaDataByRatingKeyRequest()
{ {
@@ -1310,44 +1159,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1423,7 +1239,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, RetryConfig? retryConfig = null) public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null)
{ {
var request = new GetMetadataChildrenRequest() var request = new GetMetadataChildrenRequest()
{ {
@@ -1444,44 +1260,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1557,7 +1340,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, RetryConfig? retryConfig = null) public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null)
{ {
var request = new GetTopWatchedContentRequest() var request = new GetTopWatchedContentRequest()
{ {
@@ -1578,44 +1361,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1691,7 +1441,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(RetryConfig? retryConfig = null) public async Task<GetOnDeckResponse> GetOnDeckAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -1708,44 +1458,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<LogLineResponse> LogLineAsync(Level level, string message, string source, RetryConfig? retryConfig = null); Task<LogLineResponse> LogLineAsync(Level level, string message, string source);
/// <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, RetryConfig? retryConfig = null); Task<LogMultiLineResponse> LogMultiLineAsync(string request);
/// <summary> /// <summary>
/// Enabling Papertrail /// Enabling Papertrail
@@ -80,7 +80,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<EnablePaperTrailResponse> EnablePaperTrailAsync(RetryConfig? retryConfig = null); Task<EnablePaperTrailResponse> EnablePaperTrailAsync();
} }
/// <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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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, RetryConfig? retryConfig = null) public async Task<LogLineResponse> LogLineAsync(Level level, string message, string source)
{ {
var request = new LogLineRequest() var request = new LogLineRequest()
{ {
@@ -132,44 +132,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -237,7 +204,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, RetryConfig? retryConfig = null) public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -260,44 +227,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -365,7 +299,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(RetryConfig? retryConfig = null) public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -382,44 +316,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -3,37 +3,37 @@
<PropertyGroup> <PropertyGroup>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId> <PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.9.0</Version> <Version>0.11.1</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 Media Server OpenAPI Specification <Description># Plex Media Server OpenAPI Specification<br/>
<br/>
An Open Source OpenAPI Specification for Plex Media Server An Open Source OpenAPI Specification for Plex Media Server<br/>
<br/>
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/) Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
<br/>
## Documentation ## Documentation<br/>
<br/>
[API Documentation](https://plexapi.dev) <a href="https://plexapi.dev">API Documentation</a><br/>
<br/>
## SDKs ## SDKs<br/>
<br/>
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec). The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
<br/>
| Language | Repository | Releases | Other | | Language | Repository | Releases | Other |<br/>
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - | | Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - | | JavaScript/TypeScript | <a href="https://github.com/LukeHagar/plexjs">GitHub</a> | <a href="https://www.npmjs.com/package/@lukehagar/plexjs">NPM</a> \ <a href="https://jsr.io/@lukehagar/plexjs">JSR</a> | - |<br/>
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) | | Go | <a href="https://github.com/LukeHagar/plexgo">GitHub</a> | <a href="https://github.com/LukeHagar/plexgo/releases">Releases</a> | <a href="https://pkg.go.dev/github.com/LukeHagar/plexgo">GoDoc</a> |<br/>
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - | | Ruby | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/releases">Releases</a> | - |<br/>
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | -<br/>
</Description> </Description>
</PropertyGroup> </PropertyGroup>

View File

@@ -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, RetryConfig? retryConfig = null); Task<MarkPlayedResponse> MarkPlayedAsync(double key);
/// <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, RetryConfig? retryConfig = null); Task<MarkUnplayedResponse> MarkUnplayedAsync(double key);
/// <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, RetryConfig? retryConfig = null); Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state);
/// <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, RetryConfig? retryConfig = null); Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request);
/// <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, RetryConfig? retryConfig = null); Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request);
} }
/// <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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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, RetryConfig? retryConfig = null) public async Task<MarkPlayedResponse> MarkPlayedAsync(double key)
{ {
var request = new MarkPlayedRequest() var request = new MarkPlayedRequest()
{ {
@@ -126,44 +126,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -231,7 +198,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, RetryConfig? retryConfig = null) public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
{ {
var request = new MarkUnplayedRequest() var request = new MarkUnplayedRequest()
{ {
@@ -251,44 +218,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -356,7 +290,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, RetryConfig? retryConfig = null) public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
{ {
var request = new UpdatePlayProgressRequest() var request = new UpdatePlayProgressRequest()
{ {
@@ -378,44 +312,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -483,7 +384,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<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request, RetryConfig? retryConfig = null) public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request)
{ {
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);
@@ -500,44 +401,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -612,7 +480,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<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request, RetryConfig? retryConfig = null) public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request)
{ {
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);
@@ -629,44 +497,11 @@ 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -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 GetSearchAllLibrariesBadRequest : Exception
{
[JsonProperty("errors")]
public List<GetSearchAllLibrariesErrors>? 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 GetSearchAllLibrariesErrors
{
[JsonProperty("code")]
public int? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public int? Status { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetSearchAllLibrariesLibraryErrors
{
[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 GetSearchAllLibrariesUnauthorized : Exception
{
[JsonProperty("errors")]
public List<GetSearchAllLibrariesLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,243 +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("album-types")]
AlbumTypes,
[JsonProperty("allow_dvr")]
AllowDvr,
[JsonProperty("amazon-loop-debug")]
AmazonLoopDebug,
[JsonProperty("avod-ad-analysis")]
AvodAdAnalysis,
[JsonProperty("avod-new-media")]
AvodNewMedia,
[JsonProperty("blacklist_get_signin")]
BlacklistGetSignin,
[JsonProperty("boost-voices")]
BoostVoices,
[JsonProperty("camera_upload")]
CameraUpload,
[JsonProperty("client-radio-stations")]
ClientRadioStations,
[JsonProperty("cloudflare-turnstile-required")]
CloudflareTurnstileRequired,
[JsonProperty("cloudsync")]
Cloudsync,
[JsonProperty("collections")]
Collections,
[JsonProperty("comments_and_replies_push_notifications")]
CommentsAndRepliesPushNotifications,
[JsonProperty("community_access_plex_tv")]
CommunityAccessPlexTv,
[JsonProperty("companions_sonos")]
CompanionsSonos,
[JsonProperty("content_filter")]
ContentFilter,
[JsonProperty("custom-home-removal")]
CustomHomeRemoval,
[JsonProperty("disable_home_user_friendships")]
DisableHomeUserFriendships,
[JsonProperty("disable_sharing_friendships")]
DisableSharingFriendships,
[JsonProperty("downloads-gating")]
DownloadsGating,
[JsonProperty("drm_support")]
DrmSupport,
[JsonProperty("dvr")]
Dvr,
[JsonProperty("dvr-block-unsupported-countries")]
DvrBlockUnsupportedCountries,
[JsonProperty("epg-recent-channels")]
EpgRecentChannels,
[JsonProperty("exclude restrictions")]
ExcludeRestrictions,
[JsonProperty("federated-auth")]
FederatedAuth,
[JsonProperty("friend_request_push_notifications")]
FriendRequestPushNotifications,
[JsonProperty("grandfather-sync")]
GrandfatherSync,
[JsonProperty("guided-upgrade")]
GuidedUpgrade,
[JsonProperty("hardware_transcoding")]
HardwareTranscoding,
[JsonProperty("home")]
Home,
[JsonProperty("hwtranscode")]
Hwtranscode,
[JsonProperty("imagga-v2")]
ImaggaV2,
[JsonProperty("increase-password-complexity")]
IncreasePasswordComplexity,
[JsonProperty("ios14-privacy-banner")]
Ios14PrivacyBanner,
[JsonProperty("iterable-notification-tokens")]
IterableNotificationTokens,
[JsonProperty("item_clusters")]
ItemClusters,
[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("lyrics")]
Lyrics,
[JsonProperty("metadata_search")]
MetadataSearch,
[JsonProperty("music-analysis")]
MusicAnalysis,
[JsonProperty("music_videos")]
MusicVideos,
[JsonProperty("new_plex_pass_prices")]
NewPlexPassPrices,
[JsonProperty("news-provider-sunset-modal")]
NewsProviderSunsetModal,
[JsonProperty("nominatim")]
Nominatim,
[JsonProperty("pass")]
Pass,
[JsonProperty("photos-favorites")]
PhotosFavorites,
[JsonProperty("photos-metadata-edition")]
PhotosMetadataEdition,
[JsonProperty("photosV6-edit")]
PhotosV6Edit,
[JsonProperty("photosV6-tv-albums")]
PhotosV6TvAlbums,
[JsonProperty("pms_health")]
PmsHealth,
[JsonProperty("premium-dashboard")]
PremiumDashboard,
[JsonProperty("premium_music_metadata")]
PremiumMusicMetadata,
[JsonProperty("radio")]
Radio,
[JsonProperty("rate-limit-client-token")]
RateLimitClientToken,
[JsonProperty("scrobbling-service-plex-tv")]
ScrobblingServicePlexTv,
[JsonProperty("session_bandwidth_restrictions")]
SessionBandwidthRestrictions,
[JsonProperty("session_kick")]
SessionKick,
[JsonProperty("shared_server_notification")]
SharedServerNotification,
[JsonProperty("shared_source_notification")]
SharedSourceNotification,
[JsonProperty("signin_notification")]
SigninNotification,
[JsonProperty("signin_with_apple")]
SigninWithApple,
[JsonProperty("silence-removal")]
SilenceRemoval,
[JsonProperty("sleep-timer")]
SleepTimer,
[JsonProperty("spring_serve_ad_provider")]
SpringServeAdProvider,
[JsonProperty("sync")]
Sync,
[JsonProperty("sweet-fades")]
SweetFades,
[JsonProperty("transcoder_cache")]
TranscoderCache,
[JsonProperty("trailers")]
Trailers,
[JsonProperty("tuner-sharing")]
TunerSharing,
[JsonProperty("two-factor-authentication")]
TwoFactorAuthentication,
[JsonProperty("unsupportedtuners")]
Unsupportedtuners,
[JsonProperty("upgrade-3ds2")]
Upgrade3ds2,
[JsonProperty("visualizers")]
Visualizers,
[JsonProperty("vod-schema")]
VodSchema,
[JsonProperty("vod_cloudflare")]
VodCloudflare,
[JsonProperty("volume-leveling")]
VolumeLeveling,
[JsonProperty("watch-together-invite")]
WatchTogetherInvite,
[JsonProperty("watchlist-rss")]
WatchlistRss,
[JsonProperty("web_server_dashboard")]
WebServerDashboard,
[JsonProperty("webhooks")]
Webhooks,
}
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

@@ -90,6 +90,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
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

@@ -22,7 +22,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=Timespan")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=timespan")]
public long? Timespan { get; set; } public long? Timespan { 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 GetLibraryItemsLocation
{
[JsonProperty("path")]
public string? Path { get; set; }
}
}

View File

@@ -21,43 +21,43 @@ 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; }

View File

@@ -88,7 +88,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public bool? MixedParents { get; set; } public bool? MixedParents { get; set; }
[JsonProperty("Metadata")] [JsonProperty("Metadata")]
public List<GetLibraryItemsMetadata> Metadata { get; set; } = default!; public List<GetLibraryItemsMetadata>? Metadata { get; set; }
/// <summary> /// <summary>
/// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> /// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/>

View File

@@ -199,6 +199,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[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/>
/// ///

View File

@@ -24,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!;
@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public bool? OptimizedForStreaming { get; set; } 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; }

View File

@@ -29,6 +29,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8,
} }
} }

View File

@@ -29,6 +29,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8,
} }
} }

View File

@@ -199,6 +199,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[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> /// <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/>
/// ///

View File

@@ -22,7 +22,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=Timespan")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=timespan")]
public long? Timespan { get; set; } public long? Timespan { 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 GetSearchAllLibrariesCollection
{
[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 GetSearchAllLibrariesCountry
{
[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 GetSearchAllLibrariesDirector
{
[JsonProperty("tag")]
public string? Tag { 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.Utils;
using Newtonsoft.Json;
using System;
public enum GetSearchAllLibrariesFlattenSeasons
{
[JsonProperty("0")]
False,
[JsonProperty("1")]
True,
}
public static class GetSearchAllLibrariesFlattenSeasonsExtension
{
public static string Value(this GetSearchAllLibrariesFlattenSeasons value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetSearchAllLibrariesFlattenSeasons ToEnum(this string value)
{
foreach(var field in typeof(GetSearchAllLibrariesFlattenSeasons).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 GetSearchAllLibrariesFlattenSeasons)
{
return (GetSearchAllLibrariesFlattenSeasons)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesFlattenSeasons");
}
}
}

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 GetSearchAllLibrariesGenre
{
[JsonProperty("tag")]
public string? Tag { 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.Utils;
using Newtonsoft.Json;
using System;
public enum GetSearchAllLibrariesHasThumbnail
{
[JsonProperty("0")]
False,
[JsonProperty("1")]
True,
}
public static class GetSearchAllLibrariesHasThumbnailExtension
{
public static string Value(this GetSearchAllLibrariesHasThumbnail value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetSearchAllLibrariesHasThumbnail ToEnum(this string value)
{
foreach(var field in typeof(GetSearchAllLibrariesHasThumbnail).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 GetSearchAllLibrariesHasThumbnail)
{
return (GetSearchAllLibrariesHasThumbnail)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesHasThumbnail");
}
}
}

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 GetSearchAllLibrariesImage
{
[JsonProperty("alt")]
public string Alt { get; set; } = default!;
[JsonProperty("type")]
public GetSearchAllLibrariesLibraryType Type { get; set; } = default!;
[JsonProperty("url")]
public string Url { 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 GetSearchAllLibrariesLibraryType
{
[JsonProperty("coverPoster")]
CoverPoster,
[JsonProperty("background")]
Background,
[JsonProperty("snapshot")]
Snapshot,
[JsonProperty("clearLogo")]
ClearLogo,
}
public static class GetSearchAllLibrariesLibraryTypeExtension
{
public static string Value(this GetSearchAllLibrariesLibraryType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetSearchAllLibrariesLibraryType ToEnum(this string value)
{
foreach(var field in typeof(GetSearchAllLibrariesLibraryType).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 GetSearchAllLibrariesLibraryType)
{
return (GetSearchAllLibrariesLibraryType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesLibraryType");
}
}
}

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 GetSearchAllLibrariesLocation
{
[JsonProperty("path")]
public string? Path { get; set; }
}
}

View File

@@ -0,0 +1,74 @@
//------------------------------------------------------------------------------
// <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 GetSearchAllLibrariesMedia
{
[JsonProperty("id")]
public int Id { get; set; } = default!;
[JsonProperty("duration")]
public int? Duration { get; set; }
[JsonProperty("bitrate")]
public int? Bitrate { get; set; }
[JsonProperty("width")]
public int? Width { get; set; }
[JsonProperty("height")]
public int? Height { get; set; }
[JsonProperty("aspectRatio")]
public double? AspectRatio { get; set; }
[JsonProperty("audioProfile")]
public string? AudioProfile { get; set; }
[JsonProperty("audioChannels")]
public int? AudioChannels { get; set; }
[JsonProperty("audioCodec")]
public string? AudioCodec { get; set; }
[JsonProperty("videoCodec")]
public string? VideoCodec { get; set; }
[JsonProperty("videoResolution")]
public string? VideoResolution { get; set; }
[JsonProperty("container")]
public string Container { get; set; } = default!;
[JsonProperty("videoFrameRate")]
public string? VideoFrameRate { get; set; }
[JsonProperty("videoProfile")]
public string? VideoProfile { get; set; }
[JsonProperty("hasVoiceActivity")]
public bool? HasVoiceActivity { get; set; }
[JsonProperty("optimizedForStreaming")]
public GetSearchAllLibrariesOptimizedForStreaming? OptimizedForStreaming { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetSearchAllLibrariesOptimizedForStreaming.Disable;
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("Part")]
public List<GetSearchAllLibrariesPart> Part { get; set; } = default!;
}
}

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 GetSearchAllLibrariesMediaContainer
{
[JsonProperty("size")]
public double Size { get; set; } = default!;
[JsonProperty("SearchResult")]
public List<SearchResult> SearchResult { get; set; } = default!;
}
}

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 GetSearchAllLibrariesMediaGuid
{
/// <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,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 GetSearchAllLibrariesMetaDataRating
{
/// <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

@@ -0,0 +1,297 @@
//------------------------------------------------------------------------------
// <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 NodaTime;
using System.Collections.Generic;
public class GetSearchAllLibrariesMetadata
{
/// <summary>
/// The rating key (Media ID) of this media item.<br/>
///
/// <remarks>
/// Note: This is always an integer, but is represented as a string in the API.<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("ratingKey")]
public string RatingKey { get; set; } = default!;
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("guid")]
public string Guid { get; set; } = default!;
[JsonProperty("studio")]
public string? Studio { get; set; }
[JsonProperty("skipChildren")]
public bool? SkipChildren { get; set; }
[JsonProperty("librarySectionID")]
public long? LibrarySectionID { get; set; }
[JsonProperty("librarySectionTitle")]
public string? LibrarySectionTitle { get; set; }
[JsonProperty("librarySectionKey")]
public string? LibrarySectionKey { get; set; }
/// <summary>
/// The type of media content<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("type")]
public GetSearchAllLibrariesType Type { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
[JsonProperty("slug")]
public string? Slug { get; set; }
[JsonProperty("contentRating")]
public string? ContentRating { get; set; }
[JsonProperty("summary")]
public string Summary { get; set; } = default!;
[JsonProperty("rating")]
public double? Rating { get; set; }
[JsonProperty("audienceRating")]
public double? AudienceRating { get; set; }
[JsonProperty("year")]
public int? Year { get; set; }
[JsonProperty("seasonCount")]
public int? SeasonCount { get; set; }
[JsonProperty("tagline")]
public string? Tagline { get; set; }
[JsonProperty("flattenSeasons")]
public GetSearchAllLibrariesFlattenSeasons? FlattenSeasons { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetSearchAllLibrariesFlattenSeasons.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 GetSearchAllLibrariesShowOrdering? ShowOrdering { get; set; }
[JsonProperty("thumb")]
public string? Thumb { get; set; }
[JsonProperty("art")]
public string? Art { get; set; }
[JsonProperty("banner")]
public string? Banner { get; set; }
[JsonProperty("duration")]
public int? Duration { get; set; }
[JsonProperty("originallyAvailableAt")]
public LocalDate? OriginallyAvailableAt { get; set; }
/// <summary>
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("addedAt")]
public long AddedAt { get; set; } = default!;
/// <summary>
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("updatedAt")]
public long? 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("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")]
public List<GetSearchAllLibrariesMedia>? Media { get; set; }
[JsonProperty("Genre")]
public List<GetSearchAllLibrariesGenre>? Genre { get; set; }
[JsonProperty("Country")]
public List<GetSearchAllLibrariesCountry>? Country { get; set; }
[JsonProperty("Director")]
public List<GetSearchAllLibrariesDirector>? Director { get; set; }
[JsonProperty("Writer")]
public List<GetSearchAllLibrariesWriter>? Writer { get; set; }
[JsonProperty("Collection")]
public List<GetSearchAllLibrariesCollection>? Collection { get; set; }
[JsonProperty("Role")]
public List<GetSearchAllLibrariesRole>? Role { get; set; }
[JsonProperty("Location")]
public List<GetSearchAllLibrariesLocation>? 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<GetSearchAllLibrariesMediaGuid>? MediaGuid { get; set; }
[JsonProperty("UltraBlurColors")]
public GetSearchAllLibrariesUltraBlurColors? UltraBlurColors { get; set; }
[JsonProperty("Rating")]
public List<GetSearchAllLibrariesMetaDataRating>? MetaDataRating { get; set; }
[JsonProperty("Image")]
public List<GetSearchAllLibrariesImage>? 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,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 GetSearchAllLibrariesOptimizedForStreaming
{
Disable = 0,
Enable = 1,
}
}

View File

@@ -0,0 +1,66 @@
//------------------------------------------------------------------------------
// <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 GetSearchAllLibrariesPart
{
[JsonProperty("id")]
public int Id { get; set; } = default!;
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("duration")]
public int? Duration { get; set; }
[JsonProperty("file")]
public string File { get; set; } = default!;
[JsonProperty("size")]
public long Size { get; set; } = default!;
/// <summary>
/// The container format of the media file.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("container")]
public string Container { get; set; } = default!;
[JsonProperty("audioProfile")]
public string? AudioProfile { get; set; }
[JsonProperty("has64bitOffsets")]
public bool? Has64bitOffsets { get; set; }
[JsonProperty("optimizedForStreaming")]
public bool? OptimizedForStreaming { get; set; }
[JsonProperty("videoProfile")]
public string? VideoProfile { get; set; }
[JsonProperty("indexes")]
public string? Indexes { get; set; }
[JsonProperty("hasThumbnail")]
public GetSearchAllLibrariesHasThumbnail? HasThumbnail { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.GetSearchAllLibrariesHasThumbnail.False;
[JsonProperty("Stream")]
public List<GetSearchAllLibrariesStream>? Stream { get; set; }
}
}

View File

@@ -0,0 +1,59 @@
//------------------------------------------------------------------------------
// <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 GetSearchAllLibrariesRequest
{
/// <summary>
/// The search query term.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=query")]
public string Query { get; set; } = default!;
/// <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>
/// Limit the number of results returned.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit")]
public long? Limit { get; set; }
/// <summary>
/// A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=false,name=searchTypes")]
public List<SearchTypes>? SearchTypes { get; set; }
/// <summary>
/// Whether to include collections in the search results.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeCollections")]
public QueryParamIncludeCollections? IncludeCollections { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.QueryParamIncludeCollections.Disable;
/// <summary>
/// Whether to include external media in the search results.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeExternalMedia")]
public QueryParamIncludeExternalMedia? IncludeExternalMedia { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.QueryParamIncludeExternalMedia.Disable;
}
}

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 GetSearchAllLibrariesResponse
{
/// <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 libraries available on the Server
/// </summary>
public GetSearchAllLibrariesResponseBody? 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 libraries available on the Server
/// </summary>
public class GetSearchAllLibrariesResponseBody
{
[JsonProperty("MediaContainer")]
public GetSearchAllLibrariesMediaContainer MediaContainer { get; set; } = default!;
}
}

View File

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

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 GetSearchAllLibrariesStream
{
[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

@@ -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 GetSearchAllLibrariesType
{
[JsonProperty("movie")]
Movie,
[JsonProperty("show")]
TvShow,
[JsonProperty("season")]
Season,
[JsonProperty("episode")]
Episode,
}
public static class GetSearchAllLibrariesTypeExtension
{
public static string Value(this GetSearchAllLibrariesType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetSearchAllLibrariesType ToEnum(this string value)
{
foreach(var field in typeof(GetSearchAllLibrariesType).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 GetSearchAllLibrariesType)
{
return (GetSearchAllLibrariesType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetSearchAllLibrariesType");
}
}
}

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 GetSearchAllLibrariesUltraBlurColors
{
[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

@@ -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 GetSearchAllLibrariesWriter
{
[JsonProperty("tag")]
public string? Tag { get; set; }
}
}

View File

@@ -29,6 +29,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8,
} }
} }

View File

@@ -22,7 +22,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=Timespan")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=timespan")]
public long? Timespan { get; set; } public long? Timespan { get; set; }
} }
} }

View File

@@ -1,243 +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 GetTokenDetailsFeatures
{
[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("album-types")]
AlbumTypes,
[JsonProperty("allow_dvr")]
AllowDvr,
[JsonProperty("amazon-loop-debug")]
AmazonLoopDebug,
[JsonProperty("avod-ad-analysis")]
AvodAdAnalysis,
[JsonProperty("avod-new-media")]
AvodNewMedia,
[JsonProperty("blacklist_get_signin")]
BlacklistGetSignin,
[JsonProperty("boost-voices")]
BoostVoices,
[JsonProperty("camera_upload")]
CameraUpload,
[JsonProperty("client-radio-stations")]
ClientRadioStations,
[JsonProperty("cloudflare-turnstile-required")]
CloudflareTurnstileRequired,
[JsonProperty("cloudsync")]
Cloudsync,
[JsonProperty("collections")]
Collections,
[JsonProperty("comments_and_replies_push_notifications")]
CommentsAndRepliesPushNotifications,
[JsonProperty("community_access_plex_tv")]
CommunityAccessPlexTv,
[JsonProperty("companions_sonos")]
CompanionsSonos,
[JsonProperty("content_filter")]
ContentFilter,
[JsonProperty("custom-home-removal")]
CustomHomeRemoval,
[JsonProperty("disable_home_user_friendships")]
DisableHomeUserFriendships,
[JsonProperty("disable_sharing_friendships")]
DisableSharingFriendships,
[JsonProperty("downloads-gating")]
DownloadsGating,
[JsonProperty("drm_support")]
DrmSupport,
[JsonProperty("dvr")]
Dvr,
[JsonProperty("dvr-block-unsupported-countries")]
DvrBlockUnsupportedCountries,
[JsonProperty("epg-recent-channels")]
EpgRecentChannels,
[JsonProperty("exclude restrictions")]
ExcludeRestrictions,
[JsonProperty("federated-auth")]
FederatedAuth,
[JsonProperty("friend_request_push_notifications")]
FriendRequestPushNotifications,
[JsonProperty("grandfather-sync")]
GrandfatherSync,
[JsonProperty("guided-upgrade")]
GuidedUpgrade,
[JsonProperty("hardware_transcoding")]
HardwareTranscoding,
[JsonProperty("home")]
Home,
[JsonProperty("hwtranscode")]
Hwtranscode,
[JsonProperty("imagga-v2")]
ImaggaV2,
[JsonProperty("increase-password-complexity")]
IncreasePasswordComplexity,
[JsonProperty("ios14-privacy-banner")]
Ios14PrivacyBanner,
[JsonProperty("iterable-notification-tokens")]
IterableNotificationTokens,
[JsonProperty("item_clusters")]
ItemClusters,
[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("lyrics")]
Lyrics,
[JsonProperty("metadata_search")]
MetadataSearch,
[JsonProperty("music-analysis")]
MusicAnalysis,
[JsonProperty("music_videos")]
MusicVideos,
[JsonProperty("new_plex_pass_prices")]
NewPlexPassPrices,
[JsonProperty("news-provider-sunset-modal")]
NewsProviderSunsetModal,
[JsonProperty("nominatim")]
Nominatim,
[JsonProperty("pass")]
Pass,
[JsonProperty("photos-favorites")]
PhotosFavorites,
[JsonProperty("photos-metadata-edition")]
PhotosMetadataEdition,
[JsonProperty("photosV6-edit")]
PhotosV6Edit,
[JsonProperty("photosV6-tv-albums")]
PhotosV6TvAlbums,
[JsonProperty("pms_health")]
PmsHealth,
[JsonProperty("premium-dashboard")]
PremiumDashboard,
[JsonProperty("premium_music_metadata")]
PremiumMusicMetadata,
[JsonProperty("radio")]
Radio,
[JsonProperty("rate-limit-client-token")]
RateLimitClientToken,
[JsonProperty("scrobbling-service-plex-tv")]
ScrobblingServicePlexTv,
[JsonProperty("session_bandwidth_restrictions")]
SessionBandwidthRestrictions,
[JsonProperty("session_kick")]
SessionKick,
[JsonProperty("shared_server_notification")]
SharedServerNotification,
[JsonProperty("shared_source_notification")]
SharedSourceNotification,
[JsonProperty("signin_notification")]
SigninNotification,
[JsonProperty("signin_with_apple")]
SigninWithApple,
[JsonProperty("silence-removal")]
SilenceRemoval,
[JsonProperty("sleep-timer")]
SleepTimer,
[JsonProperty("spring_serve_ad_provider")]
SpringServeAdProvider,
[JsonProperty("sync")]
Sync,
[JsonProperty("sweet-fades")]
SweetFades,
[JsonProperty("transcoder_cache")]
TranscoderCache,
[JsonProperty("trailers")]
Trailers,
[JsonProperty("tuner-sharing")]
TunerSharing,
[JsonProperty("two-factor-authentication")]
TwoFactorAuthentication,
[JsonProperty("unsupportedtuners")]
Unsupportedtuners,
[JsonProperty("upgrade-3ds2")]
Upgrade3ds2,
[JsonProperty("visualizers")]
Visualizers,
[JsonProperty("vod-schema")]
VodSchema,
[JsonProperty("vod_cloudflare")]
VodCloudflare,
[JsonProperty("volume-leveling")]
VolumeLeveling,
[JsonProperty("watch-together-invite")]
WatchTogetherInvite,
[JsonProperty("watchlist-rss")]
WatchlistRss,
[JsonProperty("web_server_dashboard")]
WebServerDashboard,
[JsonProperty("webhooks")]
Webhooks,
}
public static class GetTokenDetailsFeaturesExtension
{
public static string Value(this GetTokenDetailsFeatures value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetTokenDetailsFeatures ToEnum(this string value)
{
foreach(var field in typeof(GetTokenDetailsFeatures).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 GetTokenDetailsFeatures)
{
return (GetTokenDetailsFeatures)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetTokenDetailsFeatures");
}
}
}

View File

@@ -21,7 +21,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// List of features allowed on your Plex Pass subscription /// List of features allowed on your Plex Pass subscription
/// </summary> /// </summary>
[JsonProperty("features")] [JsonProperty("features")]
public List<GetTokenDetailsFeatures>? Features { get; set; } public List<string>? Features { get; set; }
/// <summary> /// <summary>
/// If the account&apos;s Plex Pass subscription is active /// If the account&apos;s Plex Pass subscription is active

View File

@@ -27,17 +27,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("adsConsent", NullValueHandling = NullValueHandling.Include)] [JsonProperty("adsConsent", NullValueHandling = NullValueHandling.Include)]
public bool? AdsConsent { get; set; } public bool? AdsConsent { get; set; }
/// <summary>
/// Unknown
/// </summary>
[JsonProperty("adsConsentReminderAt", NullValueHandling = NullValueHandling.Include)] [JsonProperty("adsConsentReminderAt", NullValueHandling = NullValueHandling.Include)]
public DateTime? AdsConsentReminderAt { get; set; } public long? AdsConsentReminderAt { get; set; }
/// <summary>
/// Unknown
/// </summary>
[JsonProperty("adsConsentSetAt", NullValueHandling = NullValueHandling.Include)] [JsonProperty("adsConsentSetAt", NullValueHandling = NullValueHandling.Include)]
public DateTime? AdsConsentSetAt { get; set; } public long? AdsConsentSetAt { get; set; }
/// <summary> /// <summary>
/// Unknown /// Unknown

View File

@@ -29,6 +29,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8,
} }
} }

View File

@@ -15,10 +15,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class Location public class Location
{ {
[JsonProperty("id")]
public int Id { get; set; } = default!;
[JsonProperty("path")] [JsonProperty("path")]
public string Path { get; set; } = default!; public string? Path { get; set; }
} }
} }

View File

@@ -21,43 +21,43 @@ 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; }

View File

@@ -24,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!;
@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public bool? OptimizedForStreaming { get; set; } 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; }

View File

@@ -1,243 +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 PostUsersSignInDataAuthenticationFeatures
{
[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("album-types")]
AlbumTypes,
[JsonProperty("allow_dvr")]
AllowDvr,
[JsonProperty("amazon-loop-debug")]
AmazonLoopDebug,
[JsonProperty("avod-ad-analysis")]
AvodAdAnalysis,
[JsonProperty("avod-new-media")]
AvodNewMedia,
[JsonProperty("blacklist_get_signin")]
BlacklistGetSignin,
[JsonProperty("boost-voices")]
BoostVoices,
[JsonProperty("camera_upload")]
CameraUpload,
[JsonProperty("client-radio-stations")]
ClientRadioStations,
[JsonProperty("cloudflare-turnstile-required")]
CloudflareTurnstileRequired,
[JsonProperty("cloudsync")]
Cloudsync,
[JsonProperty("collections")]
Collections,
[JsonProperty("comments_and_replies_push_notifications")]
CommentsAndRepliesPushNotifications,
[JsonProperty("community_access_plex_tv")]
CommunityAccessPlexTv,
[JsonProperty("companions_sonos")]
CompanionsSonos,
[JsonProperty("content_filter")]
ContentFilter,
[JsonProperty("custom-home-removal")]
CustomHomeRemoval,
[JsonProperty("disable_home_user_friendships")]
DisableHomeUserFriendships,
[JsonProperty("disable_sharing_friendships")]
DisableSharingFriendships,
[JsonProperty("downloads-gating")]
DownloadsGating,
[JsonProperty("drm_support")]
DrmSupport,
[JsonProperty("dvr")]
Dvr,
[JsonProperty("dvr-block-unsupported-countries")]
DvrBlockUnsupportedCountries,
[JsonProperty("epg-recent-channels")]
EpgRecentChannels,
[JsonProperty("exclude restrictions")]
ExcludeRestrictions,
[JsonProperty("federated-auth")]
FederatedAuth,
[JsonProperty("friend_request_push_notifications")]
FriendRequestPushNotifications,
[JsonProperty("grandfather-sync")]
GrandfatherSync,
[JsonProperty("guided-upgrade")]
GuidedUpgrade,
[JsonProperty("hardware_transcoding")]
HardwareTranscoding,
[JsonProperty("home")]
Home,
[JsonProperty("hwtranscode")]
Hwtranscode,
[JsonProperty("imagga-v2")]
ImaggaV2,
[JsonProperty("increase-password-complexity")]
IncreasePasswordComplexity,
[JsonProperty("ios14-privacy-banner")]
Ios14PrivacyBanner,
[JsonProperty("iterable-notification-tokens")]
IterableNotificationTokens,
[JsonProperty("item_clusters")]
ItemClusters,
[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("lyrics")]
Lyrics,
[JsonProperty("metadata_search")]
MetadataSearch,
[JsonProperty("music-analysis")]
MusicAnalysis,
[JsonProperty("music_videos")]
MusicVideos,
[JsonProperty("new_plex_pass_prices")]
NewPlexPassPrices,
[JsonProperty("news-provider-sunset-modal")]
NewsProviderSunsetModal,
[JsonProperty("nominatim")]
Nominatim,
[JsonProperty("pass")]
Pass,
[JsonProperty("photos-favorites")]
PhotosFavorites,
[JsonProperty("photos-metadata-edition")]
PhotosMetadataEdition,
[JsonProperty("photosV6-edit")]
PhotosV6Edit,
[JsonProperty("photosV6-tv-albums")]
PhotosV6TvAlbums,
[JsonProperty("pms_health")]
PmsHealth,
[JsonProperty("premium-dashboard")]
PremiumDashboard,
[JsonProperty("premium_music_metadata")]
PremiumMusicMetadata,
[JsonProperty("radio")]
Radio,
[JsonProperty("rate-limit-client-token")]
RateLimitClientToken,
[JsonProperty("scrobbling-service-plex-tv")]
ScrobblingServicePlexTv,
[JsonProperty("session_bandwidth_restrictions")]
SessionBandwidthRestrictions,
[JsonProperty("session_kick")]
SessionKick,
[JsonProperty("shared_server_notification")]
SharedServerNotification,
[JsonProperty("shared_source_notification")]
SharedSourceNotification,
[JsonProperty("signin_notification")]
SigninNotification,
[JsonProperty("signin_with_apple")]
SigninWithApple,
[JsonProperty("silence-removal")]
SilenceRemoval,
[JsonProperty("sleep-timer")]
SleepTimer,
[JsonProperty("spring_serve_ad_provider")]
SpringServeAdProvider,
[JsonProperty("sync")]
Sync,
[JsonProperty("sweet-fades")]
SweetFades,
[JsonProperty("transcoder_cache")]
TranscoderCache,
[JsonProperty("trailers")]
Trailers,
[JsonProperty("tuner-sharing")]
TunerSharing,
[JsonProperty("two-factor-authentication")]
TwoFactorAuthentication,
[JsonProperty("unsupportedtuners")]
Unsupportedtuners,
[JsonProperty("upgrade-3ds2")]
Upgrade3ds2,
[JsonProperty("visualizers")]
Visualizers,
[JsonProperty("vod-schema")]
VodSchema,
[JsonProperty("vod_cloudflare")]
VodCloudflare,
[JsonProperty("volume-leveling")]
VolumeLeveling,
[JsonProperty("watch-together-invite")]
WatchTogetherInvite,
[JsonProperty("watchlist-rss")]
WatchlistRss,
[JsonProperty("web_server_dashboard")]
WebServerDashboard,
[JsonProperty("webhooks")]
Webhooks,
}
public static class PostUsersSignInDataAuthenticationFeaturesExtension
{
public static string Value(this PostUsersSignInDataAuthenticationFeatures value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostUsersSignInDataAuthenticationFeatures ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataAuthenticationFeatures).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 PostUsersSignInDataAuthenticationFeatures)
{
return (PostUsersSignInDataAuthenticationFeatures)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAuthenticationFeatures");
}
}
}

View File

@@ -21,7 +21,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// List of features allowed on your Plex Pass subscription /// List of features allowed on your Plex Pass subscription
/// </summary> /// </summary>
[JsonProperty("features")] [JsonProperty("features")]
public List<PostUsersSignInDataAuthenticationFeatures>? Features { get; set; } public List<string>? Features { get; set; }
/// <summary> /// <summary>
/// If the account&apos;s Plex Pass subscription is active /// If the account&apos;s Plex Pass subscription is active

View File

@@ -1,243 +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 PostUsersSignInDataFeatures
{
[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("album-types")]
AlbumTypes,
[JsonProperty("allow_dvr")]
AllowDvr,
[JsonProperty("amazon-loop-debug")]
AmazonLoopDebug,
[JsonProperty("avod-ad-analysis")]
AvodAdAnalysis,
[JsonProperty("avod-new-media")]
AvodNewMedia,
[JsonProperty("blacklist_get_signin")]
BlacklistGetSignin,
[JsonProperty("boost-voices")]
BoostVoices,
[JsonProperty("camera_upload")]
CameraUpload,
[JsonProperty("client-radio-stations")]
ClientRadioStations,
[JsonProperty("cloudflare-turnstile-required")]
CloudflareTurnstileRequired,
[JsonProperty("cloudsync")]
Cloudsync,
[JsonProperty("collections")]
Collections,
[JsonProperty("comments_and_replies_push_notifications")]
CommentsAndRepliesPushNotifications,
[JsonProperty("community_access_plex_tv")]
CommunityAccessPlexTv,
[JsonProperty("companions_sonos")]
CompanionsSonos,
[JsonProperty("content_filter")]
ContentFilter,
[JsonProperty("custom-home-removal")]
CustomHomeRemoval,
[JsonProperty("disable_home_user_friendships")]
DisableHomeUserFriendships,
[JsonProperty("disable_sharing_friendships")]
DisableSharingFriendships,
[JsonProperty("downloads-gating")]
DownloadsGating,
[JsonProperty("drm_support")]
DrmSupport,
[JsonProperty("dvr")]
Dvr,
[JsonProperty("dvr-block-unsupported-countries")]
DvrBlockUnsupportedCountries,
[JsonProperty("epg-recent-channels")]
EpgRecentChannels,
[JsonProperty("exclude restrictions")]
ExcludeRestrictions,
[JsonProperty("federated-auth")]
FederatedAuth,
[JsonProperty("friend_request_push_notifications")]
FriendRequestPushNotifications,
[JsonProperty("grandfather-sync")]
GrandfatherSync,
[JsonProperty("guided-upgrade")]
GuidedUpgrade,
[JsonProperty("hardware_transcoding")]
HardwareTranscoding,
[JsonProperty("home")]
Home,
[JsonProperty("hwtranscode")]
Hwtranscode,
[JsonProperty("imagga-v2")]
ImaggaV2,
[JsonProperty("increase-password-complexity")]
IncreasePasswordComplexity,
[JsonProperty("ios14-privacy-banner")]
Ios14PrivacyBanner,
[JsonProperty("iterable-notification-tokens")]
IterableNotificationTokens,
[JsonProperty("item_clusters")]
ItemClusters,
[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("lyrics")]
Lyrics,
[JsonProperty("metadata_search")]
MetadataSearch,
[JsonProperty("music-analysis")]
MusicAnalysis,
[JsonProperty("music_videos")]
MusicVideos,
[JsonProperty("new_plex_pass_prices")]
NewPlexPassPrices,
[JsonProperty("news-provider-sunset-modal")]
NewsProviderSunsetModal,
[JsonProperty("nominatim")]
Nominatim,
[JsonProperty("pass")]
Pass,
[JsonProperty("photos-favorites")]
PhotosFavorites,
[JsonProperty("photos-metadata-edition")]
PhotosMetadataEdition,
[JsonProperty("photosV6-edit")]
PhotosV6Edit,
[JsonProperty("photosV6-tv-albums")]
PhotosV6TvAlbums,
[JsonProperty("pms_health")]
PmsHealth,
[JsonProperty("premium-dashboard")]
PremiumDashboard,
[JsonProperty("premium_music_metadata")]
PremiumMusicMetadata,
[JsonProperty("radio")]
Radio,
[JsonProperty("rate-limit-client-token")]
RateLimitClientToken,
[JsonProperty("scrobbling-service-plex-tv")]
ScrobblingServicePlexTv,
[JsonProperty("session_bandwidth_restrictions")]
SessionBandwidthRestrictions,
[JsonProperty("session_kick")]
SessionKick,
[JsonProperty("shared_server_notification")]
SharedServerNotification,
[JsonProperty("shared_source_notification")]
SharedSourceNotification,
[JsonProperty("signin_notification")]
SigninNotification,
[JsonProperty("signin_with_apple")]
SigninWithApple,
[JsonProperty("silence-removal")]
SilenceRemoval,
[JsonProperty("sleep-timer")]
SleepTimer,
[JsonProperty("spring_serve_ad_provider")]
SpringServeAdProvider,
[JsonProperty("sync")]
Sync,
[JsonProperty("sweet-fades")]
SweetFades,
[JsonProperty("transcoder_cache")]
TranscoderCache,
[JsonProperty("trailers")]
Trailers,
[JsonProperty("tuner-sharing")]
TunerSharing,
[JsonProperty("two-factor-authentication")]
TwoFactorAuthentication,
[JsonProperty("unsupportedtuners")]
Unsupportedtuners,
[JsonProperty("upgrade-3ds2")]
Upgrade3ds2,
[JsonProperty("visualizers")]
Visualizers,
[JsonProperty("vod-schema")]
VodSchema,
[JsonProperty("vod_cloudflare")]
VodCloudflare,
[JsonProperty("volume-leveling")]
VolumeLeveling,
[JsonProperty("watch-together-invite")]
WatchTogetherInvite,
[JsonProperty("watchlist-rss")]
WatchlistRss,
[JsonProperty("web_server_dashboard")]
WebServerDashboard,
[JsonProperty("webhooks")]
Webhooks,
}
public static class PostUsersSignInDataFeaturesExtension
{
public static string Value(this PostUsersSignInDataFeatures value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostUsersSignInDataFeatures ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataFeatures).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 PostUsersSignInDataFeatures)
{
return (PostUsersSignInDataFeatures)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataFeatures");
}
}
}

View File

@@ -24,7 +24,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// List of features allowed on your Plex Pass subscription /// List of features allowed on your Plex Pass subscription
/// </summary> /// </summary>
[JsonProperty("features")] [JsonProperty("features")]
public List<PostUsersSignInDataFeatures>? Features { get; set; } public List<string>? Features { get; set; }
/// <summary> /// <summary>
/// If the account&apos;s Plex Pass subscription is active /// If the account&apos;s Plex Pass subscription is active

View File

@@ -27,17 +27,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("adsConsent", NullValueHandling = NullValueHandling.Include)] [JsonProperty("adsConsent", NullValueHandling = NullValueHandling.Include)]
public bool? AdsConsent { get; set; } public bool? AdsConsent { get; set; }
/// <summary>
/// Unknown
/// </summary>
[JsonProperty("adsConsentReminderAt", NullValueHandling = NullValueHandling.Include)] [JsonProperty("adsConsentReminderAt", NullValueHandling = NullValueHandling.Include)]
public DateTime? AdsConsentReminderAt { get; set; } public long? AdsConsentReminderAt { get; set; }
/// <summary>
/// Unknown
/// </summary>
[JsonProperty("adsConsentSetAt", NullValueHandling = NullValueHandling.Include)] [JsonProperty("adsConsentSetAt", NullValueHandling = NullValueHandling.Include)]
public DateTime? AdsConsentSetAt { get; set; } public long? AdsConsentSetAt { get; set; }
/// <summary> /// <summary>
/// Unknown /// Unknown

View File

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

View File

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

View File

@@ -29,6 +29,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8,
} }
} }

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;
public class SearchResult
{
[JsonProperty("score")]
public float Score { get; set; } = default!;
[JsonProperty("Metadata")]
public GetSearchAllLibrariesMetadata Metadata { get; set; } = default!;
}
}

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <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 SearchTypes
{
[JsonProperty("movies")]
Movies,
[JsonProperty("music")]
Music,
[JsonProperty("otherVideos")]
OtherVideos,
[JsonProperty("people")]
People,
[JsonProperty("tv")]
Tv,
}
public static class SearchTypesExtension
{
public static string Value(this SearchTypes value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static SearchTypes ToEnum(this string value)
{
foreach(var field in typeof(SearchTypes).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 SearchTypes)
{
return (SearchTypes)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum SearchTypes");
}
}
}

View File

@@ -24,7 +24,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// List of features allowed on your Plex Pass subscription /// List of features allowed on your Plex Pass subscription
/// </summary> /// </summary>
[JsonProperty("features")] [JsonProperty("features")]
public List<Features>? Features { get; set; } public List<string>? Features { get; set; }
/// <summary> /// <summary>
/// If the account&apos;s Plex Pass subscription is active /// If the account&apos;s Plex Pass subscription is active

View File

@@ -29,6 +29,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
TvShow = 2, TvShow = 2,
Season = 3, Season = 3,
Episode = 4, Episode = 4,
Audio = 8,
} }
} }

View File

@@ -45,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null); Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request);
/// <summary> /// <summary>
/// Get All Playlists /// Get All Playlists
@@ -54,7 +54,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get All Playlists given the specified filters. /// Get All Playlists given the specified filters.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null); Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null);
/// <summary> /// <summary>
/// Retrieve Playlist /// Retrieve Playlist
@@ -65,7 +65,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null); Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID);
/// <summary> /// <summary>
/// Deletes a Playlist /// Deletes a Playlist
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null); Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID);
/// <summary> /// <summary>
/// Update a Playlist /// Update a Playlist
@@ -85,7 +85,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null); Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null);
/// <summary> /// <summary>
/// Retrieve Playlist Contents /// Retrieve Playlist Contents
@@ -98,7 +98,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null); Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type);
/// <summary> /// <summary>
/// Delete Playlist Contents /// Delete Playlist Contents
@@ -108,7 +108,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null); Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID);
/// <summary> /// <summary>
/// Adding to a Playlist /// Adding to a Playlist
@@ -119,7 +119,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null); Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null);
/// <summary> /// <summary>
/// Upload Playlist /// Upload Playlist
@@ -129,7 +129,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null); Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID);
} }
/// <summary> /// <summary>
@@ -146,10 +146,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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;
@@ -162,7 +162,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null) public async Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/playlists", request); var urlString = URLBuilder.Build(baseUrl, "/playlists", request);
@@ -178,44 +178,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("createPlaylist", null, _securitySource); var hookCtx = new HookContext("createPlaylist", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -291,7 +258,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<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null) public async Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null)
{ {
var request = new GetPlaylistsRequest() var request = new GetPlaylistsRequest()
{ {
@@ -312,44 +279,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getPlaylists", null, _securitySource); var hookCtx = new HookContext("getPlaylists", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -425,7 +359,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<GetPlaylistResponse> GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null) public async Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID)
{ {
var request = new GetPlaylistRequest() var request = new GetPlaylistRequest()
{ {
@@ -445,44 +379,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getPlaylist", null, _securitySource); var hookCtx = new HookContext("getPlaylist", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -558,7 +459,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<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null) public async Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID)
{ {
var request = new DeletePlaylistRequest() var request = new DeletePlaylistRequest()
{ {
@@ -578,44 +479,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("deletePlaylist", null, _securitySource); var hookCtx = new HookContext("deletePlaylist", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -683,7 +551,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<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null) public async Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null)
{ {
var request = new UpdatePlaylistRequest() var request = new UpdatePlaylistRequest()
{ {
@@ -705,44 +573,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("updatePlaylist", null, _securitySource); var hookCtx = new HookContext("updatePlaylist", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -810,7 +645,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<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null) public async Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type)
{ {
var request = new GetPlaylistContentsRequest() var request = new GetPlaylistContentsRequest()
{ {
@@ -831,44 +666,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getPlaylistContents", null, _securitySource); var hookCtx = new HookContext("getPlaylistContents", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -944,7 +746,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<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null) public async Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID)
{ {
var request = new ClearPlaylistContentsRequest() var request = new ClearPlaylistContentsRequest()
{ {
@@ -964,44 +766,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("clearPlaylistContents", null, _securitySource); var hookCtx = new HookContext("clearPlaylistContents", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1069,7 +838,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<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null) public async Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null)
{ {
var request = new AddPlaylistContentsRequest() var request = new AddPlaylistContentsRequest()
{ {
@@ -1091,44 +860,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("addPlaylistContents", null, _securitySource); var hookCtx = new HookContext("addPlaylistContents", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1204,7 +940,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<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null) public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID)
{ {
var request = new UploadPlaylistRequest() var request = new UploadPlaylistRequest()
{ {
@@ -1226,44 +962,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("uploadPlaylist", null, _securitySource); var hookCtx = new HookContext("uploadPlaylist", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Companions Data /// Get Companions Data
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null); Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null);
/// <summary> /// <summary>
/// Get list of friends of the user logged in /// Get list of friends of the user logged in
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get friends of provided auth token. /// Get friends of provided auth token.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null, RetryConfig? retryConfig = null); Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null);
/// <summary> /// <summary>
/// Get Geo Data /// Get Geo Data
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Returns the geolocation and locale data of the caller /// Returns the geolocation and locale data of the caller
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null); Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null);
/// <summary> /// <summary>
/// Get Plex Home Data /// Get Plex Home Data
@@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status. /// Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetHomeDataResponse> GetHomeDataAsync(RetryConfig? retryConfig = null); Task<GetHomeDataResponse> GetHomeDataAsync();
/// <summary> /// <summary>
/// Get Server Resources /// Get Server Resources
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Plex server access tokens and server connections /// Get Plex server access tokens and server connections
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null, RetryConfig? retryConfig = null); Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null);
/// <summary> /// <summary>
/// Get a Pin /// Get a Pin
@@ -84,7 +84,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Retrieve a Pin ID from Plex.tv to use for authentication flows /// Retrieve a Pin ID from Plex.tv to use for authentication flows
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null); Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null);
/// <summary> /// <summary>
/// Get Access Token by PinId /// Get Access Token by PinId
@@ -93,7 +93,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Retrieve an Access Token from Plex.tv after the Pin has been authenticated /// Retrieve an Access Token from Plex.tv after the Pin has been authenticated
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null, RetryConfig? retryConfig = null); Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null);
} }
/// <summary> /// <summary>
@@ -143,10 +143,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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;
@@ -159,7 +159,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null) public async Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null)
{ {
string baseUrl = Utilities.TemplateUrl(GetCompanionsDataServerList[0], new Dictionary<string, string>(){ string baseUrl = Utilities.TemplateUrl(GetCompanionsDataServerList[0], new Dictionary<string, string>(){
}); });
@@ -181,44 +181,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getCompanionsData", null, _securitySource); var hookCtx = new HookContext("getCompanionsData", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -294,7 +261,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<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null, RetryConfig? retryConfig = null) public async Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null)
{ {
string baseUrl = Utilities.TemplateUrl(GetUserFriendsServerList[0], new Dictionary<string, string>(){ string baseUrl = Utilities.TemplateUrl(GetUserFriendsServerList[0], new Dictionary<string, string>(){
}); });
@@ -316,44 +283,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getUserFriends", null, _securitySource); var hookCtx = new HookContext("getUserFriends", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -429,7 +363,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<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null) public async Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null)
{ {
string baseUrl = Utilities.TemplateUrl(GetGeoDataServerList[0], new Dictionary<string, string>(){ string baseUrl = Utilities.TemplateUrl(GetGeoDataServerList[0], new Dictionary<string, string>(){
}); });
@@ -446,44 +380,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getGeoData", null, null); var hookCtx = new HookContext("getGeoData", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -559,7 +460,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<GetHomeDataResponse> GetHomeDataAsync(RetryConfig? retryConfig = null) public async Task<GetHomeDataResponse> GetHomeDataAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -576,44 +477,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getHomeData", null, _securitySource); var hookCtx = new HookContext("getHomeData", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -689,7 +557,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<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null, RetryConfig? retryConfig = null) public async Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null)
{ {
var request = new GetServerResourcesRequest() var request = new GetServerResourcesRequest()
{ {
@@ -720,44 +588,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-server-resources", null, _securitySource); var hookCtx = new HookContext("get-server-resources", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -833,7 +668,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<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null) public async Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null)
{ {
request.ClientID ??= SDKConfiguration.ClientID; request.ClientID ??= SDKConfiguration.ClientID;
request.ClientName ??= SDKConfiguration.ClientName; request.ClientName ??= SDKConfiguration.ClientName;
@@ -856,44 +691,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getPin", null, null); var hookCtx = new HookContext("getPin", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -958,7 +760,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<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null, RetryConfig? retryConfig = null) public async Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null)
{ {
if (request == null) if (request == null)
{ {
@@ -985,44 +787,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getTokenByPinId", null, null); var hookCtx = new HookContext("getTokenByPinId", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -92,7 +92,7 @@ namespace LukeHagar.PlexAPI.SDK
/// | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/> /// | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
/// | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/> /// | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
/// | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/> /// | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
/// | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | - <br/> /// | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | -<br/>
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
@@ -322,7 +322,7 @@ namespace LukeHagar.PlexAPI.SDK
/// | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/> /// | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
/// | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/> /// | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
/// | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/> /// | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
/// | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | - <br/> /// | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | -<br/>
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
@@ -331,10 +331,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private int _serverIndex = 0; private int _serverIndex = 0;
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;

View File

@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null); Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null);
/// <summary> /// <summary>
/// Perform a voice search /// Perform a voice search
@@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null); Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null);
/// <summary> /// <summary>
/// Get Search Results /// Get Search Results
@@ -73,7 +73,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will search the database for the string provided. /// This will search the database for the string provided.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetSearchResultsResponse> GetSearchResultsAsync(string query, RetryConfig? retryConfig = null); Task<GetSearchResultsResponse> GetSearchResultsAsync(string query);
} }
/// <summary> /// <summary>
@@ -87,10 +87,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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;
@@ -103,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null) public async Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null)
{ {
var request = new PerformSearchRequest() var request = new PerformSearchRequest()
{ {
@@ -125,44 +125,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("performSearch", null, _securitySource); var hookCtx = new HookContext("performSearch", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -230,7 +197,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<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null) public async Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null)
{ {
var request = new PerformVoiceSearchRequest() var request = new PerformVoiceSearchRequest()
{ {
@@ -252,44 +219,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("performVoiceSearch", null, _securitySource); var hookCtx = new HookContext("performVoiceSearch", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -357,7 +291,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<GetSearchResultsResponse> GetSearchResultsAsync(string query, RetryConfig? retryConfig = null) public async Task<GetSearchResultsResponse> GetSearchResultsAsync(string query)
{ {
var request = new GetSearchResultsRequest() var request = new GetSearchResultsRequest()
{ {
@@ -377,44 +311,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getSearchResults", null, _securitySource); var hookCtx = new HookContext("getSearchResults", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Server Capabilities /// Get Server Capabilities
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync(RetryConfig? retryConfig = null); Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync();
/// <summary> /// <summary>
/// Get Server Preferences /// Get Server Preferences
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Server Preferences /// Get Server Preferences
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetServerPreferencesResponse> GetServerPreferencesAsync(RetryConfig? retryConfig = null); Task<GetServerPreferencesResponse> GetServerPreferencesAsync();
/// <summary> /// <summary>
/// Get Available Clients /// Get Available Clients
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Available Clients /// Get Available Clients
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetAvailableClientsResponse> GetAvailableClientsAsync(RetryConfig? retryConfig = null); Task<GetAvailableClientsResponse> GetAvailableClientsAsync();
/// <summary> /// <summary>
/// Get Devices /// Get Devices
@@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Devices /// Get Devices
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetDevicesResponse> GetDevicesAsync(RetryConfig? retryConfig = null); Task<GetDevicesResponse> GetDevicesAsync();
/// <summary> /// <summary>
/// Get Server Identity /// Get Server Identity
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This request is useful to determine if the server is online or offline /// This request is useful to determine if the server is online or offline
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetServerIdentityResponse> GetServerIdentityAsync(RetryConfig? retryConfig = null); Task<GetServerIdentityResponse> GetServerIdentityAsync();
/// <summary> /// <summary>
/// Get MyPlex Account /// Get MyPlex Account
@@ -84,7 +84,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Returns MyPlex Account Information /// Returns MyPlex Account Information
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync(RetryConfig? retryConfig = null); Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync();
/// <summary> /// <summary>
/// Get a Resized Photo /// Get a Resized Photo
@@ -94,7 +94,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request, RetryConfig? retryConfig = null); Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request);
/// <summary> /// <summary>
/// Get Media Providers /// Get Media Providers
@@ -103,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Retrieves media providers and their features from the Plex server. /// Retrieves media providers and their features from the Plex server.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken, RetryConfig? retryConfig = null); Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken);
/// <summary> /// <summary>
/// Get Server List /// Get Server List
@@ -112,7 +112,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Server List /// Get Server List
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetServerListResponse> GetServerListAsync(RetryConfig? retryConfig = null); Task<GetServerListResponse> GetServerListAsync();
} }
/// <summary> /// <summary>
@@ -126,10 +126,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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;
@@ -142,7 +142,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync(RetryConfig? retryConfig = null) public async Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -159,44 +159,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getServerCapabilities", null, _securitySource); var hookCtx = new HookContext("getServerCapabilities", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -272,7 +239,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<GetServerPreferencesResponse> GetServerPreferencesAsync(RetryConfig? retryConfig = null) public async Task<GetServerPreferencesResponse> GetServerPreferencesAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -289,44 +256,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getServerPreferences", null, _securitySource); var hookCtx = new HookContext("getServerPreferences", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -402,7 +336,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<GetAvailableClientsResponse> GetAvailableClientsAsync(RetryConfig? retryConfig = null) public async Task<GetAvailableClientsResponse> GetAvailableClientsAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -419,44 +353,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getAvailableClients", null, _securitySource); var hookCtx = new HookContext("getAvailableClients", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -532,7 +433,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<GetDevicesResponse> GetDevicesAsync(RetryConfig? retryConfig = null) public async Task<GetDevicesResponse> GetDevicesAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -549,44 +450,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getDevices", null, _securitySource); var hookCtx = new HookContext("getDevices", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -662,7 +530,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<GetServerIdentityResponse> GetServerIdentityAsync(RetryConfig? retryConfig = null) public async Task<GetServerIdentityResponse> GetServerIdentityAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -674,44 +542,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-server-identity", null, null); var hookCtx = new HookContext("get-server-identity", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 408 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 408 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -776,7 +611,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<GetMyPlexAccountResponse> GetMyPlexAccountAsync(RetryConfig? retryConfig = null) public async Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -793,44 +628,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getMyPlexAccount", null, _securitySource); var hookCtx = new HookContext("getMyPlexAccount", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -906,7 +708,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<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request, RetryConfig? retryConfig = null) public async Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/photo/:/transcode", request); var urlString = URLBuilder.Build(baseUrl, "/photo/:/transcode", request);
@@ -922,44 +724,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getResizedPhoto", null, _securitySource); var hookCtx = new HookContext("getResizedPhoto", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1027,7 +796,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<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken, RetryConfig? retryConfig = null) public async Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken)
{ {
var request = new GetMediaProvidersRequest() var request = new GetMediaProvidersRequest()
{ {
@@ -1049,44 +818,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-media-providers", null, _securitySource); var hookCtx = new HookContext("get-media-providers", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1162,7 +898,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<GetServerListResponse> GetServerListAsync(RetryConfig? retryConfig = null) public async Task<GetServerListResponse> GetServerListAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -1179,44 +915,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getServerList", null, _securitySource); var hookCtx = new HookContext("getServerList", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will retrieve the &quot;Now Playing&quot; Information of the PMS. /// This will retrieve the &quot;Now Playing&quot; Information of the PMS.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetSessionsResponse> GetSessionsAsync(RetryConfig? retryConfig = null); Task<GetSessionsResponse> GetSessionsAsync();
/// <summary> /// <summary>
/// Get Session History /// Get Session History
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will Retrieve a listing of all history views. /// This will Retrieve a listing of all history views.
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null, RetryConfig? retryConfig = null); Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null);
/// <summary> /// <summary>
/// Get Transcode Sessions /// Get Transcode Sessions
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Transcode Sessions /// Get Transcode Sessions
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync(RetryConfig? retryConfig = null); Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync();
/// <summary> /// <summary>
/// Stop a Transcode Session /// Stop a Transcode Session
@@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Stop a Transcode Session /// Stop a Transcode Session
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey, RetryConfig? retryConfig = null); Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey);
} }
/// <summary> /// <summary>
@@ -80,10 +80,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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;
@@ -96,7 +96,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetSessionsResponse> GetSessionsAsync(RetryConfig? retryConfig = null) public async Task<GetSessionsResponse> GetSessionsAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -113,44 +113,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getSessions", null, _securitySource); var hookCtx = new HookContext("getSessions", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -226,7 +193,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<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null, RetryConfig? retryConfig = null) public async Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null)
{ {
var request = new GetSessionHistoryRequest() var request = new GetSessionHistoryRequest()
{ {
@@ -249,44 +216,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getSessionHistory", null, _securitySource); var hookCtx = new HookContext("getSessionHistory", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -362,7 +296,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<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync(RetryConfig? retryConfig = null) public async Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -379,44 +313,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getTranscodeSessions", null, _securitySource); var hookCtx = new HookContext("getTranscodeSessions", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -492,7 +393,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<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey, RetryConfig? retryConfig = null) public async Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey)
{ {
var request = new StopTranscodeSessionRequest() var request = new StopTranscodeSessionRequest()
{ {
@@ -512,44 +413,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("stopTranscodeSession", null, _securitySource); var hookCtx = new HookContext("stopTranscodeSession", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will return the media statistics for the server /// This will return the media statistics for the server
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null); Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null);
/// <summary> /// <summary>
/// Get Resources Statistics /// Get Resources Statistics
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will return the resources for the server /// This will return the resources for the server
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null); Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null);
/// <summary> /// <summary>
/// Get Bandwidth Statistics /// Get Bandwidth Statistics
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will return the bandwidth statistics for the server /// This will return the bandwidth statistics for the server
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null); Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null);
} }
/// <summary> /// <summary>
@@ -71,10 +71,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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;
@@ -87,7 +87,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null) public async Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null)
{ {
var request = new GetStatisticsRequest() var request = new GetStatisticsRequest()
{ {
@@ -107,44 +107,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getStatistics", null, _securitySource); var hookCtx = new HookContext("getStatistics", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -220,7 +187,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<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null) public async Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null)
{ {
var request = new GetResourcesStatisticsRequest() var request = new GetResourcesStatisticsRequest()
{ {
@@ -240,44 +207,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getResourcesStatistics", null, _securitySource); var hookCtx = new HookContext("getResourcesStatistics", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -353,7 +287,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<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null) public async Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null)
{ {
var request = new GetBandwidthStatisticsRequest() var request = new GetBandwidthStatisticsRequest()
{ {
@@ -373,44 +307,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getBandwidthStatistics", null, _securitySource); var hookCtx = new HookContext("getBandwidthStatistics", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Querying status of updates /// Querying status of updates
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetUpdateStatusResponse> GetUpdateStatusAsync(RetryConfig? retryConfig = null); Task<GetUpdateStatusResponse> GetUpdateStatusAsync();
/// <summary> /// <summary>
/// Checking for updates /// Checking for updates
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Checking for updates /// Checking for updates
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null, RetryConfig? retryConfig = null); Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null);
/// <summary> /// <summary>
/// Apply Updates /// Apply Updates
@@ -59,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null, RetryConfig? retryConfig = null); Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = 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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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<GetUpdateStatusResponse> GetUpdateStatusAsync(RetryConfig? retryConfig = null) public async Task<GetUpdateStatusResponse> GetUpdateStatusAsync()
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -107,44 +107,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getUpdateStatus", null, _securitySource); var hookCtx = new HookContext("getUpdateStatus", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -220,7 +187,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<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null, RetryConfig? retryConfig = null) public async Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null)
{ {
var request = new CheckForUpdatesRequest() var request = new CheckForUpdatesRequest()
{ {
@@ -240,44 +207,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("checkForUpdates", null, _securitySource); var hookCtx = new HookContext("checkForUpdates", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -345,7 +279,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<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null, RetryConfig? retryConfig = null) public async Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null)
{ {
var request = new ApplyUpdatesRequest() var request = new ApplyUpdatesRequest()
{ {
@@ -366,44 +300,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("applyUpdates", null, _securitySource); var hookCtx = new HookContext("applyUpdates", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get the timeline for a media item /// Get the timeline for a media item
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request, RetryConfig? retryConfig = null); Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request);
/// <summary> /// <summary>
/// Start Universal Transcode /// Start Universal Transcode
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Begin a Universal Transcode Session /// Begin a Universal Transcode Session
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request, RetryConfig? retryConfig = null); Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request);
} }
/// <summary> /// <summary>
@@ -62,10 +62,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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;
@@ -78,7 +78,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request, RetryConfig? retryConfig = null) public async Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/:/timeline", request); var urlString = URLBuilder.Build(baseUrl, "/:/timeline", request);
@@ -94,44 +94,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getTimeline", null, _securitySource); var hookCtx = new HookContext("getTimeline", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -199,7 +166,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<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request, RetryConfig? retryConfig = null) public async Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request)
{ {
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/video/:/transcode/universal/start.mpd", request); var urlString = URLBuilder.Build(baseUrl, "/video/:/transcode/universal/start.mpd", request);
@@ -215,44 +182,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("startUniversalTranscode", null, _securitySource); var hookCtx = new HookContext("startUniversalTranscode", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get User Watchlist /// Get User Watchlist
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null, RetryConfig? retryConfig = null); Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null);
} }
/// <summary> /// <summary>
@@ -59,10 +59,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.9.0"; private const string _sdkVersion = "0.11.1";
private const string _sdkGenVersion = "2.429.0"; private const string _sdkGenVersion = "2.457.9";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.11.1 2.457.9 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;
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config; SDKConfiguration = config;
} }
public async Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null, RetryConfig? retryConfig = null) public async Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null)
{ {
string baseUrl = Utilities.TemplateUrl(GetWatchListServerList[0], new Dictionary<string, string>(){ string baseUrl = Utilities.TemplateUrl(GetWatchListServerList[0], new Dictionary<string, string>(){
}); });
@@ -97,44 +97,11 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-watch-list", null, _securitySource); var hookCtx = new HookContext("get-watch-list", 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 retries.Run(); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

112
NUGET.md
View File

@@ -25,69 +25,6 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
``` ```
<!-- End SDK Example Usage [usage] --> <!-- End SDK Example Usage [usage] -->
<!-- Start Retries [retries] -->
## Retries
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync(retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
));
// handle response
```
If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
),
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
```
<!-- End Retries [retries] -->
<!-- Start Error Handling [errors] --> <!-- Start Error Handling [errors] -->
## Error Handling ## Error Handling
@@ -104,11 +41,11 @@ By default, an API error will raise a `LukeHagar.PlexAPI.SDK.Models.Errors.SDKEx
When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `GetServerCapabilitiesAsync` method throws the following exceptions: When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `GetServerCapabilitiesAsync` method throws the following exceptions:
| Error Type | Status Code | Content Type | | Error Type | Status Code | Content Type |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | | --------------------------------------------------------------------- | ----------- | ---------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | application/json | | LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json | | LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* | | LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
### Example ### Example
@@ -157,27 +94,34 @@ catch (Exception ex)
<!-- Start Server Selection [server] --> <!-- Start Server Selection [server] -->
## Server Selection ## Server Selection
### Select Server by Index ### Server Variables
You can override the default server globally by passing a server index to the `serverIndex: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: The default server `https://10.10.10.47:32400` contains variables and is set to `https://10.10.10.47:32400` by default. To override default values, the following parameters are available when initializing the SDK client instance:
| # | Server | Variables |
| - | ------ | --------- |
| 0 | `{protocol}://{ip}:{port}` | `protocol` (default is `https`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) |
#### Variables
Some of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so:
* `protocol: ServerProtocol` * `protocol: ServerProtocol`
* `ip: string` * `ip: string`
* `port: string` * `port: string`
### Override Server URL Per-Client ### Override Server URL Per-Client
The default server can also be overridden globally by passing a URL to the `serverUrl: str` optional parameter when initializing the SDK client instance. For example: The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
serverUrl: "https://10.10.10.47:32400",
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
```
### Override Server URL Per-Operation ### Override Server URL Per-Operation
@@ -208,9 +152,9 @@ var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/
This SDK supports the following security scheme globally: This SDK supports the following security scheme globally:
| Name | Type | Scheme | | Name | Type | Scheme |
| ------------- | ------------- | ------------- | | ------------- | ------ | ------- |
| `AccessToken` | apiKey | API key | | `AccessToken` | apiKey | API key |
To authenticate with the API the `AccessToken` parameter must be set when initializing the SDK client instance. For example: To authenticate with the API the `AccessToken` parameter must be set when initializing the SDK client instance. For example:
```csharp ```csharp

114
README.md
View File

@@ -91,6 +91,7 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items * [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
* [GetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library * [GetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library
* [GetSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library * [GetSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library
* [GetSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
* [GetMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey * [GetMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey
* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children * [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
* [GetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content * [GetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
@@ -185,27 +186,34 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
<!-- Start Server Selection [server] --> <!-- Start Server Selection [server] -->
## Server Selection ## Server Selection
### Select Server by Index ### Server Variables
You can override the default server globally by passing a server index to the `serverIndex: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: The default server `{protocol}://{ip}:{port}` contains variables and is set to `https://10.10.10.47:32400` by default. To override default values, the following parameters are available when initializing the SDK client instance:
| # | Server | Variables |
| - | ------ | --------- |
| 0 | `{protocol}://{ip}:{port}` | `protocol` (default is `https`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) |
#### Variables
Some of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so:
* `protocol: ServerProtocol` * `protocol: ServerProtocol`
* `ip: string` * `ip: string`
* `port: string` * `port: string`
### Override Server URL Per-Client ### Override Server URL Per-Client
The default server can also be overridden globally by passing a URL to the `serverUrl: str` optional parameter when initializing the SDK client instance. For example: The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
serverUrl: "https://10.10.10.47:32400",
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
```
### Override Server URL Per-Operation ### Override Server URL Per-Operation
@@ -236,9 +244,9 @@ var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/
This SDK supports the following security scheme globally: This SDK supports the following security scheme globally:
| Name | Type | Scheme | | Name | Type | Scheme |
| ------------- | ------------- | ------------- | | ------------- | ------ | ------- |
| `AccessToken` | apiKey | API key | | `AccessToken` | apiKey | API key |
To authenticate with the API the `AccessToken` parameter must be set when initializing the SDK client instance. For example: To authenticate with the API the `AccessToken` parameter must be set when initializing the SDK client instance. For example:
```csharp ```csharp
@@ -260,69 +268,6 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
``` ```
<!-- End Authentication [security] --> <!-- End Authentication [security] -->
<!-- Start Retries [retries] -->
## Retries
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync(retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
));
// handle response
```
If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
),
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
```
<!-- End Retries [retries] -->
<!-- Start Error Handling [errors] --> <!-- Start Error Handling [errors] -->
## Error Handling ## Error Handling
@@ -339,11 +284,11 @@ By default, an API error will raise a `LukeHagar.PlexAPI.SDK.Models.Errors.SDKEx
When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `GetServerCapabilitiesAsync` method throws the following exceptions: When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `GetServerCapabilitiesAsync` method throws the following exceptions:
| Error Type | Status Code | Content Type | | Error Type | Status Code | Content Type |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | | --------------------------------------------------------------------- | ----------- | ---------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | application/json | | LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json | | LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* | | LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
### Example ### Example
@@ -426,7 +371,6 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
* [SDK Installation](#sdk-installation) * [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage) * [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations) * [Available Resources and Operations](#available-resources-and-operations)
* [Retries](#retries)
* [Error Handling](#error-handling) * [Error Handling](#error-handling)
* [Server Selection](#server-selection) * [Server Selection](#server-selection)
* [Authentication](#authentication) * [Authentication](#authentication)

View File

@@ -344,4 +344,54 @@ Based on:
### Generated ### Generated
- [csharp v0.9.0] . - [csharp v0.9.0] .
### Releases ### Releases
- [NuGet v0.9.0] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.9.0 - . - [NuGet v0.9.0] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.9.0 - .
## 2024-10-02 10:45:12
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.405.8 (2.429.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.9.1] .
### Releases
- [NuGet v0.9.1] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.9.1 - .
## 2024-10-02 11:09:36
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.405.8 (2.429.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.9.2] .
### Releases
- [NuGet v0.9.2] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.9.2 - .
## 2024-10-03 12:24:46
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.406.0 (2.429.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.10.0] .
### Releases
- [NuGet v0.10.0] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.10.0 - .
## 2024-11-12 00:20:30
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.438.1 (2.457.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.11.0] .
### Releases
- [NuGet v0.11.0] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.11.0 - .
## 2024-11-14 00:20:57
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.438.3 (2.457.9) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.11.1] .
### Releases
- [NuGet v0.11.1] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.11.1 - .

View File

@@ -804,6 +804,38 @@ actions:
var res = await sdk.Library.GetRecentlyAddedLibraryAsync(req); var res = await sdk.Library.GetRecentlyAddedLibraryAsync(req);
// handle response
- target: $["paths"]["/library/search"]["get"]
update:
x-codeSamples:
- lang: csharp
label: libraries
source: |-
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using System.Collections.Generic;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetSearchAllLibrariesRequest req = new GetSearchAllLibrariesRequest() {
Query = "<value>",
SearchTypes = new List<SearchTypes>() {
LukeHagar.PlexAPI.SDK.Models.Requests.SearchTypes.People,
},
IncludeCollections = LukeHagar.PlexAPI.SDK.Models.Requests.QueryParamIncludeCollections.Enable,
IncludeExternalMedia = LukeHagar.PlexAPI.SDK.Models.Requests.QueryParamIncludeExternalMedia.Enable,
};
var res = await sdk.Library.GetSearchAllLibrariesAsync(req);
// handle response // handle response
- target: $["paths"]["/library/sections"]["get"] - target: $["paths"]["/library/sections"]["get"]
update: update:

View File

@@ -0,0 +1,11 @@
# GetSearchAllLibrariesBadRequest
Bad Request - A parameter was not specified, or was specified incorrectly.
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `Errors` | List<[GetSearchAllLibrariesErrors](../../Models/Errors/GetSearchAllLibrariesErrors.md)> | :heavy_minus_sign: | N/A |
| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -0,0 +1,10 @@
# GetSearchAllLibrariesErrors
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `Code` | *int* | :heavy_minus_sign: | N/A | 1000 |
| `Message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
| `Status` | *int* | :heavy_minus_sign: | N/A | 400 |

View File

@@ -0,0 +1,10 @@
# GetSearchAllLibrariesLibraryErrors
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
| `Code` | *int* | :heavy_minus_sign: | N/A | 1001 |
| `Message` | *string* | :heavy_minus_sign: | N/A | User could not be authenticated |
| `Status` | *int* | :heavy_minus_sign: | N/A | 401 |

View File

@@ -0,0 +1,11 @@
# GetSearchAllLibrariesUnauthorized
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `Errors` | List<[GetSearchAllLibrariesLibraryErrors](../../Models/Errors/GetSearchAllLibrariesLibraryErrors.md)> | :heavy_minus_sign: | N/A |
| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -1,102 +0,0 @@
# Features
## Values
| Name | Value |
| --------------------------------------- | --------------------------------------- |
| `AndroidDolbyVision` | Android - Dolby Vision |
| `AndroidPiP` | Android - PiP |
| `CUSunset` | CU Sunset |
| `HRKEnableEUR` | HRK_enable_EUR |
| `TREBLEShowFeatures` | TREBLE-show-features |
| `AdCountdownTimer` | ad-countdown-timer |
| `AdaptiveBitrate` | adaptive_bitrate |
| `AlbumTypes` | album-types |
| `AllowDvr` | allow_dvr |
| `AmazonLoopDebug` | amazon-loop-debug |
| `AvodAdAnalysis` | avod-ad-analysis |
| `AvodNewMedia` | avod-new-media |
| `BlacklistGetSignin` | blacklist_get_signin |
| `BoostVoices` | boost-voices |
| `CameraUpload` | camera_upload |
| `ClientRadioStations` | client-radio-stations |
| `CloudflareTurnstileRequired` | cloudflare-turnstile-required |
| `Cloudsync` | cloudsync |
| `Collections` | collections |
| `CommentsAndRepliesPushNotifications` | comments_and_replies_push_notifications |
| `CommunityAccessPlexTv` | community_access_plex_tv |
| `CompanionsSonos` | companions_sonos |
| `ContentFilter` | content_filter |
| `CustomHomeRemoval` | custom-home-removal |
| `DisableHomeUserFriendships` | disable_home_user_friendships |
| `DisableSharingFriendships` | disable_sharing_friendships |
| `DownloadsGating` | downloads-gating |
| `DrmSupport` | drm_support |
| `Dvr` | dvr |
| `DvrBlockUnsupportedCountries` | dvr-block-unsupported-countries |
| `EpgRecentChannels` | epg-recent-channels |
| `ExcludeRestrictions` | exclude restrictions |
| `FederatedAuth` | federated-auth |
| `FriendRequestPushNotifications` | friend_request_push_notifications |
| `GrandfatherSync` | grandfather-sync |
| `GuidedUpgrade` | guided-upgrade |
| `HardwareTranscoding` | hardware_transcoding |
| `Home` | home |
| `Hwtranscode` | hwtranscode |
| `ImaggaV2` | imagga-v2 |
| `IncreasePasswordComplexity` | increase-password-complexity |
| `Ios14PrivacyBanner` | ios14-privacy-banner |
| `IterableNotificationTokens` | iterable-notification-tokens |
| `ItemClusters` | item_clusters |
| `KeepPaymentMethod` | keep-payment-method |
| `KevinBacon` | kevin-bacon |
| `KoreaConsent` | korea-consent |
| `LeIsrgRootX1` | le_isrg_root_x1 |
| `LetsEncrypt` | lets_encrypt |
| `LightningDvrPivot` | lightning-dvr-pivot |
| `LiveTvSupportIncompleteSegments` | live-tv-support-incomplete-segments |
| `Livetv` | livetv |
| `Lyrics` | lyrics |
| `MetadataSearch` | metadata_search |
| `MusicAnalysis` | music-analysis |
| `MusicVideos` | music_videos |
| `NewPlexPassPrices` | new_plex_pass_prices |
| `NewsProviderSunsetModal` | news-provider-sunset-modal |
| `Nominatim` | nominatim |
| `Pass` | pass |
| `PhotosFavorites` | photos-favorites |
| `PhotosMetadataEdition` | photos-metadata-edition |
| `PhotosV6Edit` | photosV6-edit |
| `PhotosV6TvAlbums` | photosV6-tv-albums |
| `PmsHealth` | pms_health |
| `PremiumDashboard` | premium-dashboard |
| `PremiumMusicMetadata` | premium_music_metadata |
| `Radio` | radio |
| `RateLimitClientToken` | rate-limit-client-token |
| `ScrobblingServicePlexTv` | scrobbling-service-plex-tv |
| `SessionBandwidthRestrictions` | session_bandwidth_restrictions |
| `SessionKick` | session_kick |
| `SharedServerNotification` | shared_server_notification |
| `SharedSourceNotification` | shared_source_notification |
| `SigninNotification` | signin_notification |
| `SigninWithApple` | signin_with_apple |
| `SilenceRemoval` | silence-removal |
| `SleepTimer` | sleep-timer |
| `SpringServeAdProvider` | spring_serve_ad_provider |
| `Sync` | sync |
| `SweetFades` | sweet-fades |
| `TranscoderCache` | transcoder_cache |
| `Trailers` | trailers |
| `TunerSharing` | tuner-sharing |
| `TwoFactorAuthentication` | two-factor-authentication |
| `Unsupportedtuners` | unsupportedtuners |
| `Upgrade3ds2` | upgrade-3ds2 |
| `Visualizers` | visualizers |
| `VodSchema` | vod-schema |
| `VodCloudflare` | vod_cloudflare |
| `VolumeLeveling` | volume-leveling |
| `WatchTogetherInvite` | watch-together-invite |
| `WatchlistRss` | watchlist-rss |
| `WebServerDashboard` | web_server_dashboard |
| `Webhooks` | webhooks |

View File

@@ -3,26 +3,26 @@
## Fields ## Fields
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | true | | `AllowSync` | *bool* | :heavy_check_mark: | N/A | true |
| `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg | | `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
| `Composite` | *string* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 | | `Composite` | *string* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 |
| `Filters` | *bool* | :heavy_check_mark: | N/A | true | | `Filters` | *bool* | :heavy_check_mark: | N/A | true |
| `Refreshing` | *bool* | :heavy_check_mark: | N/A | false | | `Refreshing` | *bool* | :heavy_check_mark: | N/A | false |
| `Thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/movie.png | | `Thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/movie.png |
| `Key` | *string* | :heavy_check_mark: | N/A | 1 | | `Key` | *string* | :heavy_check_mark: | N/A | 1 |
| `Type` | *string* | :heavy_check_mark: | N/A | movie | | `Type` | *string* | :heavy_check_mark: | N/A | movie |
| `Title` | *string* | :heavy_check_mark: | N/A | Movies | | `Title` | *string* | :heavy_check_mark: | N/A | Movies |
| `Agent` | *string* | :heavy_check_mark: | N/A | tv.plex.agents.movie | | `Agent` | *string* | :heavy_check_mark: | N/A | tv.plex.agents.movie |
| `Scanner` | *string* | :heavy_check_mark: | N/A | Plex Movie | | `Scanner` | *string* | :heavy_check_mark: | N/A | Plex Movie |
| `Language` | *string* | :heavy_check_mark: | N/A | en-US | | `Language` | *string* | :heavy_check_mark: | N/A | en-US |
| `Uuid` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | | `Uuid` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
| `UpdatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `UpdatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `CreatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `CreatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `ScannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `ScannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `Content` | *bool* | :heavy_check_mark: | N/A | true | | `Content` | *bool* | :heavy_check_mark: | N/A | true |
| `Directory` | *bool* | :heavy_check_mark: | N/A | true | | `Directory` | *bool* | :heavy_check_mark: | N/A | true |
| `ContentChangedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `ContentChangedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `Hidden` | *int* | :heavy_check_mark: | N/A | 0 | | `Hidden` | *int* | :heavy_check_mark: | N/A | 0 |
| `Location` | List<[Location](../../Models/Requests/Location.md)> | :heavy_check_mark: | N/A | | | `Location` | List<[GetAllLibrariesLocation](../../Models/Requests/GetAllLibrariesLocation.md)> | :heavy_check_mark: | N/A | |

View File

@@ -0,0 +1,9 @@
# GetAllLibrariesLocation
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Id` | *int* | :heavy_check_mark: | N/A | 1 |
| `Path` | *string* | :heavy_check_mark: | N/A | /movies |

View File

@@ -0,0 +1,8 @@
# GetLibraryItemsLocation
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Path` | *string* | :heavy_minus_sign: | N/A | /TV Shows/House |

View File

@@ -6,19 +6,19 @@
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `Id` | *int* | :heavy_check_mark: | N/A | 119534 | | `Id` | *int* | :heavy_check_mark: | N/A | 119534 |
| `Duration` | *int* | :heavy_check_mark: | N/A | 11558112 | | `Duration` | *int* | :heavy_minus_sign: | N/A | 11558112 |
| `Bitrate` | *int* | :heavy_check_mark: | N/A | 25025 | | `Bitrate` | *int* | :heavy_minus_sign: | N/A | 25025 |
| `Width` | *int* | :heavy_check_mark: | N/A | 3840 | | `Width` | *int* | :heavy_minus_sign: | N/A | 3840 |
| `Height` | *int* | :heavy_check_mark: | N/A | 2072 | | `Height` | *int* | :heavy_minus_sign: | N/A | 2072 |
| `AspectRatio` | *double* | :heavy_check_mark: | N/A | 1.85 | | `AspectRatio` | *double* | :heavy_minus_sign: | N/A | 1.85 |
| `AudioProfile` | *string* | :heavy_minus_sign: | N/A | dts | | `AudioProfile` | *string* | :heavy_minus_sign: | N/A | dts |
| `AudioChannels` | *int* | :heavy_check_mark: | N/A | 6 | | `AudioChannels` | *int* | :heavy_minus_sign: | N/A | 6 |
| `AudioCodec` | *string* | :heavy_check_mark: | N/A | eac3 | | `AudioCodec` | *string* | :heavy_minus_sign: | N/A | eac3 |
| `VideoCodec` | *string* | :heavy_check_mark: | N/A | hevc | | `VideoCodec` | *string* | :heavy_minus_sign: | N/A | hevc |
| `VideoResolution` | *string* | :heavy_check_mark: | N/A | 4k | | `VideoResolution` | *string* | :heavy_minus_sign: | N/A | 4k |
| `Container` | *string* | :heavy_check_mark: | N/A | mkv | | `Container` | *string* | :heavy_check_mark: | N/A | mkv |
| `VideoFrameRate` | *string* | :heavy_check_mark: | N/A | 24p | | `VideoFrameRate` | *string* | :heavy_minus_sign: | N/A | 24p |
| `VideoProfile` | *string* | :heavy_check_mark: | N/A | main 10 | | `VideoProfile` | *string* | :heavy_minus_sign: | N/A | main 10 |
| `HasVoiceActivity` | *bool* | :heavy_minus_sign: | N/A | false | | `HasVoiceActivity` | *bool* | :heavy_minus_sign: | N/A | false |
| `OptimizedForStreaming` | [GetLibraryItemsOptimizedForStreaming](../../Models/Requests/GetLibraryItemsOptimizedForStreaming.md) | :heavy_minus_sign: | N/A | 1 | | `OptimizedForStreaming` | [GetLibraryItemsOptimizedForStreaming](../../Models/Requests/GetLibraryItemsOptimizedForStreaming.md) | :heavy_minus_sign: | N/A | 1 |
| `Has64bitOffsets` | *bool* | :heavy_minus_sign: | N/A | false | | `Has64bitOffsets` | *bool* | :heavy_minus_sign: | N/A | false |

View File

@@ -29,5 +29,5 @@ The Meta object is only included in the response if the `includeMeta` parameter
| `ViewGroup` | *string* | :heavy_check_mark: | N/A | movie | | `ViewGroup` | *string* | :heavy_check_mark: | N/A | movie |
| `ViewMode` | *int* | :heavy_minus_sign: | N/A | 65592 | | `ViewMode` | *int* | :heavy_minus_sign: | N/A | 65592 |
| `MixedParents` | *bool* | :heavy_minus_sign: | N/A | true | | `MixedParents` | *bool* | :heavy_minus_sign: | N/A | true |
| `Metadata` | List<[GetLibraryItemsMetadata](../../Models/Requests/GetLibraryItemsMetadata.md)> | :heavy_check_mark: | N/A | | | `Metadata` | List<[GetLibraryItemsMetadata](../../Models/Requests/GetLibraryItemsMetadata.md)> | :heavy_minus_sign: | N/A | |
| `Meta` | [GetLibraryItemsMeta](../../Models/Requests/GetLibraryItemsMeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | | | `Meta` | [GetLibraryItemsMeta](../../Models/Requests/GetLibraryItemsMeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | |

View File

@@ -52,6 +52,7 @@
| `Writer` | List<[GetLibraryItemsWriter](../../Models/Requests/GetLibraryItemsWriter.md)> | :heavy_minus_sign: | N/A | | | `Writer` | List<[GetLibraryItemsWriter](../../Models/Requests/GetLibraryItemsWriter.md)> | :heavy_minus_sign: | N/A | |
| `Collection` | List<[GetLibraryItemsCollection](../../Models/Requests/GetLibraryItemsCollection.md)> | :heavy_minus_sign: | N/A | | | `Collection` | List<[GetLibraryItemsCollection](../../Models/Requests/GetLibraryItemsCollection.md)> | :heavy_minus_sign: | N/A | |
| `Role` | List<[GetLibraryItemsRole](../../Models/Requests/GetLibraryItemsRole.md)> | :heavy_minus_sign: | N/A | | | `Role` | List<[GetLibraryItemsRole](../../Models/Requests/GetLibraryItemsRole.md)> | :heavy_minus_sign: | N/A | |
| `Location` | List<[GetLibraryItemsLocation](../../Models/Requests/GetLibraryItemsLocation.md)> | :heavy_minus_sign: | N/A | |
| `MediaGuid` | List<[GetLibraryItemsMediaGuid](../../Models/Requests/GetLibraryItemsMediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/> | | | `MediaGuid` | List<[GetLibraryItemsMediaGuid](../../Models/Requests/GetLibraryItemsMediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/> | |
| `UltraBlurColors` | [GetLibraryItemsUltraBlurColors](../../Models/Requests/GetLibraryItemsUltraBlurColors.md) | :heavy_minus_sign: | N/A | | | `UltraBlurColors` | [GetLibraryItemsUltraBlurColors](../../Models/Requests/GetLibraryItemsUltraBlurColors.md) | :heavy_minus_sign: | N/A | |
| `MetaDataRating` | List<[GetLibraryItemsMetaDataRating](../../Models/Requests/GetLibraryItemsMetaDataRating.md)> | :heavy_minus_sign: | N/A | | | `MetaDataRating` | List<[GetLibraryItemsMetaDataRating](../../Models/Requests/GetLibraryItemsMetaDataRating.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -7,14 +7,14 @@
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `Id` | *int* | :heavy_check_mark: | N/A | 119542 | | `Id` | *int* | :heavy_check_mark: | N/A | 119542 |
| `Key` | *string* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv | | `Key` | *string* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv |
| `Duration` | *int* | :heavy_check_mark: | N/A | 11558112 | | `Duration` | *int* | :heavy_minus_sign: | N/A | 11558112 |
| `File` | *string* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv | | `File` | *string* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv |
| `Size` | *long* | :heavy_check_mark: | N/A | 36158371307 | | `Size` | *long* | :heavy_check_mark: | N/A | 36158371307 |
| `Container` | *string* | :heavy_check_mark: | The container format of the media file.<br/> | mkv | | `Container` | *string* | :heavy_check_mark: | The container format of the media file.<br/> | mkv |
| `AudioProfile` | *string* | :heavy_minus_sign: | N/A | dts | | `AudioProfile` | *string* | :heavy_minus_sign: | N/A | dts |
| `Has64bitOffsets` | *bool* | :heavy_minus_sign: | N/A | false | | `Has64bitOffsets` | *bool* | :heavy_minus_sign: | N/A | false |
| `OptimizedForStreaming` | *bool* | :heavy_minus_sign: | N/A | false | | `OptimizedForStreaming` | *bool* | :heavy_minus_sign: | N/A | false |
| `VideoProfile` | *string* | :heavy_check_mark: | N/A | main 10 | | `VideoProfile` | *string* | :heavy_minus_sign: | N/A | main 10 |
| `Indexes` | *string* | :heavy_minus_sign: | N/A | sd | | `Indexes` | *string* | :heavy_minus_sign: | N/A | sd |
| `HasThumbnail` | [GetLibraryItemsHasThumbnail](../../Models/Requests/GetLibraryItemsHasThumbnail.md) | :heavy_minus_sign: | N/A | 1 | | `HasThumbnail` | [GetLibraryItemsHasThumbnail](../../Models/Requests/GetLibraryItemsHasThumbnail.md) | :heavy_minus_sign: | N/A | 1 |
| `Stream` | List<[GetLibraryItemsStream](../../Models/Requests/GetLibraryItemsStream.md)> | :heavy_minus_sign: | N/A | | | `Stream` | List<[GetLibraryItemsStream](../../Models/Requests/GetLibraryItemsStream.md)> | :heavy_minus_sign: | N/A | |

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