# coding: utf-8

"""
    Kubernetes

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

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

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json


from typing import Optional
from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr

class V1AWSElasticBlockStoreVolumeSource(BaseModel):
    """
    Represents a Persistent Disk resource in AWS.  An AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.  # noqa: E501
    """
    fs_type: Optional[StrictStr] = Field(None, alias="fsType", description="fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore")
    partition: Optional[StrictInt] = Field(None, description="partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).")
    read_only: Optional[StrictBool] = Field(None, alias="readOnly", description="readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore")
    volume_id: StrictStr = Field(..., alias="volumeID", description="volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore")
    __properties = ["fsType", "partition", "readOnly", "volumeID"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

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

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

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

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> V1AWSElasticBlockStoreVolumeSource:
        """Create an instance of V1AWSElasticBlockStoreVolumeSource from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return V1AWSElasticBlockStoreVolumeSource.parse_obj(obj)

        _obj = V1AWSElasticBlockStoreVolumeSource.parse_obj({
            "fs_type": obj.get("fsType"),
            "partition": obj.get("partition"),
            "read_only": obj.get("readOnly"),
            "volume_id": obj.get("volumeID")
        })
        return _obj


