
"""
ARL Infrastructure API

OpenAPI specification for ARL (Agentic RL) Infrastructure custom resources. This SDK provides models for WarmPool, Sandbox, and Task Kubernetes custom resources.

The version of the OpenAPI document: v1alpha1
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
"""

from __future__ import annotations

import json
import pprint
import re  # noqa: F401
from typing import Any, ClassVar

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing_extensions import Self

from .models.warm_pool_spec_template_spec_volumes_inner_aws_elastic_block_store import (
    WarmPoolSpecTemplateSpecVolumesInnerAwsElasticBlockStore,
)
from .models.warm_pool_spec_template_spec_volumes_inner_azure_disk import (
    WarmPoolSpecTemplateSpecVolumesInnerAzureDisk,
)
from .models.warm_pool_spec_template_spec_volumes_inner_azure_file import (
    WarmPoolSpecTemplateSpecVolumesInnerAzureFile,
)
from .models.warm_pool_spec_template_spec_volumes_inner_cephfs import (
    WarmPoolSpecTemplateSpecVolumesInnerCephfs,
)
from .models.warm_pool_spec_template_spec_volumes_inner_cinder import (
    WarmPoolSpecTemplateSpecVolumesInnerCinder,
)
from .models.warm_pool_spec_template_spec_volumes_inner_config_map import (
    WarmPoolSpecTemplateSpecVolumesInnerConfigMap,
)
from .models.warm_pool_spec_template_spec_volumes_inner_csi import (
    WarmPoolSpecTemplateSpecVolumesInnerCsi,
)
from .models.warm_pool_spec_template_spec_volumes_inner_downward_api import (
    WarmPoolSpecTemplateSpecVolumesInnerDownwardAPI,
)
from .models.warm_pool_spec_template_spec_volumes_inner_empty_dir import (
    WarmPoolSpecTemplateSpecVolumesInnerEmptyDir,
)
from .models.warm_pool_spec_template_spec_volumes_inner_ephemeral import (
    WarmPoolSpecTemplateSpecVolumesInnerEphemeral,
)
from .models.warm_pool_spec_template_spec_volumes_inner_fc import (
    WarmPoolSpecTemplateSpecVolumesInnerFc,
)
from .models.warm_pool_spec_template_spec_volumes_inner_flex_volume import (
    WarmPoolSpecTemplateSpecVolumesInnerFlexVolume,
)
from .models.warm_pool_spec_template_spec_volumes_inner_flocker import (
    WarmPoolSpecTemplateSpecVolumesInnerFlocker,
)
from .models.warm_pool_spec_template_spec_volumes_inner_gce_persistent_disk import (
    WarmPoolSpecTemplateSpecVolumesInnerGcePersistentDisk,
)
from .models.warm_pool_spec_template_spec_volumes_inner_git_repo import (
    WarmPoolSpecTemplateSpecVolumesInnerGitRepo,
)
from .models.warm_pool_spec_template_spec_volumes_inner_glusterfs import (
    WarmPoolSpecTemplateSpecVolumesInnerGlusterfs,
)
from .models.warm_pool_spec_template_spec_volumes_inner_host_path import (
    WarmPoolSpecTemplateSpecVolumesInnerHostPath,
)
from .models.warm_pool_spec_template_spec_volumes_inner_image import (
    WarmPoolSpecTemplateSpecVolumesInnerImage,
)
from .models.warm_pool_spec_template_spec_volumes_inner_iscsi import (
    WarmPoolSpecTemplateSpecVolumesInnerIscsi,
)
from .models.warm_pool_spec_template_spec_volumes_inner_nfs import (
    WarmPoolSpecTemplateSpecVolumesInnerNfs,
)
from .models.warm_pool_spec_template_spec_volumes_inner_persistent_volume_claim import (
    WarmPoolSpecTemplateSpecVolumesInnerPersistentVolumeClaim,
)
from .models.warm_pool_spec_template_spec_volumes_inner_photon_persistent_disk import (
    WarmPoolSpecTemplateSpecVolumesInnerPhotonPersistentDisk,
)
from .models.warm_pool_spec_template_spec_volumes_inner_portworx_volume import (
    WarmPoolSpecTemplateSpecVolumesInnerPortworxVolume,
)
from .models.warm_pool_spec_template_spec_volumes_inner_projected import (
    WarmPoolSpecTemplateSpecVolumesInnerProjected,
)
from .models.warm_pool_spec_template_spec_volumes_inner_quobyte import (
    WarmPoolSpecTemplateSpecVolumesInnerQuobyte,
)
from .models.warm_pool_spec_template_spec_volumes_inner_rbd import (
    WarmPoolSpecTemplateSpecVolumesInnerRbd,
)
from .models.warm_pool_spec_template_spec_volumes_inner_scale_io import (
    WarmPoolSpecTemplateSpecVolumesInnerScaleIO,
)
from .models.warm_pool_spec_template_spec_volumes_inner_secret import (
    WarmPoolSpecTemplateSpecVolumesInnerSecret,
)
from .models.warm_pool_spec_template_spec_volumes_inner_storageos import (
    WarmPoolSpecTemplateSpecVolumesInnerStorageos,
)
from .models.warm_pool_spec_template_spec_volumes_inner_vsphere_volume import (
    WarmPoolSpecTemplateSpecVolumesInnerVsphereVolume,
)


class WarmPoolSpecTemplateSpecVolumesInner(BaseModel):
    """
    WarmPoolSpecTemplateSpecVolumesInner
    """

    aws_elastic_block_store: WarmPoolSpecTemplateSpecVolumesInnerAwsElasticBlockStore | None = (
        Field(default=None, alias="awsElasticBlockStore")
    )
    azure_disk: WarmPoolSpecTemplateSpecVolumesInnerAzureDisk | None = Field(
        default=None, alias="azureDisk"
    )
    azure_file: WarmPoolSpecTemplateSpecVolumesInnerAzureFile | None = Field(
        default=None, alias="azureFile"
    )
    cephfs: WarmPoolSpecTemplateSpecVolumesInnerCephfs | None = None
    cinder: WarmPoolSpecTemplateSpecVolumesInnerCinder | None = None
    config_map: WarmPoolSpecTemplateSpecVolumesInnerConfigMap | None = Field(
        default=None, alias="configMap"
    )
    csi: WarmPoolSpecTemplateSpecVolumesInnerCsi | None = None
    downward_api: WarmPoolSpecTemplateSpecVolumesInnerDownwardAPI | None = Field(
        default=None, alias="downwardAPI"
    )
    empty_dir: WarmPoolSpecTemplateSpecVolumesInnerEmptyDir | None = Field(
        default=None, alias="emptyDir"
    )
    ephemeral: WarmPoolSpecTemplateSpecVolumesInnerEphemeral | None = None
    fc: WarmPoolSpecTemplateSpecVolumesInnerFc | None = None
    flex_volume: WarmPoolSpecTemplateSpecVolumesInnerFlexVolume | None = Field(
        default=None, alias="flexVolume"
    )
    flocker: WarmPoolSpecTemplateSpecVolumesInnerFlocker | None = None
    gce_persistent_disk: WarmPoolSpecTemplateSpecVolumesInnerGcePersistentDisk | None = Field(
        default=None, alias="gcePersistentDisk"
    )
    git_repo: WarmPoolSpecTemplateSpecVolumesInnerGitRepo | None = Field(
        default=None, alias="gitRepo"
    )
    glusterfs: WarmPoolSpecTemplateSpecVolumesInnerGlusterfs | None = None
    host_path: WarmPoolSpecTemplateSpecVolumesInnerHostPath | None = Field(
        default=None, alias="hostPath"
    )
    image: WarmPoolSpecTemplateSpecVolumesInnerImage | None = None
    iscsi: WarmPoolSpecTemplateSpecVolumesInnerIscsi | None = None
    name: StrictStr
    nfs: WarmPoolSpecTemplateSpecVolumesInnerNfs | None = None
    persistent_volume_claim: WarmPoolSpecTemplateSpecVolumesInnerPersistentVolumeClaim | None = (
        Field(default=None, alias="persistentVolumeClaim")
    )
    photon_persistent_disk: WarmPoolSpecTemplateSpecVolumesInnerPhotonPersistentDisk | None = (
        Field(default=None, alias="photonPersistentDisk")
    )
    portworx_volume: WarmPoolSpecTemplateSpecVolumesInnerPortworxVolume | None = Field(
        default=None, alias="portworxVolume"
    )
    projected: WarmPoolSpecTemplateSpecVolumesInnerProjected | None = None
    quobyte: WarmPoolSpecTemplateSpecVolumesInnerQuobyte | None = None
    rbd: WarmPoolSpecTemplateSpecVolumesInnerRbd | None = None
    scale_io: WarmPoolSpecTemplateSpecVolumesInnerScaleIO | None = Field(
        default=None, alias="scaleIO"
    )
    secret: WarmPoolSpecTemplateSpecVolumesInnerSecret | None = None
    storageos: WarmPoolSpecTemplateSpecVolumesInnerStorageos | None = None
    vsphere_volume: WarmPoolSpecTemplateSpecVolumesInnerVsphereVolume | None = Field(
        default=None, alias="vsphereVolume"
    )
    __properties: ClassVar[list[str]] = [
        "awsElasticBlockStore",
        "azureDisk",
        "azureFile",
        "cephfs",
        "cinder",
        "configMap",
        "csi",
        "downwardAPI",
        "emptyDir",
        "ephemeral",
        "fc",
        "flexVolume",
        "flocker",
        "gcePersistentDisk",
        "gitRepo",
        "glusterfs",
        "hostPath",
        "image",
        "iscsi",
        "name",
        "nfs",
        "persistentVolumeClaim",
        "photonPersistentDisk",
        "portworxVolume",
        "projected",
        "quobyte",
        "rbd",
        "scaleIO",
        "secret",
        "storageos",
        "vsphereVolume",
    ]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Self | None:
        """Create an instance of WarmPoolSpecTemplateSpecVolumesInner from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: set[str] = set([])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # override the default output from pydantic by calling `to_dict()` of aws_elastic_block_store
        if self.aws_elastic_block_store:
            _dict["awsElasticBlockStore"] = self.aws_elastic_block_store.to_dict()
        # override the default output from pydantic by calling `to_dict()` of azure_disk
        if self.azure_disk:
            _dict["azureDisk"] = self.azure_disk.to_dict()
        # override the default output from pydantic by calling `to_dict()` of azure_file
        if self.azure_file:
            _dict["azureFile"] = self.azure_file.to_dict()
        # override the default output from pydantic by calling `to_dict()` of cephfs
        if self.cephfs:
            _dict["cephfs"] = self.cephfs.to_dict()
        # override the default output from pydantic by calling `to_dict()` of cinder
        if self.cinder:
            _dict["cinder"] = self.cinder.to_dict()
        # override the default output from pydantic by calling `to_dict()` of config_map
        if self.config_map:
            _dict["configMap"] = self.config_map.to_dict()
        # override the default output from pydantic by calling `to_dict()` of csi
        if self.csi:
            _dict["csi"] = self.csi.to_dict()
        # override the default output from pydantic by calling `to_dict()` of downward_api
        if self.downward_api:
            _dict["downwardAPI"] = self.downward_api.to_dict()
        # override the default output from pydantic by calling `to_dict()` of empty_dir
        if self.empty_dir:
            _dict["emptyDir"] = self.empty_dir.to_dict()
        # override the default output from pydantic by calling `to_dict()` of ephemeral
        if self.ephemeral:
            _dict["ephemeral"] = self.ephemeral.to_dict()
        # override the default output from pydantic by calling `to_dict()` of fc
        if self.fc:
            _dict["fc"] = self.fc.to_dict()
        # override the default output from pydantic by calling `to_dict()` of flex_volume
        if self.flex_volume:
            _dict["flexVolume"] = self.flex_volume.to_dict()
        # override the default output from pydantic by calling `to_dict()` of flocker
        if self.flocker:
            _dict["flocker"] = self.flocker.to_dict()
        # override the default output from pydantic by calling `to_dict()` of gce_persistent_disk
        if self.gce_persistent_disk:
            _dict["gcePersistentDisk"] = self.gce_persistent_disk.to_dict()
        # override the default output from pydantic by calling `to_dict()` of git_repo
        if self.git_repo:
            _dict["gitRepo"] = self.git_repo.to_dict()
        # override the default output from pydantic by calling `to_dict()` of glusterfs
        if self.glusterfs:
            _dict["glusterfs"] = self.glusterfs.to_dict()
        # override the default output from pydantic by calling `to_dict()` of host_path
        if self.host_path:
            _dict["hostPath"] = self.host_path.to_dict()
        # override the default output from pydantic by calling `to_dict()` of image
        if self.image:
            _dict["image"] = self.image.to_dict()
        # override the default output from pydantic by calling `to_dict()` of iscsi
        if self.iscsi:
            _dict["iscsi"] = self.iscsi.to_dict()
        # override the default output from pydantic by calling `to_dict()` of nfs
        if self.nfs:
            _dict["nfs"] = self.nfs.to_dict()
        # override the default output from pydantic by calling `to_dict()` of persistent_volume_claim
        if self.persistent_volume_claim:
            _dict["persistentVolumeClaim"] = self.persistent_volume_claim.to_dict()
        # override the default output from pydantic by calling `to_dict()` of photon_persistent_disk
        if self.photon_persistent_disk:
            _dict["photonPersistentDisk"] = self.photon_persistent_disk.to_dict()
        # override the default output from pydantic by calling `to_dict()` of portworx_volume
        if self.portworx_volume:
            _dict["portworxVolume"] = self.portworx_volume.to_dict()
        # override the default output from pydantic by calling `to_dict()` of projected
        if self.projected:
            _dict["projected"] = self.projected.to_dict()
        # override the default output from pydantic by calling `to_dict()` of quobyte
        if self.quobyte:
            _dict["quobyte"] = self.quobyte.to_dict()
        # override the default output from pydantic by calling `to_dict()` of rbd
        if self.rbd:
            _dict["rbd"] = self.rbd.to_dict()
        # override the default output from pydantic by calling `to_dict()` of scale_io
        if self.scale_io:
            _dict["scaleIO"] = self.scale_io.to_dict()
        # override the default output from pydantic by calling `to_dict()` of secret
        if self.secret:
            _dict["secret"] = self.secret.to_dict()
        # override the default output from pydantic by calling `to_dict()` of storageos
        if self.storageos:
            _dict["storageos"] = self.storageos.to_dict()
        # override the default output from pydantic by calling `to_dict()` of vsphere_volume
        if self.vsphere_volume:
            _dict["vsphereVolume"] = self.vsphere_volume.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: dict[str, Any] | None) -> Self | None:
        """Create an instance of WarmPoolSpecTemplateSpecVolumesInner from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate(
            {
                "awsElasticBlockStore": WarmPoolSpecTemplateSpecVolumesInnerAwsElasticBlockStore.from_dict(
                    obj["awsElasticBlockStore"]
                )
                if obj.get("awsElasticBlockStore") is not None
                else None,
                "azureDisk": WarmPoolSpecTemplateSpecVolumesInnerAzureDisk.from_dict(
                    obj["azureDisk"]
                )
                if obj.get("azureDisk") is not None
                else None,
                "azureFile": WarmPoolSpecTemplateSpecVolumesInnerAzureFile.from_dict(
                    obj["azureFile"]
                )
                if obj.get("azureFile") is not None
                else None,
                "cephfs": WarmPoolSpecTemplateSpecVolumesInnerCephfs.from_dict(obj["cephfs"])
                if obj.get("cephfs") is not None
                else None,
                "cinder": WarmPoolSpecTemplateSpecVolumesInnerCinder.from_dict(obj["cinder"])
                if obj.get("cinder") is not None
                else None,
                "configMap": WarmPoolSpecTemplateSpecVolumesInnerConfigMap.from_dict(
                    obj["configMap"]
                )
                if obj.get("configMap") is not None
                else None,
                "csi": WarmPoolSpecTemplateSpecVolumesInnerCsi.from_dict(obj["csi"])
                if obj.get("csi") is not None
                else None,
                "downwardAPI": WarmPoolSpecTemplateSpecVolumesInnerDownwardAPI.from_dict(
                    obj["downwardAPI"]
                )
                if obj.get("downwardAPI") is not None
                else None,
                "emptyDir": WarmPoolSpecTemplateSpecVolumesInnerEmptyDir.from_dict(obj["emptyDir"])
                if obj.get("emptyDir") is not None
                else None,
                "ephemeral": WarmPoolSpecTemplateSpecVolumesInnerEphemeral.from_dict(
                    obj["ephemeral"]
                )
                if obj.get("ephemeral") is not None
                else None,
                "fc": WarmPoolSpecTemplateSpecVolumesInnerFc.from_dict(obj["fc"])
                if obj.get("fc") is not None
                else None,
                "flexVolume": WarmPoolSpecTemplateSpecVolumesInnerFlexVolume.from_dict(
                    obj["flexVolume"]
                )
                if obj.get("flexVolume") is not None
                else None,
                "flocker": WarmPoolSpecTemplateSpecVolumesInnerFlocker.from_dict(obj["flocker"])
                if obj.get("flocker") is not None
                else None,
                "gcePersistentDisk": WarmPoolSpecTemplateSpecVolumesInnerGcePersistentDisk.from_dict(
                    obj["gcePersistentDisk"]
                )
                if obj.get("gcePersistentDisk") is not None
                else None,
                "gitRepo": WarmPoolSpecTemplateSpecVolumesInnerGitRepo.from_dict(obj["gitRepo"])
                if obj.get("gitRepo") is not None
                else None,
                "glusterfs": WarmPoolSpecTemplateSpecVolumesInnerGlusterfs.from_dict(
                    obj["glusterfs"]
                )
                if obj.get("glusterfs") is not None
                else None,
                "hostPath": WarmPoolSpecTemplateSpecVolumesInnerHostPath.from_dict(obj["hostPath"])
                if obj.get("hostPath") is not None
                else None,
                "image": WarmPoolSpecTemplateSpecVolumesInnerImage.from_dict(obj["image"])
                if obj.get("image") is not None
                else None,
                "iscsi": WarmPoolSpecTemplateSpecVolumesInnerIscsi.from_dict(obj["iscsi"])
                if obj.get("iscsi") is not None
                else None,
                "name": obj.get("name"),
                "nfs": WarmPoolSpecTemplateSpecVolumesInnerNfs.from_dict(obj["nfs"])
                if obj.get("nfs") is not None
                else None,
                "persistentVolumeClaim": WarmPoolSpecTemplateSpecVolumesInnerPersistentVolumeClaim.from_dict(
                    obj["persistentVolumeClaim"]
                )
                if obj.get("persistentVolumeClaim") is not None
                else None,
                "photonPersistentDisk": WarmPoolSpecTemplateSpecVolumesInnerPhotonPersistentDisk.from_dict(
                    obj["photonPersistentDisk"]
                )
                if obj.get("photonPersistentDisk") is not None
                else None,
                "portworxVolume": WarmPoolSpecTemplateSpecVolumesInnerPortworxVolume.from_dict(
                    obj["portworxVolume"]
                )
                if obj.get("portworxVolume") is not None
                else None,
                "projected": WarmPoolSpecTemplateSpecVolumesInnerProjected.from_dict(
                    obj["projected"]
                )
                if obj.get("projected") is not None
                else None,
                "quobyte": WarmPoolSpecTemplateSpecVolumesInnerQuobyte.from_dict(obj["quobyte"])
                if obj.get("quobyte") is not None
                else None,
                "rbd": WarmPoolSpecTemplateSpecVolumesInnerRbd.from_dict(obj["rbd"])
                if obj.get("rbd") is not None
                else None,
                "scaleIO": WarmPoolSpecTemplateSpecVolumesInnerScaleIO.from_dict(obj["scaleIO"])
                if obj.get("scaleIO") is not None
                else None,
                "secret": WarmPoolSpecTemplateSpecVolumesInnerSecret.from_dict(obj["secret"])
                if obj.get("secret") is not None
                else None,
                "storageos": WarmPoolSpecTemplateSpecVolumesInnerStorageos.from_dict(
                    obj["storageos"]
                )
                if obj.get("storageos") is not None
                else None,
                "vsphereVolume": WarmPoolSpecTemplateSpecVolumesInnerVsphereVolume.from_dict(
                    obj["vsphereVolume"]
                )
                if obj.get("vsphereVolume") is not None
                else None,
            }
        )
        return _obj
