# coding: utf-8

"""
    Nexus Repository Manager REST API

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

    The version of the OpenAPI document: 3.20.1-01
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from nexus_api_python_client.configuration import Configuration


class HostedStorageAttributes(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'blob_store_name': 'str',
        'strict_content_type_validation': 'bool',
        'write_policy': 'str'
    }

    attribute_map = {
        'blob_store_name': 'blobStoreName',
        'strict_content_type_validation': 'strictContentTypeValidation',
        'write_policy': 'writePolicy'
    }

    def __init__(self, blob_store_name=None, strict_content_type_validation=None, write_policy=None, local_vars_configuration=None):  # noqa: E501
        """HostedStorageAttributes - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._blob_store_name = None
        self._strict_content_type_validation = None
        self._write_policy = None
        self.discriminator = None

        if blob_store_name is not None:
            self.blob_store_name = blob_store_name
        self.strict_content_type_validation = strict_content_type_validation
        self.write_policy = write_policy

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

        Blob store used to store repository contents  # noqa: E501

        :return: The blob_store_name of this HostedStorageAttributes.  # noqa: E501
        :rtype: str
        """
        return self._blob_store_name

    @blob_store_name.setter
    def blob_store_name(self, blob_store_name):
        """Sets the blob_store_name of this HostedStorageAttributes.

        Blob store used to store repository contents  # noqa: E501

        :param blob_store_name: The blob_store_name of this HostedStorageAttributes.  # noqa: E501
        :type: str
        """

        self._blob_store_name = blob_store_name

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

        Whether to validate uploaded content's MIME type appropriate for the repository format  # noqa: E501

        :return: The strict_content_type_validation of this HostedStorageAttributes.  # noqa: E501
        :rtype: bool
        """
        return self._strict_content_type_validation

    @strict_content_type_validation.setter
    def strict_content_type_validation(self, strict_content_type_validation):
        """Sets the strict_content_type_validation of this HostedStorageAttributes.

        Whether to validate uploaded content's MIME type appropriate for the repository format  # noqa: E501

        :param strict_content_type_validation: The strict_content_type_validation of this HostedStorageAttributes.  # noqa: E501
        :type: bool
        """
        if self.local_vars_configuration.client_side_validation and strict_content_type_validation is None:  # noqa: E501
            raise ValueError("Invalid value for `strict_content_type_validation`, must not be `None`")  # noqa: E501

        self._strict_content_type_validation = strict_content_type_validation

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

        Controls if deployments of and updates to assets are allowed  # noqa: E501

        :return: The write_policy of this HostedStorageAttributes.  # noqa: E501
        :rtype: str
        """
        return self._write_policy

    @write_policy.setter
    def write_policy(self, write_policy):
        """Sets the write_policy of this HostedStorageAttributes.

        Controls if deployments of and updates to assets are allowed  # noqa: E501

        :param write_policy: The write_policy of this HostedStorageAttributes.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and write_policy is None:  # noqa: E501
            raise ValueError("Invalid value for `write_policy`, must not be `None`")  # noqa: E501
        allowed_values = ["allow", "allow_once", "deny"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and write_policy not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `write_policy` ({0}), must be one of {1}"  # noqa: E501
                .format(write_policy, allowed_values)
            )

        self._write_policy = write_policy

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

        for attr, _ in six.iteritems(self.openapi_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

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

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