mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 20:47:49 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92be5b3a91 | ||
|
|
a183f389bc | ||
|
|
4a443f6f2e | ||
|
|
b9b7cd1146 | ||
|
|
81c55cb08b | ||
|
|
860991f2a0 | ||
|
|
d25639db53 | ||
|
|
227e2351d5 | ||
|
|
3bd4f51297 | ||
|
|
4828de2345 | ||
|
|
2beb707ed5 | ||
|
|
affe5d5a8c |
1
.github/workflows/sdk_generation.yaml
vendored
1
.github/workflows/sdk_generation.yaml
vendored
@@ -24,6 +24,7 @@ jobs:
|
||||
mode: direct
|
||||
set_version: ${{ github.event.inputs.set_version }}
|
||||
speakeasy_version: latest
|
||||
dotnet_version: "8.x"
|
||||
secrets:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
|
||||
|
||||
1
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/.name
generated
Normal file
1
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
LukeHagar.PlexAPI.SDK
|
||||
4
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
8
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/projectSettingsUpdater.xml
generated
Normal file
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/projectSettingsUpdater.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="vcsConfiguration" value="3" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.LukeHagar.PlexAPI.SDK/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@ generation:
|
||||
auth:
|
||||
oAuth2ClientCredentialsEnabled: true
|
||||
csharp:
|
||||
version: 0.8.1
|
||||
version: 0.9.2
|
||||
additionalDependencies: []
|
||||
author: LukeHagar
|
||||
clientServerStatusCodesAsErrors: true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.402.14
|
||||
speakeasyVersion: 1.405.8
|
||||
sources:
|
||||
my-source:
|
||||
sourceNamespace: my-source
|
||||
@@ -16,8 +16,8 @@ sources:
|
||||
- main
|
||||
plexapi:
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e
|
||||
sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e
|
||||
sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
|
||||
sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
|
||||
tags:
|
||||
- latest
|
||||
- main
|
||||
@@ -25,10 +25,10 @@ targets:
|
||||
plexcsharp:
|
||||
source: plexapi
|
||||
sourceNamespace: plexapi
|
||||
sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e
|
||||
sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e
|
||||
sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
|
||||
sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
|
||||
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
||||
codeSamplesRevisionDigest: sha256:6838159d31ebc591bad7395890ed6d3d9054554b4906bcc7b9d1fb1225379e54
|
||||
codeSamplesRevisionDigest: sha256:92500227f7e52cdceac29cb2915dfe637ad1432c312c69dd3acb197b357a3577
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Server Activities
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetServerActivitiesResponse> GetServerActivitiesAsync();
|
||||
Task<GetServerActivitiesResponse> GetServerActivitiesAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Cancel Server Activities
|
||||
@@ -54,7 +54,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Cancel Server Activities
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID);
|
||||
Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -74,10 +74,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -90,7 +90,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync()
|
||||
public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -107,11 +107,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getServerActivities", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -187,7 +220,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
|
||||
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new CancelServerActivitiesRequest()
|
||||
{
|
||||
@@ -207,11 +240,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("cancelServerActivities", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope);
|
||||
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Source Connection Information
|
||||
@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source);
|
||||
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Token Details
|
||||
@@ -60,7 +60,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get the User data from the provided X-Plex-Token
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null);
|
||||
Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null);
|
||||
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -85,20 +85,20 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// List of server URLs available for the getTokenDetails operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetTokenDetailsServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
/// <summary>
|
||||
/// List of server URLs available for the post-users-sign-in-data operation.
|
||||
/// </summary>
|
||||
public static readonly string[] PostUsersSignInDataServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -111,7 +111,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope)
|
||||
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetTransientTokenRequest()
|
||||
{
|
||||
@@ -132,11 +132,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getTransientToken", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -204,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
|
||||
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetSourceConnectionInformationRequest()
|
||||
{
|
||||
@@ -224,11 +257,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -296,7 +362,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null)
|
||||
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
@@ -318,11 +384,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getTokenDetails", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -398,13 +497,13 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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)
|
||||
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
request.ClientID ??= SDKConfiguration.ClientID;
|
||||
request.ClientName ??= SDKConfiguration.ClientName;
|
||||
request.ClientVersion ??= SDKConfiguration.ClientVersion;
|
||||
request.ClientPlatform ??= SDKConfiguration.ClientPlatform;
|
||||
request.DeviceName ??= SDKConfiguration.DeviceName;
|
||||
request.Platform ??= SDKConfiguration.Platform;
|
||||
request.DeviceNickname ??= SDKConfiguration.DeviceNickname;
|
||||
|
||||
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
@@ -412,10 +511,12 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
baseUrl = serverUrl;
|
||||
}
|
||||
var urlString = URLBuilder.Build(baseUrl, "/users/signin", request);
|
||||
|
||||
var urlString = baseUrl + "/users/signin";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
|
||||
if (serializedBody != null)
|
||||
@@ -426,11 +527,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("post-users-sign-in-data", null, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Returns a list of butler tasks
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetButlerTasksResponse> GetButlerTasksAsync();
|
||||
Task<GetButlerTasksResponse> GetButlerTasksAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Start all Butler tasks
|
||||
@@ -53,7 +53,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<StartAllTasksResponse> StartAllTasksAsync();
|
||||
Task<StartAllTasksResponse> StartAllTasksAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Stop all Butler tasks
|
||||
@@ -63,7 +63,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<StopAllTasksResponse> StopAllTasksAsync();
|
||||
Task<StopAllTasksResponse> StopAllTasksAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Start a single Butler task
|
||||
@@ -77,7 +77,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<StartTaskResponse> StartTaskAsync(TaskName taskName);
|
||||
Task<StartTaskResponse> StartTaskAsync(TaskName taskName, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Stop a single Butler task
|
||||
@@ -87,7 +87,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName);
|
||||
Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -101,10 +101,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -117,7 +117,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetButlerTasksResponse> GetButlerTasksAsync()
|
||||
public async Task<GetButlerTasksResponse> GetButlerTasksAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -134,11 +134,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getButlerTasks", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -214,7 +247,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
||||
public async Task<StartAllTasksResponse> StartAllTasksAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -231,11 +264,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("startAllTasks", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -303,7 +369,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
||||
public async Task<StopAllTasksResponse> StopAllTasksAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -320,11 +386,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("stopAllTasks", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -392,7 +491,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
|
||||
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new StartTaskRequest()
|
||||
{
|
||||
@@ -412,11 +511,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("startTask", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -484,7 +616,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
|
||||
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new StopTaskRequest()
|
||||
{
|
||||
@@ -504,11 +636,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("stopTask", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Global Hubs filtered by the parameters provided.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null);
|
||||
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Recently Added
|
||||
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request);
|
||||
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get library specific hubs
|
||||
@@ -59,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null);
|
||||
Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -73,10 +73,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -89,7 +89,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null)
|
||||
public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetGlobalHubsRequest()
|
||||
{
|
||||
@@ -110,11 +110,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getGlobalHubs", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -190,7 +223,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request)
|
||||
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
|
||||
@@ -206,11 +239,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-recently-added", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -264,7 +330,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
|
||||
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetLibraryHubsRequest()
|
||||
{
|
||||
@@ -286,11 +352,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getLibraryHubs", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This resource returns hash values for local files
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null);
|
||||
Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Recently Added
|
||||
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request);
|
||||
Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get All Libraries
|
||||
@@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetAllLibrariesResponse> GetAllLibrariesAsync();
|
||||
Task<GetAllLibrariesResponse> GetAllLibrariesAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Library Details
|
||||
@@ -112,7 +112,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null);
|
||||
Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Delete Library Section
|
||||
@@ -121,7 +121,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Delete a library using a specific section id
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey);
|
||||
Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Library Items
|
||||
@@ -150,7 +150,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request);
|
||||
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Refresh Metadata Of The Library
|
||||
@@ -160,7 +160,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null);
|
||||
Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Search Library
|
||||
@@ -187,7 +187,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type);
|
||||
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Search All Libraries
|
||||
///
|
||||
/// <remarks>
|
||||
/// Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetSearchAllLibrariesResponse> GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Metadata by RatingKey
|
||||
@@ -197,7 +207,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey);
|
||||
Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Items Children
|
||||
@@ -207,7 +217,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null);
|
||||
Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Top Watched Content
|
||||
@@ -217,7 +227,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null);
|
||||
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get On Deck
|
||||
@@ -227,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetOnDeckResponse> GetOnDeckAsync();
|
||||
Task<GetOnDeckResponse> GetOnDeckAsync(RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -241,10 +251,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -257,7 +267,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null)
|
||||
public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetFileHashRequest()
|
||||
{
|
||||
@@ -278,11 +288,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getFileHash", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -350,7 +393,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request)
|
||||
public async Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request);
|
||||
@@ -366,11 +409,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-recently-added-library", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -446,7 +522,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync()
|
||||
public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -463,11 +539,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-all-libraries", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -543,7 +652,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null)
|
||||
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetLibraryDetailsRequest()
|
||||
{
|
||||
@@ -564,11 +673,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-library-details", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -644,7 +786,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey)
|
||||
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new DeleteLibraryRequest()
|
||||
{
|
||||
@@ -664,11 +806,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("deleteLibrary", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -736,7 +911,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request)
|
||||
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request);
|
||||
@@ -752,11 +927,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-library-items", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -832,7 +1040,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null)
|
||||
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetRefreshLibraryMetadataRequest()
|
||||
{
|
||||
@@ -853,11 +1061,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-refresh-library-metadata", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -925,7 +1166,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type)
|
||||
public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetSearchLibraryRequest()
|
||||
{
|
||||
@@ -946,11 +1187,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-search-library", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1026,7 +1300,143 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey)
|
||||
public async Task<GetSearchAllLibrariesResponse> GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
if (request == null)
|
||||
{
|
||||
request = new GetSearchAllLibrariesRequest();
|
||||
}
|
||||
request.ClientID ??= SDKConfiguration.ClientID;
|
||||
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/search", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
{
|
||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||
}
|
||||
|
||||
var hookCtx = new HookContext("get-search-all-libraries", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
{
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
httpResponse = _httpResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
httpResponse = _httpResponse;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
|
||||
|
||||
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||
if(responseStatusCode == 200)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetSearchAllLibrariesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var response = new GetSearchAllLibrariesResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
ContentType = contentType,
|
||||
RawResponse = httpResponse
|
||||
};
|
||||
response.Object = obj;
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetSearchAllLibrariesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetSearchAllLibrariesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetMetaDataByRatingKeyRequest()
|
||||
{
|
||||
@@ -1046,11 +1456,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-meta-data-by-rating-key", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1126,7 +1569,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null)
|
||||
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetMetadataChildrenRequest()
|
||||
{
|
||||
@@ -1147,11 +1590,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getMetadataChildren", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1227,7 +1703,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null)
|
||||
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetTopWatchedContentRequest()
|
||||
{
|
||||
@@ -1248,11 +1724,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getTopWatchedContent", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -1328,7 +1837,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetOnDeckResponse> GetOnDeckAsync()
|
||||
public async Task<GetOnDeckResponse> GetOnDeckAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -1345,11 +1854,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getOnDeck", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<LogLineResponse> LogLineAsync(Level level, string message, string source);
|
||||
Task<LogLineResponse> LogLineAsync(Level level, string message, string source, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Logging a multi-line message
|
||||
@@ -70,7 +70,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<LogMultiLineResponse> LogMultiLineAsync(string request);
|
||||
Task<LogMultiLineResponse> LogMultiLineAsync(string request, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Enabling Papertrail
|
||||
@@ -80,7 +80,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<EnablePaperTrailResponse> EnablePaperTrailAsync();
|
||||
Task<EnablePaperTrailResponse> EnablePaperTrailAsync(RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -94,10 +94,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -110,7 +110,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<LogLineResponse> LogLineAsync(Level level, string message, string source)
|
||||
public async Task<LogLineResponse> LogLineAsync(Level level, string message, string source, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new LogLineRequest()
|
||||
{
|
||||
@@ -132,11 +132,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("logLine", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -204,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
|
||||
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -227,11 +260,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("logMultiLine", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -299,7 +365,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
||||
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -316,11 +382,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("enablePaperTrail", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -3,14 +3,38 @@
|
||||
<PropertyGroup>
|
||||
<IsPackable>true</IsPackable>
|
||||
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
||||
<Version>0.8.1</Version>
|
||||
<Version>0.9.2</Version>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Authors>LukeHagar</Authors>
|
||||
<Copyright>Copyright (c) LukeHagar 2024</Copyright>
|
||||
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageTags>Plex Media Server SDK</PackageTags>
|
||||
<Description>Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server</Description>
|
||||
<Description># Plex Media Server OpenAPI Specification
|
||||
|
||||
An Open Source OpenAPI Specification for Plex Media Server
|
||||
|
||||
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
|
||||
|
||||
## Documentation
|
||||
|
||||
[API Documentation](https://plexapi.dev)
|
||||
|
||||
## SDKs
|
||||
|
||||
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
|
||||
|
||||
| Language | Repository | Releases | Other |
|
||||
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
|
||||
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
|
||||
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
|
||||
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
|
||||
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
|
||||
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
|
||||
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||
</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This will mark the provided media key as Played.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<MarkPlayedResponse> MarkPlayedAsync(double key);
|
||||
Task<MarkPlayedResponse> MarkPlayedAsync(double key, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Mark Media Unplayed
|
||||
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This will mark the provided media key as Unplayed.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<MarkUnplayedResponse> MarkUnplayedAsync(double key);
|
||||
Task<MarkUnplayedResponse> MarkUnplayedAsync(double key, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Update Media Play Progress
|
||||
@@ -58,7 +58,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state);
|
||||
Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Banner Image
|
||||
@@ -67,7 +67,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Gets the banner image of the media item
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request);
|
||||
Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Thumb Image
|
||||
@@ -76,7 +76,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Gets the thumbnail image of the media item
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request);
|
||||
Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -90,10 +90,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -106,7 +106,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<MarkPlayedResponse> MarkPlayedAsync(double key)
|
||||
public async Task<MarkPlayedResponse> MarkPlayedAsync(double key, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new MarkPlayedRequest()
|
||||
{
|
||||
@@ -126,11 +126,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("markPlayed", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -198,7 +231,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
|
||||
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new MarkUnplayedRequest()
|
||||
{
|
||||
@@ -218,11 +251,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("markUnplayed", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -290,7 +356,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
|
||||
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new UpdatePlayProgressRequest()
|
||||
{
|
||||
@@ -312,11 +378,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("updatePlayProgress", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -384,13 +483,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request)
|
||||
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
{
|
||||
@@ -400,11 +500,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-banner-image", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -479,13 +612,14 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request)
|
||||
public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
{
|
||||
@@ -495,11 +629,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-thumb-image", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
public enum Features
|
||||
{
|
||||
[JsonProperty("Android - Dolby Vision")]
|
||||
AndroidDolbyVision,
|
||||
[JsonProperty("Android - PiP")]
|
||||
AndroidPiP,
|
||||
[JsonProperty("CU Sunset")]
|
||||
CUSunset,
|
||||
[JsonProperty("HRK_enable_EUR")]
|
||||
HRKEnableEUR,
|
||||
[JsonProperty("TREBLE-show-features")]
|
||||
TREBLEShowFeatures,
|
||||
[JsonProperty("ad-countdown-timer")]
|
||||
AdCountdownTimer,
|
||||
[JsonProperty("adaptive_bitrate")]
|
||||
AdaptiveBitrate,
|
||||
[JsonProperty("amazon-loop-debug")]
|
||||
AmazonLoopDebug,
|
||||
[JsonProperty("avod-ad-analysis")]
|
||||
AvodAdAnalysis,
|
||||
[JsonProperty("avod-new-media")]
|
||||
AvodNewMedia,
|
||||
[JsonProperty("blacklist_get_signin")]
|
||||
BlacklistGetSignin,
|
||||
[JsonProperty("client-radio-stations")]
|
||||
ClientRadioStations,
|
||||
[JsonProperty("cloudflare-turnstile-required")]
|
||||
CloudflareTurnstileRequired,
|
||||
[JsonProperty("collections")]
|
||||
Collections,
|
||||
[JsonProperty("comments_and_replies_push_notifications")]
|
||||
CommentsAndRepliesPushNotifications,
|
||||
[JsonProperty("community_access_plex_tv")]
|
||||
CommunityAccessPlexTv,
|
||||
[JsonProperty("companions_sonos")]
|
||||
CompanionsSonos,
|
||||
[JsonProperty("custom-home-removal")]
|
||||
CustomHomeRemoval,
|
||||
[JsonProperty("disable_home_user_friendships")]
|
||||
DisableHomeUserFriendships,
|
||||
[JsonProperty("disable_sharing_friendships")]
|
||||
DisableSharingFriendships,
|
||||
[JsonProperty("drm_support")]
|
||||
DrmSupport,
|
||||
[JsonProperty("exclude restrictions")]
|
||||
ExcludeRestrictions,
|
||||
[JsonProperty("federated-auth")]
|
||||
FederatedAuth,
|
||||
[JsonProperty("friend_request_push_notifications")]
|
||||
FriendRequestPushNotifications,
|
||||
[JsonProperty("guided-upgrade")]
|
||||
GuidedUpgrade,
|
||||
[JsonProperty("home")]
|
||||
Home,
|
||||
[JsonProperty("increase-password-complexity")]
|
||||
IncreasePasswordComplexity,
|
||||
[JsonProperty("ios14-privacy-banner")]
|
||||
Ios14PrivacyBanner,
|
||||
[JsonProperty("iterable-notification-tokens")]
|
||||
IterableNotificationTokens,
|
||||
[JsonProperty("keep-payment-method")]
|
||||
KeepPaymentMethod,
|
||||
[JsonProperty("kevin-bacon")]
|
||||
KevinBacon,
|
||||
[JsonProperty("korea-consent")]
|
||||
KoreaConsent,
|
||||
[JsonProperty("le_isrg_root_x1")]
|
||||
LeIsrgRootX1,
|
||||
[JsonProperty("lets_encrypt")]
|
||||
LetsEncrypt,
|
||||
[JsonProperty("lightning-dvr-pivot")]
|
||||
LightningDvrPivot,
|
||||
[JsonProperty("live-tv-support-incomplete-segments")]
|
||||
LiveTvSupportIncompleteSegments,
|
||||
[JsonProperty("livetv")]
|
||||
Livetv,
|
||||
[JsonProperty("metadata_search")]
|
||||
MetadataSearch,
|
||||
[JsonProperty("new_plex_pass_prices")]
|
||||
NewPlexPassPrices,
|
||||
[JsonProperty("news-provider-sunset-modal")]
|
||||
NewsProviderSunsetModal,
|
||||
[JsonProperty("photos-favorites")]
|
||||
PhotosFavorites,
|
||||
[JsonProperty("photos-metadata-edition")]
|
||||
PhotosMetadataEdition,
|
||||
[JsonProperty("pms_health")]
|
||||
PmsHealth,
|
||||
[JsonProperty("radio")]
|
||||
Radio,
|
||||
[JsonProperty("rate-limit-client-token")]
|
||||
RateLimitClientToken,
|
||||
[JsonProperty("scrobbling-service-plex-tv")]
|
||||
ScrobblingServicePlexTv,
|
||||
[JsonProperty("shared_server_notification")]
|
||||
SharedServerNotification,
|
||||
[JsonProperty("shared_source_notification")]
|
||||
SharedSourceNotification,
|
||||
[JsonProperty("signin_with_apple")]
|
||||
SigninWithApple,
|
||||
[JsonProperty("spring_serve_ad_provider")]
|
||||
SpringServeAdProvider,
|
||||
[JsonProperty("transcoder_cache")]
|
||||
TranscoderCache,
|
||||
[JsonProperty("tuner-sharing")]
|
||||
TunerSharing,
|
||||
[JsonProperty("two-factor-authentication")]
|
||||
TwoFactorAuthentication,
|
||||
[JsonProperty("unsupportedtuners")]
|
||||
Unsupportedtuners,
|
||||
[JsonProperty("upgrade-3ds2")]
|
||||
Upgrade3ds2,
|
||||
[JsonProperty("vod-schema")]
|
||||
VodSchema,
|
||||
[JsonProperty("vod_cloudflare")]
|
||||
VodCloudflare,
|
||||
[JsonProperty("watch-together-invite")]
|
||||
WatchTogetherInvite,
|
||||
[JsonProperty("web_server_dashboard")]
|
||||
WebServerDashboard,
|
||||
}
|
||||
|
||||
public static class FeaturesExtension
|
||||
{
|
||||
public static string Value(this Features value)
|
||||
{
|
||||
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
|
||||
}
|
||||
|
||||
public static Features ToEnum(this string value)
|
||||
{
|
||||
foreach(var field in typeof(Features).GetFields())
|
||||
{
|
||||
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var attribute = attributes[0] as JsonPropertyAttribute;
|
||||
if (attribute != null && attribute.PropertyName == value)
|
||||
{
|
||||
var enumVal = field.GetValue(null);
|
||||
|
||||
if (enumVal is Features)
|
||||
{
|
||||
return (Features)enumVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Unknown value {value} for enum Features");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -90,6 +90,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public int Hidden { get; set; } = default!;
|
||||
|
||||
[JsonProperty("Location")]
|
||||
public List<Location> Location { get; set; } = default!;
|
||||
public List<GetAllLibrariesLocation> Location { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -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!;
|
||||
}
|
||||
}
|
||||
@@ -33,9 +33,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public long Upscale { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Plex Authentication Token
|
||||
/// An authentication token, obtained from plex.tv
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token")]
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")]
|
||||
public string XPlexToken { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -21,43 +21,43 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
[JsonProperty("duration")]
|
||||
public int Duration { get; set; } = default!;
|
||||
public int? Duration { get; set; }
|
||||
|
||||
[JsonProperty("bitrate")]
|
||||
public int Bitrate { get; set; } = default!;
|
||||
public int? Bitrate { get; set; }
|
||||
|
||||
[JsonProperty("width")]
|
||||
public int Width { get; set; } = default!;
|
||||
public int? Width { get; set; }
|
||||
|
||||
[JsonProperty("height")]
|
||||
public int Height { get; set; } = default!;
|
||||
public int? Height { get; set; }
|
||||
|
||||
[JsonProperty("aspectRatio")]
|
||||
public double AspectRatio { get; set; } = default!;
|
||||
public double? AspectRatio { get; set; }
|
||||
|
||||
[JsonProperty("audioProfile")]
|
||||
public string? AudioProfile { get; set; }
|
||||
|
||||
[JsonProperty("audioChannels")]
|
||||
public int AudioChannels { get; set; } = default!;
|
||||
public int? AudioChannels { get; set; }
|
||||
|
||||
[JsonProperty("audioCodec")]
|
||||
public string AudioCodec { get; set; } = default!;
|
||||
public string? AudioCodec { get; set; }
|
||||
|
||||
[JsonProperty("videoCodec")]
|
||||
public string VideoCodec { get; set; } = default!;
|
||||
public string? VideoCodec { get; set; }
|
||||
|
||||
[JsonProperty("videoResolution")]
|
||||
public string VideoResolution { get; set; } = default!;
|
||||
public string? VideoResolution { get; set; }
|
||||
|
||||
[JsonProperty("container")]
|
||||
public string Container { get; set; } = default!;
|
||||
|
||||
[JsonProperty("videoFrameRate")]
|
||||
public string VideoFrameRate { get; set; } = default!;
|
||||
public string? VideoFrameRate { get; set; }
|
||||
|
||||
[JsonProperty("videoProfile")]
|
||||
public string VideoProfile { get; set; } = default!;
|
||||
public string? VideoProfile { get; set; }
|
||||
|
||||
[JsonProperty("hasVoiceActivity")]
|
||||
public bool? HasVoiceActivity { get; set; }
|
||||
|
||||
@@ -199,6 +199,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
[JsonProperty("Role")]
|
||||
public List<GetLibraryItemsRole>? Role { get; set; }
|
||||
|
||||
[JsonProperty("Location")]
|
||||
public List<GetLibraryItemsLocation>? Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/>
|
||||
///
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Key { get; set; } = default!;
|
||||
|
||||
[JsonProperty("duration")]
|
||||
public int Duration { get; set; } = default!;
|
||||
public int? Duration { get; set; }
|
||||
|
||||
[JsonProperty("file")]
|
||||
public string File { get; set; } = default!;
|
||||
@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public bool? OptimizedForStreaming { get; set; }
|
||||
|
||||
[JsonProperty("videoProfile")]
|
||||
public string VideoProfile { get; set; } = default!;
|
||||
public string? VideoProfile { get; set; }
|
||||
|
||||
[JsonProperty("indexes")]
|
||||
public string? Indexes { get; set; }
|
||||
|
||||
@@ -15,6 +15,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class GetLibraryItemsRequest
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// A key representing a specific tag within the section.
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tag")]
|
||||
public Tag Tag { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The unique key of the Plex library. <br/>
|
||||
///
|
||||
@@ -26,12 +32,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")]
|
||||
public int SectionKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// A key representing a specific tag within the section.
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tag")]
|
||||
public Tag Tag { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the Guids object to the response<br/>
|
||||
///
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Plex Authentication Token
|
||||
/// An authentication token, obtained from plex.tv
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token")]
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")]
|
||||
public string XPlexToken { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -27,27 +27,33 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public bool? Strong { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier for the client application<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// This is used to track the client application and its usage<br/>
|
||||
/// (UUID, serial number, or other number unique per device)<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier")]
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
|
||||
public string? ClientID { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product")]
|
||||
/// <summary>
|
||||
/// The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product")]
|
||||
public string? ClientName { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device")]
|
||||
public string? DeviceName { get; set; }
|
||||
/// <summary>
|
||||
/// A relatively friendly name for the client device
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device")]
|
||||
public string? DeviceNickname { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version")]
|
||||
/// <summary>
|
||||
/// The version of the client application.
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version")]
|
||||
public string? ClientVersion { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform")]
|
||||
public string? ClientPlatform { get; set; }
|
||||
/// <summary>
|
||||
/// The platform of the client application.
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform")]
|
||||
public string? Platform { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -199,6 +199,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
[JsonProperty("Role")]
|
||||
public List<Role>? Role { get; set; }
|
||||
|
||||
[JsonProperty("Location")]
|
||||
public List<Location>? Location { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/>
|
||||
///
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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!;
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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!;
|
||||
}
|
||||
}
|
||||
@@ -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!;
|
||||
}
|
||||
}
|
||||
@@ -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!;
|
||||
}
|
||||
}
|
||||
@@ -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!;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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!;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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!;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -37,5 +37,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeIPv6")]
|
||||
public IncludeIPv6? IncludeIPv6 { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.Disable;
|
||||
|
||||
/// <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; }
|
||||
}
|
||||
}
|
||||
@@ -33,9 +33,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public long Upscale { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Plex Authentication Token
|
||||
/// An authentication token, obtained from plex.tv
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token")]
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")]
|
||||
public string XPlexToken { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -19,5 +19,35 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=pinID")]
|
||||
public long PinID { 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>
|
||||
/// The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product")]
|
||||
public string? ClientName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A relatively friendly name for the client device
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device")]
|
||||
public string? DeviceNickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The version of the client application.
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version")]
|
||||
public string? ClientVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The platform of the client application.
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform")]
|
||||
public string? Platform { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
public enum 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("amazon-loop-debug")]
|
||||
AmazonLoopDebug,
|
||||
[JsonProperty("avod-ad-analysis")]
|
||||
AvodAdAnalysis,
|
||||
[JsonProperty("avod-new-media")]
|
||||
AvodNewMedia,
|
||||
[JsonProperty("blacklist_get_signin")]
|
||||
BlacklistGetSignin,
|
||||
[JsonProperty("client-radio-stations")]
|
||||
ClientRadioStations,
|
||||
[JsonProperty("cloudflare-turnstile-required")]
|
||||
CloudflareTurnstileRequired,
|
||||
[JsonProperty("collections")]
|
||||
Collections,
|
||||
[JsonProperty("comments_and_replies_push_notifications")]
|
||||
CommentsAndRepliesPushNotifications,
|
||||
[JsonProperty("community_access_plex_tv")]
|
||||
CommunityAccessPlexTv,
|
||||
[JsonProperty("companions_sonos")]
|
||||
CompanionsSonos,
|
||||
[JsonProperty("custom-home-removal")]
|
||||
CustomHomeRemoval,
|
||||
[JsonProperty("disable_home_user_friendships")]
|
||||
DisableHomeUserFriendships,
|
||||
[JsonProperty("disable_sharing_friendships")]
|
||||
DisableSharingFriendships,
|
||||
[JsonProperty("drm_support")]
|
||||
DrmSupport,
|
||||
[JsonProperty("exclude restrictions")]
|
||||
ExcludeRestrictions,
|
||||
[JsonProperty("federated-auth")]
|
||||
FederatedAuth,
|
||||
[JsonProperty("friend_request_push_notifications")]
|
||||
FriendRequestPushNotifications,
|
||||
[JsonProperty("guided-upgrade")]
|
||||
GuidedUpgrade,
|
||||
[JsonProperty("home")]
|
||||
Home,
|
||||
[JsonProperty("increase-password-complexity")]
|
||||
IncreasePasswordComplexity,
|
||||
[JsonProperty("ios14-privacy-banner")]
|
||||
Ios14PrivacyBanner,
|
||||
[JsonProperty("iterable-notification-tokens")]
|
||||
IterableNotificationTokens,
|
||||
[JsonProperty("keep-payment-method")]
|
||||
KeepPaymentMethod,
|
||||
[JsonProperty("kevin-bacon")]
|
||||
KevinBacon,
|
||||
[JsonProperty("korea-consent")]
|
||||
KoreaConsent,
|
||||
[JsonProperty("le_isrg_root_x1")]
|
||||
LeIsrgRootX1,
|
||||
[JsonProperty("lets_encrypt")]
|
||||
LetsEncrypt,
|
||||
[JsonProperty("lightning-dvr-pivot")]
|
||||
LightningDvrPivot,
|
||||
[JsonProperty("live-tv-support-incomplete-segments")]
|
||||
LiveTvSupportIncompleteSegments,
|
||||
[JsonProperty("livetv")]
|
||||
Livetv,
|
||||
[JsonProperty("metadata_search")]
|
||||
MetadataSearch,
|
||||
[JsonProperty("new_plex_pass_prices")]
|
||||
NewPlexPassPrices,
|
||||
[JsonProperty("news-provider-sunset-modal")]
|
||||
NewsProviderSunsetModal,
|
||||
[JsonProperty("photos-favorites")]
|
||||
PhotosFavorites,
|
||||
[JsonProperty("photos-metadata-edition")]
|
||||
PhotosMetadataEdition,
|
||||
[JsonProperty("pms_health")]
|
||||
PmsHealth,
|
||||
[JsonProperty("radio")]
|
||||
Radio,
|
||||
[JsonProperty("rate-limit-client-token")]
|
||||
RateLimitClientToken,
|
||||
[JsonProperty("scrobbling-service-plex-tv")]
|
||||
ScrobblingServicePlexTv,
|
||||
[JsonProperty("shared_server_notification")]
|
||||
SharedServerNotification,
|
||||
[JsonProperty("shared_source_notification")]
|
||||
SharedSourceNotification,
|
||||
[JsonProperty("signin_with_apple")]
|
||||
SigninWithApple,
|
||||
[JsonProperty("spring_serve_ad_provider")]
|
||||
SpringServeAdProvider,
|
||||
[JsonProperty("transcoder_cache")]
|
||||
TranscoderCache,
|
||||
[JsonProperty("tuner-sharing")]
|
||||
TunerSharing,
|
||||
[JsonProperty("two-factor-authentication")]
|
||||
TwoFactorAuthentication,
|
||||
[JsonProperty("unsupportedtuners")]
|
||||
Unsupportedtuners,
|
||||
[JsonProperty("upgrade-3ds2")]
|
||||
Upgrade3ds2,
|
||||
[JsonProperty("vod-schema")]
|
||||
VodSchema,
|
||||
[JsonProperty("vod_cloudflare")]
|
||||
VodCloudflare,
|
||||
[JsonProperty("watch-together-invite")]
|
||||
WatchTogetherInvite,
|
||||
[JsonProperty("web_server_dashboard")]
|
||||
WebServerDashboard,
|
||||
}
|
||||
|
||||
public static class 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// List of features allowed on your Plex Pass subscription
|
||||
/// </summary>
|
||||
[JsonProperty("features")]
|
||||
public List<GetTokenDetailsFeatures>? Features { get; set; }
|
||||
public List<string>? Features { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the account's Plex Pass subscription is active
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public bool? MailingListActive { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Your current mailing list status
|
||||
/// Your current mailing list status (active or unsubscribed)
|
||||
/// </summary>
|
||||
[JsonProperty("mailingListStatus")]
|
||||
public MailingListStatus MailingListStatus { get; set; } = default!;
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public Filter Filter { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Plex Authentication Token
|
||||
/// An authentication token, obtained from plex.tv
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token")]
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")]
|
||||
public string XPlexToken { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -15,10 +15,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public class Location
|
||||
{
|
||||
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
[JsonProperty("path")]
|
||||
public string Path { get; set; } = default!;
|
||||
public string? Path { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Your current mailing list status
|
||||
/// Your current mailing list status (active or unsubscribed)
|
||||
/// </summary>
|
||||
public enum MailingListStatus
|
||||
{
|
||||
|
||||
@@ -21,43 +21,43 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public int Id { get; set; } = default!;
|
||||
|
||||
[JsonProperty("duration")]
|
||||
public int Duration { get; set; } = default!;
|
||||
public int? Duration { get; set; }
|
||||
|
||||
[JsonProperty("bitrate")]
|
||||
public int Bitrate { get; set; } = default!;
|
||||
public int? Bitrate { get; set; }
|
||||
|
||||
[JsonProperty("width")]
|
||||
public int Width { get; set; } = default!;
|
||||
public int? Width { get; set; }
|
||||
|
||||
[JsonProperty("height")]
|
||||
public int Height { get; set; } = default!;
|
||||
public int? Height { get; set; }
|
||||
|
||||
[JsonProperty("aspectRatio")]
|
||||
public double AspectRatio { get; set; } = default!;
|
||||
public double? AspectRatio { get; set; }
|
||||
|
||||
[JsonProperty("audioProfile")]
|
||||
public string? AudioProfile { get; set; }
|
||||
|
||||
[JsonProperty("audioChannels")]
|
||||
public int AudioChannels { get; set; } = default!;
|
||||
public int? AudioChannels { get; set; }
|
||||
|
||||
[JsonProperty("audioCodec")]
|
||||
public string AudioCodec { get; set; } = default!;
|
||||
public string? AudioCodec { get; set; }
|
||||
|
||||
[JsonProperty("videoCodec")]
|
||||
public string VideoCodec { get; set; } = default!;
|
||||
public string? VideoCodec { get; set; }
|
||||
|
||||
[JsonProperty("videoResolution")]
|
||||
public string VideoResolution { get; set; } = default!;
|
||||
public string? VideoResolution { get; set; }
|
||||
|
||||
[JsonProperty("container")]
|
||||
public string Container { get; set; } = default!;
|
||||
|
||||
[JsonProperty("videoFrameRate")]
|
||||
public string VideoFrameRate { get; set; } = default!;
|
||||
public string? VideoFrameRate { get; set; }
|
||||
|
||||
[JsonProperty("videoProfile")]
|
||||
public string VideoProfile { get; set; } = default!;
|
||||
public string? VideoProfile { get; set; }
|
||||
|
||||
[JsonProperty("hasVoiceActivity")]
|
||||
public bool? HasVoiceActivity { get; set; }
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public string Key { get; set; } = default!;
|
||||
|
||||
[JsonProperty("duration")]
|
||||
public int Duration { get; set; } = default!;
|
||||
public int? Duration { get; set; }
|
||||
|
||||
[JsonProperty("file")]
|
||||
public string File { get; set; } = default!;
|
||||
@@ -52,7 +52,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public bool? OptimizedForStreaming { get; set; }
|
||||
|
||||
[JsonProperty("videoProfile")]
|
||||
public string VideoProfile { get; set; } = default!;
|
||||
public string? VideoProfile { get; set; }
|
||||
|
||||
[JsonProperty("indexes")]
|
||||
public string? Indexes { get; set; }
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
public enum 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("amazon-loop-debug")]
|
||||
AmazonLoopDebug,
|
||||
[JsonProperty("avod-ad-analysis")]
|
||||
AvodAdAnalysis,
|
||||
[JsonProperty("avod-new-media")]
|
||||
AvodNewMedia,
|
||||
[JsonProperty("blacklist_get_signin")]
|
||||
BlacklistGetSignin,
|
||||
[JsonProperty("client-radio-stations")]
|
||||
ClientRadioStations,
|
||||
[JsonProperty("cloudflare-turnstile-required")]
|
||||
CloudflareTurnstileRequired,
|
||||
[JsonProperty("collections")]
|
||||
Collections,
|
||||
[JsonProperty("comments_and_replies_push_notifications")]
|
||||
CommentsAndRepliesPushNotifications,
|
||||
[JsonProperty("community_access_plex_tv")]
|
||||
CommunityAccessPlexTv,
|
||||
[JsonProperty("companions_sonos")]
|
||||
CompanionsSonos,
|
||||
[JsonProperty("custom-home-removal")]
|
||||
CustomHomeRemoval,
|
||||
[JsonProperty("disable_home_user_friendships")]
|
||||
DisableHomeUserFriendships,
|
||||
[JsonProperty("disable_sharing_friendships")]
|
||||
DisableSharingFriendships,
|
||||
[JsonProperty("drm_support")]
|
||||
DrmSupport,
|
||||
[JsonProperty("exclude restrictions")]
|
||||
ExcludeRestrictions,
|
||||
[JsonProperty("federated-auth")]
|
||||
FederatedAuth,
|
||||
[JsonProperty("friend_request_push_notifications")]
|
||||
FriendRequestPushNotifications,
|
||||
[JsonProperty("guided-upgrade")]
|
||||
GuidedUpgrade,
|
||||
[JsonProperty("home")]
|
||||
Home,
|
||||
[JsonProperty("increase-password-complexity")]
|
||||
IncreasePasswordComplexity,
|
||||
[JsonProperty("ios14-privacy-banner")]
|
||||
Ios14PrivacyBanner,
|
||||
[JsonProperty("iterable-notification-tokens")]
|
||||
IterableNotificationTokens,
|
||||
[JsonProperty("keep-payment-method")]
|
||||
KeepPaymentMethod,
|
||||
[JsonProperty("kevin-bacon")]
|
||||
KevinBacon,
|
||||
[JsonProperty("korea-consent")]
|
||||
KoreaConsent,
|
||||
[JsonProperty("le_isrg_root_x1")]
|
||||
LeIsrgRootX1,
|
||||
[JsonProperty("lets_encrypt")]
|
||||
LetsEncrypt,
|
||||
[JsonProperty("lightning-dvr-pivot")]
|
||||
LightningDvrPivot,
|
||||
[JsonProperty("live-tv-support-incomplete-segments")]
|
||||
LiveTvSupportIncompleteSegments,
|
||||
[JsonProperty("livetv")]
|
||||
Livetv,
|
||||
[JsonProperty("metadata_search")]
|
||||
MetadataSearch,
|
||||
[JsonProperty("new_plex_pass_prices")]
|
||||
NewPlexPassPrices,
|
||||
[JsonProperty("news-provider-sunset-modal")]
|
||||
NewsProviderSunsetModal,
|
||||
[JsonProperty("photos-favorites")]
|
||||
PhotosFavorites,
|
||||
[JsonProperty("photos-metadata-edition")]
|
||||
PhotosMetadataEdition,
|
||||
[JsonProperty("pms_health")]
|
||||
PmsHealth,
|
||||
[JsonProperty("radio")]
|
||||
Radio,
|
||||
[JsonProperty("rate-limit-client-token")]
|
||||
RateLimitClientToken,
|
||||
[JsonProperty("scrobbling-service-plex-tv")]
|
||||
ScrobblingServicePlexTv,
|
||||
[JsonProperty("shared_server_notification")]
|
||||
SharedServerNotification,
|
||||
[JsonProperty("shared_source_notification")]
|
||||
SharedSourceNotification,
|
||||
[JsonProperty("signin_with_apple")]
|
||||
SigninWithApple,
|
||||
[JsonProperty("spring_serve_ad_provider")]
|
||||
SpringServeAdProvider,
|
||||
[JsonProperty("transcoder_cache")]
|
||||
TranscoderCache,
|
||||
[JsonProperty("tuner-sharing")]
|
||||
TunerSharing,
|
||||
[JsonProperty("two-factor-authentication")]
|
||||
TwoFactorAuthentication,
|
||||
[JsonProperty("unsupportedtuners")]
|
||||
Unsupportedtuners,
|
||||
[JsonProperty("upgrade-3ds2")]
|
||||
Upgrade3ds2,
|
||||
[JsonProperty("vod-schema")]
|
||||
VodSchema,
|
||||
[JsonProperty("vod_cloudflare")]
|
||||
VodCloudflare,
|
||||
[JsonProperty("watch-together-invite")]
|
||||
WatchTogetherInvite,
|
||||
[JsonProperty("web_server_dashboard")]
|
||||
WebServerDashboard,
|
||||
}
|
||||
|
||||
public static class 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// List of features allowed on your Plex Pass subscription
|
||||
/// </summary>
|
||||
[JsonProperty("features")]
|
||||
public List<PostUsersSignInDataAuthenticationFeatures>? Features { get; set; }
|
||||
public List<string>? Features { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the account's Plex Pass subscription is active
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
#nullable enable
|
||||
namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
using LukeHagar.PlexAPI.SDK.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
public enum 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("amazon-loop-debug")]
|
||||
AmazonLoopDebug,
|
||||
[JsonProperty("avod-ad-analysis")]
|
||||
AvodAdAnalysis,
|
||||
[JsonProperty("avod-new-media")]
|
||||
AvodNewMedia,
|
||||
[JsonProperty("blacklist_get_signin")]
|
||||
BlacklistGetSignin,
|
||||
[JsonProperty("client-radio-stations")]
|
||||
ClientRadioStations,
|
||||
[JsonProperty("cloudflare-turnstile-required")]
|
||||
CloudflareTurnstileRequired,
|
||||
[JsonProperty("collections")]
|
||||
Collections,
|
||||
[JsonProperty("comments_and_replies_push_notifications")]
|
||||
CommentsAndRepliesPushNotifications,
|
||||
[JsonProperty("community_access_plex_tv")]
|
||||
CommunityAccessPlexTv,
|
||||
[JsonProperty("companions_sonos")]
|
||||
CompanionsSonos,
|
||||
[JsonProperty("custom-home-removal")]
|
||||
CustomHomeRemoval,
|
||||
[JsonProperty("disable_home_user_friendships")]
|
||||
DisableHomeUserFriendships,
|
||||
[JsonProperty("disable_sharing_friendships")]
|
||||
DisableSharingFriendships,
|
||||
[JsonProperty("drm_support")]
|
||||
DrmSupport,
|
||||
[JsonProperty("exclude restrictions")]
|
||||
ExcludeRestrictions,
|
||||
[JsonProperty("federated-auth")]
|
||||
FederatedAuth,
|
||||
[JsonProperty("friend_request_push_notifications")]
|
||||
FriendRequestPushNotifications,
|
||||
[JsonProperty("guided-upgrade")]
|
||||
GuidedUpgrade,
|
||||
[JsonProperty("home")]
|
||||
Home,
|
||||
[JsonProperty("increase-password-complexity")]
|
||||
IncreasePasswordComplexity,
|
||||
[JsonProperty("ios14-privacy-banner")]
|
||||
Ios14PrivacyBanner,
|
||||
[JsonProperty("iterable-notification-tokens")]
|
||||
IterableNotificationTokens,
|
||||
[JsonProperty("keep-payment-method")]
|
||||
KeepPaymentMethod,
|
||||
[JsonProperty("kevin-bacon")]
|
||||
KevinBacon,
|
||||
[JsonProperty("korea-consent")]
|
||||
KoreaConsent,
|
||||
[JsonProperty("le_isrg_root_x1")]
|
||||
LeIsrgRootX1,
|
||||
[JsonProperty("lets_encrypt")]
|
||||
LetsEncrypt,
|
||||
[JsonProperty("lightning-dvr-pivot")]
|
||||
LightningDvrPivot,
|
||||
[JsonProperty("live-tv-support-incomplete-segments")]
|
||||
LiveTvSupportIncompleteSegments,
|
||||
[JsonProperty("livetv")]
|
||||
Livetv,
|
||||
[JsonProperty("metadata_search")]
|
||||
MetadataSearch,
|
||||
[JsonProperty("new_plex_pass_prices")]
|
||||
NewPlexPassPrices,
|
||||
[JsonProperty("news-provider-sunset-modal")]
|
||||
NewsProviderSunsetModal,
|
||||
[JsonProperty("photos-favorites")]
|
||||
PhotosFavorites,
|
||||
[JsonProperty("photos-metadata-edition")]
|
||||
PhotosMetadataEdition,
|
||||
[JsonProperty("pms_health")]
|
||||
PmsHealth,
|
||||
[JsonProperty("radio")]
|
||||
Radio,
|
||||
[JsonProperty("rate-limit-client-token")]
|
||||
RateLimitClientToken,
|
||||
[JsonProperty("scrobbling-service-plex-tv")]
|
||||
ScrobblingServicePlexTv,
|
||||
[JsonProperty("shared_server_notification")]
|
||||
SharedServerNotification,
|
||||
[JsonProperty("shared_source_notification")]
|
||||
SharedSourceNotification,
|
||||
[JsonProperty("signin_with_apple")]
|
||||
SigninWithApple,
|
||||
[JsonProperty("spring_serve_ad_provider")]
|
||||
SpringServeAdProvider,
|
||||
[JsonProperty("transcoder_cache")]
|
||||
TranscoderCache,
|
||||
[JsonProperty("tuner-sharing")]
|
||||
TunerSharing,
|
||||
[JsonProperty("two-factor-authentication")]
|
||||
TwoFactorAuthentication,
|
||||
[JsonProperty("unsupportedtuners")]
|
||||
Unsupportedtuners,
|
||||
[JsonProperty("upgrade-3ds2")]
|
||||
Upgrade3ds2,
|
||||
[JsonProperty("vod-schema")]
|
||||
VodSchema,
|
||||
[JsonProperty("vod_cloudflare")]
|
||||
VodCloudflare,
|
||||
[JsonProperty("watch-together-invite")]
|
||||
WatchTogetherInvite,
|
||||
[JsonProperty("web_server_dashboard")]
|
||||
WebServerDashboard,
|
||||
}
|
||||
|
||||
public static class 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Your current mailing list status
|
||||
/// Your current mailing list status (active or unsubscribed)
|
||||
/// </summary>
|
||||
public enum PostUsersSignInDataMailingListStatus
|
||||
{
|
||||
|
||||
@@ -16,28 +16,34 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier for the client application<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// This is used to track the client application and its usage<br/>
|
||||
/// (UUID, serial number, or other number unique per device)<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier")]
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
|
||||
public string? ClientID { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product")]
|
||||
/// <summary>
|
||||
/// The name of the client application. (Plex Web, Plex Media Server, etc.)
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product")]
|
||||
public string? ClientName { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device")]
|
||||
public string? DeviceName { get; set; }
|
||||
/// <summary>
|
||||
/// A relatively friendly name for the client device
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device")]
|
||||
public string? DeviceNickname { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version")]
|
||||
/// <summary>
|
||||
/// The version of the client application.
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version")]
|
||||
public string? ClientVersion { get; set; }
|
||||
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform")]
|
||||
public string? ClientPlatform { get; set; }
|
||||
/// <summary>
|
||||
/// The platform of the client application.
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform")]
|
||||
public string? Platform { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Login credentials
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// List of features allowed on your Plex Pass subscription
|
||||
/// </summary>
|
||||
[JsonProperty("features")]
|
||||
public List<PostUsersSignInDataFeatures>? Features { get; set; }
|
||||
public List<string>? Features { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the account's Plex Pass subscription is active
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
public bool? MailingListActive { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Your current mailing list status
|
||||
/// Your current mailing list status (active or unsubscribed)
|
||||
/// </summary>
|
||||
[JsonProperty("mailingListStatus")]
|
||||
public PostUsersSignInDataMailingListStatus MailingListStatus { get; set; } = default!;
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
}
|
||||
25
LukeHagar/PlexAPI/SDK/Models/Requests/SearchResult.cs
Normal file
25
LukeHagar/PlexAPI/SDK/Models/Requests/SearchResult.cs
Normal 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!;
|
||||
}
|
||||
}
|
||||
63
LukeHagar/PlexAPI/SDK/Models/Requests/SearchTypes.cs
Normal file
63
LukeHagar/PlexAPI/SDK/Models/Requests/SearchTypes.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
|
||||
/// List of features allowed on your Plex Pass subscription
|
||||
/// </summary>
|
||||
[JsonProperty("features")]
|
||||
public List<Features>? Features { get; set; }
|
||||
public List<string>? Features { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the account's Plex Pass subscription is active
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request);
|
||||
Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get All Playlists
|
||||
@@ -54,7 +54,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get All Playlists given the specified filters.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null);
|
||||
Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Playlist
|
||||
@@ -65,7 +65,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID);
|
||||
Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a Playlist
|
||||
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID);
|
||||
Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Update a Playlist
|
||||
@@ -85,7 +85,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null);
|
||||
Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Playlist Contents
|
||||
@@ -98,7 +98,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type);
|
||||
Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Delete Playlist Contents
|
||||
@@ -108,7 +108,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID);
|
||||
Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Adding to a Playlist
|
||||
@@ -119,7 +119,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null);
|
||||
Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Upload Playlist
|
||||
@@ -129,7 +129,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID);
|
||||
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -146,10 +146,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -162,7 +162,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request)
|
||||
public async Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/playlists", request);
|
||||
@@ -178,11 +178,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("createPlaylist", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -258,7 +291,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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)
|
||||
public async Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetPlaylistsRequest()
|
||||
{
|
||||
@@ -279,11 +312,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getPlaylists", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -359,7 +425,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID)
|
||||
public async Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetPlaylistRequest()
|
||||
{
|
||||
@@ -379,11 +445,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getPlaylist", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -459,7 +558,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID)
|
||||
public async Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new DeletePlaylistRequest()
|
||||
{
|
||||
@@ -479,11 +578,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("deletePlaylist", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -551,7 +683,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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)
|
||||
public async Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new UpdatePlaylistRequest()
|
||||
{
|
||||
@@ -573,11 +705,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("updatePlaylist", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -645,7 +810,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type)
|
||||
public async Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetPlaylistContentsRequest()
|
||||
{
|
||||
@@ -666,11 +831,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getPlaylistContents", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -746,7 +944,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID)
|
||||
public async Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new ClearPlaylistContentsRequest()
|
||||
{
|
||||
@@ -766,11 +964,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("clearPlaylistContents", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -838,7 +1069,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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)
|
||||
public async Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new AddPlaylistContentsRequest()
|
||||
{
|
||||
@@ -860,11 +1091,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("addPlaylistContents", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -940,7 +1204,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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)
|
||||
public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new UploadPlaylistRequest()
|
||||
{
|
||||
@@ -962,11 +1226,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("uploadPlaylist", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Companions Data
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null);
|
||||
Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get list of friends of the user logged in
|
||||
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get friends of provided auth token.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null);
|
||||
Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Geo Data
|
||||
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Returns the geolocation and locale data of the caller
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null);
|
||||
Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetHomeDataResponse> GetHomeDataAsync();
|
||||
Task<GetHomeDataResponse> GetHomeDataAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Server Resources
|
||||
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Plex server access tokens and server connections
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? serverUrl = null);
|
||||
Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get a Pin
|
||||
@@ -84,7 +84,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Retrieve a Pin ID from Plex.tv to use for authentication flows
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null);
|
||||
Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(long pinID, string? serverUrl = null);
|
||||
Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -109,44 +109,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// List of server URLs available for the getCompanionsData operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetCompanionsDataServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
/// <summary>
|
||||
/// List of server URLs available for the getUserFriends operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetUserFriendsServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
/// <summary>
|
||||
/// List of server URLs available for the getGeoData operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetGeoDataServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
/// <summary>
|
||||
/// List of server URLs available for the get-server-resources operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetServerResourcesServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
/// <summary>
|
||||
/// List of server URLs available for the getPin operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetPinServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
/// <summary>
|
||||
/// List of server URLs available for the getTokenByPinId operation.
|
||||
/// </summary>
|
||||
public static readonly string[] GetTokenByPinIdServerList = {
|
||||
"https://plex.tv/api/v2/",
|
||||
"https://plex.tv/api/v2",
|
||||
};
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -159,7 +159,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null)
|
||||
public async Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = Utilities.TemplateUrl(GetCompanionsDataServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
@@ -181,11 +181,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getCompanionsData", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -261,7 +294,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null)
|
||||
public async Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = Utilities.TemplateUrl(GetUserFriendsServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
@@ -283,11 +316,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getUserFriends", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -363,7 +429,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null)
|
||||
public async Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = Utilities.TemplateUrl(GetGeoDataServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
@@ -380,11 +446,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getGeoData", null, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -460,7 +559,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetHomeDataResponse> GetHomeDataAsync()
|
||||
public async Task<GetHomeDataResponse> GetHomeDataAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -477,11 +576,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getHomeData", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -557,14 +689,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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? serverUrl = null)
|
||||
public async Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetServerResourcesRequest()
|
||||
{
|
||||
IncludeHttps = includeHttps,
|
||||
IncludeRelay = includeRelay,
|
||||
IncludeIPv6 = includeIPv6,
|
||||
ClientID = clientID,
|
||||
};
|
||||
request.ClientID ??= SDKConfiguration.ClientID;
|
||||
|
||||
string baseUrl = Utilities.TemplateUrl(GetServerResourcesServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
if (serverUrl != null)
|
||||
@@ -575,6 +710,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
{
|
||||
@@ -584,11 +720,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-server-resources", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -664,13 +833,13 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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)
|
||||
public async Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
request.ClientID ??= SDKConfiguration.ClientID;
|
||||
request.ClientName ??= SDKConfiguration.ClientName;
|
||||
request.ClientVersion ??= SDKConfiguration.ClientVersion;
|
||||
request.ClientPlatform ??= SDKConfiguration.ClientPlatform;
|
||||
request.DeviceName ??= SDKConfiguration.DeviceName;
|
||||
request.Platform ??= SDKConfiguration.Platform;
|
||||
request.DeviceNickname ??= SDKConfiguration.DeviceNickname;
|
||||
|
||||
string baseUrl = Utilities.TemplateUrl(GetPinServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
@@ -682,15 +851,49 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
var hookCtx = new HookContext("getPin", null, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -755,12 +958,18 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(long pinID, string? serverUrl = null)
|
||||
public async Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetTokenByPinIdRequest()
|
||||
if (request == null)
|
||||
{
|
||||
PinID = pinID,
|
||||
};
|
||||
request = new GetTokenByPinIdRequest();
|
||||
}
|
||||
request.ClientID ??= SDKConfiguration.ClientID;
|
||||
request.ClientName ??= SDKConfiguration.ClientName;
|
||||
request.ClientVersion ??= SDKConfiguration.ClientVersion;
|
||||
request.Platform ??= SDKConfiguration.Platform;
|
||||
request.DeviceNickname ??= SDKConfiguration.DeviceNickname;
|
||||
|
||||
string baseUrl = Utilities.TemplateUrl(GetTokenByPinIdServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
if (serverUrl != null)
|
||||
@@ -771,15 +980,49 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
var hookCtx = new HookContext("getTokenByPinId", null, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -67,6 +67,34 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
/// <summary>
|
||||
/// Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
///
|
||||
/// <remarks>
|
||||
/// # Plex Media Server OpenAPI Specification<br/>
|
||||
/// <br/>
|
||||
/// An Open Source OpenAPI Specification for Plex Media Server<br/>
|
||||
/// <br/>
|
||||
/// Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
|
||||
/// <br/>
|
||||
/// ## Documentation<br/>
|
||||
/// <br/>
|
||||
/// <a href="https://plexapi.dev">API Documentation</a><br/>
|
||||
/// <br/>
|
||||
/// ## 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 <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
|
||||
/// <br/>
|
||||
/// | Language | Repository | Releases | Other |<br/>
|
||||
/// | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
|
||||
/// | Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
|
||||
/// | 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 | <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 | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/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/>
|
||||
/// | 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/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public interface IPlexAPI
|
||||
{
|
||||
@@ -241,8 +269,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
public string? ClientID;
|
||||
public string? ClientName;
|
||||
public string? ClientVersion;
|
||||
public string? ClientPlatform;
|
||||
public string? DeviceName;
|
||||
public string? Platform;
|
||||
public string? DeviceNickname;
|
||||
public SDKHooks Hooks = new SDKHooks();
|
||||
public RetryConfig? RetryConfig = null;
|
||||
|
||||
@@ -269,16 +297,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
/// <summary>
|
||||
/// Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
///
|
||||
/// <remarks>
|
||||
/// # Plex Media Server OpenAPI Specification<br/>
|
||||
/// <br/>
|
||||
/// An Open Source OpenAPI Specification for Plex Media Server<br/>
|
||||
/// <br/>
|
||||
/// Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
|
||||
/// <br/>
|
||||
/// ## Documentation<br/>
|
||||
/// <br/>
|
||||
/// <a href="https://plexapi.dev">API Documentation</a><br/>
|
||||
/// <br/>
|
||||
/// ## 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 <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
|
||||
/// <br/>
|
||||
/// | Language | Repository | Releases | Other |<br/>
|
||||
/// | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
|
||||
/// | Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
|
||||
/// | 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 | <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 | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/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/>
|
||||
/// | 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/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class PlexAPI: IPlexAPI
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private int _serverIndex = 0;
|
||||
private ISpeakeasyHttpClient _client;
|
||||
@@ -300,7 +356,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
public ISessions Sessions { get; private set; }
|
||||
public IUpdater Updater { get; private set; }
|
||||
|
||||
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, string? clientID = null, string? clientName = null, string? clientVersion = null, string? clientPlatform = null, string? deviceName = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
|
||||
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, string? clientID = null, string? clientName = null, string? clientVersion = null, string? platform = null, string? deviceNickname = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
if (serverIndex != null)
|
||||
{
|
||||
@@ -345,8 +401,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
ClientID = clientID,
|
||||
ClientName = clientName,
|
||||
ClientVersion = clientVersion,
|
||||
ClientPlatform = clientPlatform,
|
||||
DeviceName = deviceName,
|
||||
Platform = platform,
|
||||
DeviceNickname = deviceNickname,
|
||||
ServerDefaults = serverDefaults,
|
||||
ServerIndex = _serverIndex,
|
||||
ServerUrl = _serverUrl,
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null);
|
||||
Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Perform a voice search
|
||||
@@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null);
|
||||
Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Search Results
|
||||
@@ -73,7 +73,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This will search the database for the string provided.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetSearchResultsResponse> GetSearchResultsAsync(string query);
|
||||
Task<GetSearchResultsResponse> GetSearchResultsAsync(string query, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -87,10 +87,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -103,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null)
|
||||
public async Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new PerformSearchRequest()
|
||||
{
|
||||
@@ -125,11 +125,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("performSearch", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -197,7 +230,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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)
|
||||
public async Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new PerformVoiceSearchRequest()
|
||||
{
|
||||
@@ -219,11 +252,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("performVoiceSearch", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -291,7 +357,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetSearchResultsResponse> GetSearchResultsAsync(string query)
|
||||
public async Task<GetSearchResultsResponse> GetSearchResultsAsync(string query, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetSearchResultsRequest()
|
||||
{
|
||||
@@ -311,11 +377,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getSearchResults", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Server Capabilities
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync();
|
||||
Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Server Preferences
|
||||
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Server Preferences
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetServerPreferencesResponse> GetServerPreferencesAsync();
|
||||
Task<GetServerPreferencesResponse> GetServerPreferencesAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Available Clients
|
||||
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Available Clients
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetAvailableClientsResponse> GetAvailableClientsAsync();
|
||||
Task<GetAvailableClientsResponse> GetAvailableClientsAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Devices
|
||||
@@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Devices
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetDevicesResponse> GetDevicesAsync();
|
||||
Task<GetDevicesResponse> GetDevicesAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Server Identity
|
||||
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This request is useful to determine if the server is online or offline
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetServerIdentityResponse> GetServerIdentityAsync();
|
||||
Task<GetServerIdentityResponse> GetServerIdentityAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get MyPlex Account
|
||||
@@ -84,7 +84,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Returns MyPlex Account Information
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync();
|
||||
Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get a Resized Photo
|
||||
@@ -94,7 +94,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request);
|
||||
Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Media Providers
|
||||
@@ -103,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Retrieves media providers and their features from the Plex server.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken);
|
||||
Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Server List
|
||||
@@ -112,7 +112,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Server List
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetServerListResponse> GetServerListAsync();
|
||||
Task<GetServerListResponse> GetServerListAsync(RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -126,10 +126,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -142,7 +142,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync()
|
||||
public async Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -159,11 +159,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getServerCapabilities", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -239,7 +272,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetServerPreferencesResponse> GetServerPreferencesAsync()
|
||||
public async Task<GetServerPreferencesResponse> GetServerPreferencesAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -256,11 +289,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getServerPreferences", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -336,7 +402,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetAvailableClientsResponse> GetAvailableClientsAsync()
|
||||
public async Task<GetAvailableClientsResponse> GetAvailableClientsAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -353,11 +419,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getAvailableClients", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -433,7 +532,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetDevicesResponse> GetDevicesAsync()
|
||||
public async Task<GetDevicesResponse> GetDevicesAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -450,11 +549,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getDevices", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -530,7 +662,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetServerIdentityResponse> GetServerIdentityAsync()
|
||||
public async Task<GetServerIdentityResponse> GetServerIdentityAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -542,11 +674,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-server-identity", null, null);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 408 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -611,7 +776,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync()
|
||||
public async Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -628,11 +793,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getMyPlexAccount", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -708,7 +906,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request)
|
||||
public async Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/photo/:/transcode", request);
|
||||
@@ -724,11 +922,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getResizedPhoto", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -796,17 +1027,19 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken)
|
||||
public async Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetMediaProvidersRequest()
|
||||
{
|
||||
XPlexToken = xPlexToken,
|
||||
};
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/media/providers", request);
|
||||
|
||||
var urlString = baseUrl + "/media/providers";
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
{
|
||||
@@ -816,11 +1049,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-media-providers", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -896,7 +1162,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetServerListResponse> GetServerListAsync()
|
||||
public async Task<GetServerListResponse> GetServerListAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -913,11 +1179,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getServerList", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This will retrieve the "Now Playing" Information of the PMS.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetSessionsResponse> GetSessionsAsync();
|
||||
Task<GetSessionsResponse> GetSessionsAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Session History
|
||||
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This will Retrieve a listing of all history views.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null);
|
||||
Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Transcode Sessions
|
||||
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get Transcode Sessions
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync();
|
||||
Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Stop a Transcode Session
|
||||
@@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Stop a Transcode Session
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey);
|
||||
Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -80,10 +80,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -96,7 +96,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetSessionsResponse> GetSessionsAsync()
|
||||
public async Task<GetSessionsResponse> GetSessionsAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -113,11 +113,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getSessions", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -193,7 +226,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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)
|
||||
public async Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetSessionHistoryRequest()
|
||||
{
|
||||
@@ -216,11 +249,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getSessionHistory", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -296,7 +362,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync()
|
||||
public async Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -313,11 +379,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getTranscodeSessions", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -393,7 +492,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey)
|
||||
public async Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new StopTranscodeSessionRequest()
|
||||
{
|
||||
@@ -413,11 +512,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("stopTranscodeSession", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This will return the media statistics for the server
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null);
|
||||
Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Resources Statistics
|
||||
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This will return the resources for the server
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null);
|
||||
Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get Bandwidth Statistics
|
||||
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// This will return the bandwidth statistics for the server
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null);
|
||||
Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -71,10 +71,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -87,7 +87,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null)
|
||||
public async Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetStatisticsRequest()
|
||||
{
|
||||
@@ -107,11 +107,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getStatistics", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -187,7 +220,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null)
|
||||
public async Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetResourcesStatisticsRequest()
|
||||
{
|
||||
@@ -207,11 +240,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getResourcesStatistics", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -287,7 +353,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null)
|
||||
public async Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new GetBandwidthStatisticsRequest()
|
||||
{
|
||||
@@ -307,11 +373,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getBandwidthStatistics", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Querying status of updates
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetUpdateStatusResponse> GetUpdateStatusAsync();
|
||||
Task<GetUpdateStatusResponse> GetUpdateStatusAsync(RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Checking for updates
|
||||
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Checking for updates
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null);
|
||||
Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Apply Updates
|
||||
@@ -59,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null);
|
||||
Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -74,10 +74,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -90,7 +90,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetUpdateStatusResponse> GetUpdateStatusAsync()
|
||||
public async Task<GetUpdateStatusResponse> GetUpdateStatusAsync(RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
|
||||
@@ -107,11 +107,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getUpdateStatus", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -187,7 +220,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null)
|
||||
public async Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new CheckForUpdatesRequest()
|
||||
{
|
||||
@@ -207,11 +240,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("checkForUpdates", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -279,7 +345,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
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)
|
||||
public async Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
var request = new ApplyUpdatesRequest()
|
||||
{
|
||||
@@ -300,11 +366,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("applyUpdates", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get the timeline for a media item
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request);
|
||||
Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request, RetryConfig? retryConfig = null);
|
||||
|
||||
/// <summary>
|
||||
/// Start Universal Transcode
|
||||
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Begin a Universal Transcode Session
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request);
|
||||
Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -62,10 +62,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -78,7 +78,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request)
|
||||
public async Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/:/timeline", request);
|
||||
@@ -94,11 +94,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("getTimeline", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
@@ -166,7 +199,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
}
|
||||
|
||||
public async Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request)
|
||||
public async Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||
var urlString = URLBuilder.Build(baseUrl, "/video/:/transcode/universal/start.mpd", request);
|
||||
@@ -182,11 +215,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("startUniversalTranscode", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get User Watchlist
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null);
|
||||
Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -59,10 +59,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
};
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.8.1";
|
||||
private const string _sdkGenVersion = "2.422.22";
|
||||
private const string _sdkVersion = "0.9.2";
|
||||
private const string _sdkGenVersion = "2.429.0";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||
private string _serverUrl = "";
|
||||
private ISpeakeasyHttpClient _client;
|
||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null)
|
||||
public async Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||
{
|
||||
string baseUrl = Utilities.TemplateUrl(GetWatchListServerList[0], new Dictionary<string, string>(){
|
||||
});
|
||||
@@ -87,6 +87,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
|
||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||
|
||||
if (_securitySource != null)
|
||||
{
|
||||
@@ -96,11 +97,44 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
var hookCtx = new HookContext("get-watch-list", null, _securitySource);
|
||||
|
||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||
if (retryConfig == null)
|
||||
{
|
||||
if (this.SDKConfiguration.RetryConfig != null)
|
||||
{
|
||||
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||
}
|
||||
else
|
||||
{
|
||||
var backoff = new BackoffStrategy(
|
||||
initialIntervalMs: 500L,
|
||||
maxIntervalMs: 60000L,
|
||||
maxElapsedTimeMs: 3600000L,
|
||||
exponent: 1.5
|
||||
);
|
||||
retryConfig = new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: backoff,
|
||||
retryConnectionErrors: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||
return await _client.SendAsync(_httpRequest);
|
||||
};
|
||||
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||
|
||||
HttpResponseMessage httpResponse;
|
||||
try
|
||||
{
|
||||
httpResponse = await _client.SendAsync(httpRequest);
|
||||
httpResponse = await retries.Run();
|
||||
int _statusCode = (int)httpResponse.StatusCode;
|
||||
|
||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||
|
||||
147
NUGET.md
147
NUGET.md
@@ -12,11 +12,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
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();
|
||||
@@ -25,65 +25,90 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
|
||||
```
|
||||
<!-- End SDK Example Usage [usage] -->
|
||||
|
||||
<!-- Start Global Parameters [global-parameters] -->
|
||||
## Global Parameters
|
||||
<!-- Start Retries [retries] -->
|
||||
## Retries
|
||||
|
||||
## Global Parameters
|
||||
|
||||
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed.
|
||||
|
||||
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
|
||||
|
||||
|
||||
### Available Globals
|
||||
|
||||
The following global parameters are available.
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
| ---- | ---- |:--------:| ----------- |
|
||||
| clientID | string | | The unique identifier for the client application
|
||||
This is used to track the client application and its usage
|
||||
(UUID, serial number, or other number unique per device)
|
||||
|
|
||||
| clientName | string | | The ClientName parameter. |
|
||||
| clientVersion | string | | The ClientVersion parameter. |
|
||||
| clientPlatform | string | | The ClientPlatform parameter. |
|
||||
| deviceName | string | | The DeviceName parameter. |
|
||||
|
||||
|
||||
### Example
|
||||
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.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
GetPinRequest req = new GetPinRequest() {};
|
||||
|
||||
var res = await sdk.Plex.GetPinAsync(req);
|
||||
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
|
||||
```
|
||||
<!-- End Global Parameters [global-parameters] -->
|
||||
|
||||
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] -->
|
||||
## Error Handling
|
||||
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type.
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
By default, an API error will raise a `LukeHagar.PlexAPI.SDK.Models.Errors.SDKException` exception, which has the following properties:
|
||||
|
||||
| Property | Type | Description |
|
||||
|---------------|-----------------------|-----------------------|
|
||||
| `Message` | *string* | The error message |
|
||||
| `StatusCode` | *int* | The HTTP status code |
|
||||
| `RawResponse` | *HttpResponseMessage* | The raw HTTP response |
|
||||
| `Body` | *string* | The response content |
|
||||
|
||||
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 |
|
||||
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
||||
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | 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
|
||||
|
||||
@@ -95,11 +120,11 @@ using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
try
|
||||
@@ -120,7 +145,7 @@ catch (Exception ex)
|
||||
// Handle exception data
|
||||
throw;
|
||||
}
|
||||
else if (ex is Models.Errors.SDKException)
|
||||
else if (ex is LukeHagar.PlexAPI.SDK.Models.Errors.SDKException)
|
||||
{
|
||||
// Handle default exception
|
||||
throw;
|
||||
@@ -163,14 +188,14 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2/");
|
||||
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2");
|
||||
|
||||
// handle response
|
||||
```
|
||||
@@ -194,11 +219,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
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();
|
||||
|
||||
175
README.md
175
README.md
@@ -36,11 +36,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
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();
|
||||
@@ -91,6 +91,7 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
|
||||
* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
|
||||
* [GetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The 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
|
||||
* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
|
||||
* [GetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
|
||||
@@ -216,14 +217,14 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2/");
|
||||
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2");
|
||||
|
||||
// handle response
|
||||
```
|
||||
@@ -247,11 +248,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
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();
|
||||
@@ -260,65 +261,90 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
|
||||
```
|
||||
<!-- End Authentication [security] -->
|
||||
|
||||
<!-- Start Global Parameters [global-parameters] -->
|
||||
## Global Parameters
|
||||
<!-- Start Retries [retries] -->
|
||||
## Retries
|
||||
|
||||
## Global Parameters
|
||||
|
||||
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed.
|
||||
|
||||
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
|
||||
|
||||
|
||||
### Available Globals
|
||||
|
||||
The following global parameters are available.
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
| ---- | ---- |:--------:| ----------- |
|
||||
| clientID | string | | The unique identifier for the client application
|
||||
This is used to track the client application and its usage
|
||||
(UUID, serial number, or other number unique per device)
|
||||
|
|
||||
| clientName | string | | The ClientName parameter. |
|
||||
| clientVersion | string | | The ClientVersion parameter. |
|
||||
| clientPlatform | string | | The ClientPlatform parameter. |
|
||||
| deviceName | string | | The DeviceName parameter. |
|
||||
|
||||
|
||||
### Example
|
||||
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.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
GetPinRequest req = new GetPinRequest() {};
|
||||
|
||||
var res = await sdk.Plex.GetPinAsync(req);
|
||||
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
|
||||
```
|
||||
<!-- End Global Parameters [global-parameters] -->
|
||||
|
||||
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] -->
|
||||
## Error Handling
|
||||
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type.
|
||||
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
By default, an API error will raise a `LukeHagar.PlexAPI.SDK.Models.Errors.SDKException` exception, which has the following properties:
|
||||
|
||||
| Property | Type | Description |
|
||||
|---------------|-----------------------|-----------------------|
|
||||
| `Message` | *string* | The error message |
|
||||
| `StatusCode` | *int* | The HTTP status code |
|
||||
| `RawResponse` | *HttpResponseMessage* | The raw HTTP response |
|
||||
| `Body` | *string* | The response content |
|
||||
|
||||
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 |
|
||||
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
||||
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | 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
|
||||
|
||||
@@ -330,11 +356,11 @@ using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
try
|
||||
@@ -355,7 +381,7 @@ catch (Exception ex)
|
||||
// Handle exception data
|
||||
throw;
|
||||
}
|
||||
else if (ex is Models.Errors.SDKException)
|
||||
else if (ex is LukeHagar.PlexAPI.SDK.Models.Errors.SDKException)
|
||||
{
|
||||
// Handle default exception
|
||||
throw;
|
||||
@@ -368,6 +394,31 @@ catch (Exception ex)
|
||||
## Summary
|
||||
|
||||
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
|
||||
# Plex Media Server OpenAPI Specification
|
||||
|
||||
An Open Source OpenAPI Specification for Plex Media Server
|
||||
|
||||
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
|
||||
|
||||
## Documentation
|
||||
|
||||
[API Documentation](https://plexapi.dev)
|
||||
|
||||
## SDKs
|
||||
|
||||
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
|
||||
|
||||
| Language | Repository | Releases | Other |
|
||||
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
|
||||
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
|
||||
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
|
||||
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
|
||||
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
|
||||
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
|
||||
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||
<!-- End Summary [summary] -->
|
||||
|
||||
<!-- Start Table of Contents [toc] -->
|
||||
@@ -376,7 +427,7 @@ Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
|
||||
* [SDK Installation](#sdk-installation)
|
||||
* [SDK Example Usage](#sdk-example-usage)
|
||||
* [Available Resources and Operations](#available-resources-and-operations)
|
||||
* [Global Parameters](#global-parameters)
|
||||
* [Retries](#retries)
|
||||
* [Error Handling](#error-handling)
|
||||
* [Server Selection](#server-selection)
|
||||
* [Authentication](#authentication)
|
||||
|
||||
92
RELEASES.md
92
RELEASES.md
@@ -274,4 +274,94 @@ Based on:
|
||||
### Generated
|
||||
- [csharp v0.8.1] .
|
||||
### Releases
|
||||
- [NuGet v0.8.1] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.1 - .
|
||||
- [NuGet v0.8.1] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.1 - .
|
||||
|
||||
## 2024-09-28 00:20:26
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.404.5 (2.426.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [csharp v0.8.2] .
|
||||
### Releases
|
||||
- [NuGet v0.8.2] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.2 - .
|
||||
|
||||
## 2024-09-29 00:23:13
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.404.5 (2.426.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [csharp v0.8.3] .
|
||||
### Releases
|
||||
- [NuGet v0.8.3] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.3 - .
|
||||
|
||||
## 2024-09-30 00:21:52
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.404.5 (2.426.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [csharp v0.8.4] .
|
||||
### Releases
|
||||
- [NuGet v0.8.4] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.4 - .
|
||||
|
||||
## 2024-09-30 08:46:19
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.404.5 (2.426.2) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [csharp v0.8.5] .
|
||||
### Releases
|
||||
- [NuGet v0.8.5] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.5 - .
|
||||
|
||||
## 2024-09-30 17:22:05
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.405.4 (2.428.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [csharp v0.8.6] .
|
||||
### Releases
|
||||
- [NuGet v0.8.6] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.6 - .
|
||||
|
||||
## 2024-09-30 17:35:18
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.405.4 (2.428.1) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [csharp v0.8.7] .
|
||||
### Releases
|
||||
- [NuGet v0.8.7] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.7 - .
|
||||
|
||||
## 2024-10-02 09:48:21
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.405.8 (2.429.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [csharp v0.9.0] .
|
||||
### Releases
|
||||
- [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 - .
|
||||
10
USAGE.md
10
USAGE.md
@@ -5,11 +5,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
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();
|
||||
|
||||
793
codeSamples.yaml
793
codeSamples.yaml
File diff suppressed because it is too large
Load Diff
11
docs/Models/Errors/GetSearchAllLibrariesBadRequest.md
Normal file
11
docs/Models/Errors/GetSearchAllLibrariesBadRequest.md
Normal 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 |
|
||||
10
docs/Models/Errors/GetSearchAllLibrariesErrors.md
Normal file
10
docs/Models/Errors/GetSearchAllLibrariesErrors.md
Normal 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 |
|
||||
10
docs/Models/Errors/GetSearchAllLibrariesLibraryErrors.md
Normal file
10
docs/Models/Errors/GetSearchAllLibrariesLibraryErrors.md
Normal 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 |
|
||||
11
docs/Models/Errors/GetSearchAllLibrariesUnauthorized.md
Normal file
11
docs/Models/Errors/GetSearchAllLibrariesUnauthorized.md
Normal 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 |
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user