mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 20:47:49 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92be5b3a91 | ||
|
|
a183f389bc | ||
|
|
4a443f6f2e | ||
|
|
b9b7cd1146 | ||
|
|
81c55cb08b | ||
|
|
860991f2a0 | ||
|
|
d25639db53 | ||
|
|
227e2351d5 | ||
|
|
3bd4f51297 | ||
|
|
4828de2345 | ||
|
|
2beb707ed5 | ||
|
|
affe5d5a8c | ||
|
|
d16abdad70 | ||
|
|
3e9ae76433 | ||
|
|
e7023f61d0 | ||
|
|
223ab320b2 | ||
|
|
5421ae0531 |
1
.github/workflows/sdk_generation.yaml
vendored
1
.github/workflows/sdk_generation.yaml
vendored
@@ -24,6 +24,7 @@ jobs:
|
|||||||
mode: direct
|
mode: direct
|
||||||
set_version: ${{ github.event.inputs.set_version }}
|
set_version: ${{ github.event.inputs.set_version }}
|
||||||
speakeasy_version: latest
|
speakeasy_version: latest
|
||||||
|
dotnet_version: "8.x"
|
||||||
secrets:
|
secrets:
|
||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
|
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
|
||||||
|
|||||||
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:
|
auth:
|
||||||
oAuth2ClientCredentialsEnabled: true
|
oAuth2ClientCredentialsEnabled: true
|
||||||
csharp:
|
csharp:
|
||||||
version: 0.7.0
|
version: 0.9.2
|
||||||
additionalDependencies: []
|
additionalDependencies: []
|
||||||
author: LukeHagar
|
author: LukeHagar
|
||||||
clientServerStatusCodesAsErrors: true
|
clientServerStatusCodesAsErrors: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
speakeasyVersion: 1.401.2
|
speakeasyVersion: 1.405.8
|
||||||
sources:
|
sources:
|
||||||
my-source:
|
my-source:
|
||||||
sourceNamespace: my-source
|
sourceNamespace: my-source
|
||||||
@@ -16,8 +16,8 @@ sources:
|
|||||||
- main
|
- main
|
||||||
plexapi:
|
plexapi:
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:5aa71ad96ca6de91143ee513c9880e08e555e7748fb4b5f8d069c6ab0c8f3069
|
sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
|
||||||
sourceBlobDigest: sha256:1cbef844e2856c2eabba4bd6d677d96c572fed13b27978d0d953aa06b224c02f
|
sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- main
|
- main
|
||||||
@@ -25,10 +25,10 @@ targets:
|
|||||||
plexcsharp:
|
plexcsharp:
|
||||||
source: plexapi
|
source: plexapi
|
||||||
sourceNamespace: plexapi
|
sourceNamespace: plexapi
|
||||||
sourceRevisionDigest: sha256:5aa71ad96ca6de91143ee513c9880e08e555e7748fb4b5f8d069c6ab0c8f3069
|
sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e
|
||||||
sourceBlobDigest: sha256:1cbef844e2856c2eabba4bd6d677d96c572fed13b27978d0d953aa06b224c02f
|
sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b
|
||||||
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
codeSamplesNamespace: code-samples-csharp-plexcsharp
|
||||||
codeSamplesRevisionDigest: sha256:f7febae6230f9bc151d99328c2b771c41002cc699d664ef857e752d9cd213bc2
|
codeSamplesRevisionDigest: sha256:92500227f7e52cdceac29cb2915dfe637ad1432c312c69dd3acb197b357a3577
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: latest
|
speakeasyVersion: latest
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Get Server Activities
|
/// Get Server Activities
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetServerActivitiesResponse> GetServerActivitiesAsync();
|
Task<GetServerActivitiesResponse> GetServerActivitiesAsync(RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cancel Server Activities
|
/// Cancel Server Activities
|
||||||
@@ -54,7 +54,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Cancel Server Activities
|
/// Cancel Server Activities
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID);
|
Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID, RetryConfig? retryConfig = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -74,10 +74,10 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.7.0";
|
private const string _sdkVersion = "0.9.2";
|
||||||
private const string _sdkGenVersion = "2.421.3";
|
private const string _sdkGenVersion = "2.429.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _client;
|
private ISpeakeasyHttpClient _client;
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||||
@@ -90,7 +90,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync()
|
public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync(RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
|
||||||
@@ -107,11 +107,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getServerActivities", null, _securitySource);
|
var hookCtx = new HookContext("getServerActivities", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -187,7 +220,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
|
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new CancelServerActivitiesRequest()
|
var request = new CancelServerActivitiesRequest()
|
||||||
{
|
{
|
||||||
@@ -207,11 +240,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("cancelServerActivities", null, _securitySource);
|
var hookCtx = new HookContext("cancelServerActivities", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope);
|
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Source Connection Information
|
/// Get Source Connection Information
|
||||||
@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source);
|
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Token Details
|
/// Get Token Details
|
||||||
@@ -60,7 +60,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Get the User data from the provided X-Plex-Token
|
/// Get the User data from the provided X-Plex-Token
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null);
|
Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get User Sign In Data
|
/// Get User Sign In Data
|
||||||
@@ -69,7 +69,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Sign in user with username and password and return user data with Plex authentication token
|
/// Sign in user with username and password and return user data with Plex authentication token
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequestBody? request = null, string? serverUrl = null);
|
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -85,20 +85,20 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// List of server URLs available for the getTokenDetails operation.
|
/// List of server URLs available for the getTokenDetails operation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string[] GetTokenDetailsServerList = {
|
public static readonly string[] GetTokenDetailsServerList = {
|
||||||
"https://plex.tv/api/v2/",
|
"https://plex.tv/api/v2",
|
||||||
};
|
};
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of server URLs available for the post-users-sign-in-data operation.
|
/// List of server URLs available for the post-users-sign-in-data operation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string[] PostUsersSignInDataServerList = {
|
public static readonly string[] PostUsersSignInDataServerList = {
|
||||||
"https://plex.tv/api/v2/",
|
"https://plex.tv/api/v2",
|
||||||
};
|
};
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.7.0";
|
private const string _sdkVersion = "0.9.2";
|
||||||
private const string _sdkGenVersion = "2.421.3";
|
private const string _sdkGenVersion = "2.429.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _client;
|
private ISpeakeasyHttpClient _client;
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||||
@@ -111,7 +111,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope)
|
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetTransientTokenRequest()
|
var request = new GetTransientTokenRequest()
|
||||||
{
|
{
|
||||||
@@ -132,11 +132,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getTransientToken", null, _securitySource);
|
var hookCtx = new HookContext("getTransientToken", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -204,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
|
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetSourceConnectionInformationRequest()
|
var request = new GetSourceConnectionInformationRequest()
|
||||||
{
|
{
|
||||||
@@ -224,11 +257,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource);
|
var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -296,7 +362,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null)
|
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary<string, string>(){
|
string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary<string, string>(){
|
||||||
});
|
});
|
||||||
@@ -318,11 +384,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getTokenDetails", null, _securitySource);
|
var hookCtx = new HookContext("getTokenDetails", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -398,8 +497,14 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequestBody? request = null, string? serverUrl = null)
|
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
|
request.ClientID ??= SDKConfiguration.ClientID;
|
||||||
|
request.ClientName ??= SDKConfiguration.ClientName;
|
||||||
|
request.ClientVersion ??= SDKConfiguration.ClientVersion;
|
||||||
|
request.Platform ??= SDKConfiguration.Platform;
|
||||||
|
request.DeviceNickname ??= SDKConfiguration.DeviceNickname;
|
||||||
|
|
||||||
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
|
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
|
||||||
});
|
});
|
||||||
if (serverUrl != null)
|
if (serverUrl != null)
|
||||||
@@ -411,8 +516,9 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "form", false, true);
|
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
|
||||||
if (serializedBody != null)
|
if (serializedBody != null)
|
||||||
{
|
{
|
||||||
httpRequest.Content = serializedBody;
|
httpRequest.Content = serializedBody;
|
||||||
@@ -421,11 +527,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("post-users-sign-in-data", null, null);
|
var hookCtx = new HookContext("post-users-sign-in-data", null, null);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Returns a list of butler tasks
|
/// Returns a list of butler tasks
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetButlerTasksResponse> GetButlerTasksAsync();
|
Task<GetButlerTasksResponse> GetButlerTasksAsync(RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start all Butler tasks
|
/// Start all Butler tasks
|
||||||
@@ -53,7 +53,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<StartAllTasksResponse> StartAllTasksAsync();
|
Task<StartAllTasksResponse> StartAllTasksAsync(RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop all Butler tasks
|
/// Stop all Butler tasks
|
||||||
@@ -63,7 +63,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<StopAllTasksResponse> StopAllTasksAsync();
|
Task<StopAllTasksResponse> StopAllTasksAsync(RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start a single Butler task
|
/// Start a single Butler task
|
||||||
@@ -77,7 +77,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<StartTaskResponse> StartTaskAsync(TaskName taskName);
|
Task<StartTaskResponse> StartTaskAsync(TaskName taskName, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop a single Butler task
|
/// Stop a single Butler task
|
||||||
@@ -87,7 +87,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName);
|
Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName, RetryConfig? retryConfig = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -101,10 +101,10 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.7.0";
|
private const string _sdkVersion = "0.9.2";
|
||||||
private const string _sdkGenVersion = "2.421.3";
|
private const string _sdkGenVersion = "2.429.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _client;
|
private ISpeakeasyHttpClient _client;
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||||
@@ -117,7 +117,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetButlerTasksResponse> GetButlerTasksAsync()
|
public async Task<GetButlerTasksResponse> GetButlerTasksAsync(RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
|
||||||
@@ -134,11 +134,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getButlerTasks", null, _securitySource);
|
var hookCtx = new HookContext("getButlerTasks", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -214,7 +247,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StartAllTasksResponse> StartAllTasksAsync()
|
public async Task<StartAllTasksResponse> StartAllTasksAsync(RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
|
||||||
@@ -231,11 +264,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("startAllTasks", null, _securitySource);
|
var hookCtx = new HookContext("startAllTasks", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -303,7 +369,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StopAllTasksResponse> StopAllTasksAsync()
|
public async Task<StopAllTasksResponse> StopAllTasksAsync(RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
|
||||||
@@ -320,11 +386,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("stopAllTasks", null, _securitySource);
|
var hookCtx = new HookContext("stopAllTasks", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -392,7 +491,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
|
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new StartTaskRequest()
|
var request = new StartTaskRequest()
|
||||||
{
|
{
|
||||||
@@ -412,11 +511,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("startTask", null, _securitySource);
|
var hookCtx = new HookContext("startTask", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -484,7 +616,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
|
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new StopTaskRequest()
|
var request = new StopTaskRequest()
|
||||||
{
|
{
|
||||||
@@ -504,11 +636,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("stopTask", null, _securitySource);
|
var hookCtx = new HookContext("stopTask", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
|||||||
@@ -39,7 +39,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Get Global Hubs filtered by the parameters provided.
|
/// Get Global Hubs filtered by the parameters provided.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null);
|
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Recently Added
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// This endpoint will return the recently added content.<br/>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get library specific hubs
|
/// Get library specific hubs
|
||||||
@@ -49,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null);
|
Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -63,10 +73,10 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.7.0";
|
private const string _sdkVersion = "0.9.2";
|
||||||
private const string _sdkGenVersion = "2.421.3";
|
private const string _sdkGenVersion = "2.429.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _client;
|
private ISpeakeasyHttpClient _client;
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||||
@@ -79,7 +89,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null)
|
public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetGlobalHubsRequest()
|
var request = new GetGlobalHubsRequest()
|
||||||
{
|
{
|
||||||
@@ -100,11 +110,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getGlobalHubs", null, _securitySource);
|
var hookCtx = new HookContext("getGlobalHubs", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -180,7 +223,114 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
|
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null)
|
||||||
|
{
|
||||||
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
|
||||||
|
|
||||||
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
|
||||||
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
var hookCtx = new HookContext("get-recently-added", null, _securitySource);
|
||||||
|
|
||||||
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
|
HttpResponseMessage httpResponse;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
httpResponse = await retries.Run();
|
||||||
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
{
|
||||||
|
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||||
|
if (_httpResponse != null)
|
||||||
|
{
|
||||||
|
httpResponse = _httpResponse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception error)
|
||||||
|
{
|
||||||
|
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
|
||||||
|
if (_httpResponse != null)
|
||||||
|
{
|
||||||
|
httpResponse = _httpResponse;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
|
||||||
|
|
||||||
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
|
if(responseStatusCode == 200)
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||||
|
var response = new GetRecentlyAddedResponse()
|
||||||
|
{
|
||||||
|
StatusCode = responseStatusCode,
|
||||||
|
ContentType = contentType,
|
||||||
|
RawResponse = httpResponse
|
||||||
|
};
|
||||||
|
response.Object = obj;
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
|
}
|
||||||
|
else if(responseStatusCode == 400 || responseStatusCode == 401 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetLibraryHubsRequest()
|
var request = new GetLibraryHubsRequest()
|
||||||
{
|
{
|
||||||
@@ -202,11 +352,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getLibraryHubs", null, _securitySource);
|
var hookCtx = new HookContext("getLibraryHubs", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// This resource returns hash values for local files
|
/// This resource returns hash values for local files
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null);
|
Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Recently Added
|
/// Get Recently Added
|
||||||
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexContainerStart = null, int? xPlexContainerSize = null);
|
Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get All Libraries
|
/// Get All Libraries
|
||||||
@@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetAllLibrariesResponse> GetAllLibrariesAsync();
|
Task<GetAllLibrariesResponse> GetAllLibrariesAsync(RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Library Details
|
/// Get Library Details
|
||||||
@@ -112,7 +112,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null);
|
Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete Library Section
|
/// Delete Library Section
|
||||||
@@ -121,7 +121,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Delete a library using a specific section id
|
/// Delete a library using a specific section id
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey);
|
Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Library Items
|
/// Get Library Items
|
||||||
@@ -150,7 +150,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request);
|
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Refresh Metadata Of The Library
|
/// Refresh Metadata Of The Library
|
||||||
@@ -160,7 +160,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null);
|
Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Search Library
|
/// Search Library
|
||||||
@@ -187,7 +187,17 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, QueryParamType type);
|
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Search All Libraries
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.<br/>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
Task<GetSearchAllLibrariesResponse> GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Metadata by RatingKey
|
/// Get Metadata by RatingKey
|
||||||
@@ -197,7 +207,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey);
|
Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Items Children
|
/// Get Items Children
|
||||||
@@ -207,7 +217,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null);
|
Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Top Watched Content
|
/// Get Top Watched Content
|
||||||
@@ -217,7 +227,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null);
|
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get On Deck
|
/// Get On Deck
|
||||||
@@ -227,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetOnDeckResponse> GetOnDeckAsync();
|
Task<GetOnDeckResponse> GetOnDeckAsync(RetryConfig? retryConfig = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -241,10 +251,10 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.7.0";
|
private const string _sdkVersion = "0.9.2";
|
||||||
private const string _sdkGenVersion = "2.421.3";
|
private const string _sdkGenVersion = "2.429.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _client;
|
private ISpeakeasyHttpClient _client;
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||||
@@ -257,7 +267,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null)
|
public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetFileHashRequest()
|
var request = new GetFileHashRequest()
|
||||||
{
|
{
|
||||||
@@ -278,11 +288,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getFileHash", null, _securitySource);
|
var hookCtx = new HookContext("getFileHash", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -350,13 +393,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexContainerStart = null, int? xPlexContainerSize = null)
|
public async Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetRecentlyAddedRequest()
|
|
||||||
{
|
|
||||||
XPlexContainerStart = xPlexContainerStart,
|
|
||||||
XPlexContainerSize = xPlexContainerSize,
|
|
||||||
};
|
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request);
|
||||||
|
|
||||||
@@ -368,14 +406,47 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hookCtx = new HookContext("getRecentlyAdded", null, _securitySource);
|
var hookCtx = new HookContext("get-recently-added-library", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -408,8 +479,8 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
|
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||||
var response = new GetRecentlyAddedResponse()
|
var response = new GetRecentlyAddedLibraryResponse()
|
||||||
{
|
{
|
||||||
StatusCode = responseStatusCode,
|
StatusCode = responseStatusCode,
|
||||||
ContentType = contentType,
|
ContentType = contentType,
|
||||||
@@ -425,7 +496,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
|
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedLibraryBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||||
obj!.RawResponse = httpResponse;
|
obj!.RawResponse = httpResponse;
|
||||||
throw obj!;
|
throw obj!;
|
||||||
}
|
}
|
||||||
@@ -436,7 +507,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
{
|
{
|
||||||
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
|
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedLibraryUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||||
obj!.RawResponse = httpResponse;
|
obj!.RawResponse = httpResponse;
|
||||||
throw obj!;
|
throw obj!;
|
||||||
}
|
}
|
||||||
@@ -451,7 +522,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync()
|
public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync(RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
|
||||||
@@ -468,11 +539,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("get-all-libraries", null, _securitySource);
|
var hookCtx = new HookContext("get-all-libraries", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -548,7 +652,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null)
|
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetLibraryDetailsRequest()
|
var request = new GetLibraryDetailsRequest()
|
||||||
{
|
{
|
||||||
@@ -569,11 +673,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("get-library-details", null, _securitySource);
|
var hookCtx = new HookContext("get-library-details", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -649,7 +786,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey)
|
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new DeleteLibraryRequest()
|
var request = new DeleteLibraryRequest()
|
||||||
{
|
{
|
||||||
@@ -669,11 +806,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("deleteLibrary", null, _securitySource);
|
var hookCtx = new HookContext("deleteLibrary", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -741,7 +911,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request)
|
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request);
|
||||||
@@ -757,11 +927,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("get-library-items", null, _securitySource);
|
var hookCtx = new HookContext("get-library-items", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -837,7 +1040,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null)
|
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetRefreshLibraryMetadataRequest()
|
var request = new GetRefreshLibraryMetadataRequest()
|
||||||
{
|
{
|
||||||
@@ -858,11 +1061,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("get-refresh-library-metadata", null, _securitySource);
|
var hookCtx = new HookContext("get-refresh-library-metadata", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -930,7 +1166,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, QueryParamType type)
|
public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetSearchLibraryRequest()
|
var request = new GetSearchLibraryRequest()
|
||||||
{
|
{
|
||||||
@@ -951,11 +1187,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("get-search-library", null, _securitySource);
|
var hookCtx = new HookContext("get-search-library", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -1031,7 +1300,143 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey)
|
public async Task<GetSearchAllLibrariesResponse> GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request, RetryConfig? retryConfig = null)
|
||||||
|
{
|
||||||
|
if (request == null)
|
||||||
|
{
|
||||||
|
request = new GetSearchAllLibrariesRequest();
|
||||||
|
}
|
||||||
|
request.ClientID ??= SDKConfiguration.ClientID;
|
||||||
|
|
||||||
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
var urlString = URLBuilder.Build(baseUrl, "/library/search", request);
|
||||||
|
|
||||||
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
|
if (_securitySource != null)
|
||||||
|
{
|
||||||
|
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
var hookCtx = new HookContext("get-search-all-libraries", null, _securitySource);
|
||||||
|
|
||||||
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
|
HttpResponseMessage httpResponse;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
httpResponse = await retries.Run();
|
||||||
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
{
|
||||||
|
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
|
||||||
|
if (_httpResponse != null)
|
||||||
|
{
|
||||||
|
httpResponse = _httpResponse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception error)
|
||||||
|
{
|
||||||
|
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
|
||||||
|
if (_httpResponse != null)
|
||||||
|
{
|
||||||
|
httpResponse = _httpResponse;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
|
||||||
|
|
||||||
|
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
|
||||||
|
int responseStatusCode = (int)httpResponse.StatusCode;
|
||||||
|
if(responseStatusCode == 200)
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var obj = ResponseBodyDeserializer.Deserialize<GetSearchAllLibrariesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||||
|
var response = new GetSearchAllLibrariesResponse()
|
||||||
|
{
|
||||||
|
StatusCode = responseStatusCode,
|
||||||
|
ContentType = contentType,
|
||||||
|
RawResponse = httpResponse
|
||||||
|
};
|
||||||
|
response.Object = obj;
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
|
}
|
||||||
|
else if(responseStatusCode == 400)
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var obj = ResponseBodyDeserializer.Deserialize<GetSearchAllLibrariesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||||
|
obj!.RawResponse = httpResponse;
|
||||||
|
throw obj!;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
|
}
|
||||||
|
else if(responseStatusCode == 401)
|
||||||
|
{
|
||||||
|
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||||
|
{
|
||||||
|
var obj = ResponseBodyDeserializer.Deserialize<GetSearchAllLibrariesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||||
|
obj!.RawResponse = httpResponse;
|
||||||
|
throw obj!;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
|
}
|
||||||
|
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
|
||||||
|
{
|
||||||
|
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetMetaDataByRatingKeyRequest()
|
var request = new GetMetaDataByRatingKeyRequest()
|
||||||
{
|
{
|
||||||
@@ -1051,11 +1456,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("get-meta-data-by-rating-key", null, _securitySource);
|
var hookCtx = new HookContext("get-meta-data-by-rating-key", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -1131,7 +1569,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null)
|
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetMetadataChildrenRequest()
|
var request = new GetMetadataChildrenRequest()
|
||||||
{
|
{
|
||||||
@@ -1152,11 +1590,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getMetadataChildren", null, _securitySource);
|
var hookCtx = new HookContext("getMetadataChildren", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -1232,7 +1703,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null)
|
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new GetTopWatchedContentRequest()
|
var request = new GetTopWatchedContentRequest()
|
||||||
{
|
{
|
||||||
@@ -1253,11 +1724,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getTopWatchedContent", null, _securitySource);
|
var hookCtx = new HookContext("getTopWatchedContent", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -1333,7 +1837,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetOnDeckResponse> GetOnDeckAsync()
|
public async Task<GetOnDeckResponse> GetOnDeckAsync(RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
|
||||||
@@ -1350,11 +1854,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("getOnDeck", null, _securitySource);
|
var hookCtx = new HookContext("getOnDeck", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<LogLineResponse> LogLineAsync(Level level, string message, string source);
|
Task<LogLineResponse> LogLineAsync(Level level, string message, string source, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Logging a multi-line message
|
/// Logging a multi-line message
|
||||||
@@ -70,7 +70,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<LogMultiLineResponse> LogMultiLineAsync(string request);
|
Task<LogMultiLineResponse> LogMultiLineAsync(string request, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enabling Papertrail
|
/// Enabling Papertrail
|
||||||
@@ -80,7 +80,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<EnablePaperTrailResponse> EnablePaperTrailAsync();
|
Task<EnablePaperTrailResponse> EnablePaperTrailAsync(RetryConfig? retryConfig = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -94,10 +94,10 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.7.0";
|
private const string _sdkVersion = "0.9.2";
|
||||||
private const string _sdkGenVersion = "2.421.3";
|
private const string _sdkGenVersion = "2.429.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _client;
|
private ISpeakeasyHttpClient _client;
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||||
@@ -110,7 +110,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<LogLineResponse> LogLineAsync(Level level, string message, string source)
|
public async Task<LogLineResponse> LogLineAsync(Level level, string message, string source, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new LogLineRequest()
|
var request = new LogLineRequest()
|
||||||
{
|
{
|
||||||
@@ -132,11 +132,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("logLine", null, _securitySource);
|
var hookCtx = new HookContext("logLine", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -204,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
|
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
|
||||||
@@ -227,11 +260,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("logMultiLine", null, _securitySource);
|
var hookCtx = new HookContext("logMultiLine", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -299,7 +365,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
|
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync(RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
|
|
||||||
@@ -316,11 +382,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("enablePaperTrail", null, _securitySource);
|
var hookCtx = new HookContext("enablePaperTrail", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
|||||||
@@ -3,14 +3,38 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
|
||||||
<Version>0.7.0</Version>
|
<Version>0.9.2</Version>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<Authors>LukeHagar</Authors>
|
<Authors>LukeHagar</Authors>
|
||||||
<Copyright>Copyright (c) LukeHagar 2024</Copyright>
|
<Copyright>Copyright (c) LukeHagar 2024</Copyright>
|
||||||
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
|
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<PackageTags>Plex Media Server SDK</PackageTags>
|
<PackageTags>Plex Media Server SDK</PackageTags>
|
||||||
<Description>Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server</Description>
|
<Description># Plex Media Server OpenAPI Specification
|
||||||
|
|
||||||
|
An Open Source OpenAPI Specification for Plex Media Server
|
||||||
|
|
||||||
|
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
[API Documentation](https://plexapi.dev)
|
||||||
|
|
||||||
|
## SDKs
|
||||||
|
|
||||||
|
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
|
||||||
|
|
||||||
|
| Language | Repository | Releases | Other |
|
||||||
|
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
|
||||||
|
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
|
||||||
|
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
|
||||||
|
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
|
||||||
|
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
|
||||||
|
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
|
||||||
|
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
|
||||||
|
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
|
||||||
|
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
|
||||||
|
</Description>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// This will mark the provided media key as Played.
|
/// This will mark the provided media key as Played.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<MarkPlayedResponse> MarkPlayedAsync(double key);
|
Task<MarkPlayedResponse> MarkPlayedAsync(double key, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Mark Media Unplayed
|
/// Mark Media Unplayed
|
||||||
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// This will mark the provided media key as Unplayed.
|
/// This will mark the provided media key as Unplayed.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<MarkUnplayedResponse> MarkUnplayedAsync(double key);
|
Task<MarkUnplayedResponse> MarkUnplayedAsync(double key, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update Media Play Progress
|
/// Update Media Play Progress
|
||||||
@@ -58,7 +58,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
///
|
///
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state);
|
Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Banner Image
|
/// Get Banner Image
|
||||||
@@ -67,7 +67,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Gets the banner image of the media item
|
/// Gets the banner image of the media item
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request);
|
Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request, RetryConfig? retryConfig = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Thumb Image
|
/// Get Thumb Image
|
||||||
@@ -76,7 +76,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
/// Gets the thumbnail image of the media item
|
/// Gets the thumbnail image of the media item
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request);
|
Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request, RetryConfig? retryConfig = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -90,10 +90,10 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
{
|
{
|
||||||
public SDKConfig SDKConfiguration { get; private set; }
|
public SDKConfig SDKConfiguration { get; private set; }
|
||||||
private const string _language = "csharp";
|
private const string _language = "csharp";
|
||||||
private const string _sdkVersion = "0.7.0";
|
private const string _sdkVersion = "0.9.2";
|
||||||
private const string _sdkGenVersion = "2.421.3";
|
private const string _sdkGenVersion = "2.429.0";
|
||||||
private const string _openapiDocVersion = "0.0.3";
|
private const string _openapiDocVersion = "0.0.3";
|
||||||
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
|
private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
|
||||||
private string _serverUrl = "";
|
private string _serverUrl = "";
|
||||||
private ISpeakeasyHttpClient _client;
|
private ISpeakeasyHttpClient _client;
|
||||||
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||||
@@ -106,7 +106,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
SDKConfiguration = config;
|
SDKConfiguration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<MarkPlayedResponse> MarkPlayedAsync(double key)
|
public async Task<MarkPlayedResponse> MarkPlayedAsync(double key, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new MarkPlayedRequest()
|
var request = new MarkPlayedRequest()
|
||||||
{
|
{
|
||||||
@@ -126,11 +126,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("markPlayed", null, _securitySource);
|
var hookCtx = new HookContext("markPlayed", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -198,7 +231,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
|
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new MarkUnplayedRequest()
|
var request = new MarkUnplayedRequest()
|
||||||
{
|
{
|
||||||
@@ -218,11 +251,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("markUnplayed", null, _securitySource);
|
var hookCtx = new HookContext("markUnplayed", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -290,7 +356,7 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
|
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
var request = new UpdatePlayProgressRequest()
|
var request = new UpdatePlayProgressRequest()
|
||||||
{
|
{
|
||||||
@@ -312,11 +378,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("updatePlayProgress", null, _securitySource);
|
var hookCtx = new HookContext("updatePlayProgress", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -384,13 +483,14 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request)
|
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (_securitySource != null)
|
||||||
{
|
{
|
||||||
@@ -400,11 +500,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("get-banner-image", null, _securitySource);
|
var hookCtx = new HookContext("get-banner-image", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
@@ -479,13 +612,14 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request)
|
public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request, RetryConfig? retryConfig = null)
|
||||||
{
|
{
|
||||||
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
|
||||||
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
|
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
|
||||||
|
|
||||||
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
|
||||||
httpRequest.Headers.Add("user-agent", _userAgent);
|
httpRequest.Headers.Add("user-agent", _userAgent);
|
||||||
|
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
|
||||||
|
|
||||||
if (_securitySource != null)
|
if (_securitySource != null)
|
||||||
{
|
{
|
||||||
@@ -495,11 +629,44 @@ namespace LukeHagar.PlexAPI.SDK
|
|||||||
var hookCtx = new HookContext("get-thumb-image", null, _securitySource);
|
var hookCtx = new HookContext("get-thumb-image", null, _securitySource);
|
||||||
|
|
||||||
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
|
||||||
|
if (retryConfig == null)
|
||||||
|
{
|
||||||
|
if (this.SDKConfiguration.RetryConfig != null)
|
||||||
|
{
|
||||||
|
retryConfig = this.SDKConfiguration.RetryConfig;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var backoff = new BackoffStrategy(
|
||||||
|
initialIntervalMs: 500L,
|
||||||
|
maxIntervalMs: 60000L,
|
||||||
|
maxElapsedTimeMs: 3600000L,
|
||||||
|
exponent: 1.5
|
||||||
|
);
|
||||||
|
retryConfig = new RetryConfig(
|
||||||
|
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||||
|
backoff: backoff,
|
||||||
|
retryConnectionErrors: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> statusCodes = new List<string>
|
||||||
|
{
|
||||||
|
"5XX",
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||||
|
{
|
||||||
|
var _httpRequest = await _client.CloneAsync(httpRequest);
|
||||||
|
return await _client.SendAsync(_httpRequest);
|
||||||
|
};
|
||||||
|
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
|
||||||
|
|
||||||
HttpResponseMessage httpResponse;
|
HttpResponseMessage httpResponse;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
httpResponse = await _client.SendAsync(httpRequest);
|
httpResponse = await retries.Run();
|
||||||
int _statusCode = (int)httpResponse.StatusCode;
|
int _statusCode = (int)httpResponse.StatusCode;
|
||||||
|
|
||||||
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
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>
|
||||||
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
|
/// </summary>
|
||||||
|
public class GetRecentlyAddedLibraryBadRequest : Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetRecentlyAddedLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
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 GetRecentlyAddedLibraryLibraryErrors
|
||||||
|
{
|
||||||
|
|
||||||
|
[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 GetRecentlyAddedLibraryUnauthorized : Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public List<GetRecentlyAddedLibraryLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("-")]
|
||||||
|
public HttpResponseMessage? RawResponse { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
/// Bad Request - A parameter was not specified, or was specified incorrectly.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GetRecentlyAddedBadRequest : Exception
|
public class GetSearchAllLibrariesBadRequest : Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetRecentlyAddedErrors>? Errors { get; set; }
|
public List<GetSearchAllLibrariesErrors>? Errors { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
@@ -12,16 +12,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
using LukeHagar.PlexAPI.SDK.Utils;
|
using LukeHagar.PlexAPI.SDK.Utils;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
public class GetRecentlyAddedErrors
|
public class GetSearchAllLibrariesErrors
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GetRecentlyAddedUnauthorized : Exception
|
public class GetSearchAllLibrariesUnauthorized : Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("errors")]
|
[JsonProperty("errors")]
|
||||||
public List<GetRecentlyAddedLibraryErrors>? Errors { get; set; }
|
public List<GetSearchAllLibrariesLibraryErrors>? Errors { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raw HTTP response; suitable for custom response parsing
|
/// Raw HTTP response; suitable for custom response parsing
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,12 +16,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
|
|||||||
{
|
{
|
||||||
|
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public long? Code { get; set; }
|
public int? Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("message")]
|
[JsonProperty("message")]
|
||||||
public string? Message { get; set; }
|
public string? Message { get; set; }
|
||||||
|
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public long? Status { get; set; }
|
public int? Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user