//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
//
namespace k8s.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
///
/// CustomResourceConversion describes how to convert different versions of
/// a CR.
///
public partial class V1beta1CustomResourceConversion
{
///
/// Initializes a new instance of the V1beta1CustomResourceConversion
/// class.
///
public V1beta1CustomResourceConversion()
{
CustomInit();
}
///
/// Initializes a new instance of the V1beta1CustomResourceConversion
/// class.
///
/// `strategy` specifies the conversion
/// strategy. Allowed values are: - `None`: The converter only change
/// the apiVersion and would not touch any other field in the CR. -
/// `Webhook`: API Server will call to an external webhook to do the
/// conversion. Additional information is needed for this
/// option.
/// `webhookClientConfig` is the
/// instructions for how to call the webhook if strategy is `Webhook`.
/// This field is alpha-level and is only honored by servers that
/// enable the CustomResourceWebhookConversion feature.
public V1beta1CustomResourceConversion(string strategy, Apiextensionsv1beta1WebhookClientConfig webhookClientConfig = default(Apiextensionsv1beta1WebhookClientConfig))
{
Strategy = strategy;
WebhookClientConfig = webhookClientConfig;
CustomInit();
}
///
/// An initialization method that performs custom operations like setting defaults
///
partial void CustomInit();
///
/// Gets or sets `strategy` specifies the conversion strategy. Allowed
/// values are: - `None`: The converter only change the apiVersion and
/// would not touch any other field in the CR. - `Webhook`: API Server
/// will call to an external webhook to do the conversion. Additional
/// information is needed for this option.
///
[JsonProperty(PropertyName = "strategy")]
public string Strategy { get; set; }
///
/// Gets or sets `webhookClientConfig` is the instructions for how to
/// call the webhook if strategy is `Webhook`. This field is
/// alpha-level and is only honored by servers that enable the
/// CustomResourceWebhookConversion feature.
///
[JsonProperty(PropertyName = "webhookClientConfig")]
public Apiextensionsv1beta1WebhookClientConfig WebhookClientConfig { get; set; }
///
/// Validate the object.
///
///
/// Thrown if validation fails
///
public virtual void Validate()
{
if (Strategy == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Strategy");
}
if (WebhookClientConfig != null)
{
WebhookClientConfig.Validate();
}
}
}
}