* gen v1.23.0 * fix converter * bump ver * update readme runtime * fix warning * update dep ver * newtonjson -> system.text.json * generate for new json api * readme lf * dotnet fmt * dotnet fmt tests/ * dotnet fmt * Revert "dotnet fmt" This reverts commit e14c59076143fe2218ed899295a00762f0ea2bd6. * fix err introduce by dotnet fmt * fix test * remove deprecated /watch api * generate code after /watch removed * remove /watch related code * trim Microsoft.Rest.Serialization
94 lines
2.9 KiB
Plaintext
94 lines
2.9 KiB
Plaintext
// <auto-generated>
|
|
// Code generated by https://github.com/kubernetes-client/csharp/tree/master/gen/KubernetesGenerator
|
|
// Changes may cause incorrect behavior and will be lost if the code is
|
|
// regenerated.
|
|
// </auto-generated>
|
|
|
|
namespace k8s.Models
|
|
{
|
|
/// <summary>
|
|
/// {{ToXmlDoc def.description}}
|
|
/// </summary>
|
|
public partial class {{clz}}
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the {{GetClassName def}} class.
|
|
/// </summary>
|
|
public {{clz}}()
|
|
{
|
|
CustomInit();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the {{GetClassName def}} class.
|
|
/// </summary>
|
|
{{#properties}}
|
|
{{#isRequired}}
|
|
/// <param name="{{GetDotNetName name "fieldctor"}}">
|
|
/// {{ToXmlDoc description}}
|
|
/// </param>
|
|
{{/isRequired}}
|
|
{{/properties}}
|
|
{{#properties}}
|
|
{{^isRequired}}
|
|
/// <param name="{{GetDotNetName name "fieldctor"}}">
|
|
/// {{ToXmlDoc description}}
|
|
/// </param>
|
|
{{/isRequired}}
|
|
{{/properties}}
|
|
public {{clz}}({{GetModelCtorParam def}})
|
|
{
|
|
{{#properties}}
|
|
{{GetDotNetName name "field"}} = {{GetDotNetName name "fieldctor"}};
|
|
{{/properties}}
|
|
CustomInit();
|
|
}
|
|
|
|
/// <summary>
|
|
/// An initialization method that performs custom operations like setting defaults
|
|
/// </summary>
|
|
partial void CustomInit();
|
|
{{#properties}}
|
|
|
|
/// <summary>
|
|
/// {{ToXmlDoc description}}
|
|
/// </summary>
|
|
[JsonPropertyName("{{name}}")]
|
|
public {{GetDotNetType .}} {{GetDotNetName name "field"}} { get; set; }
|
|
{{/properties}}
|
|
|
|
/// <summary>
|
|
/// Validate the object.
|
|
/// </summary>
|
|
/// <exception cref="ValidationException">
|
|
/// Thrown if validation fails
|
|
/// </exception>
|
|
public virtual void Validate()
|
|
{
|
|
{{#properties}}
|
|
{{#IfType . "object"}}
|
|
{{#isRequired}}
|
|
if ({{GetDotNetName name "field"}} == null)
|
|
{
|
|
throw new ArgumentNullException("{{GetDotNetName name "field"}}");
|
|
}
|
|
{{/isRequired}}
|
|
{{/IfType . "object"}}
|
|
{{/properties}}
|
|
{{#properties}}
|
|
{{#IfType . "object"}}
|
|
{{GetDotNetName name "field"}}?.Validate();
|
|
{{/IfType . "object"}}
|
|
{{#IfType . "objectarray"}}
|
|
if ({{GetDotNetName name "field"}} != null){
|
|
foreach(var obj in {{GetDotNetName name "field"}})
|
|
{
|
|
obj.Validate();
|
|
}
|
|
}
|
|
{{/IfType . "objectarray"}}
|
|
{{/properties}}
|
|
}
|
|
}
|
|
}
|