# coding: utf-8

"""
    pca20251001

    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 CreateRootInstanceRequest(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 = {
        'contact': 'ContactForCreateRootInstanceInput',
        'csr_common': 'CsrCommonForCreateRootInstanceInput',
        'duration_type': 'str',
        'extensions': 'ExtensionsForCreateRootInstanceInput',
        'hash_alg': 'str',
        'idempotence_token': 'str',
        'key_alg': 'str',
        'key_param': 'str',
        'not_after': 'str',
        'not_before': 'str',
        'project_name': 'str',
        'quantity': 'int',
        'tag': 'str',
        'tags': 'list[TagForCreateRootInstanceInput]'
    }

    attribute_map = {
        'contact': 'Contact',
        'csr_common': 'CsrCommon',
        'duration_type': 'DurationType',
        'extensions': 'Extensions',
        'hash_alg': 'HashAlg',
        'idempotence_token': 'IdempotenceToken',
        'key_alg': 'KeyAlg',
        'key_param': 'KeyParam',
        'not_after': 'NotAfter',
        'not_before': 'NotBefore',
        'project_name': 'ProjectName',
        'quantity': 'Quantity',
        'tag': 'Tag',
        'tags': 'Tags'
    }

    def __init__(self, contact=None, csr_common=None, duration_type=None, extensions=None, hash_alg=None, idempotence_token=None, key_alg=None, key_param=None, not_after=None, not_before=None, project_name=None, quantity=None, tag=None, tags=None, _configuration=None):  # noqa: E501
        """CreateRootInstanceRequest - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._contact = None
        self._csr_common = None
        self._duration_type = None
        self._extensions = None
        self._hash_alg = None
        self._idempotence_token = None
        self._key_alg = None
        self._key_param = None
        self._not_after = None
        self._not_before = None
        self._project_name = None
        self._quantity = None
        self._tag = None
        self._tags = None
        self.discriminator = None

        if contact is not None:
            self.contact = contact
        if csr_common is not None:
            self.csr_common = csr_common
        self.duration_type = duration_type
        if extensions is not None:
            self.extensions = extensions
        if hash_alg is not None:
            self.hash_alg = hash_alg
        if idempotence_token is not None:
            self.idempotence_token = idempotence_token
        self.key_alg = key_alg
        if key_param is not None:
            self.key_param = key_param
        if not_after is not None:
            self.not_after = not_after
        if not_before is not None:
            self.not_before = not_before
        if project_name is not None:
            self.project_name = project_name
        self.quantity = quantity
        if tag is not None:
            self.tag = tag
        if tags is not None:
            self.tags = tags

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


        :return: The contact of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: ContactForCreateRootInstanceInput
        """
        return self._contact

    @contact.setter
    def contact(self, contact):
        """Sets the contact of this CreateRootInstanceRequest.


        :param contact: The contact of this CreateRootInstanceRequest.  # noqa: E501
        :type: ContactForCreateRootInstanceInput
        """

        self._contact = contact

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


        :return: The csr_common of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: CsrCommonForCreateRootInstanceInput
        """
        return self._csr_common

    @csr_common.setter
    def csr_common(self, csr_common):
        """Sets the csr_common of this CreateRootInstanceRequest.


        :param csr_common: The csr_common of this CreateRootInstanceRequest.  # noqa: E501
        :type: CsrCommonForCreateRootInstanceInput
        """

        self._csr_common = csr_common

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


        :return: The duration_type of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: str
        """
        return self._duration_type

    @duration_type.setter
    def duration_type(self, duration_type):
        """Sets the duration_type of this CreateRootInstanceRequest.


        :param duration_type: The duration_type of this CreateRootInstanceRequest.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and duration_type is None:
            raise ValueError("Invalid value for `duration_type`, must not be `None`")  # noqa: E501
        allowed_values = ["hour", "day", "month", "year"]  # noqa: E501
        if (self._configuration.client_side_validation and
                duration_type not in allowed_values):
            raise ValueError(
                "Invalid value for `duration_type` ({0}), must be one of {1}"  # noqa: E501
                .format(duration_type, allowed_values)
            )

        self._duration_type = duration_type

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


        :return: The extensions of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: ExtensionsForCreateRootInstanceInput
        """
        return self._extensions

    @extensions.setter
    def extensions(self, extensions):
        """Sets the extensions of this CreateRootInstanceRequest.


        :param extensions: The extensions of this CreateRootInstanceRequest.  # noqa: E501
        :type: ExtensionsForCreateRootInstanceInput
        """

        self._extensions = extensions

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


        :return: The hash_alg of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: str
        """
        return self._hash_alg

    @hash_alg.setter
    def hash_alg(self, hash_alg):
        """Sets the hash_alg of this CreateRootInstanceRequest.


        :param hash_alg: The hash_alg of this CreateRootInstanceRequest.  # noqa: E501
        :type: str
        """

        self._hash_alg = hash_alg

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


        :return: The idempotence_token of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: str
        """
        return self._idempotence_token

    @idempotence_token.setter
    def idempotence_token(self, idempotence_token):
        """Sets the idempotence_token of this CreateRootInstanceRequest.


        :param idempotence_token: The idempotence_token of this CreateRootInstanceRequest.  # noqa: E501
        :type: str
        """

        self._idempotence_token = idempotence_token

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


        :return: The key_alg of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: str
        """
        return self._key_alg

    @key_alg.setter
    def key_alg(self, key_alg):
        """Sets the key_alg of this CreateRootInstanceRequest.


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

        self._key_alg = key_alg

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


        :return: The key_param of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: str
        """
        return self._key_param

    @key_param.setter
    def key_param(self, key_param):
        """Sets the key_param of this CreateRootInstanceRequest.


        :param key_param: The key_param of this CreateRootInstanceRequest.  # noqa: E501
        :type: str
        """
        allowed_values = ["P256", "P384", "P521", "2048", "3072", "4096"]  # noqa: E501
        if (self._configuration.client_side_validation and
                key_param not in allowed_values):
            raise ValueError(
                "Invalid value for `key_param` ({0}), must be one of {1}"  # noqa: E501
                .format(key_param, allowed_values)
            )

        self._key_param = key_param

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


        :return: The not_after of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: str
        """
        return self._not_after

    @not_after.setter
    def not_after(self, not_after):
        """Sets the not_after of this CreateRootInstanceRequest.


        :param not_after: The not_after of this CreateRootInstanceRequest.  # noqa: E501
        :type: str
        """

        self._not_after = not_after

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


        :return: The not_before of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: str
        """
        return self._not_before

    @not_before.setter
    def not_before(self, not_before):
        """Sets the not_before of this CreateRootInstanceRequest.


        :param not_before: The not_before of this CreateRootInstanceRequest.  # noqa: E501
        :type: str
        """

        self._not_before = not_before

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


        :return: The project_name of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: str
        """
        return self._project_name

    @project_name.setter
    def project_name(self, project_name):
        """Sets the project_name of this CreateRootInstanceRequest.


        :param project_name: The project_name of this CreateRootInstanceRequest.  # noqa: E501
        :type: str
        """

        self._project_name = project_name

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


        :return: The quantity of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: int
        """
        return self._quantity

    @quantity.setter
    def quantity(self, quantity):
        """Sets the quantity of this CreateRootInstanceRequest.


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

        self._quantity = quantity

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


        :return: The tag of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: str
        """
        return self._tag

    @tag.setter
    def tag(self, tag):
        """Sets the tag of this CreateRootInstanceRequest.


        :param tag: The tag of this CreateRootInstanceRequest.  # noqa: E501
        :type: str
        """

        self._tag = tag

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


        :return: The tags of this CreateRootInstanceRequest.  # noqa: E501
        :rtype: list[TagForCreateRootInstanceInput]
        """
        return self._tags

    @tags.setter
    def tags(self, tags):
        """Sets the tags of this CreateRootInstanceRequest.


        :param tags: The tags of this CreateRootInstanceRequest.  # noqa: E501
        :type: list[TagForCreateRootInstanceInput]
        """

        self._tags = tags

    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(CreateRootInstanceRequest, 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, CreateRootInstanceRequest):
            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, CreateRootInstanceRequest):
            return True

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