mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 12:37:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.615.2
This commit is contained in:
@@ -143,8 +143,8 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
};
|
||||
public SDKConfig SDKConfiguration { get; private set; }
|
||||
private const string _language = "csharp";
|
||||
private const string _sdkVersion = "0.16.1";
|
||||
private const string _sdkGenVersion = "2.674.3";
|
||||
private const string _sdkVersion = "0.17.0";
|
||||
private const string _sdkGenVersion = "2.698.4";
|
||||
private const string _openapiDocVersion = "0.0.3";
|
||||
|
||||
public Plex(SDKConfig config)
|
||||
@@ -211,7 +211,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<List<ResponseBody>>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
List<ResponseBody> obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<List<ResponseBody>>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into List<ResponseBody>.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetCompanionsDataResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
@@ -222,40 +232,60 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetCompanionsDataBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetCompanionsDataBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetCompanionsDataBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetCompanionsDataBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetCompanionsDataBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetCompanionsDataUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetCompanionsDataUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetCompanionsDataUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetCompanionsDataUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetCompanionsDataUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null)
|
||||
@@ -317,7 +347,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<List<Friend>>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
List<Friend> obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<List<Friend>>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into List<Friend>.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetUserFriendsResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
@@ -328,40 +368,60 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetUserFriendsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetUserFriendsBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetUserFriendsBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetUserFriendsBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetUserFriendsBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetUserFriendsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetUserFriendsUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetUserFriendsUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetUserFriendsUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetUserFriendsUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null)
|
||||
@@ -418,7 +478,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetGeoDataGeoData>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetGeoDataGeoData obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetGeoDataGeoData>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetGeoDataGeoData.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetGeoDataResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
@@ -429,40 +499,60 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetGeoDataBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetGeoDataBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetGeoDataBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetGeoDataBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetGeoDataBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetGeoDataUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetGeoDataUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetGeoDataUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetGeoDataUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetGeoDataUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<GetHomeDataResponse> GetHomeDataAsync()
|
||||
@@ -519,7 +609,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetHomeDataResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetHomeDataResponseBody obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetHomeDataResponseBody>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetHomeDataResponseBody.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetHomeDataResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
@@ -530,40 +630,60 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetHomeDataBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetHomeDataBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetHomeDataBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetHomeDataBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetHomeDataBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetHomeDataUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetHomeDataUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetHomeDataUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetHomeDataUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetHomeDataUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<GetServerResourcesResponse> GetServerResourcesAsync(string clientID, IncludeHttps? includeHttps = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeHttps.Disable, IncludeRelay? includeRelay = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeRelay.Disable, IncludeIPv6? includeIPv6 = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.Disable, string? serverUrl = null)
|
||||
@@ -632,7 +752,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<List<PlexDevice>>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
List<PlexDevice> obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<List<PlexDevice>>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into List<PlexDevice>.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetServerResourcesResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
@@ -643,40 +773,60 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetServerResourcesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetServerResourcesBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetServerResourcesBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetServerResourcesBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetServerResourcesBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 401)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetServerResourcesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetServerResourcesUnauthorizedPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetServerResourcesUnauthorizedPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetServerResourcesUnauthorizedPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetServerResourcesUnauthorized(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<GetPinResponse> GetPinAsync(GetPinRequest request, string? serverUrl = null)
|
||||
@@ -733,7 +883,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetPinAuthPinContainer>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetPinAuthPinContainer obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetPinAuthPinContainer>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetPinAuthPinContainer.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetPinResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
@@ -744,29 +904,39 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetPinBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetPinBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetPinBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetPinBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetPinBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
public async Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(GetTokenByPinIdRequest request, string? serverUrl = null)
|
||||
@@ -823,7 +993,17 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetTokenByPinIdAuthPinContainer>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetTokenByPinIdAuthPinContainer obj;
|
||||
try
|
||||
{
|
||||
obj = ResponseBodyDeserializer.DeserializeNotNull<GetTokenByPinIdAuthPinContainer>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTokenByPinIdAuthPinContainer.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
var response = new GetTokenByPinIdResponse()
|
||||
{
|
||||
StatusCode = responseStatusCode,
|
||||
@@ -834,40 +1014,60 @@ namespace LukeHagar.PlexAPI.SDK
|
||||
return response;
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 400)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetTokenByPinIdBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetTokenByPinIdBadRequestPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTokenByPinIdBadRequestPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTokenByPinIdBadRequestPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetTokenByPinIdBadRequest(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode == 404)
|
||||
{
|
||||
if(Utilities.IsContentTypeMatch("application/json", contentType))
|
||||
{
|
||||
var obj = ResponseBodyDeserializer.Deserialize<GetTokenByPinIdResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
|
||||
obj!.RawResponse = httpResponse;
|
||||
throw obj!;
|
||||
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
|
||||
GetTokenByPinIdResponseBodyPayload payload;
|
||||
try
|
||||
{
|
||||
payload = ResponseBodyDeserializer.DeserializeNotNull<GetTokenByPinIdResponseBodyPayload>(httpResponseBody, NullValueHandling.Ignore);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ResponseValidationException("Failed to deserialize response body into GetTokenByPinIdResponseBodyPayload.", httpResponse, httpResponseBody, ex);
|
||||
}
|
||||
|
||||
payload.RawResponse = httpResponse;
|
||||
throw new GetTokenByPinIdResponseBody(payload, httpResponse, httpResponseBody);
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 400 && responseStatusCode < 500)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
else if(responseStatusCode >= 500 && responseStatusCode < 600)
|
||||
{
|
||||
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
|
||||
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
|
||||
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user