# coding: utf-8

"""
    fluid

    client for fluid  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from fluid.configuration import Configuration


class DataProcessSpec(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 = {
        'dataset': 'TargetDatasetWithMountPath',
        'processor': 'Processor',
        'run_after': 'OperationRef',
        'ttl_seconds_after_finished': 'int'
    }

    attribute_map = {
        'dataset': 'dataset',
        'processor': 'processor',
        'run_after': 'runAfter',
        'ttl_seconds_after_finished': 'ttlSecondsAfterFinished'
    }

    def __init__(self, dataset=None, processor=None, run_after=None, ttl_seconds_after_finished=None, local_vars_configuration=None):  # noqa: E501
        """DataProcessSpec - 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._dataset = None
        self._processor = None
        self._run_after = None
        self._ttl_seconds_after_finished = None
        self.discriminator = None

        self.dataset = dataset
        self.processor = processor
        if run_after is not None:
            self.run_after = run_after
        if ttl_seconds_after_finished is not None:
            self.ttl_seconds_after_finished = ttl_seconds_after_finished

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


        :return: The dataset of this DataProcessSpec.  # noqa: E501
        :rtype: TargetDatasetWithMountPath
        """
        return self._dataset

    @dataset.setter
    def dataset(self, dataset):
        """Sets the dataset of this DataProcessSpec.


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

        self._dataset = dataset

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


        :return: The processor of this DataProcessSpec.  # noqa: E501
        :rtype: Processor
        """
        return self._processor

    @processor.setter
    def processor(self, processor):
        """Sets the processor of this DataProcessSpec.


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

        self._processor = processor

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


        :return: The run_after of this DataProcessSpec.  # noqa: E501
        :rtype: OperationRef
        """
        return self._run_after

    @run_after.setter
    def run_after(self, run_after):
        """Sets the run_after of this DataProcessSpec.


        :param run_after: The run_after of this DataProcessSpec.  # noqa: E501
        :type: OperationRef
        """

        self._run_after = run_after

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

        TTLSecondsAfterFinished is the time second to clean up data operations after finished or failed  # noqa: E501

        :return: The ttl_seconds_after_finished of this DataProcessSpec.  # noqa: E501
        :rtype: int
        """
        return self._ttl_seconds_after_finished

    @ttl_seconds_after_finished.setter
    def ttl_seconds_after_finished(self, ttl_seconds_after_finished):
        """Sets the ttl_seconds_after_finished of this DataProcessSpec.

        TTLSecondsAfterFinished is the time second to clean up data operations after finished or failed  # noqa: E501

        :param ttl_seconds_after_finished: The ttl_seconds_after_finished of this DataProcessSpec.  # noqa: E501
        :type: int
        """

        self._ttl_seconds_after_finished = ttl_seconds_after_finished

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

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