# coding: utf-8

"""
    Algorithmia Management APIs

    APIs for managing actions on the Algorithmia platform  # noqa: E501

    The version of the OpenAPI document: 1.0.1
    Contact: support@algorithmia.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from algorithmia_api_client.configuration import Configuration


class CreateRequest(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',
        'details': 'Details',
        'settings': 'SettingsMandatory',
        'source': 'SourceCreate',
        'version_info': 'CreateRequestVersionInfo'
    }

    attribute_map = {
        'name': 'name',
        'details': 'details',
        'settings': 'settings',
        'source': 'source',
        'version_info': 'version_info'
    }

    def __init__(self, name=None, details=None, settings=None, source=None, version_info=None, local_vars_configuration=None):  # noqa: E501
        """CreateRequest - 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._details = None
        self._settings = None
        self._source = None
        self._version_info = None
        self.discriminator = None

        self.name = name
        self.details = details
        self.settings = settings
        if source is not None:
            self.source = source
        if version_info is not None:
            self.version_info = version_info

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


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

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


        :param name: The name of this CreateRequest.  # 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

        self._name = name

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


        :return: The details of this CreateRequest.  # noqa: E501
        :rtype: Details
        """
        return self._details

    @details.setter
    def details(self, details):
        """Sets the details of this CreateRequest.


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

        self._details = details

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


        :return: The settings of this CreateRequest.  # noqa: E501
        :rtype: SettingsMandatory
        """
        return self._settings

    @settings.setter
    def settings(self, settings):
        """Sets the settings of this CreateRequest.


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

        self._settings = settings

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


        :return: The source of this CreateRequest.  # noqa: E501
        :rtype: SourceCreate
        """
        return self._source

    @source.setter
    def source(self, source):
        """Sets the source of this CreateRequest.


        :param source: The source of this CreateRequest.  # noqa: E501
        :type: SourceCreate
        """

        self._source = source

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


        :return: The version_info of this CreateRequest.  # noqa: E501
        :rtype: CreateRequestVersionInfo
        """
        return self._version_info

    @version_info.setter
    def version_info(self, version_info):
        """Sets the version_info of this CreateRequest.


        :param version_info: The version_info of this CreateRequest.  # noqa: E501
        :type: CreateRequestVersionInfo
        """

        self._version_info = version_info

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

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