Files
csharp/src/KubernetesClient/V1Status.cs
Boshi Lian 5be3cff425 Style fix final (#523)
* all net5

* var

* SA1310

* SA1310

* allow 1031

* SA1805

* fix SA1642

* remove unused code

* allow sa1405

* isempty

* fix CA1714

* fix CA1806

* remove always false if

* fix format

* fix CA1062

* allow SA0001

* fix CA1062

* allow ca1034 and temp allow ca1835

* fix 16XX doc related warnings

* elm SA16XX

* elm SA16XX

* fix CA2213

* revert to pass all test

* move unclear rule to ruleset

* follow up of moving ruleset

* remove this

* fix test flaky
2020-11-22 14:52:09 -08:00

22 lines
717 B
C#

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>
/// <returns>string description of the status</returns>
public override string ToString()
{
var reason = Reason;
if (string.IsNullOrEmpty(reason) && Code.GetValueOrDefault() != 0)
{
reason = ((HttpStatusCode)Code.Value).ToString();
}
return string.IsNullOrEmpty(Message) ? string.IsNullOrEmpty(reason) ? Status : reason :
string.IsNullOrEmpty(reason) ? Message : $"{reason} - {Message}";
}
}
}