# coding: utf-8

"""
    WakaTime API

    REST API for accessing your WakaTime coding activity stats. - Uses GET for retrieval, POST/PUT/PATCH for modification. - All requests must use HTTPS. - Responses are JSON objects. Data is in the `data` key, errors in `error` or `errors`. - Refer to WakaTime usage guidelines when using the trademark or logo.   # noqa: E501

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

import pprint
import re  # noqa: F401

import six

class ExternalDuration(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': 'str',
        'external_id': 'str',
        'entity': 'str',
        'type': 'str',
        'provider': 'str',
        'category': 'str',
        'start_time': 'float',
        'end_time': 'float',
        'project': 'str',
        'branch': 'str',
        'language': 'str',
        'meta': 'str'
    }

    attribute_map = {
        'id': 'id',
        'external_id': 'external_id',
        'entity': 'entity',
        'type': 'type',
        'provider': 'provider',
        'category': 'category',
        'start_time': 'start_time',
        'end_time': 'end_time',
        'project': 'project',
        'branch': 'branch',
        'language': 'language',
        'meta': 'meta'
    }

    def __init__(self, id=None, external_id=None, entity=None, type=None, provider=None, category=None, start_time=None, end_time=None, project=None, branch=None, language=None, meta=None):  # noqa: E501
        """ExternalDuration - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._external_id = None
        self._entity = None
        self._type = None
        self._provider = None
        self._category = None
        self._start_time = None
        self._end_time = None
        self._project = None
        self._branch = None
        self._language = None
        self._meta = None
        self.discriminator = None
        if id is not None:
            self.id = id
        if external_id is not None:
            self.external_id = external_id
        if entity is not None:
            self.entity = entity
        if type is not None:
            self.type = type
        if provider is not None:
            self.provider = provider
        if category is not None:
            self.category = category
        if start_time is not None:
            self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time
        if project is not None:
            self.project = project
        if branch is not None:
            self.branch = branch
        if language is not None:
            self.language = language
        if meta is not None:
            self.meta = meta

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


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

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


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

        self._id = id

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


        :return: The external_id of this ExternalDuration.  # noqa: E501
        :rtype: str
        """
        return self._external_id

    @external_id.setter
    def external_id(self, external_id):
        """Sets the external_id of this ExternalDuration.


        :param external_id: The external_id of this ExternalDuration.  # noqa: E501
        :type: str
        """

        self._external_id = external_id

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


        :return: The entity of this ExternalDuration.  # noqa: E501
        :rtype: str
        """
        return self._entity

    @entity.setter
    def entity(self, entity):
        """Sets the entity of this ExternalDuration.


        :param entity: The entity of this ExternalDuration.  # noqa: E501
        :type: str
        """

        self._entity = entity

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


        :return: The type of this ExternalDuration.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this ExternalDuration.


        :param type: The type of this ExternalDuration.  # noqa: E501
        :type: str
        """
        allowed_values = ["file", "app", "domain"]  # noqa: E501
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"  # noqa: E501
                .format(type, allowed_values)
            )

        self._type = type

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


        :return: The provider of this ExternalDuration.  # noqa: E501
        :rtype: str
        """
        return self._provider

    @provider.setter
    def provider(self, provider):
        """Sets the provider of this ExternalDuration.


        :param provider: The provider of this ExternalDuration.  # noqa: E501
        :type: str
        """

        self._provider = provider

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


        :return: The category of this ExternalDuration.  # noqa: E501
        :rtype: str
        """
        return self._category

    @category.setter
    def category(self, category):
        """Sets the category of this ExternalDuration.


        :param category: The category of this ExternalDuration.  # noqa: E501
        :type: str
        """
        allowed_values = ["coding", "building", "indexing", "debugging", "browsing", "running tests", "writing tests", "manual testing", "writing docs", "communicating", "code reviewing", "researching", "learning", "designing"]  # noqa: E501
        if category not in allowed_values:
            raise ValueError(
                "Invalid value for `category` ({0}), must be one of {1}"  # noqa: E501
                .format(category, allowed_values)
            )

        self._category = category

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

        UNIX epoch timestamp.  # noqa: E501

        :return: The start_time of this ExternalDuration.  # noqa: E501
        :rtype: float
        """
        return self._start_time

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

        UNIX epoch timestamp.  # noqa: E501

        :param start_time: The start_time of this ExternalDuration.  # noqa: E501
        :type: float
        """

        self._start_time = start_time

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

        UNIX epoch timestamp.  # noqa: E501

        :return: The end_time of this ExternalDuration.  # noqa: E501
        :rtype: float
        """
        return self._end_time

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

        UNIX epoch timestamp.  # noqa: E501

        :param end_time: The end_time of this ExternalDuration.  # noqa: E501
        :type: float
        """

        self._end_time = end_time

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


        :return: The project of this ExternalDuration.  # noqa: E501
        :rtype: str
        """
        return self._project

    @project.setter
    def project(self, project):
        """Sets the project of this ExternalDuration.


        :param project: The project of this ExternalDuration.  # noqa: E501
        :type: str
        """

        self._project = project

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


        :return: The branch of this ExternalDuration.  # noqa: E501
        :rtype: str
        """
        return self._branch

    @branch.setter
    def branch(self, branch):
        """Sets the branch of this ExternalDuration.


        :param branch: The branch of this ExternalDuration.  # noqa: E501
        :type: str
        """

        self._branch = branch

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


        :return: The language of this ExternalDuration.  # noqa: E501
        :rtype: str
        """
        return self._language

    @language.setter
    def language(self, language):
        """Sets the language of this ExternalDuration.


        :param language: The language of this ExternalDuration.  # noqa: E501
        :type: str
        """

        self._language = language

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


        :return: The meta of this ExternalDuration.  # noqa: E501
        :rtype: str
        """
        return self._meta

    @meta.setter
    def meta(self, meta):
        """Sets the meta of this ExternalDuration.


        :param meta: The meta of this ExternalDuration.  # noqa: E501
        :type: str
        """

        self._meta = meta

    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(ExternalDuration, 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, ExternalDuration):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
