2018-01-26 13:57:42 +08:00
|
|
|
using System;
|
|
|
|
|
using Microsoft.AspNetCore.JsonPatch;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
namespace k8s.Models
|
|
|
|
|
{
|
|
|
|
|
[JsonConverter(typeof(V1PathJsonConverter))]
|
|
|
|
|
public partial class V1Patch
|
|
|
|
|
{
|
|
|
|
|
public enum PathType
|
|
|
|
|
{
|
|
|
|
|
JsonPatch,
|
|
|
|
|
MergePatch,
|
|
|
|
|
StrategicMergePatch,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PathType Type { get; private set; }
|
|
|
|
|
|
2020-04-22 12:15:45 -07:00
|
|
|
public V1Patch(IJsonPatchDocument jsonPatch) : this((object)jsonPatch)
|
2018-01-26 13:57:42 +08:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
partial void CustomInit()
|
|
|
|
|
{
|
|
|
|
|
if (Content is IJsonPatchDocument)
|
|
|
|
|
{
|
|
|
|
|
Type = PathType.JsonPatch;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw new NotSupportedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|