# 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 Heartbeat(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 = {
        'entity': 'str',
        'type': 'str',
        'category': 'str',
        'time': 'float',
        'project': 'str',
        'project_root_count': 'int',
        'branch': 'str',
        'language': 'str',
        'dependencies': 'str',
        'machine_name_id': 'str',
        'line_additions': 'int',
        'line_deletions': 'int',
        'lines': 'int',
        'lineno': 'int',
        'cursorpos': 'int',
        'is_write': 'bool'
    }

    attribute_map = {
        'entity': 'entity',
        'type': 'type',
        'category': 'category',
        'time': 'time',
        'project': 'project',
        'project_root_count': 'project_root_count',
        'branch': 'branch',
        'language': 'language',
        'dependencies': 'dependencies',
        'machine_name_id': 'machine_name_id',
        'line_additions': 'line_additions',
        'line_deletions': 'line_deletions',
        'lines': 'lines',
        'lineno': 'lineno',
        'cursorpos': 'cursorpos',
        'is_write': 'is_write'
    }

    def __init__(self, entity=None, type=None, category=None, time=None, project=None, project_root_count=None, branch=None, language=None, dependencies=None, machine_name_id=None, line_additions=None, line_deletions=None, lines=None, lineno=None, cursorpos=None, is_write=None):  # noqa: E501
        """Heartbeat - a model defined in Swagger"""  # noqa: E501
        self._entity = None
        self._type = None
        self._category = None
        self._time = None
        self._project = None
        self._project_root_count = None
        self._branch = None
        self._language = None
        self._dependencies = None
        self._machine_name_id = None
        self._line_additions = None
        self._line_deletions = None
        self._lines = None
        self._lineno = None
        self._cursorpos = None
        self._is_write = None
        self.discriminator = None
        if entity is not None:
            self.entity = entity
        if type is not None:
            self.type = type
        if category is not None:
            self.category = category
        if time is not None:
            self.time = time
        if project is not None:
            self.project = project
        if project_root_count is not None:
            self.project_root_count = project_root_count
        if branch is not None:
            self.branch = branch
        if language is not None:
            self.language = language
        if dependencies is not None:
            self.dependencies = dependencies
        if machine_name_id is not None:
            self.machine_name_id = machine_name_id
        if line_additions is not None:
            self.line_additions = line_additions
        if line_deletions is not None:
            self.line_deletions = line_deletions
        if lines is not None:
            self.lines = lines
        if lineno is not None:
            self.lineno = lineno
        if cursorpos is not None:
            self.cursorpos = cursorpos
        if is_write is not None:
            self.is_write = is_write

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


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

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


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

        self._entity = entity

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


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

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


        :param type: The type of this Heartbeat.  # 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 category(self):
        """Gets the category of this Heartbeat.  # noqa: E501


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

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


        :param category: The category of this Heartbeat.  # noqa: E501
        :type: str
        """
        allowed_values = ["coding", "building", "indexing", "debugging", "browsing", "running tests", "writing tests", "manual testing", "writing docs", "code reviewing", "communicating", "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 time(self):
        """Gets the time of this Heartbeat.  # noqa: E501

        UNIX epoch timestamp.  # noqa: E501

        :return: The time of this Heartbeat.  # noqa: E501
        :rtype: float
        """
        return self._time

    @time.setter
    def time(self, time):
        """Sets the time of this Heartbeat.

        UNIX epoch timestamp.  # noqa: E501

        :param time: The time of this Heartbeat.  # noqa: E501
        :type: float
        """

        self._time = time

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


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

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


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

        self._project = project

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


        :return: The project_root_count of this Heartbeat.  # noqa: E501
        :rtype: int
        """
        return self._project_root_count

    @project_root_count.setter
    def project_root_count(self, project_root_count):
        """Sets the project_root_count of this Heartbeat.


        :param project_root_count: The project_root_count of this Heartbeat.  # noqa: E501
        :type: int
        """

        self._project_root_count = project_root_count

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


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

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


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

        self._branch = branch

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


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

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


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

        self._language = language

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


        :return: The dependencies of this Heartbeat.  # noqa: E501
        :rtype: str
        """
        return self._dependencies

    @dependencies.setter
    def dependencies(self, dependencies):
        """Sets the dependencies of this Heartbeat.


        :param dependencies: The dependencies of this Heartbeat.  # noqa: E501
        :type: str
        """

        self._dependencies = dependencies

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


        :return: The machine_name_id of this Heartbeat.  # noqa: E501
        :rtype: str
        """
        return self._machine_name_id

    @machine_name_id.setter
    def machine_name_id(self, machine_name_id):
        """Sets the machine_name_id of this Heartbeat.


        :param machine_name_id: The machine_name_id of this Heartbeat.  # noqa: E501
        :type: str
        """

        self._machine_name_id = machine_name_id

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


        :return: The line_additions of this Heartbeat.  # noqa: E501
        :rtype: int
        """
        return self._line_additions

    @line_additions.setter
    def line_additions(self, line_additions):
        """Sets the line_additions of this Heartbeat.


        :param line_additions: The line_additions of this Heartbeat.  # noqa: E501
        :type: int
        """

        self._line_additions = line_additions

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


        :return: The line_deletions of this Heartbeat.  # noqa: E501
        :rtype: int
        """
        return self._line_deletions

    @line_deletions.setter
    def line_deletions(self, line_deletions):
        """Sets the line_deletions of this Heartbeat.


        :param line_deletions: The line_deletions of this Heartbeat.  # noqa: E501
        :type: int
        """

        self._line_deletions = line_deletions

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


        :return: The lines of this Heartbeat.  # noqa: E501
        :rtype: int
        """
        return self._lines

    @lines.setter
    def lines(self, lines):
        """Sets the lines of this Heartbeat.


        :param lines: The lines of this Heartbeat.  # noqa: E501
        :type: int
        """

        self._lines = lines

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


        :return: The lineno of this Heartbeat.  # noqa: E501
        :rtype: int
        """
        return self._lineno

    @lineno.setter
    def lineno(self, lineno):
        """Sets the lineno of this Heartbeat.


        :param lineno: The lineno of this Heartbeat.  # noqa: E501
        :type: int
        """

        self._lineno = lineno

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


        :return: The cursorpos of this Heartbeat.  # noqa: E501
        :rtype: int
        """
        return self._cursorpos

    @cursorpos.setter
    def cursorpos(self, cursorpos):
        """Sets the cursorpos of this Heartbeat.


        :param cursorpos: The cursorpos of this Heartbeat.  # noqa: E501
        :type: int
        """

        self._cursorpos = cursorpos

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


        :return: The is_write of this Heartbeat.  # noqa: E501
        :rtype: bool
        """
        return self._is_write

    @is_write.setter
    def is_write(self, is_write):
        """Sets the is_write of this Heartbeat.


        :param is_write: The is_write of this Heartbeat.  # noqa: E501
        :type: bool
        """

        self._is_write = is_write

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

        return self.__dict__ == other.__dict__

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