# coding: utf-8

"""
    Harbor API

    These APIs provide services for manipulating Harbor project.  # noqa: E501

    OpenAPI spec version: 2.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from harbor_client.configuration import Configuration


class Execution(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'id': 'int',
        'vendor_type': 'str',
        'vendor_id': 'int',
        'status': 'str',
        'status_message': 'str',
        'metrics': 'Metrics',
        'trigger': 'str',
        'extra_attrs': 'ExtraAttrs',
        'start_time': 'str',
        'end_time': 'str'
    }

    attribute_map = {
        'id': 'id',
        'vendor_type': 'vendor_type',
        'vendor_id': 'vendor_id',
        'status': 'status',
        'status_message': 'status_message',
        'metrics': 'metrics',
        'trigger': 'trigger',
        'extra_attrs': 'extra_attrs',
        'start_time': 'start_time',
        'end_time': 'end_time'
    }

    def __init__(self, id=None, vendor_type=None, vendor_id=None, status=None, status_message=None, metrics=None, trigger=None, extra_attrs=None, start_time=None, end_time=None, _configuration=None):  # noqa: E501
        """Execution - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._vendor_type = None
        self._vendor_id = None
        self._status = None
        self._status_message = None
        self._metrics = None
        self._trigger = None
        self._extra_attrs = None
        self._start_time = None
        self._end_time = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if vendor_type is not None:
            self.vendor_type = vendor_type
        if vendor_id is not None:
            self.vendor_id = vendor_id
        if status is not None:
            self.status = status
        if status_message is not None:
            self.status_message = status_message
        if metrics is not None:
            self.metrics = metrics
        if trigger is not None:
            self.trigger = trigger
        if extra_attrs is not None:
            self.extra_attrs = extra_attrs
        if start_time is not None:
            self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time

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

        The ID of execution  # noqa: E501

        :return: The id of this Execution.  # noqa: E501
        :rtype: int
        """
        return self._id

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

        The ID of execution  # noqa: E501

        :param id: The id of this Execution.  # noqa: E501
        :type: int
        """

        self._id = id

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

        The vendor type of execution  # noqa: E501

        :return: The vendor_type of this Execution.  # noqa: E501
        :rtype: str
        """
        return self._vendor_type

    @vendor_type.setter
    def vendor_type(self, vendor_type):
        """Sets the vendor_type of this Execution.

        The vendor type of execution  # noqa: E501

        :param vendor_type: The vendor_type of this Execution.  # noqa: E501
        :type: str
        """

        self._vendor_type = vendor_type

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

        The vendor id of execution  # noqa: E501

        :return: The vendor_id of this Execution.  # noqa: E501
        :rtype: int
        """
        return self._vendor_id

    @vendor_id.setter
    def vendor_id(self, vendor_id):
        """Sets the vendor_id of this Execution.

        The vendor id of execution  # noqa: E501

        :param vendor_id: The vendor_id of this Execution.  # noqa: E501
        :type: int
        """

        self._vendor_id = vendor_id

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

        The status of execution  # noqa: E501

        :return: The status of this Execution.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this Execution.

        The status of execution  # noqa: E501

        :param status: The status of this Execution.  # noqa: E501
        :type: str
        """

        self._status = status

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

        The status message of execution  # noqa: E501

        :return: The status_message of this Execution.  # noqa: E501
        :rtype: str
        """
        return self._status_message

    @status_message.setter
    def status_message(self, status_message):
        """Sets the status_message of this Execution.

        The status message of execution  # noqa: E501

        :param status_message: The status_message of this Execution.  # noqa: E501
        :type: str
        """

        self._status_message = status_message

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


        :return: The metrics of this Execution.  # noqa: E501
        :rtype: Metrics
        """
        return self._metrics

    @metrics.setter
    def metrics(self, metrics):
        """Sets the metrics of this Execution.


        :param metrics: The metrics of this Execution.  # noqa: E501
        :type: Metrics
        """

        self._metrics = metrics

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

        The trigger of execution  # noqa: E501

        :return: The trigger of this Execution.  # noqa: E501
        :rtype: str
        """
        return self._trigger

    @trigger.setter
    def trigger(self, trigger):
        """Sets the trigger of this Execution.

        The trigger of execution  # noqa: E501

        :param trigger: The trigger of this Execution.  # noqa: E501
        :type: str
        """

        self._trigger = trigger

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


        :return: The extra_attrs of this Execution.  # noqa: E501
        :rtype: ExtraAttrs
        """
        return self._extra_attrs

    @extra_attrs.setter
    def extra_attrs(self, extra_attrs):
        """Sets the extra_attrs of this Execution.


        :param extra_attrs: The extra_attrs of this Execution.  # noqa: E501
        :type: ExtraAttrs
        """

        self._extra_attrs = extra_attrs

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

        The start time of execution  # noqa: E501

        :return: The start_time of this Execution.  # noqa: E501
        :rtype: str
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this Execution.

        The start time of execution  # noqa: E501

        :param start_time: The start_time of this Execution.  # noqa: E501
        :type: str
        """

        self._start_time = start_time

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

        The end time of execution  # noqa: E501

        :return: The end_time of this Execution.  # noqa: E501
        :rtype: str
        """
        return self._end_time

    @end_time.setter
    def end_time(self, end_time):
        """Sets the end_time of this Execution.

        The end time of execution  # noqa: E501

        :param end_time: The end_time of this Execution.  # noqa: E501
        :type: str
        """

        self._end_time = end_time

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(Execution, dict):
            for key, value in self.items():
                result[key] = 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, Execution):
            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, Execution):
            return True

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