# coding: utf-8

"""
    Aliro Quantum App

    This is an api for the Aliro Quantum App  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Contact: nick@aliroquantum.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from aliro_quantum.configuration import Configuration


class Job(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 = {
        'allocations': 'JobAllocations',
        'cancelling': 'bool',
        'costs': 'JobCosts',
        'errors': 'list[JobErrors]',
        'execution': 'JobExecution',
        'id': 'str',
        'reservation': 'Reservation',
        'target': 'OwnerDetails'
    }

    attribute_map = {
        'allocations': 'allocations',
        'cancelling': 'cancelling',
        'costs': 'costs',
        'errors': 'errors',
        'execution': 'execution',
        'id': 'id',
        'reservation': 'reservation',
        'target': 'target'
    }

    def __init__(self, allocations=None, cancelling=None, costs=None, errors=None, execution=None, id=None, reservation=None, target=None, local_vars_configuration=None):  # noqa: E501
        """Job - 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._allocations = None
        self._cancelling = None
        self._costs = None
        self._errors = None
        self._execution = None
        self._id = None
        self._reservation = None
        self._target = None
        self.discriminator = None

        self.allocations = allocations
        if cancelling is not None:
            self.cancelling = cancelling
        if costs is not None:
            self.costs = costs
        if errors is not None:
            self.errors = errors
        self.execution = execution
        if id is not None:
            self.id = id
        if reservation is not None:
            self.reservation = reservation
        self.target = target

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


        :return: The allocations of this Job.  # noqa: E501
        :rtype: JobAllocations
        """
        return self._allocations

    @allocations.setter
    def allocations(self, allocations):
        """Sets the allocations of this Job.


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

        self._allocations = allocations

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


        :return: The cancelling of this Job.  # noqa: E501
        :rtype: bool
        """
        return self._cancelling

    @cancelling.setter
    def cancelling(self, cancelling):
        """Sets the cancelling of this Job.


        :param cancelling: The cancelling of this Job.  # noqa: E501
        :type: bool
        """

        self._cancelling = cancelling

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


        :return: The costs of this Job.  # noqa: E501
        :rtype: JobCosts
        """
        return self._costs

    @costs.setter
    def costs(self, costs):
        """Sets the costs of this Job.


        :param costs: The costs of this Job.  # noqa: E501
        :type: JobCosts
        """

        self._costs = costs

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


        :return: The errors of this Job.  # noqa: E501
        :rtype: list[JobErrors]
        """
        return self._errors

    @errors.setter
    def errors(self, errors):
        """Sets the errors of this Job.


        :param errors: The errors of this Job.  # noqa: E501
        :type: list[JobErrors]
        """

        self._errors = errors

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


        :return: The execution of this Job.  # noqa: E501
        :rtype: JobExecution
        """
        return self._execution

    @execution.setter
    def execution(self, execution):
        """Sets the execution of this Job.


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

        self._execution = execution

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


        :return: The id of this Job.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Job.


        :param id: The id of this Job.  # noqa: E501
        :type: str
        """

        self._id = id

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


        :return: The reservation of this Job.  # noqa: E501
        :rtype: Reservation
        """
        return self._reservation

    @reservation.setter
    def reservation(self, reservation):
        """Sets the reservation of this Job.


        :param reservation: The reservation of this Job.  # noqa: E501
        :type: Reservation
        """

        self._reservation = reservation

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


        :return: The target of this Job.  # noqa: E501
        :rtype: OwnerDetails
        """
        return self._target

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


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

        self._target = target

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

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