Compare commits

...

9 Commits

Author SHA1 Message Date
speakeasybot
4a443f6f2e ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8 2024-10-02 09:49:57 +00:00
speakeasybot
b9b7cd1146 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.4 2024-09-30 17:36:49 +00:00
speakeasybot
81c55cb08b ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.4 2024-09-30 17:23:32 +00:00
speakeasybot
860991f2a0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-30 08:47:49 +00:00
Jason Landbridge
d25639db53 Added dotnet_version directly 2024-09-30 10:42:22 +02:00
speakeasybot
227e2351d5 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-30 00:23:16 +00:00
JasonLandbridge
3bd4f51297 Merge remote-tracking branch 'origin/main' 2024-09-29 09:09:51 +02:00
speakeasybot
4828de2345 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.404.5 2024-09-29 00:24:39 +00:00
JasonLandbridge
2beb707ed5 make project intelij compatible 2024-09-28 10:01:25 +02:00
76 changed files with 4563 additions and 1495 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 5a8dbcbc-e0ee-41f0-9d84-b8b50567d1e9
management:
docChecksum: e7673f3f46e5b0bf495c378378aa7ad6
docChecksum: 649b155561aeea4d804f8713e7b2dcac
docVersion: 0.0.3
speakeasyVersion: 1.404.5
generationVersion: 2.426.2
releaseVersion: 0.8.2
configChecksum: 1b899ed5e03c8720f1f7f13507ac2519
speakeasyVersion: 1.405.8
generationVersion: 2.429.0
releaseVersion: 0.9.0
configChecksum: dc06201584fb7850142fe453a89a3e52
repoURL: https://github.com/LukeHagar/plexcsharp.git
repoSubDirectory: .
published: true
@@ -14,10 +14,10 @@ features:
csharp:
additionalDependencies: 0.1.0
constsAndDefaults: 0.0.1
core: 3.10.2
core: 3.10.3
deprecations: 2.81.2
enums: 2.82.0
errors: 0.0.2
errors: 0.0.3
flattening: 2.81.3
globalSecurity: 2.83.6
globalSecurityCallbacks: 0.1.0
@@ -29,6 +29,7 @@ features:
nameOverrides: 2.81.2
nullables: 0.1.0
responseFormat: 0.0.4
retries: 0.0.1
sdkHooks: 0.1.0
generatedFiles:
- .gitattributes
@@ -1689,6 +1690,8 @@ examples:
parameters:
query:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
header:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses:
"401":
application/json: {"errors": []}
@@ -1748,6 +1751,8 @@ examples:
minSize: 1
upscale: 1
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
header:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses:
"401":
application/json: {"errors": []}
@@ -1766,6 +1771,8 @@ examples:
minSize: 1
upscale: 1
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
header:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses:
"401":
application/json: {"errors": []}
@@ -1922,6 +1929,7 @@ examples:
includeHttps: 1
includeRelay: 1
includeIPv6: 1
X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40"
responses:
"401":
application/json: {"errors": []}
@@ -1929,6 +1937,21 @@ examples:
application/json: []
"400":
application/json: {"errors": []}
"":
parameters:
query:
includeHttps: 1
includeRelay: 1
includeIPv6: 1
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
responses:
"200":
application/json: []
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]}
getPin:
"":
parameters:
@@ -1938,6 +1961,12 @@ examples:
X-Plex-Version: "4.133.0"
X-Plex-Platform: "Chrome"
X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40"
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
X-Plex-Product: "Plex for Roku"
X-Plex-Device: "Roku 3"
X-Plex-Version: "2.4.1"
X-Plex-Platform: "Roku"
responses:
"200":
application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": 802, "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null}
@@ -1956,6 +1985,12 @@ examples:
X-Plex-Device: "Linux"
X-Plex-Version: "4.133.0"
X-Plex-Platform: "Chrome"
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
X-Plex-Product: "Plex for Roku"
X-Plex-Device: "Roku 3"
X-Plex-Version: "2.4.1"
X-Plex-Platform: "Roku"
responses:
"200":
application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": 802, "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null}
@@ -2220,6 +2255,8 @@ examples:
X-Plex-Container-Start: 0
X-Plex-Container-Size: 50
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
header:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses:
"401":
application/json: {"errors": []}
@@ -2414,6 +2451,12 @@ examples:
X-Plex-Device: "Linux"
X-Plex-Version: "4.133.0"
X-Plex-Platform: "Chrome"
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
X-Plex-Product: "Plex for Roku"
X-Plex-Device: "Roku 3"
X-Plex-Version: "2.4.1"
X-Plex-Platform: "Roku"
requestBody:
application/x-www-form-urlencoded: {"login": "username@email.com", "password": "password123", "verificationCode": "123456"}
responses:

View File

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

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.404.5
speakeasyVersion: 1.405.8
sources:
my-source:
sourceNamespace: my-source
@@ -16,8 +16,8 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:276a31ab98595ebaf2b1fac4b4f5c3c1c7b55e0431f9074c89b8fbcb55b52d3f
sourceBlobDigest: sha256:2bc9e816db669d609d8a5988ebb629578dc5cbbaff191d260b5c63b7ba1bd59b
sourceRevisionDigest: sha256:b1e231bd781f352738612b0158382ba51cfac32e97c23d9e4913aab5501e9529
sourceBlobDigest: sha256:8ce05d5965182eb3fe9376715c269b9e1c7f3e2d90273c175a4181735f41daa0
tags:
- latest
- main
@@ -25,10 +25,10 @@ targets:
plexcsharp:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:276a31ab98595ebaf2b1fac4b4f5c3c1c7b55e0431f9074c89b8fbcb55b52d3f
sourceBlobDigest: sha256:2bc9e816db669d609d8a5988ebb629578dc5cbbaff191d260b5c63b7ba1bd59b
sourceRevisionDigest: sha256:b1e231bd781f352738612b0158382ba51cfac32e97c23d9e4913aab5501e9529
sourceBlobDigest: sha256:8ce05d5965182eb3fe9376715c269b9e1c7f3e2d90273c175a4181735f41daa0
codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:bc6e1a88628b72f211e33c015c1dbc6badafb295aeebf5a0bdafe1b542483c89
codeSamplesRevisionDigest: sha256:58fe70fa1a5c905723a25f3e8c72551cc91f8227b052f13d826b5a6b25eb7049
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

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

View File

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

View File

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

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Global Hubs filtered by the parameters provided.
/// </remarks>
/// </summary>
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null);
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Recently Added
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request);
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null);
/// <summary>
/// Get library specific hubs
@@ -59,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null);
Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null);
}
/// <summary>
@@ -73,10 +73,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -89,7 +89,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null)
public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null)
{
var request = new GetGlobalHubsRequest()
{
@@ -110,11 +110,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getGlobalHubs", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -190,7 +223,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request)
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);
@@ -206,11 +239,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-recently-added", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -264,7 +330,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null)
{
var request = new GetLibraryHubsRequest()
{
@@ -286,11 +352,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getLibraryHubs", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This resource returns hash values for local files
/// </remarks>
/// </summary>
Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null);
Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Recently Added
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request);
Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null);
/// <summary>
/// Get All Libraries
@@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetAllLibrariesResponse> GetAllLibrariesAsync();
Task<GetAllLibrariesResponse> GetAllLibrariesAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Get Library Details
@@ -112,7 +112,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null);
Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null);
/// <summary>
/// Delete Library Section
@@ -121,7 +121,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Delete a library using a specific section id
/// </remarks>
/// </summary>
Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey);
Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null);
/// <summary>
/// Get Library Items
@@ -150,7 +150,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request);
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null);
/// <summary>
/// Refresh Metadata Of The Library
@@ -160,7 +160,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null);
Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null);
/// <summary>
/// Search Library
@@ -187,7 +187,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type);
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null);
/// <summary>
/// Get Metadata by RatingKey
@@ -197,7 +197,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey);
Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null);
/// <summary>
/// Get Items Children
@@ -207,7 +207,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null);
Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Top Watched Content
@@ -217,7 +217,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null);
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get On Deck
@@ -227,7 +227,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetOnDeckResponse> GetOnDeckAsync();
Task<GetOnDeckResponse> GetOnDeckAsync(RetryConfig? retryConfig = null);
}
/// <summary>
@@ -241,10 +241,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -257,7 +257,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null)
public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null)
{
var request = new GetFileHashRequest()
{
@@ -278,11 +278,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getFileHash", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -350,7 +383,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request)
public async Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request);
@@ -366,11 +399,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-recently-added-library", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -446,7 +512,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync()
public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -463,11 +529,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-all-libraries", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -543,7 +642,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null)
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null)
{
var request = new GetLibraryDetailsRequest()
{
@@ -564,11 +663,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-library-details", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -644,7 +776,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey)
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null)
{
var request = new DeleteLibraryRequest()
{
@@ -664,11 +796,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("deleteLibrary", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -736,7 +901,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request)
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request);
@@ -752,11 +917,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-library-items", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -832,7 +1030,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null)
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null)
{
var request = new GetRefreshLibraryMetadataRequest()
{
@@ -853,11 +1051,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-refresh-library-metadata", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -925,7 +1156,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type)
public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null)
{
var request = new GetSearchLibraryRequest()
{
@@ -946,11 +1177,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-search-library", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1026,7 +1290,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey)
public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null)
{
var request = new GetMetaDataByRatingKeyRequest()
{
@@ -1046,11 +1310,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-meta-data-by-rating-key", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1126,7 +1423,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null)
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null)
{
var request = new GetMetadataChildrenRequest()
{
@@ -1147,11 +1444,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getMetadataChildren", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1227,7 +1557,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null)
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null)
{
var request = new GetTopWatchedContentRequest()
{
@@ -1248,11 +1578,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getTopWatchedContent", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -1328,7 +1691,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetOnDeckResponse> GetOnDeckAsync()
public async Task<GetOnDeckResponse> GetOnDeckAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -1345,11 +1708,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getOnDeck", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

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

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.8.2</Version>
<Version>0.9.0</Version>
<TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2024</Copyright>
@@ -22,7 +22,7 @@ Automation and SDKs provided by [Speakeasy](https://speakeasyapi.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 respective repository.
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 |
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |

View File

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

View File

@@ -29,6 +29,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
AdCountdownTimer,
[JsonProperty("adaptive_bitrate")]
AdaptiveBitrate,
[JsonProperty("album-types")]
AlbumTypes,
[JsonProperty("allow_dvr")]
AllowDvr,
[JsonProperty("amazon-loop-debug")]
AmazonLoopDebug,
[JsonProperty("avod-ad-analysis")]
@@ -37,10 +41,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
AvodNewMedia,
[JsonProperty("blacklist_get_signin")]
BlacklistGetSignin,
[JsonProperty("boost-voices")]
BoostVoices,
[JsonProperty("camera_upload")]
CameraUpload,
[JsonProperty("client-radio-stations")]
ClientRadioStations,
[JsonProperty("cloudflare-turnstile-required")]
CloudflareTurnstileRequired,
[JsonProperty("cloudsync")]
Cloudsync,
[JsonProperty("collections")]
Collections,
[JsonProperty("comments_and_replies_push_notifications")]
@@ -49,30 +59,50 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
CommunityAccessPlexTv,
[JsonProperty("companions_sonos")]
CompanionsSonos,
[JsonProperty("content_filter")]
ContentFilter,
[JsonProperty("custom-home-removal")]
CustomHomeRemoval,
[JsonProperty("disable_home_user_friendships")]
DisableHomeUserFriendships,
[JsonProperty("disable_sharing_friendships")]
DisableSharingFriendships,
[JsonProperty("downloads-gating")]
DownloadsGating,
[JsonProperty("drm_support")]
DrmSupport,
[JsonProperty("dvr")]
Dvr,
[JsonProperty("dvr-block-unsupported-countries")]
DvrBlockUnsupportedCountries,
[JsonProperty("epg-recent-channels")]
EpgRecentChannels,
[JsonProperty("exclude restrictions")]
ExcludeRestrictions,
[JsonProperty("federated-auth")]
FederatedAuth,
[JsonProperty("friend_request_push_notifications")]
FriendRequestPushNotifications,
[JsonProperty("grandfather-sync")]
GrandfatherSync,
[JsonProperty("guided-upgrade")]
GuidedUpgrade,
[JsonProperty("hardware_transcoding")]
HardwareTranscoding,
[JsonProperty("home")]
Home,
[JsonProperty("hwtranscode")]
Hwtranscode,
[JsonProperty("imagga-v2")]
ImaggaV2,
[JsonProperty("increase-password-complexity")]
IncreasePasswordComplexity,
[JsonProperty("ios14-privacy-banner")]
Ios14PrivacyBanner,
[JsonProperty("iterable-notification-tokens")]
IterableNotificationTokens,
[JsonProperty("item_clusters")]
ItemClusters,
[JsonProperty("keep-payment-method")]
KeepPaymentMethod,
[JsonProperty("kevin-bacon")]
@@ -89,34 +119,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
LiveTvSupportIncompleteSegments,
[JsonProperty("livetv")]
Livetv,
[JsonProperty("lyrics")]
Lyrics,
[JsonProperty("metadata_search")]
MetadataSearch,
[JsonProperty("music-analysis")]
MusicAnalysis,
[JsonProperty("music_videos")]
MusicVideos,
[JsonProperty("new_plex_pass_prices")]
NewPlexPassPrices,
[JsonProperty("news-provider-sunset-modal")]
NewsProviderSunsetModal,
[JsonProperty("nominatim")]
Nominatim,
[JsonProperty("pass")]
Pass,
[JsonProperty("photos-favorites")]
PhotosFavorites,
[JsonProperty("photos-metadata-edition")]
PhotosMetadataEdition,
[JsonProperty("photosV6-edit")]
PhotosV6Edit,
[JsonProperty("photosV6-tv-albums")]
PhotosV6TvAlbums,
[JsonProperty("pms_health")]
PmsHealth,
[JsonProperty("premium-dashboard")]
PremiumDashboard,
[JsonProperty("premium_music_metadata")]
PremiumMusicMetadata,
[JsonProperty("radio")]
Radio,
[JsonProperty("rate-limit-client-token")]
RateLimitClientToken,
[JsonProperty("scrobbling-service-plex-tv")]
ScrobblingServicePlexTv,
[JsonProperty("session_bandwidth_restrictions")]
SessionBandwidthRestrictions,
[JsonProperty("session_kick")]
SessionKick,
[JsonProperty("shared_server_notification")]
SharedServerNotification,
[JsonProperty("shared_source_notification")]
SharedSourceNotification,
[JsonProperty("signin_notification")]
SigninNotification,
[JsonProperty("signin_with_apple")]
SigninWithApple,
[JsonProperty("silence-removal")]
SilenceRemoval,
[JsonProperty("sleep-timer")]
SleepTimer,
[JsonProperty("spring_serve_ad_provider")]
SpringServeAdProvider,
[JsonProperty("sync")]
Sync,
[JsonProperty("sweet-fades")]
SweetFades,
[JsonProperty("transcoder_cache")]
TranscoderCache,
[JsonProperty("trailers")]
Trailers,
[JsonProperty("tuner-sharing")]
TunerSharing,
[JsonProperty("two-factor-authentication")]
@@ -125,14 +189,22 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Unsupportedtuners,
[JsonProperty("upgrade-3ds2")]
Upgrade3ds2,
[JsonProperty("visualizers")]
Visualizers,
[JsonProperty("vod-schema")]
VodSchema,
[JsonProperty("vod_cloudflare")]
VodCloudflare,
[JsonProperty("volume-leveling")]
VolumeLeveling,
[JsonProperty("watch-together-invite")]
WatchTogetherInvite,
[JsonProperty("watchlist-rss")]
WatchlistRss,
[JsonProperty("web_server_dashboard")]
WebServerDashboard,
[JsonProperty("webhooks")]
Webhooks,
}
public static class FeaturesExtension

View File

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

View File

@@ -15,6 +15,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetLibraryItemsRequest
{
/// <summary>
/// A key representing a specific tag within the section.
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tag")]
public Tag Tag { get; set; } = default!;
/// <summary>
/// The unique key of the Plex library. <br/>
///
@@ -26,12 +32,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionKey")]
public int SectionKey { get; set; } = default!;
/// <summary>
/// A key representing a specific tag within the section.
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tag")]
public Tag Tag { get; set; } = default!;
/// <summary>
/// Adds the Guids object to the response<br/>
///

View File

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

View File

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

View File

@@ -37,5 +37,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeIPv6")]
public IncludeIPv6? IncludeIPv6 { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.Disable;
/// <summary>
/// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
public string? ClientID { get; set; }
}
}

View File

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

View File

@@ -21,27 +21,33 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public long PinID { get; set; } = default!;
/// <summary>
/// The unique identifier for the client application<br/>
///
/// <remarks>
/// This is used to track the client application and its usage<br/>
/// (UUID, serial number, or other number unique per device)<br/>
///
/// </remarks>
/// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier")]
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
public string? ClientID { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product")]
/// <summary>
/// The name of the client application. (Plex Web, Plex Media Server, etc.)
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product")]
public string? ClientName { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device")]
public string? DeviceName { get; set; }
/// <summary>
/// A relatively friendly name for the client device
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device")]
public string? DeviceNickname { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version")]
/// <summary>
/// The version of the client application.
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version")]
public string? ClientVersion { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform")]
public string? ClientPlatform { get; set; }
/// <summary>
/// The platform of the client application.
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform")]
public string? Platform { get; set; }
}
}

View File

@@ -29,6 +29,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
AdCountdownTimer,
[JsonProperty("adaptive_bitrate")]
AdaptiveBitrate,
[JsonProperty("album-types")]
AlbumTypes,
[JsonProperty("allow_dvr")]
AllowDvr,
[JsonProperty("amazon-loop-debug")]
AmazonLoopDebug,
[JsonProperty("avod-ad-analysis")]
@@ -37,10 +41,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
AvodNewMedia,
[JsonProperty("blacklist_get_signin")]
BlacklistGetSignin,
[JsonProperty("boost-voices")]
BoostVoices,
[JsonProperty("camera_upload")]
CameraUpload,
[JsonProperty("client-radio-stations")]
ClientRadioStations,
[JsonProperty("cloudflare-turnstile-required")]
CloudflareTurnstileRequired,
[JsonProperty("cloudsync")]
Cloudsync,
[JsonProperty("collections")]
Collections,
[JsonProperty("comments_and_replies_push_notifications")]
@@ -49,30 +59,50 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
CommunityAccessPlexTv,
[JsonProperty("companions_sonos")]
CompanionsSonos,
[JsonProperty("content_filter")]
ContentFilter,
[JsonProperty("custom-home-removal")]
CustomHomeRemoval,
[JsonProperty("disable_home_user_friendships")]
DisableHomeUserFriendships,
[JsonProperty("disable_sharing_friendships")]
DisableSharingFriendships,
[JsonProperty("downloads-gating")]
DownloadsGating,
[JsonProperty("drm_support")]
DrmSupport,
[JsonProperty("dvr")]
Dvr,
[JsonProperty("dvr-block-unsupported-countries")]
DvrBlockUnsupportedCountries,
[JsonProperty("epg-recent-channels")]
EpgRecentChannels,
[JsonProperty("exclude restrictions")]
ExcludeRestrictions,
[JsonProperty("federated-auth")]
FederatedAuth,
[JsonProperty("friend_request_push_notifications")]
FriendRequestPushNotifications,
[JsonProperty("grandfather-sync")]
GrandfatherSync,
[JsonProperty("guided-upgrade")]
GuidedUpgrade,
[JsonProperty("hardware_transcoding")]
HardwareTranscoding,
[JsonProperty("home")]
Home,
[JsonProperty("hwtranscode")]
Hwtranscode,
[JsonProperty("imagga-v2")]
ImaggaV2,
[JsonProperty("increase-password-complexity")]
IncreasePasswordComplexity,
[JsonProperty("ios14-privacy-banner")]
Ios14PrivacyBanner,
[JsonProperty("iterable-notification-tokens")]
IterableNotificationTokens,
[JsonProperty("item_clusters")]
ItemClusters,
[JsonProperty("keep-payment-method")]
KeepPaymentMethod,
[JsonProperty("kevin-bacon")]
@@ -89,34 +119,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
LiveTvSupportIncompleteSegments,
[JsonProperty("livetv")]
Livetv,
[JsonProperty("lyrics")]
Lyrics,
[JsonProperty("metadata_search")]
MetadataSearch,
[JsonProperty("music-analysis")]
MusicAnalysis,
[JsonProperty("music_videos")]
MusicVideos,
[JsonProperty("new_plex_pass_prices")]
NewPlexPassPrices,
[JsonProperty("news-provider-sunset-modal")]
NewsProviderSunsetModal,
[JsonProperty("nominatim")]
Nominatim,
[JsonProperty("pass")]
Pass,
[JsonProperty("photos-favorites")]
PhotosFavorites,
[JsonProperty("photos-metadata-edition")]
PhotosMetadataEdition,
[JsonProperty("photosV6-edit")]
PhotosV6Edit,
[JsonProperty("photosV6-tv-albums")]
PhotosV6TvAlbums,
[JsonProperty("pms_health")]
PmsHealth,
[JsonProperty("premium-dashboard")]
PremiumDashboard,
[JsonProperty("premium_music_metadata")]
PremiumMusicMetadata,
[JsonProperty("radio")]
Radio,
[JsonProperty("rate-limit-client-token")]
RateLimitClientToken,
[JsonProperty("scrobbling-service-plex-tv")]
ScrobblingServicePlexTv,
[JsonProperty("session_bandwidth_restrictions")]
SessionBandwidthRestrictions,
[JsonProperty("session_kick")]
SessionKick,
[JsonProperty("shared_server_notification")]
SharedServerNotification,
[JsonProperty("shared_source_notification")]
SharedSourceNotification,
[JsonProperty("signin_notification")]
SigninNotification,
[JsonProperty("signin_with_apple")]
SigninWithApple,
[JsonProperty("silence-removal")]
SilenceRemoval,
[JsonProperty("sleep-timer")]
SleepTimer,
[JsonProperty("spring_serve_ad_provider")]
SpringServeAdProvider,
[JsonProperty("sync")]
Sync,
[JsonProperty("sweet-fades")]
SweetFades,
[JsonProperty("transcoder_cache")]
TranscoderCache,
[JsonProperty("trailers")]
Trailers,
[JsonProperty("tuner-sharing")]
TunerSharing,
[JsonProperty("two-factor-authentication")]
@@ -125,14 +189,22 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Unsupportedtuners,
[JsonProperty("upgrade-3ds2")]
Upgrade3ds2,
[JsonProperty("visualizers")]
Visualizers,
[JsonProperty("vod-schema")]
VodSchema,
[JsonProperty("vod_cloudflare")]
VodCloudflare,
[JsonProperty("volume-leveling")]
VolumeLeveling,
[JsonProperty("watch-together-invite")]
WatchTogetherInvite,
[JsonProperty("watchlist-rss")]
WatchlistRss,
[JsonProperty("web_server_dashboard")]
WebServerDashboard,
[JsonProperty("webhooks")]
Webhooks,
}
public static class GetTokenDetailsFeaturesExtension

View File

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

View File

@@ -29,6 +29,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
AdCountdownTimer,
[JsonProperty("adaptive_bitrate")]
AdaptiveBitrate,
[JsonProperty("album-types")]
AlbumTypes,
[JsonProperty("allow_dvr")]
AllowDvr,
[JsonProperty("amazon-loop-debug")]
AmazonLoopDebug,
[JsonProperty("avod-ad-analysis")]
@@ -37,10 +41,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
AvodNewMedia,
[JsonProperty("blacklist_get_signin")]
BlacklistGetSignin,
[JsonProperty("boost-voices")]
BoostVoices,
[JsonProperty("camera_upload")]
CameraUpload,
[JsonProperty("client-radio-stations")]
ClientRadioStations,
[JsonProperty("cloudflare-turnstile-required")]
CloudflareTurnstileRequired,
[JsonProperty("cloudsync")]
Cloudsync,
[JsonProperty("collections")]
Collections,
[JsonProperty("comments_and_replies_push_notifications")]
@@ -49,30 +59,50 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
CommunityAccessPlexTv,
[JsonProperty("companions_sonos")]
CompanionsSonos,
[JsonProperty("content_filter")]
ContentFilter,
[JsonProperty("custom-home-removal")]
CustomHomeRemoval,
[JsonProperty("disable_home_user_friendships")]
DisableHomeUserFriendships,
[JsonProperty("disable_sharing_friendships")]
DisableSharingFriendships,
[JsonProperty("downloads-gating")]
DownloadsGating,
[JsonProperty("drm_support")]
DrmSupport,
[JsonProperty("dvr")]
Dvr,
[JsonProperty("dvr-block-unsupported-countries")]
DvrBlockUnsupportedCountries,
[JsonProperty("epg-recent-channels")]
EpgRecentChannels,
[JsonProperty("exclude restrictions")]
ExcludeRestrictions,
[JsonProperty("federated-auth")]
FederatedAuth,
[JsonProperty("friend_request_push_notifications")]
FriendRequestPushNotifications,
[JsonProperty("grandfather-sync")]
GrandfatherSync,
[JsonProperty("guided-upgrade")]
GuidedUpgrade,
[JsonProperty("hardware_transcoding")]
HardwareTranscoding,
[JsonProperty("home")]
Home,
[JsonProperty("hwtranscode")]
Hwtranscode,
[JsonProperty("imagga-v2")]
ImaggaV2,
[JsonProperty("increase-password-complexity")]
IncreasePasswordComplexity,
[JsonProperty("ios14-privacy-banner")]
Ios14PrivacyBanner,
[JsonProperty("iterable-notification-tokens")]
IterableNotificationTokens,
[JsonProperty("item_clusters")]
ItemClusters,
[JsonProperty("keep-payment-method")]
KeepPaymentMethod,
[JsonProperty("kevin-bacon")]
@@ -89,34 +119,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
LiveTvSupportIncompleteSegments,
[JsonProperty("livetv")]
Livetv,
[JsonProperty("lyrics")]
Lyrics,
[JsonProperty("metadata_search")]
MetadataSearch,
[JsonProperty("music-analysis")]
MusicAnalysis,
[JsonProperty("music_videos")]
MusicVideos,
[JsonProperty("new_plex_pass_prices")]
NewPlexPassPrices,
[JsonProperty("news-provider-sunset-modal")]
NewsProviderSunsetModal,
[JsonProperty("nominatim")]
Nominatim,
[JsonProperty("pass")]
Pass,
[JsonProperty("photos-favorites")]
PhotosFavorites,
[JsonProperty("photos-metadata-edition")]
PhotosMetadataEdition,
[JsonProperty("photosV6-edit")]
PhotosV6Edit,
[JsonProperty("photosV6-tv-albums")]
PhotosV6TvAlbums,
[JsonProperty("pms_health")]
PmsHealth,
[JsonProperty("premium-dashboard")]
PremiumDashboard,
[JsonProperty("premium_music_metadata")]
PremiumMusicMetadata,
[JsonProperty("radio")]
Radio,
[JsonProperty("rate-limit-client-token")]
RateLimitClientToken,
[JsonProperty("scrobbling-service-plex-tv")]
ScrobblingServicePlexTv,
[JsonProperty("session_bandwidth_restrictions")]
SessionBandwidthRestrictions,
[JsonProperty("session_kick")]
SessionKick,
[JsonProperty("shared_server_notification")]
SharedServerNotification,
[JsonProperty("shared_source_notification")]
SharedSourceNotification,
[JsonProperty("signin_notification")]
SigninNotification,
[JsonProperty("signin_with_apple")]
SigninWithApple,
[JsonProperty("silence-removal")]
SilenceRemoval,
[JsonProperty("sleep-timer")]
SleepTimer,
[JsonProperty("spring_serve_ad_provider")]
SpringServeAdProvider,
[JsonProperty("sync")]
Sync,
[JsonProperty("sweet-fades")]
SweetFades,
[JsonProperty("transcoder_cache")]
TranscoderCache,
[JsonProperty("trailers")]
Trailers,
[JsonProperty("tuner-sharing")]
TunerSharing,
[JsonProperty("two-factor-authentication")]
@@ -125,14 +189,22 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Unsupportedtuners,
[JsonProperty("upgrade-3ds2")]
Upgrade3ds2,
[JsonProperty("visualizers")]
Visualizers,
[JsonProperty("vod-schema")]
VodSchema,
[JsonProperty("vod_cloudflare")]
VodCloudflare,
[JsonProperty("volume-leveling")]
VolumeLeveling,
[JsonProperty("watch-together-invite")]
WatchTogetherInvite,
[JsonProperty("watchlist-rss")]
WatchlistRss,
[JsonProperty("web_server_dashboard")]
WebServerDashboard,
[JsonProperty("webhooks")]
Webhooks,
}
public static class PostUsersSignInDataAuthenticationFeaturesExtension

View File

@@ -29,6 +29,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
AdCountdownTimer,
[JsonProperty("adaptive_bitrate")]
AdaptiveBitrate,
[JsonProperty("album-types")]
AlbumTypes,
[JsonProperty("allow_dvr")]
AllowDvr,
[JsonProperty("amazon-loop-debug")]
AmazonLoopDebug,
[JsonProperty("avod-ad-analysis")]
@@ -37,10 +41,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
AvodNewMedia,
[JsonProperty("blacklist_get_signin")]
BlacklistGetSignin,
[JsonProperty("boost-voices")]
BoostVoices,
[JsonProperty("camera_upload")]
CameraUpload,
[JsonProperty("client-radio-stations")]
ClientRadioStations,
[JsonProperty("cloudflare-turnstile-required")]
CloudflareTurnstileRequired,
[JsonProperty("cloudsync")]
Cloudsync,
[JsonProperty("collections")]
Collections,
[JsonProperty("comments_and_replies_push_notifications")]
@@ -49,30 +59,50 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
CommunityAccessPlexTv,
[JsonProperty("companions_sonos")]
CompanionsSonos,
[JsonProperty("content_filter")]
ContentFilter,
[JsonProperty("custom-home-removal")]
CustomHomeRemoval,
[JsonProperty("disable_home_user_friendships")]
DisableHomeUserFriendships,
[JsonProperty("disable_sharing_friendships")]
DisableSharingFriendships,
[JsonProperty("downloads-gating")]
DownloadsGating,
[JsonProperty("drm_support")]
DrmSupport,
[JsonProperty("dvr")]
Dvr,
[JsonProperty("dvr-block-unsupported-countries")]
DvrBlockUnsupportedCountries,
[JsonProperty("epg-recent-channels")]
EpgRecentChannels,
[JsonProperty("exclude restrictions")]
ExcludeRestrictions,
[JsonProperty("federated-auth")]
FederatedAuth,
[JsonProperty("friend_request_push_notifications")]
FriendRequestPushNotifications,
[JsonProperty("grandfather-sync")]
GrandfatherSync,
[JsonProperty("guided-upgrade")]
GuidedUpgrade,
[JsonProperty("hardware_transcoding")]
HardwareTranscoding,
[JsonProperty("home")]
Home,
[JsonProperty("hwtranscode")]
Hwtranscode,
[JsonProperty("imagga-v2")]
ImaggaV2,
[JsonProperty("increase-password-complexity")]
IncreasePasswordComplexity,
[JsonProperty("ios14-privacy-banner")]
Ios14PrivacyBanner,
[JsonProperty("iterable-notification-tokens")]
IterableNotificationTokens,
[JsonProperty("item_clusters")]
ItemClusters,
[JsonProperty("keep-payment-method")]
KeepPaymentMethod,
[JsonProperty("kevin-bacon")]
@@ -89,34 +119,68 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
LiveTvSupportIncompleteSegments,
[JsonProperty("livetv")]
Livetv,
[JsonProperty("lyrics")]
Lyrics,
[JsonProperty("metadata_search")]
MetadataSearch,
[JsonProperty("music-analysis")]
MusicAnalysis,
[JsonProperty("music_videos")]
MusicVideos,
[JsonProperty("new_plex_pass_prices")]
NewPlexPassPrices,
[JsonProperty("news-provider-sunset-modal")]
NewsProviderSunsetModal,
[JsonProperty("nominatim")]
Nominatim,
[JsonProperty("pass")]
Pass,
[JsonProperty("photos-favorites")]
PhotosFavorites,
[JsonProperty("photos-metadata-edition")]
PhotosMetadataEdition,
[JsonProperty("photosV6-edit")]
PhotosV6Edit,
[JsonProperty("photosV6-tv-albums")]
PhotosV6TvAlbums,
[JsonProperty("pms_health")]
PmsHealth,
[JsonProperty("premium-dashboard")]
PremiumDashboard,
[JsonProperty("premium_music_metadata")]
PremiumMusicMetadata,
[JsonProperty("radio")]
Radio,
[JsonProperty("rate-limit-client-token")]
RateLimitClientToken,
[JsonProperty("scrobbling-service-plex-tv")]
ScrobblingServicePlexTv,
[JsonProperty("session_bandwidth_restrictions")]
SessionBandwidthRestrictions,
[JsonProperty("session_kick")]
SessionKick,
[JsonProperty("shared_server_notification")]
SharedServerNotification,
[JsonProperty("shared_source_notification")]
SharedSourceNotification,
[JsonProperty("signin_notification")]
SigninNotification,
[JsonProperty("signin_with_apple")]
SigninWithApple,
[JsonProperty("silence-removal")]
SilenceRemoval,
[JsonProperty("sleep-timer")]
SleepTimer,
[JsonProperty("spring_serve_ad_provider")]
SpringServeAdProvider,
[JsonProperty("sync")]
Sync,
[JsonProperty("sweet-fades")]
SweetFades,
[JsonProperty("transcoder_cache")]
TranscoderCache,
[JsonProperty("trailers")]
Trailers,
[JsonProperty("tuner-sharing")]
TunerSharing,
[JsonProperty("two-factor-authentication")]
@@ -125,14 +189,22 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
Unsupportedtuners,
[JsonProperty("upgrade-3ds2")]
Upgrade3ds2,
[JsonProperty("visualizers")]
Visualizers,
[JsonProperty("vod-schema")]
VodSchema,
[JsonProperty("vod_cloudflare")]
VodCloudflare,
[JsonProperty("volume-leveling")]
VolumeLeveling,
[JsonProperty("watch-together-invite")]
WatchTogetherInvite,
[JsonProperty("watchlist-rss")]
WatchlistRss,
[JsonProperty("web_server_dashboard")]
WebServerDashboard,
[JsonProperty("webhooks")]
Webhooks,
}
public static class PostUsersSignInDataFeaturesExtension

View File

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

View File

@@ -45,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request);
Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null);
/// <summary>
/// Get All Playlists
@@ -54,7 +54,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get All Playlists given the specified filters.
/// </remarks>
/// </summary>
Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null);
Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null);
/// <summary>
/// Retrieve Playlist
@@ -65,7 +65,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID);
Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null);
/// <summary>
/// Deletes a Playlist
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID);
Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null);
/// <summary>
/// Update a Playlist
@@ -85,7 +85,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null);
Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null);
/// <summary>
/// Retrieve Playlist Contents
@@ -98,7 +98,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type);
Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null);
/// <summary>
/// Delete Playlist Contents
@@ -108,7 +108,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID);
Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null);
/// <summary>
/// Adding to a Playlist
@@ -119,7 +119,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null);
Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null);
/// <summary>
/// Upload Playlist
@@ -129,7 +129,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID);
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null);
}
/// <summary>
@@ -146,10 +146,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -162,7 +162,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request)
public async Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/playlists", request);
@@ -178,11 +178,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("createPlaylist", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -258,7 +291,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null)
public async Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null)
{
var request = new GetPlaylistsRequest()
{
@@ -279,11 +312,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getPlaylists", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -359,7 +425,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID)
public async Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null)
{
var request = new GetPlaylistRequest()
{
@@ -379,11 +445,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getPlaylist", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -459,7 +558,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID)
public async Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null)
{
var request = new DeletePlaylistRequest()
{
@@ -479,11 +578,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("deletePlaylist", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -551,7 +683,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null)
public async Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null)
{
var request = new UpdatePlaylistRequest()
{
@@ -573,11 +705,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("updatePlaylist", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -645,7 +810,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type)
public async Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null)
{
var request = new GetPlaylistContentsRequest()
{
@@ -666,11 +831,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getPlaylistContents", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -746,7 +944,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID)
public async Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null)
{
var request = new ClearPlaylistContentsRequest()
{
@@ -766,11 +964,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("clearPlaylistContents", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -838,7 +1069,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null)
public async Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null)
{
var request = new AddPlaylistContentsRequest()
{
@@ -860,11 +1091,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("addPlaylistContents", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -940,7 +1204,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID)
public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null)
{
var request = new UploadPlaylistRequest()
{
@@ -962,11 +1226,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("uploadPlaylist", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Companions Data
/// </remarks>
/// </summary>
Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null);
Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get list of friends of the user logged in
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get friends of provided auth token.
/// </remarks>
/// </summary>
Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null);
Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Geo Data
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Returns the geolocation and locale data of the caller
/// </remarks>
/// </summary>
Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null);
Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Plex Home Data
@@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.
/// </remarks>
/// </summary>
Task<GetHomeDataResponse> GetHomeDataAsync();
Task<GetHomeDataResponse> GetHomeDataAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Get Server Resources
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Plex server access tokens and server connections
/// </remarks>
/// </summary>
Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? serverUrl = null);
Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get a Pin
@@ -84,7 +84,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Retrieve a Pin ID from Plex.tv to use for authentication flows
/// </remarks>
/// </summary>
Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null);
Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Access Token by PinId
@@ -93,7 +93,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Retrieve an Access Token from Plex.tv after the Pin has been authenticated
/// </remarks>
/// </summary>
Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null);
Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null, RetryConfig? retryConfig = null);
}
/// <summary>
@@ -143,10 +143,10 @@ namespace LukeHagar.PlexAPI.SDK
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -159,7 +159,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null)
public async Task<GetCompanionsDataResponse> GetCompanionsDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null)
{
string baseUrl = Utilities.TemplateUrl(GetCompanionsDataServerList[0], new Dictionary<string, string>(){
});
@@ -181,11 +181,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getCompanionsData", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -261,7 +294,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null)
public async Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null, RetryConfig? retryConfig = null)
{
string baseUrl = Utilities.TemplateUrl(GetUserFriendsServerList[0], new Dictionary<string, string>(){
});
@@ -283,11 +316,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getUserFriends", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -363,7 +429,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null)
public async Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null)
{
string baseUrl = Utilities.TemplateUrl(GetGeoDataServerList[0], new Dictionary<string, string>(){
});
@@ -380,11 +446,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getGeoData", null, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -460,7 +559,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetHomeDataResponse> GetHomeDataAsync()
public async Task<GetHomeDataResponse> GetHomeDataAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -477,11 +576,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getHomeData", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -557,14 +689,17 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? serverUrl = null)
public async Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null, RetryConfig? retryConfig = null)
{
var request = new GetServerResourcesRequest()
{
IncludeHttps = includeHttps,
IncludeRelay = includeRelay,
IncludeIPv6 = includeIPv6,
ClientID = clientID,
};
request.ClientID ??= SDKConfiguration.ClientID;
string baseUrl = Utilities.TemplateUrl(GetServerResourcesServerList[0], new Dictionary<string, string>(){
});
if (serverUrl != null)
@@ -575,6 +710,7 @@ namespace LukeHagar.PlexAPI.SDK
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null)
{
@@ -584,11 +720,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-server-resources", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -664,13 +833,13 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null)
public async Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null)
{
request.ClientID ??= SDKConfiguration.ClientID;
request.ClientName ??= SDKConfiguration.ClientName;
request.ClientVersion ??= SDKConfiguration.ClientVersion;
request.ClientPlatform ??= SDKConfiguration.ClientPlatform;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Platform ??= SDKConfiguration.Platform;
request.DeviceNickname ??= SDKConfiguration.DeviceNickname;
string baseUrl = Utilities.TemplateUrl(GetPinServerList[0], new Dictionary<string, string>(){
});
@@ -682,15 +851,49 @@ namespace LukeHagar.PlexAPI.SDK
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var hookCtx = new HookContext("getPin", null, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -755,7 +958,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null)
public async Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null, RetryConfig? retryConfig = null)
{
if (request == null)
{
@@ -764,8 +967,8 @@ namespace LukeHagar.PlexAPI.SDK
request.ClientID ??= SDKConfiguration.ClientID;
request.ClientName ??= SDKConfiguration.ClientName;
request.ClientVersion ??= SDKConfiguration.ClientVersion;
request.ClientPlatform ??= SDKConfiguration.ClientPlatform;
request.DeviceName ??= SDKConfiguration.DeviceName;
request.Platform ??= SDKConfiguration.Platform;
request.DeviceNickname ??= SDKConfiguration.DeviceNickname;
string baseUrl = Utilities.TemplateUrl(GetTokenByPinIdServerList[0], new Dictionary<string, string>(){
});
@@ -777,15 +980,49 @@ namespace LukeHagar.PlexAPI.SDK
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var hookCtx = new HookContext("getTokenByPinId", null, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -81,7 +81,7 @@ namespace LukeHagar.PlexAPI.SDK
/// <br/>
/// ## SDKs<br/>
/// <br/>
/// The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the respective repository.<br/>
/// The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
/// <br/>
/// | Language | Repository | Releases | Other |<br/>
/// | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
@@ -269,8 +269,8 @@ namespace LukeHagar.PlexAPI.SDK
public string? ClientID;
public string? ClientName;
public string? ClientVersion;
public string? ClientPlatform;
public string? DeviceName;
public string? Platform;
public string? DeviceNickname;
public SDKHooks Hooks = new SDKHooks();
public RetryConfig? RetryConfig = null;
@@ -311,7 +311,7 @@ namespace LukeHagar.PlexAPI.SDK
/// <br/>
/// ## SDKs<br/>
/// <br/>
/// The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the respective repository.<br/>
/// The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
/// <br/>
/// | Language | Repository | Releases | Other |<br/>
/// | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
@@ -331,10 +331,10 @@ namespace LukeHagar.PlexAPI.SDK
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private int _serverIndex = 0;
private ISpeakeasyHttpClient _client;
@@ -356,7 +356,7 @@ namespace LukeHagar.PlexAPI.SDK
public ISessions Sessions { get; private set; }
public IUpdater Updater { get; private set; }
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, string? clientID = null, string? clientName = null, string? clientVersion = null, string? clientPlatform = null, string? deviceName = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, string? clientID = null, string? clientName = null, string? clientVersion = null, string? platform = null, string? deviceNickname = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
{
if (serverIndex != null)
{
@@ -401,8 +401,8 @@ namespace LukeHagar.PlexAPI.SDK
ClientID = clientID,
ClientName = clientName,
ClientVersion = clientVersion,
ClientPlatform = clientPlatform,
DeviceName = deviceName,
Platform = platform,
DeviceNickname = deviceNickname,
ServerDefaults = serverDefaults,
ServerIndex = _serverIndex,
ServerUrl = _serverUrl,

View File

@@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null);
Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null);
/// <summary>
/// Perform a voice search
@@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null);
Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Search Results
@@ -73,7 +73,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will search the database for the string provided.
/// </remarks>
/// </summary>
Task<GetSearchResultsResponse> GetSearchResultsAsync(string query);
Task<GetSearchResultsResponse> GetSearchResultsAsync(string query, RetryConfig? retryConfig = null);
}
/// <summary>
@@ -87,10 +87,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -103,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null)
public async Task<PerformSearchResponse> PerformSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null)
{
var request = new PerformSearchRequest()
{
@@ -125,11 +125,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("performSearch", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -197,7 +230,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null)
public async Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null)
{
var request = new PerformVoiceSearchRequest()
{
@@ -219,11 +252,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("performVoiceSearch", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -291,7 +357,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetSearchResultsResponse> GetSearchResultsAsync(string query)
public async Task<GetSearchResultsResponse> GetSearchResultsAsync(string query, RetryConfig? retryConfig = null)
{
var request = new GetSearchResultsRequest()
{
@@ -311,11 +377,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getSearchResults", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Server Capabilities
/// </remarks>
/// </summary>
Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync();
Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Get Server Preferences
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Server Preferences
/// </remarks>
/// </summary>
Task<GetServerPreferencesResponse> GetServerPreferencesAsync();
Task<GetServerPreferencesResponse> GetServerPreferencesAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Get Available Clients
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Available Clients
/// </remarks>
/// </summary>
Task<GetAvailableClientsResponse> GetAvailableClientsAsync();
Task<GetAvailableClientsResponse> GetAvailableClientsAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Get Devices
@@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Devices
/// </remarks>
/// </summary>
Task<GetDevicesResponse> GetDevicesAsync();
Task<GetDevicesResponse> GetDevicesAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Get Server Identity
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This request is useful to determine if the server is online or offline
/// </remarks>
/// </summary>
Task<GetServerIdentityResponse> GetServerIdentityAsync();
Task<GetServerIdentityResponse> GetServerIdentityAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Get MyPlex Account
@@ -84,7 +84,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Returns MyPlex Account Information
/// </remarks>
/// </summary>
Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync();
Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Get a Resized Photo
@@ -94,7 +94,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request);
Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request, RetryConfig? retryConfig = null);
/// <summary>
/// Get Media Providers
@@ -103,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Retrieves media providers and their features from the Plex server.
/// </remarks>
/// </summary>
Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken);
Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken, RetryConfig? retryConfig = null);
/// <summary>
/// Get Server List
@@ -112,7 +112,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Server List
/// </remarks>
/// </summary>
Task<GetServerListResponse> GetServerListAsync();
Task<GetServerListResponse> GetServerListAsync(RetryConfig? retryConfig = null);
}
/// <summary>
@@ -126,10 +126,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -142,7 +142,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync()
public async Task<GetServerCapabilitiesResponse> GetServerCapabilitiesAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -159,11 +159,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getServerCapabilities", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -239,7 +272,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetServerPreferencesResponse> GetServerPreferencesAsync()
public async Task<GetServerPreferencesResponse> GetServerPreferencesAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -256,11 +289,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getServerPreferences", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -336,7 +402,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetAvailableClientsResponse> GetAvailableClientsAsync()
public async Task<GetAvailableClientsResponse> GetAvailableClientsAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -353,11 +419,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getAvailableClients", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -433,7 +532,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetDevicesResponse> GetDevicesAsync()
public async Task<GetDevicesResponse> GetDevicesAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -450,11 +549,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getDevices", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -530,7 +662,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetServerIdentityResponse> GetServerIdentityAsync()
public async Task<GetServerIdentityResponse> GetServerIdentityAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -542,11 +674,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-server-identity", null, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 408 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -611,7 +776,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync()
public async Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -628,11 +793,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getMyPlexAccount", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -708,7 +906,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request)
public async Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/photo/:/transcode", request);
@@ -724,11 +922,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getResizedPhoto", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -796,17 +1027,19 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken)
public async Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken, RetryConfig? retryConfig = null)
{
var request = new GetMediaProvidersRequest()
{
XPlexToken = xPlexToken,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/media/providers", request);
var urlString = baseUrl + "/media/providers";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null)
{
@@ -816,11 +1049,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-media-providers", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -896,7 +1162,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetServerListResponse> GetServerListAsync()
public async Task<GetServerListResponse> GetServerListAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -913,11 +1179,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getServerList", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will retrieve the &quot;Now Playing&quot; Information of the PMS.
/// </remarks>
/// </summary>
Task<GetSessionsResponse> GetSessionsAsync();
Task<GetSessionsResponse> GetSessionsAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Get Session History
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will Retrieve a listing of all history views.
/// </remarks>
/// </summary>
Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null);
Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Transcode Sessions
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Transcode Sessions
/// </remarks>
/// </summary>
Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync();
Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Stop a Transcode Session
@@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Stop a Transcode Session
/// </remarks>
/// </summary>
Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey);
Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey, RetryConfig? retryConfig = null);
}
/// <summary>
@@ -80,10 +80,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -96,7 +96,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<GetSessionsResponse> GetSessionsAsync()
public async Task<GetSessionsResponse> GetSessionsAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -113,11 +113,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getSessions", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -193,7 +226,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null)
public async Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null, RetryConfig? retryConfig = null)
{
var request = new GetSessionHistoryRequest()
{
@@ -216,11 +249,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getSessionHistory", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -296,7 +362,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync()
public async Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -313,11 +379,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getTranscodeSessions", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -393,7 +492,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey)
public async Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey, RetryConfig? retryConfig = null)
{
var request = new StopTranscodeSessionRequest()
{
@@ -413,11 +512,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("stopTranscodeSession", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will return the media statistics for the server
/// </remarks>
/// </summary>
Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null);
Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Resources Statistics
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will return the resources for the server
/// </remarks>
/// </summary>
Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null);
Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null);
/// <summary>
/// Get Bandwidth Statistics
@@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK
/// This will return the bandwidth statistics for the server
/// </remarks>
/// </summary>
Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null);
Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null);
}
/// <summary>
@@ -71,10 +71,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -87,7 +87,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null)
public async Task<GetStatisticsResponse> GetStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null)
{
var request = new GetStatisticsRequest()
{
@@ -107,11 +107,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getStatistics", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -187,7 +220,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null)
public async Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null)
{
var request = new GetResourcesStatisticsRequest()
{
@@ -207,11 +240,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getResourcesStatistics", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -287,7 +353,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null)
public async Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null)
{
var request = new GetBandwidthStatisticsRequest()
{
@@ -307,11 +373,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getBandwidthStatistics", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Querying status of updates
/// </remarks>
/// </summary>
Task<GetUpdateStatusResponse> GetUpdateStatusAsync();
Task<GetUpdateStatusResponse> GetUpdateStatusAsync(RetryConfig? retryConfig = null);
/// <summary>
/// Checking for updates
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Checking for updates
/// </remarks>
/// </summary>
Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null);
Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null, RetryConfig? retryConfig = null);
/// <summary>
/// Apply Updates
@@ -59,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null);
Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null, RetryConfig? retryConfig = null);
}
/// <summary>
@@ -74,10 +74,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -90,7 +90,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<GetUpdateStatusResponse> GetUpdateStatusAsync()
public async Task<GetUpdateStatusResponse> GetUpdateStatusAsync(RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -107,11 +107,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getUpdateStatus", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -187,7 +220,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null)
public async Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null, RetryConfig? retryConfig = null)
{
var request = new CheckForUpdatesRequest()
{
@@ -207,11 +240,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("checkForUpdates", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -279,7 +345,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null)
public async Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null, RetryConfig? retryConfig = null)
{
var request = new ApplyUpdatesRequest()
{
@@ -300,11 +366,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("applyUpdates", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get the timeline for a media item
/// </remarks>
/// </summary>
Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request);
Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request, RetryConfig? retryConfig = null);
/// <summary>
/// Start Universal Transcode
@@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Begin a Universal Transcode Session
/// </remarks>
/// </summary>
Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request);
Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request, RetryConfig? retryConfig = null);
}
/// <summary>
@@ -62,10 +62,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -78,7 +78,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request)
public async Task<GetTimelineResponse> GetTimelineAsync(GetTimelineRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/:/timeline", request);
@@ -94,11 +94,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("getTimeline", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
@@ -166,7 +199,7 @@ namespace LukeHagar.PlexAPI.SDK
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request)
public async Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/video/:/transcode/universal/start.mpd", request);
@@ -182,11 +215,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("startUniversalTranscode", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

View File

@@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Get User Watchlist
/// </remarks>
/// </summary>
Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null);
Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null, RetryConfig? retryConfig = null);
}
/// <summary>
@@ -59,10 +59,10 @@ namespace LukeHagar.PlexAPI.SDK
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.8.2";
private const string _sdkGenVersion = "2.426.2";
private const string _sdkVersion = "0.9.0";
private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.2 2.426.2 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.9.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = config;
}
public async Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null)
public async Task<GetWatchListResponse> GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null, RetryConfig? retryConfig = null)
{
string baseUrl = Utilities.TemplateUrl(GetWatchListServerList[0], new Dictionary<string, string>(){
});
@@ -87,6 +87,7 @@ namespace LukeHagar.PlexAPI.SDK
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
if (_securitySource != null)
{
@@ -96,11 +97,44 @@ namespace LukeHagar.PlexAPI.SDK
var hookCtx = new HookContext("get-watch-list", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}
List<string> statusCodes = new List<string>
{
"5XX",
};
Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)

145
NUGET.md
View File

@@ -12,11 +12,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -25,65 +25,90 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
```
<!-- End SDK Example Usage [usage] -->
<!-- Start Global Parameters [global-parameters] -->
## Global Parameters
<!-- Start Retries [retries] -->
## Retries
## Global Parameters
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
### Available Globals
The following global parameters are available.
| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| clientID | string | | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
|
| clientName | string | | The ClientName parameter. |
| clientVersion | string | | The ClientVersion parameter. |
| clientPlatform | string | | The ClientPlatform parameter. |
| deviceName | string | | The DeviceName parameter. |
### Example
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetPinRequest req = new GetPinRequest() {};
var res = await sdk.Plex.GetPinAsync(req);
var res = await sdk.Server.GetServerCapabilitiesAsync(retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
));
// handle response
```
<!-- End Global Parameters [global-parameters] -->
If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
),
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
```
<!-- End Retries [retries] -->
<!-- Start Error Handling [errors] -->
## Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type.
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
| Error Object | Status Code | Content Type |
By default, an API error will raise a `LukeHagar.PlexAPI.SDK.Models.Errors.SDKException` exception, which has the following properties:
| Property | Type | Description |
|---------------|-----------------------|-----------------------|
| `Message` | *string* | The error message |
| `StatusCode` | *int* | The HTTP status code |
| `RawResponse` | *HttpResponseMessage* | The raw HTTP response |
| `Body` | *string* | The response content |
When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `GetServerCapabilitiesAsync` method throws the following exceptions:
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
### Example
@@ -95,11 +120,11 @@ using LukeHagar.PlexAPI.SDK.Models.Errors;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
try
@@ -120,7 +145,7 @@ catch (Exception ex)
// Handle exception data
throw;
}
else if (ex is Models.Errors.SDKException)
else if (ex is LukeHagar.PlexAPI.SDK.Models.Errors.SDKException)
{
// Handle default exception
throw;
@@ -163,11 +188,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2");
@@ -194,11 +219,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();

149
README.md
View File

@@ -36,11 +36,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -216,11 +216,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2");
@@ -247,11 +247,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -260,65 +260,90 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
```
<!-- End Authentication [security] -->
<!-- Start Global Parameters [global-parameters] -->
## Global Parameters
<!-- Start Retries [retries] -->
## Retries
## Global Parameters
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
### Available Globals
The following global parameters are available.
| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| clientID | string | | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
|
| clientName | string | | The ClientName parameter. |
| clientVersion | string | | The ClientVersion parameter. |
| clientPlatform | string | | The ClientPlatform parameter. |
| deviceName | string | | The DeviceName parameter. |
### Example
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetPinRequest req = new GetPinRequest() {};
var res = await sdk.Plex.GetPinAsync(req);
var res = await sdk.Server.GetServerCapabilitiesAsync(retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
));
// handle response
```
<!-- End Global Parameters [global-parameters] -->
If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK:
```csharp
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
),
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
```
<!-- End Retries [retries] -->
<!-- Start Error Handling [errors] -->
## Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type.
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
| Error Object | Status Code | Content Type |
By default, an API error will raise a `LukeHagar.PlexAPI.SDK.Models.Errors.SDKException` exception, which has the following properties:
| Property | Type | Description |
|---------------|-----------------------|-----------------------|
| `Message` | *string* | The error message |
| `StatusCode` | *int* | The HTTP status code |
| `RawResponse` | *HttpResponseMessage* | The raw HTTP response |
| `Body` | *string* | The response content |
When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `GetServerCapabilitiesAsync` method throws the following exceptions:
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
### Example
@@ -330,11 +355,11 @@ using LukeHagar.PlexAPI.SDK.Models.Errors;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
try
@@ -355,7 +380,7 @@ catch (Exception ex)
// Handle exception data
throw;
}
else if (ex is Models.Errors.SDKException)
else if (ex is LukeHagar.PlexAPI.SDK.Models.Errors.SDKException)
{
// Handle default exception
throw;
@@ -381,7 +406,7 @@ Automation and SDKs provided by [Speakeasy](https://speakeasyapi.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 respective repository.
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 |
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
@@ -401,7 +426,7 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Global Parameters](#global-parameters)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Authentication](#authentication)

View File

@@ -284,4 +284,64 @@ Based on:
### Generated
- [csharp v0.8.2] .
### Releases
- [NuGet v0.8.2] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.2 - .
- [NuGet v0.8.2] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.2 - .
## 2024-09-29 00:23:13
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.404.5 (2.426.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.8.3] .
### Releases
- [NuGet v0.8.3] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.3 - .
## 2024-09-30 00:21:52
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.404.5 (2.426.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.8.4] .
### Releases
- [NuGet v0.8.4] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.4 - .
## 2024-09-30 08:46:19
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.404.5 (2.426.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.8.5] .
### Releases
- [NuGet v0.8.5] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.5 - .
## 2024-09-30 17:22:05
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.405.4 (2.428.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.8.6] .
### Releases
- [NuGet v0.8.6] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.6 - .
## 2024-09-30 17:35:18
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.405.4 (2.428.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.8.7] .
### Releases
- [NuGet v0.8.7] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.8.7 - .
## 2024-10-02 09:48:21
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.405.8 (2.429.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.9.0] .
### Releases
- [NuGet v0.9.0] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.9.0 - .

View File

@@ -5,11 +5,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -10,4 +10,4 @@
| `Height` | *long* | :heavy_check_mark: | N/A | 396 |
| `MinSize` | *long* | :heavy_check_mark: | N/A | 1 |
| `Upscale` | *long* | :heavy_check_mark: | N/A | 1 |
| `XPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |

View File

@@ -5,8 +5,8 @@
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| `Tag` | [Tag](../../Models/Requests/Tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | |
| `SectionKey` | *int* | :heavy_check_mark: | The unique key of the Plex library. <br/>Note: This is unique in the context of the Plex server.<br/> | 9518 |
| `IncludeGuids` | [IncludeGuids](../../Models/Requests/IncludeGuids.md) | :heavy_minus_sign: | Adds the Guids object to the response<br/> | 1 |
| `Type` | [GetLibraryItemsQueryParamType](../../Models/Requests/GetLibraryItemsQueryParamType.md) | :heavy_minus_sign: | The type of media to retrieve.<br/>1 = movie<br/>2 = show<br/>3 = season<br/>4 = episode<br/>E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries<br/> | 2 |
| `IncludeMeta` | [GetLibraryItemsQueryParamIncludeMeta](../../Models/Requests/GetLibraryItemsQueryParamIncludeMeta.md) | :heavy_minus_sign: | Adds the Meta object to the response<br/> | 1 |

View File

@@ -3,6 +3,6 @@
## Fields
| Field | Type | Required | Description | Example |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- |
| `XPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| Field | Type | Required | Description | Example |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |

View File

@@ -15,7 +15,7 @@
| `Title` | *string* | :heavy_minus_sign: | N/A | Season 2 |
| `ParentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/30072 |
| `ParentTitle` | *string* | :heavy_minus_sign: | N/A | Reacher |
| `Summary` | *string* | :heavy_minus_sign: | N/A | Based on"Bad Luck and Trouble," when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mindrevenge. |
| `Summary` | *string* | :heavy_minus_sign: | N/A | Based on"Bad Luck and Trouble," when members of Reacher's old military unit start turning up dead, Reacher has just one thing on his mind-revenge. |
| `Index` | *int* | :heavy_minus_sign: | N/A | 2 |
| `ParentIndex` | *int* | :heavy_minus_sign: | N/A | 1 |
| `ViewCount` | *int* | :heavy_minus_sign: | N/A | 11 |

View File

@@ -3,11 +3,11 @@
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Strong` | *bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | |
| `ClientID` | *string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | gcgzw5rz2xovp84b4vha3a40 |
| `ClientName` | *string* | :heavy_minus_sign: | N/A | Plex Web |
| `DeviceName` | *string* | :heavy_minus_sign: | N/A | Linux |
| `ClientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 |
| `ClientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome |
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Strong` | *bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | |
| `ClientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `ClientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku |
| `DeviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 |
| `ClientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |
| `Platform` | *string* | :heavy_minus_sign: | The platform of the client application. | Roku |

View File

@@ -7,4 +7,5 @@
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `IncludeHttps` | [IncludeHttps](../../Models/Requests/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 |
| `IncludeRelay` | [IncludeRelay](../../Models/Requests/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 |
| `IncludeIPv6` | [IncludeIPv6](../../Models/Requests/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
| `IncludeIPv6` | [IncludeIPv6](../../Models/Requests/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
| `ClientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |

View File

@@ -10,4 +10,4 @@
| `Height` | *long* | :heavy_check_mark: | N/A | 396 |
| `MinSize` | *long* | :heavy_check_mark: | N/A | 1 |
| `Upscale` | *long* | :heavy_check_mark: | N/A | 1 |
| `XPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |

View File

@@ -3,11 +3,11 @@
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | |
| `ClientID` | *string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | gcgzw5rz2xovp84b4vha3a40 |
| `ClientName` | *string* | :heavy_minus_sign: | N/A | Plex Web |
| `DeviceName` | *string* | :heavy_minus_sign: | N/A | Linux |
| `ClientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 |
| `ClientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome |
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `PinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | |
| `ClientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `ClientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku |
| `DeviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 |
| `ClientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |
| `Platform` | *string* | :heavy_minus_sign: | The platform of the client application. | Roku |

View File

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

View File

@@ -6,7 +6,7 @@
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Filter` | [Filter](../../Models/Requests/Filter.md) | :heavy_check_mark: | Filter | |
| `XPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |
| `Sort` | *string* | :heavy_minus_sign: | In the format "field:dir". Available fields are "watchlistedAt" (Added At),<br/>"titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).<br/>"dir" can be "asc" or "desc"<br/> | |
| `Libtype` | [Libtype](../../Models/Requests/Libtype.md) | :heavy_minus_sign: | The type of library to filter. Can be "movie" or "show", or all if not present.<br/> | |
| `Maxresults` | *int* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.<br/>If the number of items exceeds the limit, the response will be paginated.<br/> | |

View File

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

View File

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

View File

@@ -3,11 +3,11 @@
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ClientID` | *string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | gcgzw5rz2xovp84b4vha3a40 |
| `ClientName` | *string* | :heavy_minus_sign: | N/A | Plex Web |
| `DeviceName` | *string* | :heavy_minus_sign: | N/A | Linux |
| `ClientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 |
| `ClientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome |
| `RequestBody` | [PostUsersSignInDataRequestBody](../../Models/Requests/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | |
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `ClientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `ClientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku |
| `DeviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 |
| `ClientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |
| `Platform` | *string* | :heavy_minus_sign: | The platform of the client application. | Roku |
| `RequestBody` | [PostUsersSignInDataRequestBody](../../Models/Requests/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | |

View File

@@ -29,11 +29,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Activities.GetServerActivitiesAsync();
@@ -47,12 +47,11 @@ var res = await sdk.Activities.GetServerActivitiesAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerActivitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerActivitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## CancelServerActivities
@@ -67,11 +66,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Activities.CancelServerActivitiesAsync(activityUUID: "25b71ed5-0f9d-461c-baa7-d404e9e10d3e");
@@ -91,8 +90,8 @@ var res = await sdk.Activities.CancelServerActivitiesAsync(activityUUID: "25b71e
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.CancelServerActivitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.CancelServerActivitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -27,11 +27,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Authentication.GetTransientTokenAsync(
@@ -55,12 +55,11 @@ var res = await sdk.Authentication.GetTransientTokenAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTransientTokenBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTransientTokenUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetSourceConnectionInformation
@@ -77,11 +76,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Authentication.GetSourceConnectionInformationAsync(source: "server://client-identifier");
@@ -101,12 +100,11 @@ var res = await sdk.Authentication.GetSourceConnectionInformationAsync(source: "
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSourceConnectionInformationBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSourceConnectionInformationUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetTokenDetails
@@ -120,11 +118,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Authentication.GetTokenDetailsAsync();
@@ -144,12 +142,11 @@ var res = await sdk.Authentication.GetTokenDetailsAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTokenDetailsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTokenDetailsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## PostUsersSignInData
@@ -163,11 +160,11 @@ using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
PostUsersSignInDataRequest req = new PostUsersSignInDataRequest() {
@@ -196,8 +193,8 @@ var res = await sdk.Authentication.PostUsersSignInDataAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.PostUsersSignInDataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.PostUsersSignInDataUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -26,11 +26,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Butler.GetButlerTasksAsync();
@@ -44,12 +44,11 @@ var res = await sdk.Butler.GetButlerTasksAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetButlerTasksBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetButlerTasksUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## StartAllTasks
@@ -68,11 +67,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Butler.StartAllTasksAsync();
@@ -86,12 +85,11 @@ var res = await sdk.Butler.StartAllTasksAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.StartAllTasksBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StartAllTasksUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## StopAllTasks
@@ -106,11 +104,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Butler.StopAllTasksAsync();
@@ -124,12 +122,11 @@ var res = await sdk.Butler.StopAllTasksAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.StopAllTasksBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StopAllTasksUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## StartTask
@@ -149,11 +146,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Butler.StartTaskAsync(taskName: LukeHagar.PlexAPI.SDK.Models.Requests.TaskName.CleanOldBundles);
@@ -173,12 +170,11 @@ var res = await sdk.Butler.StartTaskAsync(taskName: LukeHagar.PlexAPI.SDK.Models
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.StartTaskBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StartTaskUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## StopTask
@@ -194,11 +190,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Butler.StopTaskAsync(taskName: LukeHagar.PlexAPI.SDK.Models.Requests.PathParamTaskName.BackupDatabase);
@@ -218,8 +214,8 @@ var res = await sdk.Butler.StopTaskAsync(taskName: LukeHagar.PlexAPI.SDK.Models.
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.StopTaskBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StopTaskUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -25,11 +25,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Hubs.GetGlobalHubsAsync(
@@ -53,12 +53,11 @@ var res = await sdk.Hubs.GetGlobalHubsAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetGlobalHubsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetGlobalHubsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetRecentlyAdded
@@ -74,11 +73,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetRecentlyAddedRequest req = new GetRecentlyAddedRequest() {
@@ -107,10 +106,9 @@ var res = await sdk.Hubs.GetRecentlyAddedAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetLibraryHubs
@@ -126,11 +124,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Hubs.GetLibraryHubsAsync(
@@ -156,8 +154,8 @@ var res = await sdk.Hubs.GetLibraryHubsAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetLibraryHubsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetLibraryHubsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -34,11 +34,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.GetFileHashAsync(
@@ -62,12 +62,11 @@ var res = await sdk.Library.GetFileHashAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetFileHashBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetFileHashUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetRecentlyAddedLibrary
@@ -84,11 +83,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetRecentlyAddedLibraryRequest req = new GetRecentlyAddedLibraryRequest() {
@@ -131,12 +130,11 @@ var res = await sdk.Library.GetRecentlyAddedLibraryAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetRecentlyAddedLibraryBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetRecentlyAddedLibraryUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetAllLibraries
@@ -156,11 +154,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.GetAllLibrariesAsync();
@@ -174,12 +172,11 @@ var res = await sdk.Library.GetAllLibrariesAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetAllLibrariesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetAllLibrariesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetLibraryDetails
@@ -233,11 +230,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.GetLibraryDetailsAsync(
@@ -261,12 +258,11 @@ var res = await sdk.Library.GetLibraryDetailsAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetLibraryDetailsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetLibraryDetailsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## DeleteLibrary
@@ -281,11 +277,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.DeleteLibraryAsync(sectionKey: 9518);
@@ -305,12 +301,11 @@ var res = await sdk.Library.DeleteLibraryAsync(sectionKey: 9518);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.DeleteLibraryBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.DeleteLibraryUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetLibraryItems
@@ -345,16 +340,16 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetLibraryItemsRequest req = new GetLibraryItemsRequest() {
SectionKey = 9518,
Tag = LukeHagar.PlexAPI.SDK.Models.Requests.Tag.Edition,
SectionKey = 9518,
IncludeGuids = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeGuids.Enable,
Type = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsQueryParamType.TvShow,
IncludeMeta = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsQueryParamIncludeMeta.Enable,
@@ -379,12 +374,11 @@ var res = await sdk.Library.GetLibraryItemsAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetLibraryItemsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetLibraryItemsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetRefreshLibraryMetadata
@@ -400,11 +394,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.GetRefreshLibraryMetadataAsync(
@@ -428,12 +422,11 @@ var res = await sdk.Library.GetRefreshLibraryMetadataAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetRefreshLibraryMetadataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetRefreshLibraryMetadataUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetSearchLibrary
@@ -466,11 +459,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.GetSearchLibraryAsync(
@@ -494,12 +487,11 @@ var res = await sdk.Library.GetSearchLibraryAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSearchLibraryBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSearchLibraryUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetMetaDataByRatingKey
@@ -515,11 +507,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.GetMetaDataByRatingKeyAsync(ratingKey: 9518);
@@ -539,12 +531,11 @@ var res = await sdk.Library.GetMetaDataByRatingKeyAsync(ratingKey: 9518);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMetaDataByRatingKeyBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMetaDataByRatingKeyUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetMetadataChildren
@@ -560,11 +551,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.GetMetadataChildrenAsync(
@@ -588,12 +579,11 @@ var res = await sdk.Library.GetMetadataChildrenAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMetadataChildrenBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMetadataChildrenUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetTopWatchedContent
@@ -609,11 +599,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.GetTopWatchedContentAsync(
@@ -637,12 +627,11 @@ var res = await sdk.Library.GetTopWatchedContentAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTopWatchedContentBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTopWatchedContentUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetOnDeck
@@ -657,11 +646,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Library.GetOnDeckAsync();
@@ -675,8 +664,8 @@ var res = await sdk.Library.GetOnDeckAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetOnDeckBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetOnDeckUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -26,11 +26,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Log.LogLineAsync(
@@ -56,12 +56,11 @@ var res = await sdk.Log.LogLineAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.LogLineBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.LogLineUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## LogMultiLine
@@ -96,11 +95,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
string req = "level=4&message=Test%20message%201&source=postman
@@ -124,12 +123,11 @@ var res = await sdk.Log.LogMultiLineAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.LogMultiLineBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.LogMultiLineUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## EnablePaperTrail
@@ -144,11 +142,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Log.EnablePaperTrailAsync();
@@ -162,8 +160,8 @@ var res = await sdk.Log.EnablePaperTrailAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.EnablePaperTrailBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.EnablePaperTrailUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -27,11 +27,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Media.MarkPlayedAsync(key: 59398D);
@@ -51,12 +51,11 @@ var res = await sdk.Media.MarkPlayedAsync(key: 59398D);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.MarkPlayedBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.MarkPlayedUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## MarkUnplayed
@@ -71,11 +70,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Media.MarkUnplayedAsync(key: 59398D);
@@ -95,12 +94,11 @@ var res = await sdk.Media.MarkUnplayedAsync(key: 59398D);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.MarkUnplayedBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.MarkUnplayedUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## UpdatePlayProgress
@@ -116,11 +114,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Media.UpdatePlayProgressAsync(
@@ -146,12 +144,11 @@ var res = await sdk.Media.UpdatePlayProgressAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.UpdatePlayProgressBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.UpdatePlayProgressUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetBannerImage
@@ -166,11 +163,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetBannerImageRequest req = new GetBannerImageRequest() {
@@ -199,12 +196,11 @@ var res = await sdk.Media.GetBannerImageAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetBannerImageBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetBannerImageUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetThumbImage
@@ -219,11 +215,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetThumbImageRequest req = new GetThumbImageRequest() {
@@ -252,8 +248,8 @@ var res = await sdk.Media.GetThumbImageAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetThumbImageBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetThumbImageUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -37,11 +37,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
CreatePlaylistRequest req = new CreatePlaylistRequest() {
@@ -68,12 +68,11 @@ var res = await sdk.Playlists.CreatePlaylistAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.CreatePlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.CreatePlaylistUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetPlaylists
@@ -88,11 +87,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Playlists.GetPlaylistsAsync(
@@ -116,12 +115,11 @@ var res = await sdk.Playlists.GetPlaylistsAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPlaylistsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPlaylistsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetPlaylist
@@ -138,11 +136,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Playlists.GetPlaylistAsync(playlistID: 4109.48D);
@@ -162,12 +160,11 @@ var res = await sdk.Playlists.GetPlaylistAsync(playlistID: 4109.48D);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPlaylistUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## DeletePlaylist
@@ -183,11 +180,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Playlists.DeletePlaylistAsync(playlistID: 216.22D);
@@ -207,12 +204,11 @@ var res = await sdk.Playlists.DeletePlaylistAsync(playlistID: 216.22D);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.DeletePlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.DeletePlaylistUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## UpdatePlaylist
@@ -228,11 +224,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Playlists.UpdatePlaylistAsync(
@@ -258,12 +254,11 @@ var res = await sdk.Playlists.UpdatePlaylistAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.UpdatePlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.UpdatePlaylistUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetPlaylistContents
@@ -282,11 +277,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Playlists.GetPlaylistContentsAsync(
@@ -310,12 +305,11 @@ var res = await sdk.Playlists.GetPlaylistContentsAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPlaylistContentsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPlaylistContentsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## ClearPlaylistContents
@@ -331,11 +325,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Playlists.ClearPlaylistContentsAsync(playlistID: 1893.18D);
@@ -355,12 +349,11 @@ var res = await sdk.Playlists.ClearPlaylistContentsAsync(playlistID: 1893.18D);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.ClearPlaylistContentsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.ClearPlaylistContentsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## AddPlaylistContents
@@ -377,11 +370,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Playlists.AddPlaylistContentsAsync(
@@ -407,12 +400,11 @@ var res = await sdk.Playlists.AddPlaylistContentsAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.AddPlaylistContentsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.AddPlaylistContentsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## UploadPlaylist
@@ -428,11 +420,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Playlists.UploadPlaylistAsync(
@@ -458,8 +450,8 @@ var res = await sdk.Playlists.UploadPlaylistAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.UploadPlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.UploadPlaylistUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -28,11 +28,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Plex.GetCompanionsDataAsync();
@@ -52,12 +52,11 @@ var res = await sdk.Plex.GetCompanionsDataAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetCompanionsDataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetCompanionsDataUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetUserFriends
@@ -71,11 +70,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Plex.GetUserFriendsAsync();
@@ -95,12 +94,11 @@ var res = await sdk.Plex.GetUserFriendsAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetUserFriendsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetUserFriendsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetGeoData
@@ -113,11 +111,11 @@ using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Plex.GetGeoDataAsync();
@@ -137,12 +135,11 @@ var res = await sdk.Plex.GetGeoDataAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetGeoDataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetGeoDataUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetHomeData
@@ -156,11 +153,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Plex.GetHomeDataAsync();
@@ -174,12 +171,11 @@ var res = await sdk.Plex.GetHomeDataAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetHomeDataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetHomeDataUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetServerResources
@@ -194,17 +190,18 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Plex.GetServerResourcesAsync(
includeHttps: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeHttps.Enable,
includeRelay: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeRelay.Enable,
includeIPv6: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.Enable
includeIPv6: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.Enable,
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58"
);
// handle response
@@ -217,6 +214,7 @@ var res = await sdk.Plex.GetServerResourcesAsync(
| `IncludeHttps` | [IncludeHttps](../../Models/Requests/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 |
| `IncludeRelay` | [IncludeRelay](../../Models/Requests/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 |
| `IncludeIPv6` | [IncludeIPv6](../../Models/Requests/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
| `ClientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
### Response
@@ -225,12 +223,11 @@ var res = await sdk.Plex.GetServerResourcesAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerResourcesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerResourcesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetPin
@@ -244,11 +241,11 @@ using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetPinRequest req = new GetPinRequest() {};
@@ -271,11 +268,10 @@ var res = await sdk.Plex.GetPinAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPinBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetTokenByPinId
@@ -289,11 +285,11 @@ using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetTokenByPinIdRequest req = new GetTokenByPinIdRequest() {
@@ -318,8 +314,8 @@ var res = await sdk.Plex.GetTokenByPinIdAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTokenByPinIdBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTokenByPinIdResponseBody | 404 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -14,7 +14,7 @@ Automation and SDKs provided by [Speakeasy](https://speakeasyapi.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 respective repository.
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 |
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |

View File

@@ -37,11 +37,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Search.PerformSearchAsync(
@@ -67,12 +67,11 @@ var res = await sdk.Search.PerformSearchAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.PerformSearchBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.PerformSearchUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## PerformVoiceSearch
@@ -91,11 +90,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Search.PerformVoiceSearchAsync(
@@ -121,12 +120,11 @@ var res = await sdk.Search.PerformVoiceSearchAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.PerformVoiceSearchBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.PerformVoiceSearchUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetSearchResults
@@ -141,11 +139,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Search.GetSearchResultsAsync(query: "110");
@@ -165,8 +163,8 @@ var res = await sdk.Search.GetSearchResultsAsync(query: "110");
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSearchResultsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSearchResultsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -30,11 +30,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -48,12 +48,11 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetServerPreferences
@@ -67,11 +66,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerPreferencesAsync();
@@ -85,12 +84,11 @@ var res = await sdk.Server.GetServerPreferencesAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerPreferencesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerPreferencesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetAvailableClients
@@ -104,11 +102,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetAvailableClientsAsync();
@@ -122,12 +120,11 @@ var res = await sdk.Server.GetAvailableClientsAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetAvailableClientsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetAvailableClientsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetDevices
@@ -141,11 +138,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetDevicesAsync();
@@ -159,12 +156,11 @@ var res = await sdk.Server.GetDevicesAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetDevicesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetDevicesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetServerIdentity
@@ -177,11 +173,11 @@ using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerIdentityAsync();
@@ -195,11 +191,10 @@ var res = await sdk.Server.GetServerIdentityAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerIdentityRequestTimeout | 408 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetMyPlexAccount
@@ -213,11 +208,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetMyPlexAccountAsync();
@@ -231,12 +226,11 @@ var res = await sdk.Server.GetMyPlexAccountAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMyPlexAccountBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMyPlexAccountUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetResizedPhoto
@@ -252,11 +246,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetResizedPhotoRequest req = new GetResizedPhotoRequest() {
@@ -286,12 +280,11 @@ var res = await sdk.Server.GetResizedPhotoAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetResizedPhotoBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetResizedPhotoUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetMediaProviders
@@ -306,11 +299,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetMediaProvidersAsync(xPlexToken: "CV5xoxjTpFKUzBTShsaf");
@@ -320,9 +313,9 @@ var res = await sdk.Server.GetMediaProvidersAsync(xPlexToken: "CV5xoxjTpFKUzBTSh
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- |
| `XPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf |
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |
### Response
@@ -330,12 +323,11 @@ var res = await sdk.Server.GetMediaProvidersAsync(xPlexToken: "CV5xoxjTpFKUzBTSh
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMediaProvidersBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMediaProvidersUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetServerList
@@ -349,11 +341,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Server.GetServerListAsync();
@@ -367,8 +359,8 @@ var res = await sdk.Server.GetServerListAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerListBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerListUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -25,11 +25,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Sessions.GetSessionsAsync();
@@ -43,12 +43,11 @@ var res = await sdk.Sessions.GetSessionsAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSessionsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSessionsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetSessionHistory
@@ -63,11 +62,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Sessions.GetSessionHistoryAsync(
@@ -95,12 +94,11 @@ var res = await sdk.Sessions.GetSessionHistoryAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSessionHistoryBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSessionHistoryUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetTranscodeSessions
@@ -114,11 +112,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Sessions.GetTranscodeSessionsAsync();
@@ -132,12 +130,11 @@ var res = await sdk.Sessions.GetTranscodeSessionsAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTranscodeSessionsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTranscodeSessionsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## StopTranscodeSession
@@ -152,11 +149,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Sessions.StopTranscodeSessionAsync(sessionKey: "zz7llzqlx8w9vnrsbnwhbmep");
@@ -176,8 +173,8 @@ var res = await sdk.Sessions.StopTranscodeSessionAsync(sessionKey: "zz7llzqlx8w9
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.StopTranscodeSessionBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StopTranscodeSessionUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -25,11 +25,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Statistics.GetStatisticsAsync(timespan: 4);
@@ -49,12 +49,11 @@ var res = await sdk.Statistics.GetStatisticsAsync(timespan: 4);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetStatisticsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetStatisticsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetResourcesStatistics
@@ -69,11 +68,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Statistics.GetResourcesStatisticsAsync(timespan: 4);
@@ -93,12 +92,11 @@ var res = await sdk.Statistics.GetResourcesStatisticsAsync(timespan: 4);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetResourcesStatisticsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetResourcesStatisticsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetBandwidthStatistics
@@ -113,11 +111,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Statistics.GetBandwidthStatisticsAsync(timespan: 4);
@@ -137,8 +135,8 @@ var res = await sdk.Statistics.GetBandwidthStatisticsAsync(timespan: 4);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetBandwidthStatisticsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetBandwidthStatisticsUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -25,11 +25,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Updater.GetUpdateStatusAsync();
@@ -43,12 +43,11 @@ var res = await sdk.Updater.GetUpdateStatusAsync();
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetUpdateStatusBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetUpdateStatusUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## CheckForUpdates
@@ -63,11 +62,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Updater.CheckForUpdatesAsync(download: LukeHagar.PlexAPI.SDK.Models.Requests.Download.One);
@@ -87,12 +86,11 @@ var res = await sdk.Updater.CheckForUpdatesAsync(download: LukeHagar.PlexAPI.SDK
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.CheckForUpdatesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.CheckForUpdatesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## ApplyUpdates
@@ -108,11 +106,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
var res = await sdk.Updater.ApplyUpdatesAsync(
@@ -136,8 +134,8 @@ var res = await sdk.Updater.ApplyUpdatesAsync(
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.ApplyUpdatesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.ApplyUpdatesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -24,11 +24,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetTimelineRequest req = new GetTimelineRequest() {
@@ -61,12 +61,11 @@ var res = await sdk.Video.GetTimelineAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTimelineBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTimelineUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## StartUniversalTranscode
@@ -81,11 +80,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
StartUniversalTranscodeRequest req = new StartUniversalTranscodeRequest() {
@@ -124,8 +123,8 @@ var res = await sdk.Video.StartUniversalTranscodeAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| LukeHagar.PlexAPI.SDK.Models.Errors.StartUniversalTranscodeBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StartUniversalTranscodeUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |

View File

@@ -23,11 +23,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
clientVersion: "2.4.1",
platform: "Roku",
deviceNickname: "Roku 3"
);
GetWatchListRequest req = new GetWatchListRequest() {
@@ -55,8 +55,8 @@ var res = await sdk.Watchlist.GetWatchListAsync(req);
### Errors
| Error Object | Status Code | Content Type |
| Error Type | Status Code | Content Type |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetWatchListBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetWatchListUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |