# coding: utf-8

"""
    Tator REST API

    Interface to the Tator backend.  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from ..configuration import Configuration


class JobSpec(object):
    """
    """

    """
    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 = {
        'algorithm_name': 'str',
        'extra_params': 'list[AlgorithmParameter]',
        'failure_email_spec': 'JobSpecFailureEmailSpec',
        'media_ids': 'list[int]',
        'success_email_spec': 'JobSpecFailureEmailSpec'
    }

    attribute_map = {
        'algorithm_name': 'algorithm_name',
        'extra_params': 'extra_params',
        'failure_email_spec': 'failure_email_spec',
        'media_ids': 'media_ids',
        'success_email_spec': 'success_email_spec'
    }

    def __init__(self, algorithm_name=None, extra_params=None, failure_email_spec=None, media_ids=None, success_email_spec=None, local_vars_configuration=None):  # noqa: E501
        """JobSpec - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._algorithm_name = None
        self._extra_params = None
        self._failure_email_spec = None
        self._media_ids = None
        self._success_email_spec = None
        self.discriminator = None

        self.algorithm_name = algorithm_name
        if extra_params is not None:
            self.extra_params = extra_params
        self.failure_email_spec = failure_email_spec
        self.media_ids = media_ids
        self.success_email_spec = success_email_spec

    @property
    def algorithm_name(self):
        """
        Name of the algorithm to execute.

        :return: The algorithm_name of this JobSpec. 
        :rtype: str
        """
        return self._algorithm_name

    @algorithm_name.setter
    def algorithm_name(self, algorithm_name):
        """
        Name of the algorithm to execute.

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

        self._algorithm_name = algorithm_name

    @property
    def extra_params(self):
        """
        Extra parameters to pass into the algorithm

        :return: The extra_params of this JobSpec. 
        :rtype: list[AlgorithmParameter]
        """
        return self._extra_params

    @extra_params.setter
    def extra_params(self, extra_params):
        """
        Extra parameters to pass into the algorithm

        :param extra_params: The extra_params of this JobSpec.
        :type: list[AlgorithmParameter]
        """

        self._extra_params = extra_params

    @property
    def failure_email_spec(self):
        """

        :return: The failure_email_spec of this JobSpec. 
        :rtype: JobSpecFailureEmailSpec
        """
        return self._failure_email_spec

    @failure_email_spec.setter
    def failure_email_spec(self, failure_email_spec):
        """

        :param failure_email_spec: The failure_email_spec of this JobSpec.
        :type: JobSpecFailureEmailSpec
        """

        self._failure_email_spec = failure_email_spec

    @property
    def media_ids(self):
        """
        List of media IDs.

        :return: The media_ids of this JobSpec. 
        :rtype: list[int]
        """
        return self._media_ids

    @media_ids.setter
    def media_ids(self, media_ids):
        """
        List of media IDs.

        :param media_ids: The media_ids of this JobSpec.
        :type: list[int]
        """
        if self.local_vars_configuration.client_side_validation and media_ids is None:  # noqa: E501
            raise ValueError("Invalid value for `media_ids`, must not be `None`")  # noqa: E501

        self._media_ids = media_ids

    @property
    def success_email_spec(self):
        """

        :return: The success_email_spec of this JobSpec. 
        :rtype: JobSpecFailureEmailSpec
        """
        return self._success_email_spec

    @success_email_spec.setter
    def success_email_spec(self, success_email_spec):
        """

        :param success_email_spec: The success_email_spec of this JobSpec.
        :type: JobSpecFailureEmailSpec
        """

        self._success_email_spec = success_email_spec

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

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