# coding: utf-8

"""
    Pulp 3 API

    Fetch, Upload, Organize, and Distribute Software Packages  # noqa: E501

    The version of the OpenAPI document: v3
    Contact: pulp-list@redhat.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from pulpcore.client.pulp_rpm.configuration import Configuration


class Domain(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 = {
        'name': 'str',
        'description': 'str',
        'storage_class': 'StorageClassEnum',
        'storage_settings': 'object',
        'redirect_to_object_storage': 'bool',
        'hide_guarded_distributions': 'bool'
    }

    attribute_map = {
        'name': 'name',
        'description': 'description',
        'storage_class': 'storage_class',
        'storage_settings': 'storage_settings',
        'redirect_to_object_storage': 'redirect_to_object_storage',
        'hide_guarded_distributions': 'hide_guarded_distributions'
    }

    def __init__(self, name=None, description=None, storage_class=None, storage_settings=None, redirect_to_object_storage=True, hide_guarded_distributions=False, local_vars_configuration=None):  # noqa: E501
        """Domain - 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._name = None
        self._description = None
        self._storage_class = None
        self._storage_settings = None
        self._redirect_to_object_storage = None
        self._hide_guarded_distributions = None
        self.discriminator = None

        self.name = name
        self.description = description
        self.storage_class = storage_class
        self.storage_settings = storage_settings
        if redirect_to_object_storage is not None:
            self.redirect_to_object_storage = redirect_to_object_storage
        if hide_guarded_distributions is not None:
            self.hide_guarded_distributions = hide_guarded_distributions

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

        A name for this domain.  # noqa: E501

        :return: The name of this Domain.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Domain.

        A name for this domain.  # noqa: E501

        :param name: The name of this Domain.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                name is not None and len(name) < 1):
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                name is not None and not re.search(r'^[-a-zA-Z0-9_]+$', name)):  # noqa: E501
            raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^[-a-zA-Z0-9_]+$/`")  # noqa: E501

        self._name = name

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

        An optional description.  # noqa: E501

        :return: The description of this Domain.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this Domain.

        An optional description.  # noqa: E501

        :param description: The description of this Domain.  # noqa: E501
        :type: str
        """
        if (self.local_vars_configuration.client_side_validation and
                description is not None and len(description) < 1):
            raise ValueError("Invalid value for `description`, length must be greater than or equal to `1`")  # noqa: E501

        self._description = description

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

        Backend storage class for domain.  * `pulpcore.app.models.storage.FileSystem` - Use local filesystem as storage * `storages.backends.s3boto3.S3Boto3Storage` - Use Amazon S3 as storage * `storages.backends.azure_storage.AzureStorage` - Use Azure Blob as storage  # noqa: E501

        :return: The storage_class of this Domain.  # noqa: E501
        :rtype: StorageClassEnum
        """
        return self._storage_class

    @storage_class.setter
    def storage_class(self, storage_class):
        """Sets the storage_class of this Domain.

        Backend storage class for domain.  * `pulpcore.app.models.storage.FileSystem` - Use local filesystem as storage * `storages.backends.s3boto3.S3Boto3Storage` - Use Amazon S3 as storage * `storages.backends.azure_storage.AzureStorage` - Use Azure Blob as storage  # noqa: E501

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

        self._storage_class = storage_class

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

        Settings for storage class.  # noqa: E501

        :return: The storage_settings of this Domain.  # noqa: E501
        :rtype: object
        """
        return self._storage_settings

    @storage_settings.setter
    def storage_settings(self, storage_settings):
        """Sets the storage_settings of this Domain.

        Settings for storage class.  # noqa: E501

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

        self._storage_settings = storage_settings

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

        Boolean to have the content app redirect to object storage.  # noqa: E501

        :return: The redirect_to_object_storage of this Domain.  # noqa: E501
        :rtype: bool
        """
        return self._redirect_to_object_storage

    @redirect_to_object_storage.setter
    def redirect_to_object_storage(self, redirect_to_object_storage):
        """Sets the redirect_to_object_storage of this Domain.

        Boolean to have the content app redirect to object storage.  # noqa: E501

        :param redirect_to_object_storage: The redirect_to_object_storage of this Domain.  # noqa: E501
        :type: bool
        """

        self._redirect_to_object_storage = redirect_to_object_storage

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

        Boolean to hide distributions with a content guard in the content app.  # noqa: E501

        :return: The hide_guarded_distributions of this Domain.  # noqa: E501
        :rtype: bool
        """
        return self._hide_guarded_distributions

    @hide_guarded_distributions.setter
    def hide_guarded_distributions(self, hide_guarded_distributions):
        """Sets the hide_guarded_distributions of this Domain.

        Boolean to hide distributions with a content guard in the content app.  # noqa: E501

        :param hide_guarded_distributions: The hide_guarded_distributions of this Domain.  # noqa: E501
        :type: bool
        """

        self._hide_guarded_distributions = hide_guarded_distributions

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

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