// // 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; /// /// DownwardAPIVolumeFile represents information to create the file /// containing the pod field /// public partial class V1DownwardAPIVolumeFile { /// /// Initializes a new instance of the V1DownwardAPIVolumeFile class. /// public V1DownwardAPIVolumeFile() { CustomInit(); } /// /// Initializes a new instance of the V1DownwardAPIVolumeFile class. /// /// Required: Path is the relative path name of the /// file to be created. Must not be absolute or contain the '..' path. /// Must be utf-8 encoded. The first item of the relative path must not /// start with '..' /// Required: Selects a field of the pod: only /// annotations, labels, name and namespace are supported. /// Optional: mode bits to use on this file, must be /// a value between 0 and 0777. If not specified, the volume /// defaultMode will be used. This might be in conflict with other /// options that affect the file mode, like fsGroup, and the result can /// be other mode bits set. /// Selects a resource of the container: /// only resources limits and requests (limits.cpu, limits.memory, /// requests.cpu and requests.memory) are currently supported. public V1DownwardAPIVolumeFile(string path, V1ObjectFieldSelector fieldRef = default(V1ObjectFieldSelector), int? mode = default(int?), V1ResourceFieldSelector resourceFieldRef = default(V1ResourceFieldSelector)) { FieldRef = fieldRef; Mode = mode; Path = path; ResourceFieldRef = resourceFieldRef; CustomInit(); } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); /// /// Gets or sets required: Selects a field of the pod: only /// annotations, labels, name and namespace are supported. /// [JsonProperty(PropertyName = "fieldRef")] public V1ObjectFieldSelector FieldRef { get; set; } /// /// Gets or sets optional: mode bits to use on this file, must be a /// value between 0 and 0777. If not specified, the volume defaultMode /// will be used. This might be in conflict with other options that /// affect the file mode, like fsGroup, and the result can be other /// mode bits set. /// [JsonProperty(PropertyName = "mode")] public int? Mode { get; set; } /// /// Gets or sets required: Path is the relative path name of the file /// to be created. Must not be absolute or contain the '..' path. Must /// be utf-8 encoded. The first item of the relative path must not /// start with '..' /// [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// /// Gets or sets selects a resource of the container: only resources /// limits and requests (limits.cpu, limits.memory, requests.cpu and /// requests.memory) are currently supported. /// [JsonProperty(PropertyName = "resourceFieldRef")] public V1ResourceFieldSelector ResourceFieldRef { get; set; } /// /// Validate the object. /// /// /// Thrown if validation fails /// public virtual void Validate() { if (Path == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Path"); } if (FieldRef != null) { FieldRef.Validate(); } if (ResourceFieldRef != null) { ResourceFieldRef.Validate(); } } } }