# 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 DataLoadSpec(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 = {
        'affinity': 'V1Affinity',
        'dataset': 'TargetDataset',
        'load_metadata': 'bool',
        'node_selector': 'dict(str, str)',
        'options': 'dict(str, str)',
        'pod_metadata': 'PodMetadata',
        'policy': 'str',
        'resources': 'V1ResourceRequirements',
        'run_after': 'OperationRef',
        'schedule': 'str',
        'scheduler_name': 'str',
        'target': 'list[TargetPath]',
        'tolerations': 'list[V1Toleration]',
        'ttl_seconds_after_finished': 'int'
    }

    attribute_map = {
        'affinity': 'affinity',
        'dataset': 'dataset',
        'load_metadata': 'loadMetadata',
        'node_selector': 'nodeSelector',
        'options': 'options',
        'pod_metadata': 'podMetadata',
        'policy': 'policy',
        'resources': 'resources',
        'run_after': 'runAfter',
        'schedule': 'schedule',
        'scheduler_name': 'schedulerName',
        'target': 'target',
        'tolerations': 'tolerations',
        'ttl_seconds_after_finished': 'ttlSecondsAfterFinished'
    }

    def __init__(self, affinity=None, dataset=None, load_metadata=None, node_selector=None, options=None, pod_metadata=None, policy=None, resources=None, run_after=None, schedule=None, scheduler_name=None, target=None, tolerations=None, ttl_seconds_after_finished=None, local_vars_configuration=None):  # noqa: E501
        """DataLoadSpec - 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._affinity = None
        self._dataset = None
        self._load_metadata = None
        self._node_selector = None
        self._options = None
        self._pod_metadata = None
        self._policy = None
        self._resources = None
        self._run_after = None
        self._schedule = None
        self._scheduler_name = None
        self._target = None
        self._tolerations = None
        self._ttl_seconds_after_finished = None
        self.discriminator = None

        if affinity is not None:
            self.affinity = affinity
        if dataset is not None:
            self.dataset = dataset
        if load_metadata is not None:
            self.load_metadata = load_metadata
        if node_selector is not None:
            self.node_selector = node_selector
        if options is not None:
            self.options = options
        if pod_metadata is not None:
            self.pod_metadata = pod_metadata
        if policy is not None:
            self.policy = policy
        if resources is not None:
            self.resources = resources
        if run_after is not None:
            self.run_after = run_after
        if schedule is not None:
            self.schedule = schedule
        if scheduler_name is not None:
            self.scheduler_name = scheduler_name
        if target is not None:
            self.target = target
        if tolerations is not None:
            self.tolerations = tolerations
        if ttl_seconds_after_finished is not None:
            self.ttl_seconds_after_finished = ttl_seconds_after_finished

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


        :return: The affinity of this DataLoadSpec.  # noqa: E501
        :rtype: V1Affinity
        """
        return self._affinity

    @affinity.setter
    def affinity(self, affinity):
        """Sets the affinity of this DataLoadSpec.


        :param affinity: The affinity of this DataLoadSpec.  # noqa: E501
        :type: V1Affinity
        """

        self._affinity = affinity

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


        :return: The dataset of this DataLoadSpec.  # noqa: E501
        :rtype: TargetDataset
        """
        return self._dataset

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


        :param dataset: The dataset of this DataLoadSpec.  # noqa: E501
        :type: TargetDataset
        """

        self._dataset = dataset

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

        LoadMetadata specifies if the dataload job should load metadata  # noqa: E501

        :return: The load_metadata of this DataLoadSpec.  # noqa: E501
        :rtype: bool
        """
        return self._load_metadata

    @load_metadata.setter
    def load_metadata(self, load_metadata):
        """Sets the load_metadata of this DataLoadSpec.

        LoadMetadata specifies if the dataload job should load metadata  # noqa: E501

        :param load_metadata: The load_metadata of this DataLoadSpec.  # noqa: E501
        :type: bool
        """

        self._load_metadata = load_metadata

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

        NodeSelector defiens node selector for DataLoad pod  # noqa: E501

        :return: The node_selector of this DataLoadSpec.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._node_selector

    @node_selector.setter
    def node_selector(self, node_selector):
        """Sets the node_selector of this DataLoadSpec.

        NodeSelector defiens node selector for DataLoad pod  # noqa: E501

        :param node_selector: The node_selector of this DataLoadSpec.  # noqa: E501
        :type: dict(str, str)
        """

        self._node_selector = node_selector

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

        Options specifies the extra dataload properties for runtime  # noqa: E501

        :return: The options of this DataLoadSpec.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._options

    @options.setter
    def options(self, options):
        """Sets the options of this DataLoadSpec.

        Options specifies the extra dataload properties for runtime  # noqa: E501

        :param options: The options of this DataLoadSpec.  # noqa: E501
        :type: dict(str, str)
        """

        self._options = options

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


        :return: The pod_metadata of this DataLoadSpec.  # noqa: E501
        :rtype: PodMetadata
        """
        return self._pod_metadata

    @pod_metadata.setter
    def pod_metadata(self, pod_metadata):
        """Sets the pod_metadata of this DataLoadSpec.


        :param pod_metadata: The pod_metadata of this DataLoadSpec.  # noqa: E501
        :type: PodMetadata
        """

        self._pod_metadata = pod_metadata

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

        including Once, Cron, OnEvent  # noqa: E501

        :return: The policy of this DataLoadSpec.  # noqa: E501
        :rtype: str
        """
        return self._policy

    @policy.setter
    def policy(self, policy):
        """Sets the policy of this DataLoadSpec.

        including Once, Cron, OnEvent  # noqa: E501

        :param policy: The policy of this DataLoadSpec.  # noqa: E501
        :type: str
        """

        self._policy = policy

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


        :return: The resources of this DataLoadSpec.  # noqa: E501
        :rtype: V1ResourceRequirements
        """
        return self._resources

    @resources.setter
    def resources(self, resources):
        """Sets the resources of this DataLoadSpec.


        :param resources: The resources of this DataLoadSpec.  # noqa: E501
        :type: V1ResourceRequirements
        """

        self._resources = resources

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


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

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


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

        self._run_after = run_after

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

        The schedule in Cron format, only set when policy is cron, see https://en.wikipedia.org/wiki/Cron.  # noqa: E501

        :return: The schedule of this DataLoadSpec.  # noqa: E501
        :rtype: str
        """
        return self._schedule

    @schedule.setter
    def schedule(self, schedule):
        """Sets the schedule of this DataLoadSpec.

        The schedule in Cron format, only set when policy is cron, see https://en.wikipedia.org/wiki/Cron.  # noqa: E501

        :param schedule: The schedule of this DataLoadSpec.  # noqa: E501
        :type: str
        """

        self._schedule = schedule

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

        SchedulerName sets the scheduler to be used for DataLoad pod  # noqa: E501

        :return: The scheduler_name of this DataLoadSpec.  # noqa: E501
        :rtype: str
        """
        return self._scheduler_name

    @scheduler_name.setter
    def scheduler_name(self, scheduler_name):
        """Sets the scheduler_name of this DataLoadSpec.

        SchedulerName sets the scheduler to be used for DataLoad pod  # noqa: E501

        :param scheduler_name: The scheduler_name of this DataLoadSpec.  # noqa: E501
        :type: str
        """

        self._scheduler_name = scheduler_name

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

        Target defines target paths that needs to be loaded  # noqa: E501

        :return: The target of this DataLoadSpec.  # noqa: E501
        :rtype: list[TargetPath]
        """
        return self._target

    @target.setter
    def target(self, target):
        """Sets the target of this DataLoadSpec.

        Target defines target paths that needs to be loaded  # noqa: E501

        :param target: The target of this DataLoadSpec.  # noqa: E501
        :type: list[TargetPath]
        """

        self._target = target

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

        Tolerations defines tolerations for DataLoad pod  # noqa: E501

        :return: The tolerations of this DataLoadSpec.  # noqa: E501
        :rtype: list[V1Toleration]
        """
        return self._tolerations

    @tolerations.setter
    def tolerations(self, tolerations):
        """Sets the tolerations of this DataLoadSpec.

        Tolerations defines tolerations for DataLoad pod  # noqa: E501

        :param tolerations: The tolerations of this DataLoadSpec.  # noqa: E501
        :type: list[V1Toleration]
        """

        self._tolerations = tolerations

    @property
    def ttl_seconds_after_finished(self):
        """Gets the ttl_seconds_after_finished of this DataLoadSpec.  # 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 DataLoadSpec.  # 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 DataLoadSpec.

        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 DataLoadSpec.  # 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, DataLoadSpec):
            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, DataLoadSpec):
            return True

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