// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace k8s.Models
{
    using Microsoft.Rest;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Volume represents a named volume in a pod that may be accessed by any
    /// container in the pod.
    /// </summary>
    public partial class V1Volume
    {
        /// <summary>
        /// Initializes a new instance of the V1Volume class.
        /// </summary>
        public V1Volume()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the V1Volume class.
        /// </summary>
        /// <param name="name">Volume's name. Must be a DNS_LABEL and unique
        /// within the pod. More info:
        /// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names</param>
        /// <param name="awsElasticBlockStore">AWSElasticBlockStore represents
        /// an AWS Disk resource that is attached to a kubelet's host machine
        /// and then exposed to the pod. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore</param>
        /// <param name="azureDisk">AzureDisk represents an Azure Data Disk
        /// mount on the host and bind mount to the pod.</param>
        /// <param name="azureFile">AzureFile represents an Azure File Service
        /// mount on the host and bind mount to the pod.</param>
        /// <param name="cephfs">CephFS represents a Ceph FS mount on the host
        /// that shares a pod's lifetime</param>
        /// <param name="cinder">Cinder represents a cinder volume attached and
        /// mounted on kubelets host machine More info:
        /// https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md</param>
        /// <param name="configMap">ConfigMap represents a configMap that
        /// should populate this volume</param>
        /// <param name="downwardAPI">DownwardAPI represents downward API about
        /// the pod that should populate this volume</param>
        /// <param name="emptyDir">EmptyDir represents a temporary directory
        /// that shares a pod's lifetime. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#emptydir</param>
        /// <param name="fc">FC represents a Fibre Channel resource that is
        /// attached to a kubelet's host machine and then exposed to the
        /// pod.</param>
        /// <param name="flexVolume">FlexVolume represents a generic volume
        /// resource that is provisioned/attached using an exec based
        /// plugin.</param>
        /// <param name="flocker">Flocker represents a Flocker volume attached
        /// to a kubelet's host machine. This depends on the Flocker control
        /// service being running</param>
        /// <param name="gcePersistentDisk">GCEPersistentDisk represents a GCE
        /// Disk resource that is attached to a kubelet's host machine and then
        /// exposed to the pod. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk</param>
        /// <param name="gitRepo">GitRepo represents a git repository at a
        /// particular revision. DEPRECATED: GitRepo is deprecated. To
        /// provision a container with a git repo, mount an EmptyDir into an
        /// InitContainer that clones the repo using git, then mount the
        /// EmptyDir into the Pod's container.</param>
        /// <param name="glusterfs">Glusterfs represents a Glusterfs mount on
        /// the host that shares a pod's lifetime. More info:
        /// https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md</param>
        /// <param name="hostPath">HostPath represents a pre-existing file or
        /// directory on the host machine that is directly exposed to the
        /// container. This is generally used for system agents or other
        /// privileged things that are allowed to see the host machine. Most
        /// containers will NOT need this. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#hostpath</param>
        /// <param name="iscsi">ISCSI represents an ISCSI Disk resource that is
        /// attached to a kubelet's host machine and then exposed to the pod.
        /// More info:
        /// https://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md</param>
        /// <param name="nfs">NFS represents an NFS mount on the host that
        /// shares a pod's lifetime More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#nfs</param>
        /// <param
        /// name="persistentVolumeClaim">PersistentVolumeClaimVolumeSource
        /// represents a reference to a PersistentVolumeClaim in the same
        /// namespace. More info:
        /// https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims</param>
        /// <param name="photonPersistentDisk">PhotonPersistentDisk represents
        /// a PhotonController persistent disk attached and mounted on kubelets
        /// host machine</param>
        /// <param name="portworxVolume">PortworxVolume represents a portworx
        /// volume attached and mounted on kubelets host machine</param>
        /// <param name="projected">Items for all in one resources secrets,
        /// configmaps, and downward API</param>
        /// <param name="quobyte">Quobyte represents a Quobyte mount on the
        /// host that shares a pod's lifetime</param>
        /// <param name="rbd">RBD represents a Rados Block Device mount on the
        /// host that shares a pod's lifetime. More info:
        /// https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md</param>
        /// <param name="scaleIO">ScaleIO represents a ScaleIO persistent
        /// volume attached and mounted on Kubernetes nodes.</param>
        /// <param name="secret">Secret represents a secret that should
        /// populate this volume. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#secret</param>
        /// <param name="storageos">StorageOS represents a StorageOS volume
        /// attached and mounted on Kubernetes nodes.</param>
        /// <param name="vsphereVolume">VsphereVolume represents a vSphere
        /// volume attached and mounted on kubelets host machine</param>
        public V1Volume(string name, V1AWSElasticBlockStoreVolumeSource awsElasticBlockStore = default(V1AWSElasticBlockStoreVolumeSource), V1AzureDiskVolumeSource azureDisk = default(V1AzureDiskVolumeSource), V1AzureFileVolumeSource azureFile = default(V1AzureFileVolumeSource), V1CephFSVolumeSource cephfs = default(V1CephFSVolumeSource), V1CinderVolumeSource cinder = default(V1CinderVolumeSource), V1ConfigMapVolumeSource configMap = default(V1ConfigMapVolumeSource), V1DownwardAPIVolumeSource downwardAPI = default(V1DownwardAPIVolumeSource), V1EmptyDirVolumeSource emptyDir = default(V1EmptyDirVolumeSource), V1FCVolumeSource fc = default(V1FCVolumeSource), V1FlexVolumeSource flexVolume = default(V1FlexVolumeSource), V1FlockerVolumeSource flocker = default(V1FlockerVolumeSource), V1GCEPersistentDiskVolumeSource gcePersistentDisk = default(V1GCEPersistentDiskVolumeSource), V1GitRepoVolumeSource gitRepo = default(V1GitRepoVolumeSource), V1GlusterfsVolumeSource glusterfs = default(V1GlusterfsVolumeSource), V1HostPathVolumeSource hostPath = default(V1HostPathVolumeSource), V1ISCSIVolumeSource iscsi = default(V1ISCSIVolumeSource), V1NFSVolumeSource nfs = default(V1NFSVolumeSource), V1PersistentVolumeClaimVolumeSource persistentVolumeClaim = default(V1PersistentVolumeClaimVolumeSource), V1PhotonPersistentDiskVolumeSource photonPersistentDisk = default(V1PhotonPersistentDiskVolumeSource), V1PortworxVolumeSource portworxVolume = default(V1PortworxVolumeSource), V1ProjectedVolumeSource projected = default(V1ProjectedVolumeSource), V1QuobyteVolumeSource quobyte = default(V1QuobyteVolumeSource), V1RBDVolumeSource rbd = default(V1RBDVolumeSource), V1ScaleIOVolumeSource scaleIO = default(V1ScaleIOVolumeSource), V1SecretVolumeSource secret = default(V1SecretVolumeSource), V1StorageOSVolumeSource storageos = default(V1StorageOSVolumeSource), V1VsphereVirtualDiskVolumeSource vsphereVolume = default(V1VsphereVirtualDiskVolumeSource))
        {
            AwsElasticBlockStore = awsElasticBlockStore;
            AzureDisk = azureDisk;
            AzureFile = azureFile;
            Cephfs = cephfs;
            Cinder = cinder;
            ConfigMap = configMap;
            DownwardAPI = downwardAPI;
            EmptyDir = emptyDir;
            Fc = fc;
            FlexVolume = flexVolume;
            Flocker = flocker;
            GcePersistentDisk = gcePersistentDisk;
            GitRepo = gitRepo;
            Glusterfs = glusterfs;
            HostPath = hostPath;
            Iscsi = iscsi;
            Name = name;
            Nfs = nfs;
            PersistentVolumeClaim = persistentVolumeClaim;
            PhotonPersistentDisk = photonPersistentDisk;
            PortworxVolume = portworxVolume;
            Projected = projected;
            Quobyte = quobyte;
            Rbd = rbd;
            ScaleIO = scaleIO;
            Secret = secret;
            Storageos = storageos;
            VsphereVolume = vsphereVolume;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets aWSElasticBlockStore represents an AWS Disk resource
        /// that is attached to a kubelet's host machine and then exposed to
        /// the pod. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
        /// </summary>
        [JsonProperty(PropertyName = "awsElasticBlockStore")]
        public V1AWSElasticBlockStoreVolumeSource AwsElasticBlockStore { get; set; }

        /// <summary>
        /// Gets or sets azureDisk represents an Azure Data Disk mount on the
        /// host and bind mount to the pod.
        /// </summary>
        [JsonProperty(PropertyName = "azureDisk")]
        public V1AzureDiskVolumeSource AzureDisk { get; set; }

        /// <summary>
        /// Gets or sets azureFile represents an Azure File Service mount on
        /// the host and bind mount to the pod.
        /// </summary>
        [JsonProperty(PropertyName = "azureFile")]
        public V1AzureFileVolumeSource AzureFile { get; set; }

        /// <summary>
        /// Gets or sets cephFS represents a Ceph FS mount on the host that
        /// shares a pod's lifetime
        /// </summary>
        [JsonProperty(PropertyName = "cephfs")]
        public V1CephFSVolumeSource Cephfs { get; set; }

        /// <summary>
        /// Gets or sets cinder represents a cinder volume attached and mounted
        /// on kubelets host machine More info:
        /// https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md
        /// </summary>
        [JsonProperty(PropertyName = "cinder")]
        public V1CinderVolumeSource Cinder { get; set; }

        /// <summary>
        /// Gets or sets configMap represents a configMap that should populate
        /// this volume
        /// </summary>
        [JsonProperty(PropertyName = "configMap")]
        public V1ConfigMapVolumeSource ConfigMap { get; set; }

        /// <summary>
        /// Gets or sets downwardAPI represents downward API about the pod that
        /// should populate this volume
        /// </summary>
        [JsonProperty(PropertyName = "downwardAPI")]
        public V1DownwardAPIVolumeSource DownwardAPI { get; set; }

        /// <summary>
        /// Gets or sets emptyDir represents a temporary directory that shares
        /// a pod's lifetime. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#emptydir
        /// </summary>
        [JsonProperty(PropertyName = "emptyDir")]
        public V1EmptyDirVolumeSource EmptyDir { get; set; }

        /// <summary>
        /// Gets or sets FC represents a Fibre Channel resource that is
        /// attached to a kubelet's host machine and then exposed to the pod.
        /// </summary>
        [JsonProperty(PropertyName = "fc")]
        public V1FCVolumeSource Fc { get; set; }

        /// <summary>
        /// Gets or sets flexVolume represents a generic volume resource that
        /// is provisioned/attached using an exec based plugin.
        /// </summary>
        [JsonProperty(PropertyName = "flexVolume")]
        public V1FlexVolumeSource FlexVolume { get; set; }

        /// <summary>
        /// Gets or sets flocker represents a Flocker volume attached to a
        /// kubelet's host machine. This depends on the Flocker control service
        /// being running
        /// </summary>
        [JsonProperty(PropertyName = "flocker")]
        public V1FlockerVolumeSource Flocker { get; set; }

        /// <summary>
        /// Gets or sets gCEPersistentDisk represents a GCE Disk resource that
        /// is attached to a kubelet's host machine and then exposed to the
        /// pod. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
        /// </summary>
        [JsonProperty(PropertyName = "gcePersistentDisk")]
        public V1GCEPersistentDiskVolumeSource GcePersistentDisk { get; set; }

        /// <summary>
        /// Gets or sets gitRepo represents a git repository at a particular
        /// revision. DEPRECATED: GitRepo is deprecated. To provision a
        /// container with a git repo, mount an EmptyDir into an InitContainer
        /// that clones the repo using git, then mount the EmptyDir into the
        /// Pod's container.
        /// </summary>
        [JsonProperty(PropertyName = "gitRepo")]
        public V1GitRepoVolumeSource GitRepo { get; set; }

        /// <summary>
        /// Gets or sets glusterfs represents a Glusterfs mount on the host
        /// that shares a pod's lifetime. More info:
        /// https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md
        /// </summary>
        [JsonProperty(PropertyName = "glusterfs")]
        public V1GlusterfsVolumeSource Glusterfs { get; set; }

        /// <summary>
        /// Gets or sets hostPath represents a pre-existing file or directory
        /// on the host machine that is directly exposed to the container. This
        /// is generally used for system agents or other privileged things that
        /// are allowed to see the host machine. Most containers will NOT need
        /// this. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#hostpath
        /// </summary>
        [JsonProperty(PropertyName = "hostPath")]
        public V1HostPathVolumeSource HostPath { get; set; }

        /// <summary>
        /// Gets or sets ISCSI represents an ISCSI Disk resource that is
        /// attached to a kubelet's host machine and then exposed to the pod.
        /// More info:
        /// https://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md
        /// </summary>
        [JsonProperty(PropertyName = "iscsi")]
        public V1ISCSIVolumeSource Iscsi { get; set; }

        /// <summary>
        /// Gets or sets volume's name. Must be a DNS_LABEL and unique within
        /// the pod. More info:
        /// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
        /// </summary>
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets NFS represents an NFS mount on the host that shares a
        /// pod's lifetime More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#nfs
        /// </summary>
        [JsonProperty(PropertyName = "nfs")]
        public V1NFSVolumeSource Nfs { get; set; }

        /// <summary>
        /// Gets or sets persistentVolumeClaimVolumeSource represents a
        /// reference to a PersistentVolumeClaim in the same namespace. More
        /// info:
        /// https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
        /// </summary>
        [JsonProperty(PropertyName = "persistentVolumeClaim")]
        public V1PersistentVolumeClaimVolumeSource PersistentVolumeClaim { get; set; }

        /// <summary>
        /// Gets or sets photonPersistentDisk represents a PhotonController
        /// persistent disk attached and mounted on kubelets host machine
        /// </summary>
        [JsonProperty(PropertyName = "photonPersistentDisk")]
        public V1PhotonPersistentDiskVolumeSource PhotonPersistentDisk { get; set; }

        /// <summary>
        /// Gets or sets portworxVolume represents a portworx volume attached
        /// and mounted on kubelets host machine
        /// </summary>
        [JsonProperty(PropertyName = "portworxVolume")]
        public V1PortworxVolumeSource PortworxVolume { get; set; }

        /// <summary>
        /// Gets or sets items for all in one resources secrets, configmaps,
        /// and downward API
        /// </summary>
        [JsonProperty(PropertyName = "projected")]
        public V1ProjectedVolumeSource Projected { get; set; }

        /// <summary>
        /// Gets or sets quobyte represents a Quobyte mount on the host that
        /// shares a pod's lifetime
        /// </summary>
        [JsonProperty(PropertyName = "quobyte")]
        public V1QuobyteVolumeSource Quobyte { get; set; }

        /// <summary>
        /// Gets or sets RBD represents a Rados Block Device mount on the host
        /// that shares a pod's lifetime. More info:
        /// https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md
        /// </summary>
        [JsonProperty(PropertyName = "rbd")]
        public V1RBDVolumeSource Rbd { get; set; }

        /// <summary>
        /// Gets or sets scaleIO represents a ScaleIO persistent volume
        /// attached and mounted on Kubernetes nodes.
        /// </summary>
        [JsonProperty(PropertyName = "scaleIO")]
        public V1ScaleIOVolumeSource ScaleIO { get; set; }

        /// <summary>
        /// Gets or sets secret represents a secret that should populate this
        /// volume. More info:
        /// https://kubernetes.io/docs/concepts/storage/volumes#secret
        /// </summary>
        [JsonProperty(PropertyName = "secret")]
        public V1SecretVolumeSource Secret { get; set; }

        /// <summary>
        /// Gets or sets storageOS represents a StorageOS volume attached and
        /// mounted on Kubernetes nodes.
        /// </summary>
        [JsonProperty(PropertyName = "storageos")]
        public V1StorageOSVolumeSource Storageos { get; set; }

        /// <summary>
        /// Gets or sets vsphereVolume represents a vSphere volume attached and
        /// mounted on kubelets host machine
        /// </summary>
        [JsonProperty(PropertyName = "vsphereVolume")]
        public V1VsphereVirtualDiskVolumeSource VsphereVolume { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (Name == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
            }
            if (AwsElasticBlockStore != null)
            {
                AwsElasticBlockStore.Validate();
            }
            if (AzureDisk != null)
            {
                AzureDisk.Validate();
            }
            if (AzureFile != null)
            {
                AzureFile.Validate();
            }
            if (Cephfs != null)
            {
                Cephfs.Validate();
            }
            if (Cinder != null)
            {
                Cinder.Validate();
            }
            if (FlexVolume != null)
            {
                FlexVolume.Validate();
            }
            if (GcePersistentDisk != null)
            {
                GcePersistentDisk.Validate();
            }
            if (GitRepo != null)
            {
                GitRepo.Validate();
            }
            if (Glusterfs != null)
            {
                Glusterfs.Validate();
            }
            if (HostPath != null)
            {
                HostPath.Validate();
            }
            if (Iscsi != null)
            {
                Iscsi.Validate();
            }
            if (Nfs != null)
            {
                Nfs.Validate();
            }
            if (PersistentVolumeClaim != null)
            {
                PersistentVolumeClaim.Validate();
            }
            if (PhotonPersistentDisk != null)
            {
                PhotonPersistentDisk.Validate();
            }
            if (PortworxVolume != null)
            {
                PortworxVolume.Validate();
            }
            if (Projected != null)
            {
                Projected.Validate();
            }
            if (Quobyte != null)
            {
                Quobyte.Validate();
            }
            if (Rbd != null)
            {
                Rbd.Validate();
            }
            if (ScaleIO != null)
            {
                ScaleIO.Validate();
            }
            if (VsphereVolume != null)
            {
                VsphereVolume.Validate();
            }
        }
    }
}
