# coding: utf-8

"""
    efs

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: common-version
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from volcenginesdkcore.configuration import Configuration


class CreatePermissionRuleRequest(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'cidr_ip': 'str',
        'permission_group_id': 'str',
        'rw_mode': 'str',
        'user_mode': 'str'
    }

    attribute_map = {
        'cidr_ip': 'CidrIp',
        'permission_group_id': 'PermissionGroupId',
        'rw_mode': 'RwMode',
        'user_mode': 'UserMode'
    }

    def __init__(self, cidr_ip=None, permission_group_id=None, rw_mode=None, user_mode=None, _configuration=None):  # noqa: E501
        """CreatePermissionRuleRequest - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._cidr_ip = None
        self._permission_group_id = None
        self._rw_mode = None
        self._user_mode = None
        self.discriminator = None

        self.cidr_ip = cidr_ip
        self.permission_group_id = permission_group_id
        self.rw_mode = rw_mode
        self.user_mode = user_mode

    @property
    def cidr_ip(self):
        """Gets the cidr_ip of this CreatePermissionRuleRequest.  # noqa: E501


        :return: The cidr_ip of this CreatePermissionRuleRequest.  # noqa: E501
        :rtype: str
        """
        return self._cidr_ip

    @cidr_ip.setter
    def cidr_ip(self, cidr_ip):
        """Sets the cidr_ip of this CreatePermissionRuleRequest.


        :param cidr_ip: The cidr_ip of this CreatePermissionRuleRequest.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and cidr_ip is None:
            raise ValueError("Invalid value for `cidr_ip`, must not be `None`")  # noqa: E501

        self._cidr_ip = cidr_ip

    @property
    def permission_group_id(self):
        """Gets the permission_group_id of this CreatePermissionRuleRequest.  # noqa: E501


        :return: The permission_group_id of this CreatePermissionRuleRequest.  # noqa: E501
        :rtype: str
        """
        return self._permission_group_id

    @permission_group_id.setter
    def permission_group_id(self, permission_group_id):
        """Sets the permission_group_id of this CreatePermissionRuleRequest.


        :param permission_group_id: The permission_group_id of this CreatePermissionRuleRequest.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and permission_group_id is None:
            raise ValueError("Invalid value for `permission_group_id`, must not be `None`")  # noqa: E501

        self._permission_group_id = permission_group_id

    @property
    def rw_mode(self):
        """Gets the rw_mode of this CreatePermissionRuleRequest.  # noqa: E501


        :return: The rw_mode of this CreatePermissionRuleRequest.  # noqa: E501
        :rtype: str
        """
        return self._rw_mode

    @rw_mode.setter
    def rw_mode(self, rw_mode):
        """Sets the rw_mode of this CreatePermissionRuleRequest.


        :param rw_mode: The rw_mode of this CreatePermissionRuleRequest.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and rw_mode is None:
            raise ValueError("Invalid value for `rw_mode`, must not be `None`")  # noqa: E501
        allowed_values = ["Unknown", "RW", "RO"]  # noqa: E501
        if (self._configuration.client_side_validation and
                rw_mode not in allowed_values):
            raise ValueError(
                "Invalid value for `rw_mode` ({0}), must be one of {1}"  # noqa: E501
                .format(rw_mode, allowed_values)
            )

        self._rw_mode = rw_mode

    @property
    def user_mode(self):
        """Gets the user_mode of this CreatePermissionRuleRequest.  # noqa: E501


        :return: The user_mode of this CreatePermissionRuleRequest.  # noqa: E501
        :rtype: str
        """
        return self._user_mode

    @user_mode.setter
    def user_mode(self, user_mode):
        """Sets the user_mode of this CreatePermissionRuleRequest.


        :param user_mode: The user_mode of this CreatePermissionRuleRequest.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and user_mode is None:
            raise ValueError("Invalid value for `user_mode`, must not be `None`")  # noqa: E501
        allowed_values = ["Unknown", "Root_squash", "No_root_squash", "All_squash"]  # noqa: E501
        if (self._configuration.client_side_validation and
                user_mode not in allowed_values):
            raise ValueError(
                "Invalid value for `user_mode` ({0}), must be one of {1}"  # noqa: E501
                .format(user_mode, allowed_values)
            )

        self._user_mode = user_mode

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(CreatePermissionRuleRequest, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, CreatePermissionRuleRequest):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, CreatePermissionRuleRequest):
            return True

        return self.to_dict() != other.to_dict()
