// // 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; /// /// Selects a key from a ConfigMap. /// public partial class V1ConfigMapKeySelector { /// /// Initializes a new instance of the V1ConfigMapKeySelector class. /// public V1ConfigMapKeySelector() { CustomInit(); } /// /// Initializes a new instance of the V1ConfigMapKeySelector class. /// /// The key to select. /// Name of the referent. More info: /// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names /// Specify whether the ConfigMap or its key /// must be defined public V1ConfigMapKeySelector(string key, string name = default(string), bool? optional = default(bool?)) { Key = key; Name = name; Optional = optional; CustomInit(); } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); /// /// Gets or sets the key to select. /// [JsonProperty(PropertyName = "key")] public string Key { get; set; } /// /// Gets or sets name of the referent. More info: /// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets specify whether the ConfigMap or its key must be /// defined /// [JsonProperty(PropertyName = "optional")] public bool? Optional { get; set; } /// /// Validate the object. /// /// /// Thrown if validation fails /// public virtual void Validate() { if (Key == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Key"); } } } }