2020-04-20 09:37:39 -07:00
|
|
|
using System.Net;
|
|
|
|
|
|
|
|
|
|
namespace k8s.Models
|
|
|
|
|
{
|
|
|
|
|
public partial class V1Status
|
|
|
|
|
{
|
|
|
|
|
/// <summary>Converts a <see cref="V1Status"/> object into a short description of the status.</summary>
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
string reason = Reason;
|
|
|
|
|
if (string.IsNullOrEmpty(reason) && Code.GetValueOrDefault() != 0)
|
|
|
|
|
{
|
|
|
|
|
reason = ((HttpStatusCode)Code.Value).ToString();
|
|
|
|
|
}
|
2020-04-23 11:40:06 -07:00
|
|
|
|
2020-04-20 09:37:39 -07:00
|
|
|
return string.IsNullOrEmpty(Message) ? string.IsNullOrEmpty(reason) ? Status : reason :
|
2020-04-23 11:40:06 -07:00
|
|
|
string.IsNullOrEmpty(reason) ? Message : $"{reason} - {Message}";
|
2020-04-20 09:37:39 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|