fix patch example. (#517)

This commit is contained in:
Brendan Burns
2020-11-17 05:40:04 -08:00
committed by GitHub
parent 19854da0a1
commit e18ec35250
3 changed files with 31 additions and 11 deletions

View File

@@ -7,25 +7,36 @@ namespace k8s.Models
[JsonConverter(typeof(V1PathJsonConverter))]
public partial class V1Patch
{
public enum PathType
public enum PatchType
{
JsonPatch,
MergePatch,
StrategicMergePatch,
}
public PathType Type { get; private set; }
public PatchType Type { get; private set; }
public V1Patch(IJsonPatchDocument jsonPatch)
: this((object)jsonPatch)
{
}
public V1Patch(String body, PatchType type)
: this(body)
{
this.Type = type;
}
partial void CustomInit()
{
if (Content is IJsonPatchDocument)
{
Type = PathType.JsonPatch;
Type = PatchType.JsonPatch;
return;
}
if (Content is String)
{
return;
}