mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.406.0
This commit is contained in:
@@ -45,7 +45,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null);
|
||||
Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// Get All Playlists
|
||||
@@ -54,7 +54,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
/// Get All Playlists given the specified filters.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null);
|
||||
Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Playlist
|
||||
@@ -65,7 +65,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null);
|
||||
Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a Playlist
|
||||
@@ -75,7 +75,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null);
|
||||
Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID);
|
||||
|
||||
/// <summary>
|
||||
/// Update a Playlist
|
||||
@@ -85,7 +85,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null);
|
||||
Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Playlist Contents
|
||||
@@ -98,7 +98,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null);
|
||||
Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type);
|
||||
|
||||
/// <summary>
|
||||
/// Delete Playlist Contents
|
||||
@@ -108,7 +108,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null);
|
||||
Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID);
|
||||
|
||||
/// <summary>
|
||||
/// Adding to a Playlist
|
||||
@@ -119,7 +119,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null);
|
||||
Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null);
|
||||
|
||||
/// <summary>
|
||||
/// Upload Playlist
|
||||
@@ -129,7 +129,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null);
|
||||
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -146,10 +146,10 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.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<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
|
||||
@@ -162,7 +162,7 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
SDKConfiguration = config;
|
||||
}
|
||||
|
||||
public async Task<CreatePlaylistResponse> CreatePlaylistAsync(CreatePlaylistRequest request, RetryConfig? retryConfig = null)
|
||||
public async Task<CreatePlaylistResponse> 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<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _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<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null, RetryConfig? retryConfig = null)
|
||||
public async Task<GetPlaylistsResponse> 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<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _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<GetPlaylistResponse> GetPlaylistAsync(double playlistID, RetryConfig? retryConfig = null)
|
||||
public async Task<GetPlaylistResponse> 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<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _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<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID, RetryConfig? retryConfig = null)
|
||||
public async Task<DeletePlaylistResponse> 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<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _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<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null, RetryConfig? retryConfig = null)
|
||||
public async Task<UpdatePlaylistResponse> 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<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _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<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type, RetryConfig? retryConfig = null)
|
||||
public async Task<GetPlaylistContentsResponse> 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<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _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<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID, RetryConfig? retryConfig = null)
|
||||
public async Task<ClearPlaylistContentsResponse> 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<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _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<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null, RetryConfig? retryConfig = null)
|
||||
public async Task<AddPlaylistContentsResponse> 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<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _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<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID, RetryConfig? retryConfig = null)
|
||||
public async Task<UploadPlaylistResponse> 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<string> statusCodes = new List<string>
|
||||
{
|
||||
"5XX",
|
||||
};
|
||||
|
||||
Func<Task<HttpResponseMessage>> retrySend = async () =>
|
||||
{
|
||||
var _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)
|
||||
|
||||
Reference in New Issue
Block a user