Compare commits

...

11 Commits

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,12 +1,12 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: 5a8dbcbc-e0ee-41f0-9d84-b8b50567d1e9 id: 5a8dbcbc-e0ee-41f0-9d84-b8b50567d1e9
management: management:
docChecksum: 5e039359563b41bbe118fc6701ba22dc docChecksum: 649b155561aeea4d804f8713e7b2dcac
docVersion: 0.0.3 docVersion: 0.0.3
speakeasyVersion: 1.402.14 speakeasyVersion: 1.405.8
generationVersion: 2.422.22 generationVersion: 2.429.0
releaseVersion: 0.8.1 releaseVersion: 0.9.1
configChecksum: 67c2fafca972224c918ba21859003791 configChecksum: 38ad5ccb4192ab52c8c4eb6945073cbf
repoURL: https://github.com/LukeHagar/plexcsharp.git repoURL: https://github.com/LukeHagar/plexcsharp.git
repoSubDirectory: . repoSubDirectory: .
published: true published: true
@@ -14,10 +14,10 @@ features:
csharp: csharp:
additionalDependencies: 0.1.0 additionalDependencies: 0.1.0
constsAndDefaults: 0.0.1 constsAndDefaults: 0.0.1
core: 3.10.1 core: 3.10.3
deprecations: 2.81.2 deprecations: 2.81.2
enums: 2.82.0 enums: 2.82.0
errors: 0.0.2 errors: 0.0.3
flattening: 2.81.3 flattening: 2.81.3
globalSecurity: 2.83.6 globalSecurity: 2.83.6
globalSecurityCallbacks: 0.1.0 globalSecurityCallbacks: 0.1.0
@@ -29,6 +29,7 @@ features:
nameOverrides: 2.81.2 nameOverrides: 2.81.2
nullables: 0.1.0 nullables: 0.1.0
responseFormat: 0.0.4 responseFormat: 0.0.4
retries: 0.0.1
sdkHooks: 0.1.0 sdkHooks: 0.1.0
generatedFiles: generatedFiles:
- .gitattributes - .gitattributes
@@ -1689,6 +1690,8 @@ examples:
parameters: parameters:
query: query:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
header:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses: responses:
"401": "401":
application/json: {"errors": []} application/json: {"errors": []}
@@ -1748,6 +1751,8 @@ examples:
minSize: 1 minSize: 1
upscale: 1 upscale: 1
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
header:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses: responses:
"401": "401":
application/json: {"errors": []} application/json: {"errors": []}
@@ -1766,6 +1771,8 @@ examples:
minSize: 1 minSize: 1
upscale: 1 upscale: 1
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
header:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses: responses:
"401": "401":
application/json: {"errors": []} application/json: {"errors": []}
@@ -1922,6 +1929,7 @@ examples:
includeHttps: 1 includeHttps: 1
includeRelay: 1 includeRelay: 1
includeIPv6: 1 includeIPv6: 1
X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40"
responses: responses:
"401": "401":
application/json: {"errors": []} application/json: {"errors": []}
@@ -1929,6 +1937,21 @@ examples:
application/json: [] application/json: []
"400": "400":
application/json: {"errors": []} 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: getPin:
"": "":
parameters: parameters:
@@ -1938,6 +1961,12 @@ examples:
X-Plex-Version: "4.133.0" X-Plex-Version: "4.133.0"
X-Plex-Platform: "Chrome" X-Plex-Platform: "Chrome"
X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40" 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: responses:
"200": "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} 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}
@@ -1950,7 +1979,18 @@ examples:
parameters: parameters:
path: path:
pinID: 408895 pinID: 408895
query: {} query:
X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40"
X-Plex-Product: "Plex Web"
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: responses:
"200": "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} 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}
@@ -2215,6 +2255,8 @@ examples:
X-Plex-Container-Start: 0 X-Plex-Container-Start: 0
X-Plex-Container-Size: 50 X-Plex-Container-Size: 50
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
header:
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses: responses:
"401": "401":
application/json: {"errors": []} application/json: {"errors": []}
@@ -2409,6 +2451,12 @@ examples:
X-Plex-Device: "Linux" X-Plex-Device: "Linux"
X-Plex-Version: "4.133.0" X-Plex-Version: "4.133.0"
X-Plex-Platform: "Chrome" 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: requestBody:
application/x-www-form-urlencoded: {"login": "username@email.com", "password": "password123", "verificationCode": "123456"} application/x-www-form-urlencoded: {"login": "username@email.com", "password": "password123", "verificationCode": "123456"}
responses: responses:
@@ -2594,7 +2642,7 @@ examples:
speakeasy-default-get-token-details: speakeasy-default-get-token-details:
responses: responses:
"200": "200":
application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "unsubscribed", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null} application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "active", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null}
"400": "400":
application/json: {"errors": []} application/json: {"errors": []}
"401": "401":

View File

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

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.402.14 speakeasyVersion: 1.405.8
sources: sources:
my-source: my-source:
sourceNamespace: my-source sourceNamespace: my-source
@@ -16,8 +16,8 @@ sources:
- main - main
plexapi: plexapi:
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e sourceRevisionDigest: sha256:b1e231bd781f352738612b0158382ba51cfac32e97c23d9e4913aab5501e9529
sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e sourceBlobDigest: sha256:8ce05d5965182eb3fe9376715c269b9e1c7f3e2d90273c175a4181735f41daa0
tags: tags:
- latest - latest
- main - main
@@ -25,10 +25,10 @@ targets:
plexcsharp: plexcsharp:
source: plexapi source: plexapi
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:b7081644a59eca24a22b8009506fcf459bf18b07dce0462b39bc36c40d94862e sourceRevisionDigest: sha256:b1e231bd781f352738612b0158382ba51cfac32e97c23d9e4913aab5501e9529
sourceBlobDigest: sha256:6b822f23afbc630bbc0fc12299316ea03d3671a2c2a81241ad4caa49022b430e sourceBlobDigest: sha256:8ce05d5965182eb3fe9376715c269b9e1c7f3e2d90273c175a4181735f41daa0
codeSamplesNamespace: code-samples-csharp-plexcsharp codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:6838159d31ebc591bad7395890ed6d3d9054554b4906bcc7b9d1fb1225379e54 codeSamplesRevisionDigest: sha256:ef462cf1d9335608fd53502cd183401b095536041eac8d1b26d2e1c3366e6a0e
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: latest speakeasyVersion: latest

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -37,5 +37,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeIPv6")] [SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeIPv6")]
public IncludeIPv6? IncludeIPv6 { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.Disable; 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!; public long Upscale { get; set; } = default!;
/// <summary> /// <summary>
/// Plex Authentication Token /// An authentication token, obtained from plex.tv
/// </summary> /// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Token")] [SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")]
public string XPlexToken { get; set; } = default!; public string XPlexToken { get; set; } = default!;
} }
} }

View File

@@ -19,5 +19,35 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary> /// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=pinID")] [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=pinID")]
public long PinID { get; set; } = default!; public long PinID { get; set; } = default!;
/// <summary>
/// An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
public string? ClientID { get; set; }
/// <summary>
/// The name of the client application. (Plex Web, Plex Media Server, etc.)
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product")]
public string? ClientName { get; set; }
/// <summary>
/// A relatively friendly name for the client device
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device")]
public string? DeviceNickname { get; set; }
/// <summary>
/// The version of the client application.
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version")]
public string? ClientVersion { get; set; }
/// <summary>
/// The platform of the client application.
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform")]
public string? Platform { get; set; }
} }
} }

View File

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

View File

@@ -154,7 +154,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public bool? MailingListActive { get; set; } = false; public bool? MailingListActive { get; set; } = false;
/// <summary> /// <summary>
/// Your current mailing list status /// Your current mailing list status (active or unsubscribed)
/// </summary> /// </summary>
[JsonProperty("mailingListStatus")] [JsonProperty("mailingListStatus")]
public MailingListStatus MailingListStatus { get; set; } = default!; public MailingListStatus MailingListStatus { get; set; } = default!;

View File

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

View File

@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using System; using System;
/// <summary> /// <summary>
/// Your current mailing list status /// Your current mailing list status (active or unsubscribed)
/// </summary> /// </summary>
public enum MailingListStatus public enum MailingListStatus
{ {

View File

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

View File

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

View File

@@ -14,7 +14,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
using System; using System;
/// <summary> /// <summary>
/// Your current mailing list status /// Your current mailing list status (active or unsubscribed)
/// </summary> /// </summary>
public enum PostUsersSignInDataMailingListStatus public enum PostUsersSignInDataMailingListStatus
{ {

View File

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

View File

@@ -154,7 +154,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public bool? MailingListActive { get; set; } = false; public bool? MailingListActive { get; set; } = false;
/// <summary> /// <summary>
/// Your current mailing list status /// Your current mailing list status (active or unsubscribed)
/// </summary> /// </summary>
[JsonProperty("mailingListStatus")] [JsonProperty("mailingListStatus")]
public PostUsersSignInDataMailingListStatus MailingListStatus { get; set; } = default!; public PostUsersSignInDataMailingListStatus MailingListStatus { get; set; } = default!;

View File

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

View File

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

View File

@@ -67,6 +67,34 @@ namespace LukeHagar.PlexAPI.SDK
/// <summary> /// <summary>
/// Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server /// Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
///
/// <remarks>
/// # Plex Media Server OpenAPI Specification<br/>
/// <br/>
/// An Open Source OpenAPI Specification for Plex Media Server<br/>
/// <br/>
/// Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
/// <br/>
/// ## Documentation<br/>
/// <br/>
/// <a href="https://plexapi.dev">API Documentation</a><br/>
/// <br/>
/// ## SDKs<br/>
/// <br/>
/// The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
/// <br/>
/// | Language | Repository | Releases | Other |<br/>
/// | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
/// | Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
/// | JavaScript/TypeScript | <a href="https://github.com/LukeHagar/plexjs">GitHub</a> | <a href="https://www.npmjs.com/package/@lukehagar/plexjs">NPM</a> \ <a href="https://jsr.io/@lukehagar/plexjs">JSR</a> | - |<br/>
/// | Go | <a href="https://github.com/LukeHagar/plexgo">GitHub</a> | <a href="https://github.com/LukeHagar/plexgo/releases">Releases</a> | <a href="https://pkg.go.dev/github.com/LukeHagar/plexgo">GoDoc</a> |<br/>
/// | Ruby | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/releases">Releases</a> | - |<br/>
/// | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
/// | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
/// | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
/// | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | - <br/>
///
/// </remarks>
/// </summary> /// </summary>
public interface IPlexAPI public interface IPlexAPI
{ {
@@ -241,8 +269,8 @@ namespace LukeHagar.PlexAPI.SDK
public string? ClientID; public string? ClientID;
public string? ClientName; public string? ClientName;
public string? ClientVersion; public string? ClientVersion;
public string? ClientPlatform; public string? Platform;
public string? DeviceName; public string? DeviceNickname;
public SDKHooks Hooks = new SDKHooks(); public SDKHooks Hooks = new SDKHooks();
public RetryConfig? RetryConfig = null; public RetryConfig? RetryConfig = null;
@@ -269,16 +297,44 @@ namespace LukeHagar.PlexAPI.SDK
/// <summary> /// <summary>
/// Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server /// Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
///
/// <remarks>
/// # Plex Media Server OpenAPI Specification<br/>
/// <br/>
/// An Open Source OpenAPI Specification for Plex Media Server<br/>
/// <br/>
/// Automation and SDKs provided by <a href="https://speakeasyapi.dev/">Speakeasy</a><br/>
/// <br/>
/// ## Documentation<br/>
/// <br/>
/// <a href="https://plexapi.dev">API Documentation</a><br/>
/// <br/>
/// ## SDKs<br/>
/// <br/>
/// The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the <a href="https://github.com/LukeHagar/plex-api-spec">main specification Repository</a>.<br/>
/// <br/>
/// | Language | Repository | Releases | Other |<br/>
/// | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |<br/>
/// | Python | <a href="https://github.com/LukeHagar/plexpy">GitHub</a> | <a href="https://pypi.org/project/plex-api-client/">PyPI</a> | - |<br/>
/// | JavaScript/TypeScript | <a href="https://github.com/LukeHagar/plexjs">GitHub</a> | <a href="https://www.npmjs.com/package/@lukehagar/plexjs">NPM</a> \ <a href="https://jsr.io/@lukehagar/plexjs">JSR</a> | - |<br/>
/// | Go | <a href="https://github.com/LukeHagar/plexgo">GitHub</a> | <a href="https://github.com/LukeHagar/plexgo/releases">Releases</a> | <a href="https://pkg.go.dev/github.com/LukeHagar/plexgo">GoDoc</a> |<br/>
/// | Ruby | <a href="https://github.com/LukeHagar/plexruby">GitHub</a> | <a href="https://github.com/LukeHagar/plexruby/releases">Releases</a> | - |<br/>
/// | Swift | <a href="https://github.com/LukeHagar/plexswift">GitHub</a> | <a href="https://github.com/LukeHagar/plexswift/releases">Releases</a> | - |<br/>
/// | PHP | <a href="https://github.com/LukeHagar/plexphp">GitHub</a> | <a href="https://github.com/LukeHagar/plexphp/releases">Releases</a> | - |<br/>
/// | Java | <a href="https://github.com/LukeHagar/plexjava">GitHub</a> | <a href="https://github.com/LukeHagar/plexjava/releases">Releases</a> | - |<br/>
/// | C# | <a href="https://github.com/LukeHagar/plexcsharp">GitHub</a> | <a href="https://github.com/LukeHagar/plexcsharp/releases">Releases</a> | - <br/>
///
/// </remarks>
/// </summary> /// </summary>
public class PlexAPI: IPlexAPI public class PlexAPI: IPlexAPI
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.8.1"; private const string _sdkVersion = "0.9.1";
private const string _sdkGenVersion = "2.422.22"; private const string _sdkGenVersion = "2.429.0";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK"; private const string _userAgent = "speakeasy-sdk/csharp 0.9.1 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private int _serverIndex = 0; private int _serverIndex = 0;
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
@@ -300,7 +356,7 @@ namespace LukeHagar.PlexAPI.SDK
public ISessions Sessions { get; private set; } public ISessions Sessions { get; private set; }
public IUpdater Updater { 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) if (serverIndex != null)
{ {
@@ -345,8 +401,8 @@ namespace LukeHagar.PlexAPI.SDK
ClientID = clientID, ClientID = clientID,
ClientName = clientName, ClientName = clientName,
ClientVersion = clientVersion, ClientVersion = clientVersion,
ClientPlatform = clientPlatform, Platform = platform,
DeviceName = deviceName, DeviceNickname = deviceNickname,
ServerDefaults = serverDefaults, ServerDefaults = serverDefaults,
ServerIndex = _serverIndex, ServerIndex = _serverIndex,
ServerUrl = _serverUrl, ServerUrl = _serverUrl,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

147
NUGET.md
View File

@@ -12,11 +12,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetServerCapabilitiesAsync(); var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -25,65 +25,90 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
``` ```
<!-- End SDK Example Usage [usage] --> <!-- End SDK Example Usage [usage] -->
<!-- Start Global Parameters [global-parameters] --> <!-- Start Retries [retries] -->
## Global Parameters ## Retries
## Global Parameters 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.
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
To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call:
```csharp ```csharp
using LukeHagar.PlexAPI.SDK; using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40", accessToken: "<YOUR_API_KEY_HERE>",
clientName: "Plex Web", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientVersion: "4.133.0", clientName: "Plex for Roku",
clientPlatform: "Chrome", clientVersion: "2.4.1",
deviceName: "Linux" platform: "Roku",
deviceNickname: "Roku 3"
); );
GetPinRequest req = new GetPinRequest() {}; var res = await sdk.Server.GetServerCapabilitiesAsync(retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
var res = await sdk.Plex.GetPinAsync(req); backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
));
// handle response // 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] --> <!-- Start Error Handling [errors] -->
## Error Handling ## 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.GetServerCapabilitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json | | LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* | | LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
### Example ### Example
@@ -95,11 +120,11 @@ using LukeHagar.PlexAPI.SDK.Models.Errors;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
try try
@@ -120,7 +145,7 @@ catch (Exception ex)
// Handle exception data // Handle exception data
throw; throw;
} }
else if (ex is Models.Errors.SDKException) else if (ex is LukeHagar.PlexAPI.SDK.Models.Errors.SDKException)
{ {
// Handle default exception // Handle default exception
throw; throw;
@@ -163,14 +188,14 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2/"); var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2");
// handle response // handle response
``` ```
@@ -194,11 +219,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetServerCapabilitiesAsync(); var res = await sdk.Server.GetServerCapabilitiesAsync();

174
README.md
View File

@@ -36,11 +36,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetServerCapabilitiesAsync(); var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -216,14 +216,14 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2/"); var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2");
// handle response // handle response
``` ```
@@ -247,11 +247,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetServerCapabilitiesAsync(); var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -260,65 +260,90 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
``` ```
<!-- End Authentication [security] --> <!-- End Authentication [security] -->
<!-- Start Global Parameters [global-parameters] --> <!-- Start Retries [retries] -->
## Global Parameters ## Retries
## Global Parameters 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.
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
To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call:
```csharp ```csharp
using LukeHagar.PlexAPI.SDK; using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40", accessToken: "<YOUR_API_KEY_HERE>",
clientName: "Plex Web", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientVersion: "4.133.0", clientName: "Plex for Roku",
clientPlatform: "Chrome", clientVersion: "2.4.1",
deviceName: "Linux" platform: "Roku",
deviceNickname: "Roku 3"
); );
GetPinRequest req = new GetPinRequest() {}; var res = await sdk.Server.GetServerCapabilitiesAsync(retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
var res = await sdk.Plex.GetPinAsync(req); backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
));
// handle response // 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] --> <!-- Start Error Handling [errors] -->
## Error Handling ## 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.GetServerCapabilitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json | | LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* | | LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
### Example ### Example
@@ -330,11 +355,11 @@ using LukeHagar.PlexAPI.SDK.Models.Errors;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
try try
@@ -355,7 +380,7 @@ catch (Exception ex)
// Handle exception data // Handle exception data
throw; throw;
} }
else if (ex is Models.Errors.SDKException) else if (ex is LukeHagar.PlexAPI.SDK.Models.Errors.SDKException)
{ {
// Handle default exception // Handle default exception
throw; throw;
@@ -368,6 +393,31 @@ catch (Exception ex)
## Summary ## Summary
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
# Plex Media Server OpenAPI Specification
An Open Source OpenAPI Specification for Plex Media Server
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
## Documentation
[API Documentation](https://plexapi.dev)
## SDKs
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
| Language | Repository | Releases | Other |
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -
<!-- End Summary [summary] --> <!-- End Summary [summary] -->
<!-- Start Table of Contents [toc] --> <!-- Start Table of Contents [toc] -->
@@ -376,7 +426,7 @@ Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server
* [SDK Installation](#sdk-installation) * [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage) * [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations) * [Available Resources and Operations](#available-resources-and-operations)
* [Global Parameters](#global-parameters) * [Retries](#retries)
* [Error Handling](#error-handling) * [Error Handling](#error-handling)
* [Server Selection](#server-selection) * [Server Selection](#server-selection)
* [Authentication](#authentication) * [Authentication](#authentication)

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -3,12 +3,12 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
| `Protocol` | [Protocol](../../Models/Requests/Protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) | | `Protocol` | [Protocol](../../Models/Requests/Protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) | http |
| `Address` | *string* | :heavy_check_mark: | The (ip) address or domain name used for the connection | | `Address` | *string* | :heavy_check_mark: | The (ip) address or domain name used for the connection | |
| `Port` | *int* | :heavy_check_mark: | The port used for the connection | | `Port` | *int* | :heavy_check_mark: | The port used for the connection | |
| `Uri` | *string* | :heavy_check_mark: | The full URI of the connection | | `Uri` | *string* | :heavy_check_mark: | The full URI of the connection | |
| `Local` | *bool* | :heavy_check_mark: | If the connection is local address | | `Local` | *bool* | :heavy_check_mark: | If the connection is local address | |
| `Relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct | | `Relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct | |
| `IPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 | | `IPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 | |

View File

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

View File

@@ -3,11 +3,11 @@
## Fields ## Fields
| Field | Type | Required | Description | Example | | 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/> | | | `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 | | `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: | N/A | Plex Web | | `ClientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku |
| `DeviceName` | *string* | :heavy_minus_sign: | N/A | Linux | | `DeviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 |
| `ClientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 | | `ClientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |
| `ClientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome | | `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 | | `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 | | `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 | | `Height` | *long* | :heavy_check_mark: | N/A | 396 |
| `MinSize` | *long* | :heavy_check_mark: | N/A | 1 | | `MinSize` | *long* | :heavy_check_mark: | N/A | 1 |
| `Upscale` | *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,6 +3,11 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `PinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | | `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 | | `TREBLEShowFeatures` | TREBLE-show-features |
| `AdCountdownTimer` | ad-countdown-timer | | `AdCountdownTimer` | ad-countdown-timer |
| `AdaptiveBitrate` | adaptive_bitrate | | `AdaptiveBitrate` | adaptive_bitrate |
| `AlbumTypes` | album-types |
| `AllowDvr` | allow_dvr |
| `AmazonLoopDebug` | amazon-loop-debug | | `AmazonLoopDebug` | amazon-loop-debug |
| `AvodAdAnalysis` | avod-ad-analysis | | `AvodAdAnalysis` | avod-ad-analysis |
| `AvodNewMedia` | avod-new-media | | `AvodNewMedia` | avod-new-media |
| `BlacklistGetSignin` | blacklist_get_signin | | `BlacklistGetSignin` | blacklist_get_signin |
| `BoostVoices` | boost-voices |
| `CameraUpload` | camera_upload |
| `ClientRadioStations` | client-radio-stations | | `ClientRadioStations` | client-radio-stations |
| `CloudflareTurnstileRequired` | cloudflare-turnstile-required | | `CloudflareTurnstileRequired` | cloudflare-turnstile-required |
| `Cloudsync` | cloudsync |
| `Collections` | collections | | `Collections` | collections |
| `CommentsAndRepliesPushNotifications` | comments_and_replies_push_notifications | | `CommentsAndRepliesPushNotifications` | comments_and_replies_push_notifications |
| `CommunityAccessPlexTv` | community_access_plex_tv | | `CommunityAccessPlexTv` | community_access_plex_tv |
| `CompanionsSonos` | companions_sonos | | `CompanionsSonos` | companions_sonos |
| `ContentFilter` | content_filter |
| `CustomHomeRemoval` | custom-home-removal | | `CustomHomeRemoval` | custom-home-removal |
| `DisableHomeUserFriendships` | disable_home_user_friendships | | `DisableHomeUserFriendships` | disable_home_user_friendships |
| `DisableSharingFriendships` | disable_sharing_friendships | | `DisableSharingFriendships` | disable_sharing_friendships |
| `DownloadsGating` | downloads-gating |
| `DrmSupport` | drm_support | | `DrmSupport` | drm_support |
| `Dvr` | dvr |
| `DvrBlockUnsupportedCountries` | dvr-block-unsupported-countries |
| `EpgRecentChannels` | epg-recent-channels |
| `ExcludeRestrictions` | exclude restrictions | | `ExcludeRestrictions` | exclude restrictions |
| `FederatedAuth` | federated-auth | | `FederatedAuth` | federated-auth |
| `FriendRequestPushNotifications` | friend_request_push_notifications | | `FriendRequestPushNotifications` | friend_request_push_notifications |
| `GrandfatherSync` | grandfather-sync |
| `GuidedUpgrade` | guided-upgrade | | `GuidedUpgrade` | guided-upgrade |
| `HardwareTranscoding` | hardware_transcoding |
| `Home` | home | | `Home` | home |
| `Hwtranscode` | hwtranscode |
| `ImaggaV2` | imagga-v2 |
| `IncreasePasswordComplexity` | increase-password-complexity | | `IncreasePasswordComplexity` | increase-password-complexity |
| `Ios14PrivacyBanner` | ios14-privacy-banner | | `Ios14PrivacyBanner` | ios14-privacy-banner |
| `IterableNotificationTokens` | iterable-notification-tokens | | `IterableNotificationTokens` | iterable-notification-tokens |
| `ItemClusters` | item_clusters |
| `KeepPaymentMethod` | keep-payment-method | | `KeepPaymentMethod` | keep-payment-method |
| `KevinBacon` | kevin-bacon | | `KevinBacon` | kevin-bacon |
| `KoreaConsent` | korea-consent | | `KoreaConsent` | korea-consent |
@@ -42,25 +57,46 @@
| `LightningDvrPivot` | lightning-dvr-pivot | | `LightningDvrPivot` | lightning-dvr-pivot |
| `LiveTvSupportIncompleteSegments` | live-tv-support-incomplete-segments | | `LiveTvSupportIncompleteSegments` | live-tv-support-incomplete-segments |
| `Livetv` | livetv | | `Livetv` | livetv |
| `Lyrics` | lyrics |
| `MetadataSearch` | metadata_search | | `MetadataSearch` | metadata_search |
| `MusicAnalysis` | music-analysis |
| `MusicVideos` | music_videos |
| `NewPlexPassPrices` | new_plex_pass_prices | | `NewPlexPassPrices` | new_plex_pass_prices |
| `NewsProviderSunsetModal` | news-provider-sunset-modal | | `NewsProviderSunsetModal` | news-provider-sunset-modal |
| `Nominatim` | nominatim |
| `Pass` | pass |
| `PhotosFavorites` | photos-favorites | | `PhotosFavorites` | photos-favorites |
| `PhotosMetadataEdition` | photos-metadata-edition | | `PhotosMetadataEdition` | photos-metadata-edition |
| `PhotosV6Edit` | photosV6-edit |
| `PhotosV6TvAlbums` | photosV6-tv-albums |
| `PmsHealth` | pms_health | | `PmsHealth` | pms_health |
| `PremiumDashboard` | premium-dashboard |
| `PremiumMusicMetadata` | premium_music_metadata |
| `Radio` | radio | | `Radio` | radio |
| `RateLimitClientToken` | rate-limit-client-token | | `RateLimitClientToken` | rate-limit-client-token |
| `ScrobblingServicePlexTv` | scrobbling-service-plex-tv | | `ScrobblingServicePlexTv` | scrobbling-service-plex-tv |
| `SessionBandwidthRestrictions` | session_bandwidth_restrictions |
| `SessionKick` | session_kick |
| `SharedServerNotification` | shared_server_notification | | `SharedServerNotification` | shared_server_notification |
| `SharedSourceNotification` | shared_source_notification | | `SharedSourceNotification` | shared_source_notification |
| `SigninNotification` | signin_notification |
| `SigninWithApple` | signin_with_apple | | `SigninWithApple` | signin_with_apple |
| `SilenceRemoval` | silence-removal |
| `SleepTimer` | sleep-timer |
| `SpringServeAdProvider` | spring_serve_ad_provider | | `SpringServeAdProvider` | spring_serve_ad_provider |
| `Sync` | sync |
| `SweetFades` | sweet-fades |
| `TranscoderCache` | transcoder_cache | | `TranscoderCache` | transcoder_cache |
| `Trailers` | trailers |
| `TunerSharing` | tuner-sharing | | `TunerSharing` | tuner-sharing |
| `TwoFactorAuthentication` | two-factor-authentication | | `TwoFactorAuthentication` | two-factor-authentication |
| `Unsupportedtuners` | unsupportedtuners | | `Unsupportedtuners` | unsupportedtuners |
| `Upgrade3ds2` | upgrade-3ds2 | | `Upgrade3ds2` | upgrade-3ds2 |
| `Visualizers` | visualizers |
| `VodSchema` | vod-schema | | `VodSchema` | vod-schema |
| `VodCloudflare` | vod_cloudflare | | `VodCloudflare` | vod_cloudflare |
| `VolumeLeveling` | volume-leveling |
| `WatchTogetherInvite` | watch-together-invite | | `WatchTogetherInvite` | watch-together-invite |
| `WebServerDashboard` | web_server_dashboard | | `WatchlistRss` | watchlist-rss |
| `WebServerDashboard` | web_server_dashboard |
| `Webhooks` | webhooks |

View File

@@ -29,7 +29,7 @@ Logged in user details
| `JoinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `JoinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `Locale` | *string* | :heavy_check_mark: | The account locale | | | `Locale` | *string* | :heavy_check_mark: | The account locale | |
| `MailingListActive` | *bool* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | | | `MailingListActive` | *bool* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | |
| `MailingListStatus` | [MailingListStatus](../../Models/Requests/MailingListStatus.md) | :heavy_check_mark: | Your current mailing list status | | | `MailingListStatus` | [MailingListStatus](../../Models/Requests/MailingListStatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active |
| `MaxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 | | `MaxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 |
| ~~`Pin`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>[Might be removed] The hashed Plex Home PIN | | | ~~`Pin`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>[Might be removed] The hashed Plex Home PIN | |
| `Profile` | [UserProfile](../../Models/Requests/UserProfile.md) | :heavy_check_mark: | N/A | | | `Profile` | [UserProfile](../../Models/Requests/UserProfile.md) | :heavy_check_mark: | N/A | |

View File

@@ -6,7 +6,7 @@
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Filter` | [Filter](../../Models/Requests/Filter.md) | :heavy_check_mark: | Filter | | | `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/> | | | `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/> | | | `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/> | | | `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

@@ -1,6 +1,6 @@
# MailingListStatus # MailingListStatus
Your current mailing list status Your current mailing list status (active or unsubscribed)
## Values ## Values

View File

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

View File

@@ -1,6 +1,6 @@
# PostUsersSignInDataMailingListStatus # PostUsersSignInDataMailingListStatus
Your current mailing list status Your current mailing list status (active or unsubscribed)
## Values ## Values

View File

@@ -3,11 +3,11 @@
## Fields ## Fields
| Field | Type | Required | Description | Example | | 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 | | `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: | N/A | Plex Web | | `ClientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku |
| `DeviceName` | *string* | :heavy_minus_sign: | N/A | Linux | | `DeviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 |
| `ClientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 | | `ClientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |
| `ClientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome | | `Platform` | *string* | :heavy_minus_sign: | The platform of the client application. | Roku |
| `RequestBody` | [PostUsersSignInDataRequestBody](../../Models/Requests/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | | | `RequestBody` | [PostUsersSignInDataRequestBody](../../Models/Requests/PostUsersSignInDataRequestBody.md) | :heavy_minus_sign: | Login credentials | |

View File

@@ -29,7 +29,7 @@ Returns the user account data with a valid auth token
| `JoinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `JoinedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `Locale` | *string* | :heavy_check_mark: | The account locale | | | `Locale` | *string* | :heavy_check_mark: | The account locale | |
| `MailingListActive` | *bool* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | | | `MailingListActive` | *bool* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | |
| `MailingListStatus` | [PostUsersSignInDataMailingListStatus](../../Models/Requests/PostUsersSignInDataMailingListStatus.md) | :heavy_check_mark: | Your current mailing list status | | | `MailingListStatus` | [PostUsersSignInDataMailingListStatus](../../Models/Requests/PostUsersSignInDataMailingListStatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active |
| `MaxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 | | `MaxHomeSize` | *int* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 |
| ~~`Pin`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>[Might be removed] The hashed Plex Home PIN | | | ~~`Pin`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>[Might be removed] The hashed Plex Home PIN | |
| `Profile` | [PostUsersSignInDataUserProfile](../../Models/Requests/PostUsersSignInDataUserProfile.md) | :heavy_check_mark: | N/A | | | `Profile` | [PostUsersSignInDataUserProfile](../../Models/Requests/PostUsersSignInDataUserProfile.md) | :heavy_check_mark: | N/A | |

View File

@@ -29,11 +29,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Activities.GetServerActivitiesAsync(); var res = await sdk.Activities.GetServerActivitiesAsync();
@@ -47,12 +47,11 @@ var res = await sdk.Activities.GetServerActivitiesAsync();
### Errors ### 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.GetServerActivitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerActivitiesUnauthorized | 401 | 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 ## CancelServerActivities
@@ -67,11 +66,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Activities.CancelServerActivitiesAsync(activityUUID: "25b71ed5-0f9d-461c-baa7-d404e9e10d3e"); 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 ### 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.CancelServerActivitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.CancelServerActivitiesUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Authentication.GetTransientTokenAsync( var res = await sdk.Authentication.GetTransientTokenAsync(
@@ -55,12 +55,11 @@ var res = await sdk.Authentication.GetTransientTokenAsync(
### Errors ### 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.GetTransientTokenBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTransientTokenUnauthorized | 401 | 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 ## GetSourceConnectionInformation
@@ -77,11 +76,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Authentication.GetSourceConnectionInformationAsync(source: "server://client-identifier"); var res = await sdk.Authentication.GetSourceConnectionInformationAsync(source: "server://client-identifier");
@@ -101,12 +100,11 @@ var res = await sdk.Authentication.GetSourceConnectionInformationAsync(source: "
### Errors ### 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.GetSourceConnectionInformationBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSourceConnectionInformationUnauthorized | 401 | 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 ## GetTokenDetails
@@ -120,11 +118,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Authentication.GetTokenDetailsAsync(); var res = await sdk.Authentication.GetTokenDetailsAsync();
@@ -144,12 +142,11 @@ var res = await sdk.Authentication.GetTokenDetailsAsync();
### Errors ### 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.GetTokenDetailsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTokenDetailsUnauthorized | 401 | 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 ## PostUsersSignInData
@@ -163,11 +160,11 @@ using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
PostUsersSignInDataRequest req = new PostUsersSignInDataRequest() { PostUsersSignInDataRequest req = new PostUsersSignInDataRequest() {
@@ -196,8 +193,8 @@ var res = await sdk.Authentication.PostUsersSignInDataAsync(req);
### Errors ### 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.PostUsersSignInDataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.PostUsersSignInDataUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Butler.GetButlerTasksAsync(); var res = await sdk.Butler.GetButlerTasksAsync();
@@ -44,12 +44,11 @@ var res = await sdk.Butler.GetButlerTasksAsync();
### Errors ### 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.GetButlerTasksBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetButlerTasksUnauthorized | 401 | 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 ## StartAllTasks
@@ -68,11 +67,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Butler.StartAllTasksAsync(); var res = await sdk.Butler.StartAllTasksAsync();
@@ -86,12 +85,11 @@ var res = await sdk.Butler.StartAllTasksAsync();
### Errors ### 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.StartAllTasksBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StartAllTasksUnauthorized | 401 | 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 ## StopAllTasks
@@ -106,11 +104,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Butler.StopAllTasksAsync(); var res = await sdk.Butler.StopAllTasksAsync();
@@ -124,12 +122,11 @@ var res = await sdk.Butler.StopAllTasksAsync();
### Errors ### 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.StopAllTasksBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StopAllTasksUnauthorized | 401 | 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 ## StartTask
@@ -149,11 +146,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Butler.StartTaskAsync(taskName: LukeHagar.PlexAPI.SDK.Models.Requests.TaskName.CleanOldBundles); 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 ### 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.StartTaskBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StartTaskUnauthorized | 401 | 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 ## StopTask
@@ -194,11 +190,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Butler.StopTaskAsync(taskName: LukeHagar.PlexAPI.SDK.Models.Requests.PathParamTaskName.BackupDatabase); 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 ### 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.StopTaskBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StopTaskUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Hubs.GetGlobalHubsAsync( var res = await sdk.Hubs.GetGlobalHubsAsync(
@@ -53,12 +53,11 @@ var res = await sdk.Hubs.GetGlobalHubsAsync(
### Errors ### 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.GetGlobalHubsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetGlobalHubsUnauthorized | 401 | 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 ## GetRecentlyAdded
@@ -74,11 +73,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
GetRecentlyAddedRequest req = new GetRecentlyAddedRequest() { GetRecentlyAddedRequest req = new GetRecentlyAddedRequest() {
@@ -107,10 +106,9 @@ var res = await sdk.Hubs.GetRecentlyAddedAsync(req);
### Errors ### 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 ## GetLibraryHubs
@@ -126,11 +124,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Hubs.GetLibraryHubsAsync( var res = await sdk.Hubs.GetLibraryHubsAsync(
@@ -156,8 +154,8 @@ var res = await sdk.Hubs.GetLibraryHubsAsync(
### Errors ### 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.GetLibraryHubsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetLibraryHubsUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.GetFileHashAsync( var res = await sdk.Library.GetFileHashAsync(
@@ -62,12 +62,11 @@ var res = await sdk.Library.GetFileHashAsync(
### Errors ### 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.GetFileHashBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetFileHashUnauthorized | 401 | 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 ## GetRecentlyAddedLibrary
@@ -84,11 +83,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
GetRecentlyAddedLibraryRequest req = new GetRecentlyAddedLibraryRequest() { GetRecentlyAddedLibraryRequest req = new GetRecentlyAddedLibraryRequest() {
@@ -131,12 +130,11 @@ var res = await sdk.Library.GetRecentlyAddedLibraryAsync(req);
### Errors ### 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.GetRecentlyAddedLibraryBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetRecentlyAddedLibraryUnauthorized | 401 | 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 ## GetAllLibraries
@@ -156,11 +154,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.GetAllLibrariesAsync(); var res = await sdk.Library.GetAllLibrariesAsync();
@@ -174,12 +172,11 @@ var res = await sdk.Library.GetAllLibrariesAsync();
### Errors ### 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.GetAllLibrariesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetAllLibrariesUnauthorized | 401 | 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 ## GetLibraryDetails
@@ -233,11 +230,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.GetLibraryDetailsAsync( var res = await sdk.Library.GetLibraryDetailsAsync(
@@ -261,12 +258,11 @@ var res = await sdk.Library.GetLibraryDetailsAsync(
### Errors ### 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.GetLibraryDetailsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetLibraryDetailsUnauthorized | 401 | 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 ## DeleteLibrary
@@ -281,11 +277,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.DeleteLibraryAsync(sectionKey: 9518); var res = await sdk.Library.DeleteLibraryAsync(sectionKey: 9518);
@@ -305,12 +301,11 @@ var res = await sdk.Library.DeleteLibraryAsync(sectionKey: 9518);
### Errors ### 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.DeleteLibraryBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.DeleteLibraryUnauthorized | 401 | 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 ## GetLibraryItems
@@ -345,16 +340,16 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
GetLibraryItemsRequest req = new GetLibraryItemsRequest() { GetLibraryItemsRequest req = new GetLibraryItemsRequest() {
SectionKey = 9518,
Tag = LukeHagar.PlexAPI.SDK.Models.Requests.Tag.Edition, Tag = LukeHagar.PlexAPI.SDK.Models.Requests.Tag.Edition,
SectionKey = 9518,
IncludeGuids = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeGuids.Enable, IncludeGuids = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeGuids.Enable,
Type = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsQueryParamType.TvShow, Type = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsQueryParamType.TvShow,
IncludeMeta = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsQueryParamIncludeMeta.Enable, IncludeMeta = LukeHagar.PlexAPI.SDK.Models.Requests.GetLibraryItemsQueryParamIncludeMeta.Enable,
@@ -379,12 +374,11 @@ var res = await sdk.Library.GetLibraryItemsAsync(req);
### Errors ### 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.GetLibraryItemsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetLibraryItemsUnauthorized | 401 | 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 ## GetRefreshLibraryMetadata
@@ -400,11 +394,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.GetRefreshLibraryMetadataAsync( var res = await sdk.Library.GetRefreshLibraryMetadataAsync(
@@ -428,12 +422,11 @@ var res = await sdk.Library.GetRefreshLibraryMetadataAsync(
### Errors ### 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.GetRefreshLibraryMetadataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetRefreshLibraryMetadataUnauthorized | 401 | 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 ## GetSearchLibrary
@@ -466,11 +459,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.GetSearchLibraryAsync( var res = await sdk.Library.GetSearchLibraryAsync(
@@ -494,12 +487,11 @@ var res = await sdk.Library.GetSearchLibraryAsync(
### Errors ### 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.GetSearchLibraryBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSearchLibraryUnauthorized | 401 | 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 ## GetMetaDataByRatingKey
@@ -515,11 +507,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.GetMetaDataByRatingKeyAsync(ratingKey: 9518); var res = await sdk.Library.GetMetaDataByRatingKeyAsync(ratingKey: 9518);
@@ -539,12 +531,11 @@ var res = await sdk.Library.GetMetaDataByRatingKeyAsync(ratingKey: 9518);
### Errors ### 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.GetMetaDataByRatingKeyBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMetaDataByRatingKeyUnauthorized | 401 | 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 ## GetMetadataChildren
@@ -560,11 +551,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.GetMetadataChildrenAsync( var res = await sdk.Library.GetMetadataChildrenAsync(
@@ -588,12 +579,11 @@ var res = await sdk.Library.GetMetadataChildrenAsync(
### Errors ### 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.GetMetadataChildrenBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMetadataChildrenUnauthorized | 401 | 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 ## GetTopWatchedContent
@@ -609,11 +599,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.GetTopWatchedContentAsync( var res = await sdk.Library.GetTopWatchedContentAsync(
@@ -637,12 +627,11 @@ var res = await sdk.Library.GetTopWatchedContentAsync(
### Errors ### 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.GetTopWatchedContentBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTopWatchedContentUnauthorized | 401 | 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 ## GetOnDeck
@@ -657,11 +646,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Library.GetOnDeckAsync(); var res = await sdk.Library.GetOnDeckAsync();
@@ -675,8 +664,8 @@ var res = await sdk.Library.GetOnDeckAsync();
### Errors ### 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.GetOnDeckBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetOnDeckUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Log.LogLineAsync( var res = await sdk.Log.LogLineAsync(
@@ -56,12 +56,11 @@ var res = await sdk.Log.LogLineAsync(
### Errors ### 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.LogLineBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.LogLineUnauthorized | 401 | 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 ## LogMultiLine
@@ -96,11 +95,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
string req = "level=4&message=Test%20message%201&source=postman string req = "level=4&message=Test%20message%201&source=postman
@@ -124,12 +123,11 @@ var res = await sdk.Log.LogMultiLineAsync(req);
### Errors ### 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.LogMultiLineBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.LogMultiLineUnauthorized | 401 | 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 ## EnablePaperTrail
@@ -144,11 +142,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Log.EnablePaperTrailAsync(); var res = await sdk.Log.EnablePaperTrailAsync();
@@ -162,8 +160,8 @@ var res = await sdk.Log.EnablePaperTrailAsync();
### Errors ### 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.EnablePaperTrailBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.EnablePaperTrailUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Media.MarkPlayedAsync(key: 59398D); var res = await sdk.Media.MarkPlayedAsync(key: 59398D);
@@ -51,12 +51,11 @@ var res = await sdk.Media.MarkPlayedAsync(key: 59398D);
### Errors ### 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.MarkPlayedBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.MarkPlayedUnauthorized | 401 | 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 ## MarkUnplayed
@@ -71,11 +70,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Media.MarkUnplayedAsync(key: 59398D); var res = await sdk.Media.MarkUnplayedAsync(key: 59398D);
@@ -95,12 +94,11 @@ var res = await sdk.Media.MarkUnplayedAsync(key: 59398D);
### Errors ### 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.MarkUnplayedBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.MarkUnplayedUnauthorized | 401 | 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 ## UpdatePlayProgress
@@ -116,11 +114,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Media.UpdatePlayProgressAsync( var res = await sdk.Media.UpdatePlayProgressAsync(
@@ -146,12 +144,11 @@ var res = await sdk.Media.UpdatePlayProgressAsync(
### Errors ### 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.UpdatePlayProgressBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.UpdatePlayProgressUnauthorized | 401 | 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 ## GetBannerImage
@@ -166,11 +163,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
GetBannerImageRequest req = new GetBannerImageRequest() { GetBannerImageRequest req = new GetBannerImageRequest() {
@@ -199,12 +196,11 @@ var res = await sdk.Media.GetBannerImageAsync(req);
### Errors ### 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.GetBannerImageBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetBannerImageUnauthorized | 401 | 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 ## GetThumbImage
@@ -219,11 +215,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
GetThumbImageRequest req = new GetThumbImageRequest() { GetThumbImageRequest req = new GetThumbImageRequest() {
@@ -252,8 +248,8 @@ var res = await sdk.Media.GetThumbImageAsync(req);
### Errors ### 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.GetThumbImageBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetThumbImageUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
CreatePlaylistRequest req = new CreatePlaylistRequest() { CreatePlaylistRequest req = new CreatePlaylistRequest() {
@@ -68,12 +68,11 @@ var res = await sdk.Playlists.CreatePlaylistAsync(req);
### Errors ### 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.CreatePlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.CreatePlaylistUnauthorized | 401 | 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 ## GetPlaylists
@@ -88,11 +87,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Playlists.GetPlaylistsAsync( var res = await sdk.Playlists.GetPlaylistsAsync(
@@ -116,12 +115,11 @@ var res = await sdk.Playlists.GetPlaylistsAsync(
### Errors ### 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.GetPlaylistsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPlaylistsUnauthorized | 401 | 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 ## GetPlaylist
@@ -138,11 +136,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Playlists.GetPlaylistAsync(playlistID: 4109.48D); var res = await sdk.Playlists.GetPlaylistAsync(playlistID: 4109.48D);
@@ -162,12 +160,11 @@ var res = await sdk.Playlists.GetPlaylistAsync(playlistID: 4109.48D);
### Errors ### 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.GetPlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPlaylistUnauthorized | 401 | 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 ## DeletePlaylist
@@ -183,11 +180,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Playlists.DeletePlaylistAsync(playlistID: 216.22D); var res = await sdk.Playlists.DeletePlaylistAsync(playlistID: 216.22D);
@@ -207,12 +204,11 @@ var res = await sdk.Playlists.DeletePlaylistAsync(playlistID: 216.22D);
### Errors ### 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.DeletePlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.DeletePlaylistUnauthorized | 401 | 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 ## UpdatePlaylist
@@ -228,11 +224,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Playlists.UpdatePlaylistAsync( var res = await sdk.Playlists.UpdatePlaylistAsync(
@@ -258,12 +254,11 @@ var res = await sdk.Playlists.UpdatePlaylistAsync(
### Errors ### 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.UpdatePlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.UpdatePlaylistUnauthorized | 401 | 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 ## GetPlaylistContents
@@ -282,11 +277,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Playlists.GetPlaylistContentsAsync( var res = await sdk.Playlists.GetPlaylistContentsAsync(
@@ -310,12 +305,11 @@ var res = await sdk.Playlists.GetPlaylistContentsAsync(
### Errors ### 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.GetPlaylistContentsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetPlaylistContentsUnauthorized | 401 | 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 ## ClearPlaylistContents
@@ -331,11 +325,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Playlists.ClearPlaylistContentsAsync(playlistID: 1893.18D); var res = await sdk.Playlists.ClearPlaylistContentsAsync(playlistID: 1893.18D);
@@ -355,12 +349,11 @@ var res = await sdk.Playlists.ClearPlaylistContentsAsync(playlistID: 1893.18D);
### Errors ### 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.ClearPlaylistContentsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.ClearPlaylistContentsUnauthorized | 401 | 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 ## AddPlaylistContents
@@ -377,11 +370,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Playlists.AddPlaylistContentsAsync( var res = await sdk.Playlists.AddPlaylistContentsAsync(
@@ -407,12 +400,11 @@ var res = await sdk.Playlists.AddPlaylistContentsAsync(
### Errors ### 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.AddPlaylistContentsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.AddPlaylistContentsUnauthorized | 401 | 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 ## UploadPlaylist
@@ -428,11 +420,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Playlists.UploadPlaylistAsync( var res = await sdk.Playlists.UploadPlaylistAsync(
@@ -458,8 +450,8 @@ var res = await sdk.Playlists.UploadPlaylistAsync(
### Errors ### 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.UploadPlaylistBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.UploadPlaylistUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Plex.GetCompanionsDataAsync(); var res = await sdk.Plex.GetCompanionsDataAsync();
@@ -52,12 +52,11 @@ var res = await sdk.Plex.GetCompanionsDataAsync();
### Errors ### 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.GetCompanionsDataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetCompanionsDataUnauthorized | 401 | 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 ## GetUserFriends
@@ -71,11 +70,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Plex.GetUserFriendsAsync(); var res = await sdk.Plex.GetUserFriendsAsync();
@@ -95,12 +94,11 @@ var res = await sdk.Plex.GetUserFriendsAsync();
### Errors ### 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.GetUserFriendsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetUserFriendsUnauthorized | 401 | 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 ## GetGeoData
@@ -113,11 +111,11 @@ using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Plex.GetGeoDataAsync(); var res = await sdk.Plex.GetGeoDataAsync();
@@ -137,12 +135,11 @@ var res = await sdk.Plex.GetGeoDataAsync();
### Errors ### 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.GetGeoDataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetGeoDataUnauthorized | 401 | 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 ## GetHomeData
@@ -156,11 +153,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Plex.GetHomeDataAsync(); var res = await sdk.Plex.GetHomeDataAsync();
@@ -174,12 +171,11 @@ var res = await sdk.Plex.GetHomeDataAsync();
### Errors ### 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.GetHomeDataBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetHomeDataUnauthorized | 401 | 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 ## GetServerResources
@@ -194,17 +190,18 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Plex.GetServerResourcesAsync( var res = await sdk.Plex.GetServerResourcesAsync(
includeHttps: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeHttps.Enable, includeHttps: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeHttps.Enable,
includeRelay: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeRelay.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 // 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 | | `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 | | `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 |
| `serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | | `serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
### Response ### Response
@@ -225,12 +223,11 @@ var res = await sdk.Plex.GetServerResourcesAsync(
### Errors ### 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.GetServerResourcesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerResourcesUnauthorized | 401 | 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 ## GetPin
@@ -244,11 +241,11 @@ using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
GetPinRequest req = new GetPinRequest() {}; GetPinRequest req = new GetPinRequest() {};
@@ -271,11 +268,10 @@ var res = await sdk.Plex.GetPinAsync(req);
### Errors ### 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.GetPinBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* | | LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetTokenByPinId ## GetTokenByPinId
@@ -289,24 +285,28 @@ using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Plex.GetTokenByPinIdAsync(pinID: 408895); GetTokenByPinIdRequest req = new GetTokenByPinIdRequest() {
PinID = 408895,
};
var res = await sdk.Plex.GetTokenByPinIdAsync(req);
// handle response // handle response
``` ```
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `PinID` | *long* | :heavy_check_mark: | The PinID to retrieve an access token for | | `request` | [GetTokenByPinIdRequest](../../Models/Requests/GetTokenByPinIdRequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | | `serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
### Response ### Response
@@ -314,8 +314,8 @@ var res = await sdk.Plex.GetTokenByPinIdAsync(pinID: 408895);
### Errors ### 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.GetTokenByPinIdBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTokenByPinIdResponseBody | 404 | 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

@@ -2,4 +2,27 @@
## Overview ## Overview
Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server # Plex Media Server OpenAPI Specification
An Open Source OpenAPI Specification for Plex Media Server
Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
## Documentation
[API Documentation](https://plexapi.dev)
## SDKs
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec).
| Language | Repository | Releases | Other |
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - |
| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - |
| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - |
| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - |
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | -

View File

@@ -37,11 +37,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Search.PerformSearchAsync( var res = await sdk.Search.PerformSearchAsync(
@@ -67,12 +67,11 @@ var res = await sdk.Search.PerformSearchAsync(
### Errors ### 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.PerformSearchBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.PerformSearchUnauthorized | 401 | 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 ## PerformVoiceSearch
@@ -91,11 +90,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Search.PerformVoiceSearchAsync( var res = await sdk.Search.PerformVoiceSearchAsync(
@@ -121,12 +120,11 @@ var res = await sdk.Search.PerformVoiceSearchAsync(
### Errors ### 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.PerformVoiceSearchBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.PerformVoiceSearchUnauthorized | 401 | 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 ## GetSearchResults
@@ -141,11 +139,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Search.GetSearchResultsAsync(query: "110"); var res = await sdk.Search.GetSearchResultsAsync(query: "110");
@@ -165,8 +163,8 @@ var res = await sdk.Search.GetSearchResultsAsync(query: "110");
### Errors ### 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.GetSearchResultsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSearchResultsUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetServerCapabilitiesAsync(); var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -48,12 +48,11 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
### Errors ### 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.GetServerCapabilitiesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json | | LukeHagar.PlexAPI.SDK.Models.Errors.GetServerCapabilitiesUnauthorized | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* | | LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetServerPreferences ## GetServerPreferences
@@ -67,11 +66,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetServerPreferencesAsync(); var res = await sdk.Server.GetServerPreferencesAsync();
@@ -85,12 +84,11 @@ var res = await sdk.Server.GetServerPreferencesAsync();
### Errors ### 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.GetServerPreferencesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerPreferencesUnauthorized | 401 | 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 ## GetAvailableClients
@@ -104,11 +102,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetAvailableClientsAsync(); var res = await sdk.Server.GetAvailableClientsAsync();
@@ -122,12 +120,11 @@ var res = await sdk.Server.GetAvailableClientsAsync();
### Errors ### 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.GetAvailableClientsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetAvailableClientsUnauthorized | 401 | 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 ## GetDevices
@@ -141,11 +138,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetDevicesAsync(); var res = await sdk.Server.GetDevicesAsync();
@@ -159,12 +156,11 @@ var res = await sdk.Server.GetDevicesAsync();
### Errors ### 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.GetDevicesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetDevicesUnauthorized | 401 | 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 ## GetServerIdentity
@@ -177,11 +173,11 @@ using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components; using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetServerIdentityAsync(); var res = await sdk.Server.GetServerIdentityAsync();
@@ -195,11 +191,10 @@ var res = await sdk.Server.GetServerIdentityAsync();
### Errors ### 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.GetServerIdentityRequestTimeout | 408 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | */* | | LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4XX, 5XX | \*/\* |
## GetMyPlexAccount ## GetMyPlexAccount
@@ -213,11 +208,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetMyPlexAccountAsync(); var res = await sdk.Server.GetMyPlexAccountAsync();
@@ -231,12 +226,11 @@ var res = await sdk.Server.GetMyPlexAccountAsync();
### Errors ### 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.GetMyPlexAccountBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMyPlexAccountUnauthorized | 401 | 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 ## GetResizedPhoto
@@ -252,11 +246,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
GetResizedPhotoRequest req = new GetResizedPhotoRequest() { GetResizedPhotoRequest req = new GetResizedPhotoRequest() {
@@ -286,12 +280,11 @@ var res = await sdk.Server.GetResizedPhotoAsync(req);
### Errors ### 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.GetResizedPhotoBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetResizedPhotoUnauthorized | 401 | 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 ## GetMediaProviders
@@ -306,11 +299,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetMediaProvidersAsync(xPlexToken: "CV5xoxjTpFKUzBTShsaf"); var res = await sdk.Server.GetMediaProvidersAsync(xPlexToken: "CV5xoxjTpFKUzBTShsaf");
@@ -320,9 +313,9 @@ var res = await sdk.Server.GetMediaProvidersAsync(xPlexToken: "CV5xoxjTpFKUzBTSh
### Parameters ### Parameters
| Parameter | Type | Required | Description | Example | | Parameter | Type | Required | Description | Example |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| `XPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | | `XPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |
### Response ### Response
@@ -330,12 +323,11 @@ var res = await sdk.Server.GetMediaProvidersAsync(xPlexToken: "CV5xoxjTpFKUzBTSh
### Errors ### 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.GetMediaProvidersBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetMediaProvidersUnauthorized | 401 | 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 ## GetServerList
@@ -349,11 +341,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Server.GetServerListAsync(); var res = await sdk.Server.GetServerListAsync();
@@ -367,8 +359,8 @@ var res = await sdk.Server.GetServerListAsync();
### Errors ### 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.GetServerListBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetServerListUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Sessions.GetSessionsAsync(); var res = await sdk.Sessions.GetSessionsAsync();
@@ -43,12 +43,11 @@ var res = await sdk.Sessions.GetSessionsAsync();
### Errors ### 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.GetSessionsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSessionsUnauthorized | 401 | 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 ## GetSessionHistory
@@ -63,11 +62,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Sessions.GetSessionHistoryAsync( var res = await sdk.Sessions.GetSessionHistoryAsync(
@@ -95,12 +94,11 @@ var res = await sdk.Sessions.GetSessionHistoryAsync(
### Errors ### 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.GetSessionHistoryBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetSessionHistoryUnauthorized | 401 | 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 ## GetTranscodeSessions
@@ -114,11 +112,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Sessions.GetTranscodeSessionsAsync(); var res = await sdk.Sessions.GetTranscodeSessionsAsync();
@@ -132,12 +130,11 @@ var res = await sdk.Sessions.GetTranscodeSessionsAsync();
### Errors ### 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.GetTranscodeSessionsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTranscodeSessionsUnauthorized | 401 | 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 ## StopTranscodeSession
@@ -152,11 +149,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Sessions.StopTranscodeSessionAsync(sessionKey: "zz7llzqlx8w9vnrsbnwhbmep"); var res = await sdk.Sessions.StopTranscodeSessionAsync(sessionKey: "zz7llzqlx8w9vnrsbnwhbmep");
@@ -176,8 +173,8 @@ var res = await sdk.Sessions.StopTranscodeSessionAsync(sessionKey: "zz7llzqlx8w9
### Errors ### 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.StopTranscodeSessionBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StopTranscodeSessionUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Statistics.GetStatisticsAsync(timespan: 4); var res = await sdk.Statistics.GetStatisticsAsync(timespan: 4);
@@ -49,12 +49,11 @@ var res = await sdk.Statistics.GetStatisticsAsync(timespan: 4);
### Errors ### 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.GetStatisticsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetStatisticsUnauthorized | 401 | 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 ## GetResourcesStatistics
@@ -69,11 +68,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Statistics.GetResourcesStatisticsAsync(timespan: 4); var res = await sdk.Statistics.GetResourcesStatisticsAsync(timespan: 4);
@@ -93,12 +92,11 @@ var res = await sdk.Statistics.GetResourcesStatisticsAsync(timespan: 4);
### Errors ### 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.GetResourcesStatisticsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetResourcesStatisticsUnauthorized | 401 | 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 ## GetBandwidthStatistics
@@ -113,11 +111,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Statistics.GetBandwidthStatisticsAsync(timespan: 4); var res = await sdk.Statistics.GetBandwidthStatisticsAsync(timespan: 4);
@@ -137,8 +135,8 @@ var res = await sdk.Statistics.GetBandwidthStatisticsAsync(timespan: 4);
### Errors ### 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.GetBandwidthStatisticsBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetBandwidthStatisticsUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Updater.GetUpdateStatusAsync(); var res = await sdk.Updater.GetUpdateStatusAsync();
@@ -43,12 +43,11 @@ var res = await sdk.Updater.GetUpdateStatusAsync();
### Errors ### 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.GetUpdateStatusBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetUpdateStatusUnauthorized | 401 | 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 ## CheckForUpdates
@@ -63,11 +62,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Updater.CheckForUpdatesAsync(download: LukeHagar.PlexAPI.SDK.Models.Requests.Download.One); 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 ### 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.CheckForUpdatesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.CheckForUpdatesUnauthorized | 401 | 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 ## ApplyUpdates
@@ -108,11 +106,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
var res = await sdk.Updater.ApplyUpdatesAsync( var res = await sdk.Updater.ApplyUpdatesAsync(
@@ -136,8 +134,8 @@ var res = await sdk.Updater.ApplyUpdatesAsync(
### Errors ### 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.ApplyUpdatesBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.ApplyUpdatesUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
GetTimelineRequest req = new GetTimelineRequest() { GetTimelineRequest req = new GetTimelineRequest() {
@@ -61,12 +61,11 @@ var res = await sdk.Video.GetTimelineAsync(req);
### Errors ### 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.GetTimelineBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetTimelineUnauthorized | 401 | 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 ## StartUniversalTranscode
@@ -81,11 +80,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
StartUniversalTranscodeRequest req = new StartUniversalTranscodeRequest() { StartUniversalTranscodeRequest req = new StartUniversalTranscodeRequest() {
@@ -124,8 +123,8 @@ var res = await sdk.Video.StartUniversalTranscodeAsync(req);
### Errors ### 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.StartUniversalTranscodeBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.StartUniversalTranscodeUnauthorized | 401 | 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( var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
clientID: "gcgzw5rz2xovp84b4vha3a40", clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex Web", clientName: "Plex for Roku",
clientVersion: "4.133.0", clientVersion: "2.4.1",
clientPlatform: "Chrome", platform: "Roku",
deviceName: "Linux" deviceNickname: "Roku 3"
); );
GetWatchListRequest req = new GetWatchListRequest() { GetWatchListRequest req = new GetWatchListRequest() {
@@ -55,8 +55,8 @@ var res = await sdk.Watchlist.GetWatchListAsync(req);
### Errors ### 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.GetWatchListBadRequest | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetWatchListUnauthorized | 401 | 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 | \*/\* |