diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 86e6f8a..2627732 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 5a8dbcbc-e0ee-41f0-9d84-b8b50567d1e9 management: - docChecksum: 1ee2e5413af07e886e33659b9b269dd5 + docChecksum: 23094f3a9fe02710a8628ad5456f5d42 docVersion: 0.0.3 - speakeasyVersion: 1.405.8 + speakeasyVersion: 1.406.0 generationVersion: 2.429.0 - releaseVersion: 0.9.2 - configChecksum: 81c2971806adecbcf35170ac11c4c585 + releaseVersion: 0.10.0 + configChecksum: 5aeda5d0b47fd16a77f217e0065d7c45 repoURL: https://github.com/LukeHagar/plexcsharp.git repoSubDirectory: . published: true @@ -29,7 +29,6 @@ features: nameOverrides: 2.81.2 nullables: 0.1.0 responseFormat: 0.0.4 - retries: 0.0.1 sdkHooks: 0.1.0 generatedFiles: - .gitattributes @@ -2704,7 +2703,7 @@ examples: speakeasy-default-get-token-details: responses: "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": "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} + application/json: {"adsConsent": true, "adsConsentReminderAt": 1556281940, "adsConsentSetAt": 1556281940, "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": application/json: {"errors": []} "401": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2e31ea4..a476d08 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true csharp: - version: 0.9.2 + version: 0.10.0 additionalDependencies: [] author: LukeHagar clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 6f9041f..50c9e5b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.405.8 +speakeasyVersion: 1.406.0 sources: my-source: sourceNamespace: my-source @@ -16,8 +16,8 @@ sources: - main plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e - sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b + sourceRevisionDigest: sha256:8d2eb3adbd97ce5976291c4b123d1eadfef62d1f6bf86c6a18bcd89443f2f390 + sourceBlobDigest: sha256:3e48471b7e058840fc598ccd75b2cbf8187961c7e625fe7b606555ce9a9bf109 tags: - latest - main @@ -25,10 +25,10 @@ targets: plexcsharp: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:c6ab8f13847c7cdc4ab3752f517164d7da08266726255aa0d614b1eaea66fb0e - sourceBlobDigest: sha256:64c7694915a0828aeb256d10d2fa0ea477681785b818916b6681be8cc5ffb93b + sourceRevisionDigest: sha256:8d2eb3adbd97ce5976291c4b123d1eadfef62d1f6bf86c6a18bcd89443f2f390 + sourceBlobDigest: sha256:3e48471b7e058840fc598ccd75b2cbf8187961c7e625fe7b606555ce9a9bf109 codeSamplesNamespace: code-samples-csharp-plexcsharp - codeSamplesRevisionDigest: sha256:92500227f7e52cdceac29cb2915dfe637ad1432c312c69dd3acb197b357a3577 + codeSamplesRevisionDigest: sha256:0cb9cf47b819ad0fbf1acb82308274a28c7d0b5feb94c089863fddaa6128cd87 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/LukeHagar/PlexAPI/SDK/Activities.cs b/LukeHagar/PlexAPI/SDK/Activities.cs index ff58d15..01be872 100644 --- a/LukeHagar/PlexAPI/SDK/Activities.cs +++ b/LukeHagar/PlexAPI/SDK/Activities.cs @@ -45,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Server Activities /// /// - Task GetServerActivitiesAsync(RetryConfig? retryConfig = null); + Task GetServerActivitiesAsync(); /// /// Cancel Server Activities @@ -54,7 +54,7 @@ namespace LukeHagar.PlexAPI.SDK /// Cancel Server Activities /// /// - Task CancelServerActivitiesAsync(string activityUUID, RetryConfig? retryConfig = null); + Task CancelServerActivitiesAsync(string activityUUID); } /// @@ -74,10 +74,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -90,7 +90,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetServerActivitiesAsync(RetryConfig? retryConfig = null) + public async Task GetServerActivitiesAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -107,44 +107,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getServerActivities", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -220,7 +187,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task CancelServerActivitiesAsync(string activityUUID, RetryConfig? retryConfig = null) + public async Task CancelServerActivitiesAsync(string activityUUID) { var request = new CancelServerActivitiesRequest() { @@ -240,44 +207,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("cancelServerActivities", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Authentication.cs b/LukeHagar/PlexAPI/SDK/Authentication.cs index f31f1fc..b786d52 100644 --- a/LukeHagar/PlexAPI/SDK/Authentication.cs +++ b/LukeHagar/PlexAPI/SDK/Authentication.cs @@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope, RetryConfig? retryConfig = null); + Task GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope); /// /// Get Source Connection Information @@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetSourceConnectionInformationAsync(string source, RetryConfig? retryConfig = null); + Task GetSourceConnectionInformationAsync(string source); /// /// Get Token Details @@ -60,7 +60,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get the User data from the provided X-Plex-Token /// /// - Task GetTokenDetailsAsync(string? serverUrl = null, RetryConfig? retryConfig = null); + Task GetTokenDetailsAsync(string? serverUrl = null); /// /// 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 /// /// - Task PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null); + Task PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null); } /// @@ -95,10 +95,10 @@ namespace LukeHagar.PlexAPI.SDK }; public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -111,7 +111,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope, RetryConfig? retryConfig = null) + public async Task GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope) { var request = new GetTransientTokenRequest() { @@ -132,44 +132,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getTransientToken", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -237,7 +204,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetSourceConnectionInformationAsync(string source, RetryConfig? retryConfig = null) + public async Task GetSourceConnectionInformationAsync(string source) { var request = new GetSourceConnectionInformationRequest() { @@ -257,44 +224,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -362,7 +296,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetTokenDetailsAsync(string? serverUrl = null, RetryConfig? retryConfig = null) + public async Task GetTokenDetailsAsync(string? serverUrl = null) { string baseUrl = Utilities.TemplateUrl(GetTokenDetailsServerList[0], new Dictionary(){ }); @@ -384,44 +318,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getTokenDetails", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -497,7 +398,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null) + public async Task PostUsersSignInDataAsync(PostUsersSignInDataRequest? request = null, string? serverUrl = null) { request.ClientID ??= SDKConfiguration.ClientID; request.ClientName ??= SDKConfiguration.ClientName; @@ -527,44 +428,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("post-users-sign-in-data", null, null); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Butler.cs b/LukeHagar/PlexAPI/SDK/Butler.cs index d49b401..146f0f7 100644 --- a/LukeHagar/PlexAPI/SDK/Butler.cs +++ b/LukeHagar/PlexAPI/SDK/Butler.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// Returns a list of butler tasks /// /// - Task GetButlerTasksAsync(RetryConfig? retryConfig = null); + Task GetButlerTasksAsync(); /// /// Start all Butler tasks @@ -53,7 +53,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task StartAllTasksAsync(RetryConfig? retryConfig = null); + Task StartAllTasksAsync(); /// /// Stop all Butler tasks @@ -63,7 +63,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task StopAllTasksAsync(RetryConfig? retryConfig = null); + Task StopAllTasksAsync(); /// /// Start a single Butler task @@ -77,7 +77,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task StartTaskAsync(TaskName taskName, RetryConfig? retryConfig = null); + Task StartTaskAsync(TaskName taskName); /// /// Stop a single Butler task @@ -87,7 +87,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task StopTaskAsync(PathParamTaskName taskName, RetryConfig? retryConfig = null); + Task StopTaskAsync(PathParamTaskName taskName); } /// @@ -101,10 +101,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -117,7 +117,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetButlerTasksAsync(RetryConfig? retryConfig = null) + public async Task GetButlerTasksAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -134,44 +134,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getButlerTasks", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -247,7 +214,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task StartAllTasksAsync(RetryConfig? retryConfig = null) + public async Task StartAllTasksAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -264,44 +231,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("startAllTasks", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -369,7 +303,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task StopAllTasksAsync(RetryConfig? retryConfig = null) + public async Task StopAllTasksAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -386,44 +320,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("stopAllTasks", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -491,7 +392,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task StartTaskAsync(TaskName taskName, RetryConfig? retryConfig = null) + public async Task StartTaskAsync(TaskName taskName) { var request = new StartTaskRequest() { @@ -511,44 +412,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("startTask", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -616,7 +484,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task StopTaskAsync(PathParamTaskName taskName, RetryConfig? retryConfig = null) + public async Task StopTaskAsync(PathParamTaskName taskName) { var request = new StopTaskRequest() { @@ -636,44 +504,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("stopTask", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Hubs.cs b/LukeHagar/PlexAPI/SDK/Hubs.cs index 3a06bd2..6299d23 100644 --- a/LukeHagar/PlexAPI/SDK/Hubs.cs +++ b/LukeHagar/PlexAPI/SDK/Hubs.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Global Hubs filtered by the parameters provided. /// /// - Task GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null); + Task GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null); /// /// Get Recently Added @@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null); + Task GetRecentlyAddedAsync(GetRecentlyAddedRequest request); /// /// Get library specific hubs @@ -59,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null); + Task GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null); } /// @@ -73,10 +73,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -89,7 +89,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null) + public async Task GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null) { var request = new GetGlobalHubsRequest() { @@ -110,44 +110,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getGlobalHubs", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -223,7 +190,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetRecentlyAddedAsync(GetRecentlyAddedRequest request, RetryConfig? retryConfig = null) + public async Task GetRecentlyAddedAsync(GetRecentlyAddedRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request); @@ -239,44 +206,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-recently-added", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -330,7 +264,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null, RetryConfig? retryConfig = null) + public async Task GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null) { var request = new GetLibraryHubsRequest() { @@ -352,44 +286,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getLibraryHubs", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Library.cs b/LukeHagar/PlexAPI/SDK/Library.cs index 1def081..1aee411 100644 --- a/LukeHagar/PlexAPI/SDK/Library.cs +++ b/LukeHagar/PlexAPI/SDK/Library.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// This resource returns hash values for local files /// /// - Task GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null); + Task GetFileHashAsync(string url, double? type = null); /// /// Get Recently Added @@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null); + Task GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request); /// /// Get All Libraries @@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetAllLibrariesAsync(RetryConfig? retryConfig = null); + Task GetAllLibrariesAsync(); /// /// Get Library Details @@ -112,7 +112,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null); + Task GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null); /// /// Delete Library Section @@ -121,7 +121,7 @@ namespace LukeHagar.PlexAPI.SDK /// Delete a library using a specific section id /// /// - Task DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null); + Task DeleteLibraryAsync(int sectionKey); /// /// Get Library Items @@ -150,7 +150,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null); + Task GetLibraryItemsAsync(GetLibraryItemsRequest request); /// /// Refresh Metadata Of The Library @@ -160,7 +160,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null); + Task GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null); /// /// Search Library @@ -187,7 +187,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null); + Task GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type); /// /// Search All Libraries @@ -197,7 +197,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request, RetryConfig? retryConfig = null); + Task GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request); /// /// Get Metadata by RatingKey @@ -207,7 +207,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null); + Task GetMetaDataByRatingKeyAsync(long ratingKey); /// /// Get Items Children @@ -217,7 +217,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null); + Task GetMetadataChildrenAsync(double ratingKey, string? includeElements = null); /// /// Get Top Watched Content @@ -227,7 +227,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null); + Task GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null); /// /// Get On Deck @@ -237,7 +237,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetOnDeckAsync(RetryConfig? retryConfig = null); + Task GetOnDeckAsync(); } /// @@ -251,10 +251,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -267,7 +267,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetFileHashAsync(string url, double? type = null, RetryConfig? retryConfig = null) + public async Task GetFileHashAsync(string url, double? type = null) { var request = new GetFileHashRequest() { @@ -288,44 +288,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getFileHash", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -393,7 +360,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request, RetryConfig? retryConfig = null) + public async Task GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request); @@ -409,44 +376,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-recently-added-library", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -522,7 +456,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetAllLibrariesAsync(RetryConfig? retryConfig = null) + public async Task GetAllLibrariesAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -539,44 +473,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-all-libraries", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -652,7 +553,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null, RetryConfig? retryConfig = null) + public async Task GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null) { var request = new GetLibraryDetailsRequest() { @@ -673,44 +574,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-library-details", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -786,7 +654,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task DeleteLibraryAsync(int sectionKey, RetryConfig? retryConfig = null) + public async Task DeleteLibraryAsync(int sectionKey) { var request = new DeleteLibraryRequest() { @@ -806,44 +674,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("deleteLibrary", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -911,7 +746,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetLibraryItemsAsync(GetLibraryItemsRequest request, RetryConfig? retryConfig = null) + public async Task GetLibraryItemsAsync(GetLibraryItemsRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request); @@ -927,44 +762,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-library-items", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1040,7 +842,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null, RetryConfig? retryConfig = null) + public async Task GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null) { var request = new GetRefreshLibraryMetadataRequest() { @@ -1061,44 +863,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-refresh-library-metadata", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1166,7 +935,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type, RetryConfig? retryConfig = null) + public async Task GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type) { var request = new GetSearchLibraryRequest() { @@ -1187,44 +956,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-search-library", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1300,7 +1036,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request, RetryConfig? retryConfig = null) + public async Task GetSearchAllLibrariesAsync(GetSearchAllLibrariesRequest request) { if (request == null) { @@ -1323,44 +1059,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-search-all-libraries", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1436,7 +1139,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetMetaDataByRatingKeyAsync(long ratingKey, RetryConfig? retryConfig = null) + public async Task GetMetaDataByRatingKeyAsync(long ratingKey) { var request = new GetMetaDataByRatingKeyRequest() { @@ -1456,44 +1159,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-meta-data-by-rating-key", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1569,7 +1239,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetMetadataChildrenAsync(double ratingKey, string? includeElements = null, RetryConfig? retryConfig = null) + public async Task GetMetadataChildrenAsync(double ratingKey, string? includeElements = null) { var request = new GetMetadataChildrenRequest() { @@ -1590,44 +1260,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getMetadataChildren", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1703,7 +1340,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null, RetryConfig? retryConfig = null) + public async Task GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null) { var request = new GetTopWatchedContentRequest() { @@ -1724,44 +1361,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getTopWatchedContent", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1837,7 +1441,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetOnDeckAsync(RetryConfig? retryConfig = null) + public async Task GetOnDeckAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -1854,44 +1458,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getOnDeck", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Log.cs b/LukeHagar/PlexAPI/SDK/Log.cs index 60519d2..6e9c7b8 100644 --- a/LukeHagar/PlexAPI/SDK/Log.cs +++ b/LukeHagar/PlexAPI/SDK/Log.cs @@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task LogLineAsync(Level level, string message, string source, RetryConfig? retryConfig = null); + Task LogLineAsync(Level level, string message, string source); /// /// Logging a multi-line message @@ -70,7 +70,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task LogMultiLineAsync(string request, RetryConfig? retryConfig = null); + Task LogMultiLineAsync(string request); /// /// Enabling Papertrail @@ -80,7 +80,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task EnablePaperTrailAsync(RetryConfig? retryConfig = null); + Task EnablePaperTrailAsync(); } /// @@ -94,10 +94,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -110,7 +110,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task LogLineAsync(Level level, string message, string source, RetryConfig? retryConfig = null) + public async Task LogLineAsync(Level level, string message, string source) { var request = new LogLineRequest() { @@ -132,44 +132,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("logLine", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -237,7 +204,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task LogMultiLineAsync(string request, RetryConfig? retryConfig = null) + public async Task LogMultiLineAsync(string request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -260,44 +227,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("logMultiLine", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -365,7 +299,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task EnablePaperTrailAsync(RetryConfig? retryConfig = null) + public async Task EnablePaperTrailAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -382,44 +316,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("enablePaperTrail", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/LukeHagar.PlexAPI.SDK.csproj b/LukeHagar/PlexAPI/SDK/LukeHagar.PlexAPI.SDK.csproj index 7695ce6..e4b4d98 100644 --- a/LukeHagar/PlexAPI/SDK/LukeHagar.PlexAPI.SDK.csproj +++ b/LukeHagar/PlexAPI/SDK/LukeHagar.PlexAPI.SDK.csproj @@ -3,7 +3,7 @@ true LukeHagar.PlexAPI.SDK - 0.9.2 + 0.10.0 net8.0 LukeHagar Copyright (c) LukeHagar 2024 diff --git a/LukeHagar/PlexAPI/SDK/Media.cs b/LukeHagar/PlexAPI/SDK/Media.cs index b1351a3..f935257 100644 --- a/LukeHagar/PlexAPI/SDK/Media.cs +++ b/LukeHagar/PlexAPI/SDK/Media.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// This will mark the provided media key as Played. /// /// - Task MarkPlayedAsync(double key, RetryConfig? retryConfig = null); + Task MarkPlayedAsync(double key); /// /// Mark Media Unplayed @@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK /// This will mark the provided media key as Unplayed. /// /// - Task MarkUnplayedAsync(double key, RetryConfig? retryConfig = null); + Task MarkUnplayedAsync(double key); /// /// Update Media Play Progress @@ -58,7 +58,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task UpdatePlayProgressAsync(string key, double time, string state, RetryConfig? retryConfig = null); + Task UpdatePlayProgressAsync(string key, double time, string state); /// /// Get Banner Image @@ -67,7 +67,7 @@ namespace LukeHagar.PlexAPI.SDK /// Gets the banner image of the media item /// /// - Task GetBannerImageAsync(GetBannerImageRequest request, RetryConfig? retryConfig = null); + Task GetBannerImageAsync(GetBannerImageRequest request); /// /// Get Thumb Image @@ -76,7 +76,7 @@ namespace LukeHagar.PlexAPI.SDK /// Gets the thumbnail image of the media item /// /// - Task GetThumbImageAsync(GetThumbImageRequest request, RetryConfig? retryConfig = null); + Task GetThumbImageAsync(GetThumbImageRequest request); } /// @@ -90,10 +90,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -106,7 +106,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task MarkPlayedAsync(double key, RetryConfig? retryConfig = null) + public async Task MarkPlayedAsync(double key) { var request = new MarkPlayedRequest() { @@ -126,44 +126,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("markPlayed", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -231,7 +198,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task MarkUnplayedAsync(double key, RetryConfig? retryConfig = null) + public async Task MarkUnplayedAsync(double key) { var request = new MarkUnplayedRequest() { @@ -251,44 +218,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("markUnplayed", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -356,7 +290,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task UpdatePlayProgressAsync(string key, double time, string state, RetryConfig? retryConfig = null) + public async Task UpdatePlayProgressAsync(string key, double time, string state) { var request = new UpdatePlayProgressRequest() { @@ -378,44 +312,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("updatePlayProgress", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -483,7 +384,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetBannerImageAsync(GetBannerImageRequest request, RetryConfig? retryConfig = null) + public async Task GetBannerImageAsync(GetBannerImageRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request); @@ -500,44 +401,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-banner-image", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -612,7 +480,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetThumbImageAsync(GetThumbImageRequest request, RetryConfig? retryConfig = null) + public async Task GetThumbImageAsync(GetThumbImageRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request); @@ -629,44 +497,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-thumb-image", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Models/Requests/GetLibraryItemsMediaContainer.cs b/LukeHagar/PlexAPI/SDK/Models/Requests/GetLibraryItemsMediaContainer.cs index 42f9af7..c391d84 100644 --- a/LukeHagar/PlexAPI/SDK/Models/Requests/GetLibraryItemsMediaContainer.cs +++ b/LukeHagar/PlexAPI/SDK/Models/Requests/GetLibraryItemsMediaContainer.cs @@ -88,7 +88,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests public bool? MixedParents { get; set; } [JsonProperty("Metadata")] - public List Metadata { get; set; } = default!; + public List? Metadata { get; set; } /// /// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
diff --git a/LukeHagar/PlexAPI/SDK/Models/Requests/GetTokenDetailsUserPlexAccount.cs b/LukeHagar/PlexAPI/SDK/Models/Requests/GetTokenDetailsUserPlexAccount.cs index 087a5fe..9888d49 100644 --- a/LukeHagar/PlexAPI/SDK/Models/Requests/GetTokenDetailsUserPlexAccount.cs +++ b/LukeHagar/PlexAPI/SDK/Models/Requests/GetTokenDetailsUserPlexAccount.cs @@ -27,17 +27,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests [JsonProperty("adsConsent", NullValueHandling = NullValueHandling.Include)] public bool? AdsConsent { get; set; } - /// - /// Unknown - /// [JsonProperty("adsConsentReminderAt", NullValueHandling = NullValueHandling.Include)] - public DateTime? AdsConsentReminderAt { get; set; } + public long? AdsConsentReminderAt { get; set; } - /// - /// Unknown - /// [JsonProperty("adsConsentSetAt", NullValueHandling = NullValueHandling.Include)] - public DateTime? AdsConsentSetAt { get; set; } + public long? AdsConsentSetAt { get; set; } /// /// Unknown diff --git a/LukeHagar/PlexAPI/SDK/Models/Requests/PostUsersSignInDataUserPlexAccount.cs b/LukeHagar/PlexAPI/SDK/Models/Requests/PostUsersSignInDataUserPlexAccount.cs index ba9bdf6..f5329eb 100644 --- a/LukeHagar/PlexAPI/SDK/Models/Requests/PostUsersSignInDataUserPlexAccount.cs +++ b/LukeHagar/PlexAPI/SDK/Models/Requests/PostUsersSignInDataUserPlexAccount.cs @@ -27,17 +27,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests [JsonProperty("adsConsent", NullValueHandling = NullValueHandling.Include)] public bool? AdsConsent { get; set; } - /// - /// Unknown - /// [JsonProperty("adsConsentReminderAt", NullValueHandling = NullValueHandling.Include)] - public DateTime? AdsConsentReminderAt { get; set; } + public long? AdsConsentReminderAt { get; set; } - /// - /// Unknown - /// [JsonProperty("adsConsentSetAt", NullValueHandling = NullValueHandling.Include)] - public DateTime? AdsConsentSetAt { get; set; } + public long? AdsConsentSetAt { get; set; } /// /// Unknown diff --git a/LukeHagar/PlexAPI/SDK/Playlists.cs b/LukeHagar/PlexAPI/SDK/Playlists.cs index 7e6afd6..484ad32 100644 --- a/LukeHagar/PlexAPI/SDK/Playlists.cs +++ b/LukeHagar/PlexAPI/SDK/Playlists.cs @@ -45,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null); + Task CreatePlaylistAsync(CreatePlaylistRequest request); /// /// Get All Playlists @@ -54,7 +54,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get All Playlists given the specified filters. /// /// - Task GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null); + Task GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null); /// /// Retrieve Playlist @@ -65,7 +65,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null); + Task GetPlaylistAsync(double playlistID); /// /// Deletes a Playlist @@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null); + Task DeletePlaylistAsync(double playlistID); /// /// Update a Playlist @@ -85,7 +85,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null); + Task UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null); /// /// Retrieve Playlist Contents @@ -98,7 +98,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null); + Task GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type); /// /// Delete Playlist Contents @@ -108,7 +108,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null); + Task ClearPlaylistContentsAsync(double playlistID); /// /// Adding to a Playlist @@ -119,7 +119,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null); + Task AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null); /// /// Upload Playlist @@ -129,7 +129,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null); + Task UploadPlaylistAsync(string path, QueryParamForce force, long sectionID); } /// @@ -146,10 +146,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -162,7 +162,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null) + public async Task CreatePlaylistAsync(CreatePlaylistRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/playlists", request); @@ -178,44 +178,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("createPlaylist", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -291,7 +258,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null) + public async Task GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null) { var request = new GetPlaylistsRequest() { @@ -312,44 +279,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getPlaylists", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -425,7 +359,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null) + public async Task GetPlaylistAsync(double playlistID) { var request = new GetPlaylistRequest() { @@ -445,44 +379,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getPlaylist", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -558,7 +459,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null) + public async Task DeletePlaylistAsync(double playlistID) { var request = new DeletePlaylistRequest() { @@ -578,44 +479,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("deletePlaylist", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -683,7 +551,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null) + public async Task UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null) { var request = new UpdatePlaylistRequest() { @@ -705,44 +573,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("updatePlaylist", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -810,7 +645,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null) + public async Task GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type) { var request = new GetPlaylistContentsRequest() { @@ -831,44 +666,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getPlaylistContents", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -944,7 +746,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null) + public async Task ClearPlaylistContentsAsync(double playlistID) { var request = new ClearPlaylistContentsRequest() { @@ -964,44 +766,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("clearPlaylistContents", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1069,7 +838,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null) + public async Task AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null) { var request = new AddPlaylistContentsRequest() { @@ -1091,44 +860,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("addPlaylistContents", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1204,7 +940,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null) + public async Task UploadPlaylistAsync(string path, QueryParamForce force, long sectionID) { var request = new UploadPlaylistRequest() { @@ -1226,44 +962,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("uploadPlaylist", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Plex.cs b/LukeHagar/PlexAPI/SDK/Plex.cs index 7e43dfb..c7c8c89 100644 --- a/LukeHagar/PlexAPI/SDK/Plex.cs +++ b/LukeHagar/PlexAPI/SDK/Plex.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Companions Data /// /// - Task GetCompanionsDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null); + Task GetCompanionsDataAsync(string? serverUrl = null); /// /// Get list of friends of the user logged in @@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get friends of provided auth token. /// /// - Task GetUserFriendsAsync(string? serverUrl = null, RetryConfig? retryConfig = null); + Task GetUserFriendsAsync(string? serverUrl = null); /// /// Get Geo Data @@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK /// Returns the geolocation and locale data of the caller /// /// - Task GetGeoDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null); + Task GetGeoDataAsync(string? serverUrl = null); /// /// 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. /// /// - Task GetHomeDataAsync(RetryConfig? retryConfig = null); + Task GetHomeDataAsync(); /// /// Get Server Resources @@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Plex server access tokens and server connections /// /// - Task GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null, RetryConfig? retryConfig = null); + Task GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null); /// /// Get a Pin @@ -84,7 +84,7 @@ namespace LukeHagar.PlexAPI.SDK /// Retrieve a Pin ID from Plex.tv to use for authentication flows /// /// - Task GetPinAsync(GetPinRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null); + Task GetPinAsync(GetPinRequest? request = null, string? serverUrl = null); /// /// 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 /// /// - Task GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null, RetryConfig? retryConfig = null); + Task GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null); } /// @@ -143,10 +143,10 @@ namespace LukeHagar.PlexAPI.SDK }; public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -159,7 +159,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetCompanionsDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null) + public async Task GetCompanionsDataAsync(string? serverUrl = null) { string baseUrl = Utilities.TemplateUrl(GetCompanionsDataServerList[0], new Dictionary(){ }); @@ -181,44 +181,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getCompanionsData", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -294,7 +261,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetUserFriendsAsync(string? serverUrl = null, RetryConfig? retryConfig = null) + public async Task GetUserFriendsAsync(string? serverUrl = null) { string baseUrl = Utilities.TemplateUrl(GetUserFriendsServerList[0], new Dictionary(){ }); @@ -316,44 +283,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getUserFriends", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -429,7 +363,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetGeoDataAsync(string? serverUrl = null, RetryConfig? retryConfig = null) + public async Task GetGeoDataAsync(string? serverUrl = null) { string baseUrl = Utilities.TemplateUrl(GetGeoDataServerList[0], new Dictionary(){ }); @@ -446,44 +380,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getGeoData", null, null); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -559,7 +460,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetHomeDataAsync(RetryConfig? retryConfig = null) + public async Task GetHomeDataAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -576,44 +477,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getHomeData", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -689,7 +557,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null, RetryConfig? retryConfig = null) + public async Task GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? clientID = null, string? serverUrl = null) { var request = new GetServerResourcesRequest() { @@ -720,44 +588,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-server-resources", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -833,7 +668,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetPinAsync(GetPinRequest? request = null, string? serverUrl = null, RetryConfig? retryConfig = null) + public async Task GetPinAsync(GetPinRequest? request = null, string? serverUrl = null) { request.ClientID ??= SDKConfiguration.ClientID; request.ClientName ??= SDKConfiguration.ClientName; @@ -856,44 +691,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getPin", null, null); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -958,7 +760,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null, RetryConfig? retryConfig = null) + public async Task GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null) { if (request == null) { @@ -985,44 +787,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getTokenByPinId", null, null); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/PlexAPI.cs b/LukeHagar/PlexAPI/SDK/PlexAPI.cs index ca59dd1..44e8138 100644 --- a/LukeHagar/PlexAPI/SDK/PlexAPI.cs +++ b/LukeHagar/PlexAPI/SDK/PlexAPI.cs @@ -331,10 +331,10 @@ namespace LukeHagar.PlexAPI.SDK public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private int _serverIndex = 0; private ISpeakeasyHttpClient _client; diff --git a/LukeHagar/PlexAPI/SDK/Search.cs b/LukeHagar/PlexAPI/SDK/Search.cs index 4b363aa..77609ec 100644 --- a/LukeHagar/PlexAPI/SDK/Search.cs +++ b/LukeHagar/PlexAPI/SDK/Search.cs @@ -51,7 +51,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task PerformSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null); + Task PerformSearchAsync(string query, double? sectionId = null, double? limit = null); /// /// Perform a voice search @@ -64,7 +64,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null); + Task PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null); /// /// Get Search Results @@ -73,7 +73,7 @@ namespace LukeHagar.PlexAPI.SDK /// This will search the database for the string provided. /// /// - Task GetSearchResultsAsync(string query, RetryConfig? retryConfig = null); + Task GetSearchResultsAsync(string query); } /// @@ -87,10 +87,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -103,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task PerformSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null) + public async Task PerformSearchAsync(string query, double? sectionId = null, double? limit = null) { var request = new PerformSearchRequest() { @@ -125,44 +125,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("performSearch", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -230,7 +197,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null, RetryConfig? retryConfig = null) + public async Task PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null) { var request = new PerformVoiceSearchRequest() { @@ -252,44 +219,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("performVoiceSearch", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -357,7 +291,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetSearchResultsAsync(string query, RetryConfig? retryConfig = null) + public async Task GetSearchResultsAsync(string query) { var request = new GetSearchResultsRequest() { @@ -377,44 +311,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getSearchResults", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Server.cs b/LukeHagar/PlexAPI/SDK/Server.cs index fff440e..57e42d7 100644 --- a/LukeHagar/PlexAPI/SDK/Server.cs +++ b/LukeHagar/PlexAPI/SDK/Server.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Server Capabilities /// /// - Task GetServerCapabilitiesAsync(RetryConfig? retryConfig = null); + Task GetServerCapabilitiesAsync(); /// /// Get Server Preferences @@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Server Preferences /// /// - Task GetServerPreferencesAsync(RetryConfig? retryConfig = null); + Task GetServerPreferencesAsync(); /// /// Get Available Clients @@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Available Clients /// /// - Task GetAvailableClientsAsync(RetryConfig? retryConfig = null); + Task GetAvailableClientsAsync(); /// /// Get Devices @@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Devices /// /// - Task GetDevicesAsync(RetryConfig? retryConfig = null); + Task GetDevicesAsync(); /// /// Get Server Identity @@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK /// This request is useful to determine if the server is online or offline /// /// - Task GetServerIdentityAsync(RetryConfig? retryConfig = null); + Task GetServerIdentityAsync(); /// /// Get MyPlex Account @@ -84,7 +84,7 @@ namespace LukeHagar.PlexAPI.SDK /// Returns MyPlex Account Information /// /// - Task GetMyPlexAccountAsync(RetryConfig? retryConfig = null); + Task GetMyPlexAccountAsync(); /// /// Get a Resized Photo @@ -94,7 +94,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task GetResizedPhotoAsync(GetResizedPhotoRequest request, RetryConfig? retryConfig = null); + Task GetResizedPhotoAsync(GetResizedPhotoRequest request); /// /// Get Media Providers @@ -103,7 +103,7 @@ namespace LukeHagar.PlexAPI.SDK /// Retrieves media providers and their features from the Plex server. /// /// - Task GetMediaProvidersAsync(string xPlexToken, RetryConfig? retryConfig = null); + Task GetMediaProvidersAsync(string xPlexToken); /// /// Get Server List @@ -112,7 +112,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Server List /// /// - Task GetServerListAsync(RetryConfig? retryConfig = null); + Task GetServerListAsync(); } /// @@ -126,10 +126,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -142,7 +142,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetServerCapabilitiesAsync(RetryConfig? retryConfig = null) + public async Task GetServerCapabilitiesAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -159,44 +159,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getServerCapabilities", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -272,7 +239,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetServerPreferencesAsync(RetryConfig? retryConfig = null) + public async Task GetServerPreferencesAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -289,44 +256,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getServerPreferences", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -402,7 +336,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetAvailableClientsAsync(RetryConfig? retryConfig = null) + public async Task GetAvailableClientsAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -419,44 +353,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getAvailableClients", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -532,7 +433,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetDevicesAsync(RetryConfig? retryConfig = null) + public async Task GetDevicesAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -549,44 +450,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getDevices", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -662,7 +530,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetServerIdentityAsync(RetryConfig? retryConfig = null) + public async Task GetServerIdentityAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -674,44 +542,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-server-identity", null, null); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 408 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -776,7 +611,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetMyPlexAccountAsync(RetryConfig? retryConfig = null) + public async Task GetMyPlexAccountAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -793,44 +628,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getMyPlexAccount", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -906,7 +708,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetResizedPhotoAsync(GetResizedPhotoRequest request, RetryConfig? retryConfig = null) + public async Task GetResizedPhotoAsync(GetResizedPhotoRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/photo/:/transcode", request); @@ -922,44 +724,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getResizedPhoto", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1027,7 +796,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetMediaProvidersAsync(string xPlexToken, RetryConfig? retryConfig = null) + public async Task GetMediaProvidersAsync(string xPlexToken) { var request = new GetMediaProvidersRequest() { @@ -1049,44 +818,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-media-providers", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1162,7 +898,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetServerListAsync(RetryConfig? retryConfig = null) + public async Task GetServerListAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -1179,44 +915,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getServerList", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Sessions.cs b/LukeHagar/PlexAPI/SDK/Sessions.cs index 47f61fd..359eaa8 100644 --- a/LukeHagar/PlexAPI/SDK/Sessions.cs +++ b/LukeHagar/PlexAPI/SDK/Sessions.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// This will retrieve the "Now Playing" Information of the PMS. /// /// - Task GetSessionsAsync(RetryConfig? retryConfig = null); + Task GetSessionsAsync(); /// /// Get Session History @@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK /// This will Retrieve a listing of all history views. /// /// - Task GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null, RetryConfig? retryConfig = null); + Task GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null); /// /// Get Transcode Sessions @@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get Transcode Sessions /// /// - Task GetTranscodeSessionsAsync(RetryConfig? retryConfig = null); + Task GetTranscodeSessionsAsync(); /// /// Stop a Transcode Session @@ -66,7 +66,7 @@ namespace LukeHagar.PlexAPI.SDK /// Stop a Transcode Session /// /// - Task StopTranscodeSessionAsync(string sessionKey, RetryConfig? retryConfig = null); + Task StopTranscodeSessionAsync(string sessionKey); } /// @@ -80,10 +80,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -96,7 +96,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetSessionsAsync(RetryConfig? retryConfig = null) + public async Task GetSessionsAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -113,44 +113,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getSessions", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -226,7 +193,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null, RetryConfig? retryConfig = null) + public async Task GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null) { var request = new GetSessionHistoryRequest() { @@ -249,44 +216,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getSessionHistory", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -362,7 +296,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetTranscodeSessionsAsync(RetryConfig? retryConfig = null) + public async Task GetTranscodeSessionsAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -379,44 +313,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getTranscodeSessions", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -492,7 +393,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task StopTranscodeSessionAsync(string sessionKey, RetryConfig? retryConfig = null) + public async Task StopTranscodeSessionAsync(string sessionKey) { var request = new StopTranscodeSessionRequest() { @@ -512,44 +413,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("stopTranscodeSession", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Statistics.cs b/LukeHagar/PlexAPI/SDK/Statistics.cs index 4a3381d..60e7233 100644 --- a/LukeHagar/PlexAPI/SDK/Statistics.cs +++ b/LukeHagar/PlexAPI/SDK/Statistics.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// This will return the media statistics for the server /// /// - Task GetStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null); + Task GetStatisticsAsync(long? timespan = null); /// /// Get Resources Statistics @@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK /// This will return the resources for the server /// /// - Task GetResourcesStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null); + Task GetResourcesStatisticsAsync(long? timespan = null); /// /// Get Bandwidth Statistics @@ -57,7 +57,7 @@ namespace LukeHagar.PlexAPI.SDK /// This will return the bandwidth statistics for the server /// /// - Task GetBandwidthStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null); + Task GetBandwidthStatisticsAsync(long? timespan = null); } /// @@ -71,10 +71,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -87,7 +87,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null) + public async Task GetStatisticsAsync(long? timespan = null) { var request = new GetStatisticsRequest() { @@ -107,44 +107,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getStatistics", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -220,7 +187,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetResourcesStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null) + public async Task GetResourcesStatisticsAsync(long? timespan = null) { var request = new GetResourcesStatisticsRequest() { @@ -240,44 +207,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getResourcesStatistics", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -353,7 +287,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task GetBandwidthStatisticsAsync(long? timespan = null, RetryConfig? retryConfig = null) + public async Task GetBandwidthStatisticsAsync(long? timespan = null) { var request = new GetBandwidthStatisticsRequest() { @@ -373,44 +307,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getBandwidthStatistics", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Updater.cs b/LukeHagar/PlexAPI/SDK/Updater.cs index 5608661..92534be 100644 --- a/LukeHagar/PlexAPI/SDK/Updater.cs +++ b/LukeHagar/PlexAPI/SDK/Updater.cs @@ -40,7 +40,7 @@ namespace LukeHagar.PlexAPI.SDK /// Querying status of updates /// /// - Task GetUpdateStatusAsync(RetryConfig? retryConfig = null); + Task GetUpdateStatusAsync(); /// /// Checking for updates @@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK /// Checking for updates /// /// - Task CheckForUpdatesAsync(Download? download = null, RetryConfig? retryConfig = null); + Task CheckForUpdatesAsync(Download? download = null); /// /// Apply Updates @@ -59,7 +59,7 @@ namespace LukeHagar.PlexAPI.SDK /// /// /// - Task ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null, RetryConfig? retryConfig = null); + Task ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null); } /// @@ -74,10 +74,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -90,7 +90,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetUpdateStatusAsync(RetryConfig? retryConfig = null) + public async Task GetUpdateStatusAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -107,44 +107,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getUpdateStatus", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -220,7 +187,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task CheckForUpdatesAsync(Download? download = null, RetryConfig? retryConfig = null) + public async Task CheckForUpdatesAsync(Download? download = null) { var request = new CheckForUpdatesRequest() { @@ -240,44 +207,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("checkForUpdates", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -345,7 +279,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null, RetryConfig? retryConfig = null) + public async Task ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null) { var request = new ApplyUpdatesRequest() { @@ -366,44 +300,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("applyUpdates", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Video.cs b/LukeHagar/PlexAPI/SDK/Video.cs index d4004ea..d512c73 100644 --- a/LukeHagar/PlexAPI/SDK/Video.cs +++ b/LukeHagar/PlexAPI/SDK/Video.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get the timeline for a media item /// /// - Task GetTimelineAsync(GetTimelineRequest request, RetryConfig? retryConfig = null); + Task GetTimelineAsync(GetTimelineRequest request); /// /// Start Universal Transcode @@ -48,7 +48,7 @@ namespace LukeHagar.PlexAPI.SDK /// Begin a Universal Transcode Session /// /// - Task StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request, RetryConfig? retryConfig = null); + Task StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request); } /// @@ -62,10 +62,10 @@ namespace LukeHagar.PlexAPI.SDK { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -78,7 +78,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetTimelineAsync(GetTimelineRequest request, RetryConfig? retryConfig = null) + public async Task GetTimelineAsync(GetTimelineRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/:/timeline", request); @@ -94,44 +94,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("getTimeline", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -199,7 +166,7 @@ namespace LukeHagar.PlexAPI.SDK throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - public async Task StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request, RetryConfig? retryConfig = null) + public async Task StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/video/:/transcode/universal/start.mpd", request); @@ -215,44 +182,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("startUniversalTranscode", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/LukeHagar/PlexAPI/SDK/Watchlist.cs b/LukeHagar/PlexAPI/SDK/Watchlist.cs index 5455010..b03141a 100644 --- a/LukeHagar/PlexAPI/SDK/Watchlist.cs +++ b/LukeHagar/PlexAPI/SDK/Watchlist.cs @@ -39,7 +39,7 @@ namespace LukeHagar.PlexAPI.SDK /// Get User Watchlist /// /// - Task GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null, RetryConfig? retryConfig = null); + Task GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null); } /// @@ -59,10 +59,10 @@ namespace LukeHagar.PlexAPI.SDK }; public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "0.9.2"; + private const string _sdkVersion = "0.10.0"; private const string _sdkGenVersion = "2.429.0"; private const string _openapiDocVersion = "0.0.3"; - private const string _userAgent = "speakeasy-sdk/csharp 0.9.2 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; + private const string _userAgent = "speakeasy-sdk/csharp 0.10.0 2.429.0 0.0.3 LukeHagar.PlexAPI.SDK"; private string _serverUrl = ""; private ISpeakeasyHttpClient _client; private Func? _securitySource; @@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK SDKConfiguration = config; } - public async Task GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null, RetryConfig? retryConfig = null) + public async Task GetWatchListAsync(GetWatchListRequest request, string? serverUrl = null) { string baseUrl = Utilities.TemplateUrl(GetWatchListServerList[0], new Dictionary(){ }); @@ -97,44 +97,11 @@ namespace LukeHagar.PlexAPI.SDK var hookCtx = new HookContext("get-watch-list", null, _securitySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - if (retryConfig == null) - { - if (this.SDKConfiguration.RetryConfig != null) - { - retryConfig = this.SDKConfiguration.RetryConfig; - } - else - { - var backoff = new BackoffStrategy( - initialIntervalMs: 500L, - maxIntervalMs: 60000L, - maxElapsedTimeMs: 3600000L, - exponent: 1.5 - ); - retryConfig = new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: backoff, - retryConnectionErrors: true - ); - } - } - - List statusCodes = new List - { - "5XX", - }; - - Func> retrySend = async () => - { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); - }; - var retries = new LukeHagar.PlexAPI.SDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); HttpResponseMessage httpResponse; try { - httpResponse = await retries.Run(); + httpResponse = await _client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/NUGET.md b/NUGET.md index 0aa2623..419b6df 100644 --- a/NUGET.md +++ b/NUGET.md @@ -25,69 +25,6 @@ var res = await sdk.Server.GetServerCapabilitiesAsync(); ``` - -## Retries - -Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. - -To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call: -```csharp -using LukeHagar.PlexAPI.SDK; -using LukeHagar.PlexAPI.SDK.Models.Components; - -var sdk = new PlexAPI( - accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3" -); - -var res = await sdk.Server.GetServerCapabilitiesAsync(retryConfig: new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: new BackoffStrategy( - initialIntervalMs: 1L, - maxIntervalMs: 50L, - maxElapsedTimeMs: 100L, - exponent: 1.1 - ), - retryConnectionErrors: false -)); - -// handle response -``` - -If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK: -```csharp -using LukeHagar.PlexAPI.SDK; -using LukeHagar.PlexAPI.SDK.Models.Components; - -var sdk = new PlexAPI( - retryConfig: new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: new BackoffStrategy( - initialIntervalMs: 1L, - maxIntervalMs: 50L, - maxElapsedTimeMs: 100L, - exponent: 1.1 - ), - retryConnectionErrors: false - ), - accessToken: "", - 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 -``` - - ## Error Handling diff --git a/README.md b/README.md index 94fe681..5bdfdc7 100644 --- a/README.md +++ b/README.md @@ -261,69 +261,6 @@ var res = await sdk.Server.GetServerCapabilitiesAsync(); ``` - -## Retries - -Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. - -To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call: -```csharp -using LukeHagar.PlexAPI.SDK; -using LukeHagar.PlexAPI.SDK.Models.Components; - -var sdk = new PlexAPI( - accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3" -); - -var res = await sdk.Server.GetServerCapabilitiesAsync(retryConfig: new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: new BackoffStrategy( - initialIntervalMs: 1L, - maxIntervalMs: 50L, - maxElapsedTimeMs: 100L, - exponent: 1.1 - ), - retryConnectionErrors: false -)); - -// handle response -``` - -If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK: -```csharp -using LukeHagar.PlexAPI.SDK; -using LukeHagar.PlexAPI.SDK.Models.Components; - -var sdk = new PlexAPI( - retryConfig: new RetryConfig( - strategy: RetryConfig.RetryStrategy.BACKOFF, - backoff: new BackoffStrategy( - initialIntervalMs: 1L, - maxIntervalMs: 50L, - maxElapsedTimeMs: 100L, - exponent: 1.1 - ), - retryConnectionErrors: false - ), - accessToken: "", - 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 -``` - - ## Error Handling @@ -427,7 +364,6 @@ The following SDKs are generated from the OpenAPI Specification. They are automa * [SDK Installation](#sdk-installation) * [SDK Example Usage](#sdk-example-usage) * [Available Resources and Operations](#available-resources-and-operations) -* [Retries](#retries) * [Error Handling](#error-handling) * [Server Selection](#server-selection) * [Authentication](#authentication) diff --git a/RELEASES.md b/RELEASES.md index 7873587..4fafc47 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -364,4 +364,14 @@ Based on: ### Generated - [csharp v0.9.2] . ### Releases -- [NuGet v0.9.2] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.9.2 - . \ No newline at end of file +- [NuGet v0.9.2] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.9.2 - . + +## 2024-10-03 12:24:46 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.406.0 (2.429.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [csharp v0.10.0] . +### Releases +- [NuGet v0.10.0] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.10.0 - . \ No newline at end of file diff --git a/docs/Models/Requests/GetLibraryItemsMediaContainer.md b/docs/Models/Requests/GetLibraryItemsMediaContainer.md index 202a7a4..1075c05 100644 --- a/docs/Models/Requests/GetLibraryItemsMediaContainer.md +++ b/docs/Models/Requests/GetLibraryItemsMediaContainer.md @@ -29,5 +29,5 @@ The Meta object is only included in the response if the `includeMeta` parameter | `ViewGroup` | *string* | :heavy_check_mark: | N/A | movie | | `ViewMode` | *int* | :heavy_minus_sign: | N/A | 65592 | | `MixedParents` | *bool* | :heavy_minus_sign: | N/A | true | -| `Metadata` | List<[GetLibraryItemsMetadata](../../Models/Requests/GetLibraryItemsMetadata.md)> | :heavy_check_mark: | N/A | | +| `Metadata` | List<[GetLibraryItemsMetadata](../../Models/Requests/GetLibraryItemsMetadata.md)> | :heavy_minus_sign: | N/A | | | `Meta` | [GetLibraryItemsMeta](../../Models/Requests/GetLibraryItemsMeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
| | \ No newline at end of file diff --git a/docs/Models/Requests/GetTokenDetailsResponse.md b/docs/Models/Requests/GetTokenDetailsResponse.md index 5fdb602..dab2859 100644 --- a/docs/Models/Requests/GetTokenDetailsResponse.md +++ b/docs/Models/Requests/GetTokenDetailsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `UserPlexAccount` | [GetTokenDetailsUserPlexAccount](../../Models/Requests/GetTokenDetailsUserPlexAccount.md) | :heavy_minus_sign: | Logged in user details | {
"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": 1721154902,
"locale": null,
"mailingListActive": false,
"mailingListStatus": "subscribed",
"maxHomeSize": 15,
"pastSubscriptions": [
{
"id": "string",
"mode": "string",
"renewsAt": "string",
"endsAt": "1556281940",
"canceled": "0",
"gracePeriod": "0",
"onHold": "0",
"canReactivate": "0",
"canUpgrade": "0",
"canDowngrade": "0",
"canConvert": "0",
"type": "plexpass",
"transfer": "string",
"state": "ended",
"billing": [
{
"internalPaymentMethod": "string",
"paymentMethodId": "string"
}
]
}
],
"pin": "string",
"profile": [
{
"autoSelectAudio": true,
"defaultAudioLanguage": "ja",
"defaultSubtitleLanguage": "en",
"autoSelectSubtitle": 1,
"defaultSubtitleAccessibility": 1,
"defaultSubtitleForced": 0,
"watchedIndicator": 1,
"mediaReviewsVisibility": 0
}
],
"protected": false,
"rememberExpiresAt": 1722364046,
"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",
"trials": [
{}
],
"twoFactorEnabled": false,
"username": "Username",
"uuid": "dae343c1f45beb4f"
} | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `UserPlexAccount` | [GetTokenDetailsUserPlexAccount](../../Models/Requests/GetTokenDetailsUserPlexAccount.md) | :heavy_minus_sign: | Logged in user details | \ No newline at end of file diff --git a/docs/Models/Requests/GetTokenDetailsUserPlexAccount.md b/docs/Models/Requests/GetTokenDetailsUserPlexAccount.md index 020e2b9..c88c809 100644 --- a/docs/Models/Requests/GetTokenDetailsUserPlexAccount.md +++ b/docs/Models/Requests/GetTokenDetailsUserPlexAccount.md @@ -8,8 +8,8 @@ Logged in user details | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AdsConsent` | *bool* | :heavy_check_mark: | Unknown | | -| `AdsConsentReminderAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | Unknown | | -| `AdsConsentSetAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | Unknown | | +| `AdsConsentReminderAt` | *long* | :heavy_check_mark: | N/A | 1556281940 | +| `AdsConsentSetAt` | *long* | :heavy_check_mark: | N/A | 1556281940 | | `Anonymous` | *bool* | :heavy_minus_sign: | Unknown | | | `AuthToken` | *string* | :heavy_check_mark: | The account token | CxoUzBTSV5hsxjTpFKaf | | `BackupCodesCreated` | *bool* | :heavy_minus_sign: | If the two-factor authentication backup codes have been created | | diff --git a/docs/Models/Requests/PostUsersSignInDataResponse.md b/docs/Models/Requests/PostUsersSignInDataResponse.md index 4693106..5e700a7 100644 --- a/docs/Models/Requests/PostUsersSignInDataResponse.md +++ b/docs/Models/Requests/PostUsersSignInDataResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `UserPlexAccount` | [PostUsersSignInDataUserPlexAccount](../../Models/Requests/PostUsersSignInDataUserPlexAccount.md) | :heavy_minus_sign: | Returns the user account data with a valid auth token | {
"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": 1721154902,
"locale": null,
"mailingListActive": false,
"mailingListStatus": "subscribed",
"maxHomeSize": 15,
"pastSubscriptions": [
{
"id": "string",
"mode": "string",
"renewsAt": "string",
"endsAt": "1556281940",
"canceled": "0",
"gracePeriod": "0",
"onHold": "0",
"canReactivate": "0",
"canUpgrade": "0",
"canDowngrade": "0",
"canConvert": "0",
"type": "plexpass",
"transfer": "string",
"state": "ended",
"billing": [
{
"internalPaymentMethod": "string",
"paymentMethodId": "string"
}
]
}
],
"pin": "string",
"profile": [
{
"autoSelectAudio": true,
"defaultAudioLanguage": "ja",
"defaultSubtitleLanguage": "en",
"autoSelectSubtitle": 1,
"defaultSubtitleAccessibility": 1,
"defaultSubtitleForced": 0,
"watchedIndicator": 1,
"mediaReviewsVisibility": 0
}
],
"protected": false,
"rememberExpiresAt": 1722364046,
"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",
"trials": [
{}
],
"twoFactorEnabled": false,
"username": "Username",
"uuid": "dae343c1f45beb4f"
} | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `UserPlexAccount` | [PostUsersSignInDataUserPlexAccount](../../Models/Requests/PostUsersSignInDataUserPlexAccount.md) | :heavy_minus_sign: | Returns the user account data with a valid auth token | \ No newline at end of file diff --git a/docs/Models/Requests/PostUsersSignInDataUserPlexAccount.md b/docs/Models/Requests/PostUsersSignInDataUserPlexAccount.md index 22dd3e4..d60c77a 100644 --- a/docs/Models/Requests/PostUsersSignInDataUserPlexAccount.md +++ b/docs/Models/Requests/PostUsersSignInDataUserPlexAccount.md @@ -8,8 +8,8 @@ Returns the user account data with a valid auth token | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AdsConsent` | *bool* | :heavy_check_mark: | Unknown | | -| `AdsConsentReminderAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | Unknown | | -| `AdsConsentSetAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | Unknown | | +| `AdsConsentReminderAt` | *long* | :heavy_check_mark: | N/A | 1556281940 | +| `AdsConsentSetAt` | *long* | :heavy_check_mark: | N/A | 1556281940 | | `Anonymous` | *bool* | :heavy_minus_sign: | Unknown | | | `AuthToken` | *string* | :heavy_check_mark: | The account token | CxoUzBTSV5hsxjTpFKaf | | `BackupCodesCreated` | *bool* | :heavy_minus_sign: | If the two-factor authentication backup codes have been created | |