Files
plexcsharp/LukeHagar/PlexAPI/SDK/Models/Errors/GetServerIdentityRequestTimeout.cs

74 lines
2.5 KiB
C#

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Net.Http;
public class GetServerIdentityRequestTimeoutPayload
{
[JsonProperty("code")]
public int? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
/// <summary>
/// Request Timeout
/// </summary>
public class GetServerIdentityRequestTimeout : PlexAPIError
{
/// <summary>
/// The original data that was passed to this exception.
/// </summary>
public GetServerIdentityRequestTimeoutPayload Payload { get; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetServerIdentityRequestTimeout.Payload.Code instead.")]
public int? Code { get; set; }
[Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use GetServerIdentityRequestTimeout.Payload.Message instead.")]
private string? _message { get; set; }
private static string ErrorMessage(GetServerIdentityRequestTimeoutPayload payload, string body)
{
string? message = payload.Message;
if (!string.IsNullOrEmpty(message))
{
return message;
}
return "API error occurred";
}
public GetServerIdentityRequestTimeout(
GetServerIdentityRequestTimeoutPayload payload,
HttpResponseMessage rawResponse,
string body
): base(ErrorMessage(payload, body), rawResponse, body)
{
Payload = payload;
#pragma warning disable CS0618
Code = payload.Code;
_message = payload.Message;
#pragma warning restore CS0618
}
}
}