# coding: utf-8

"""
    ARLAS Exploration API

    Explore the content of ARLAS collections

    OpenAPI spec version: 13.0.2
    Contact: contact@gisaia.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class ComputationResponse(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 = {
        'query_time': 'int',
        'total_time': 'int',
        'totalnb': 'int',
        'field': 'str',
        'metric': 'str',
        'value': 'float',
        'geometry': 'object'
    }

    attribute_map = {
        'query_time': 'query_time',
        'total_time': 'total_time',
        'totalnb': 'totalnb',
        'field': 'field',
        'metric': 'metric',
        'value': 'value',
        'geometry': 'geometry'
    }

    def __init__(self, query_time=None, total_time=None, totalnb=None, field=None, metric=None, value=None, geometry=None):
        """
        ComputationResponse - a model defined in Swagger
        """

        self._query_time = None
        self._total_time = None
        self._totalnb = None
        self._field = None
        self._metric = None
        self._value = None
        self._geometry = None

        if query_time is not None:
          self.query_time = query_time
        if total_time is not None:
          self.total_time = total_time
        if totalnb is not None:
          self.totalnb = totalnb
        if field is not None:
          self.field = field
        if metric is not None:
          self.metric = metric
        if value is not None:
          self.value = value
        if geometry is not None:
          self.geometry = geometry

    @property
    def query_time(self):
        """
        Gets the query_time of this ComputationResponse.

        :return: The query_time of this ComputationResponse.
        :rtype: int
        """
        return self._query_time

    @query_time.setter
    def query_time(self, query_time):
        """
        Sets the query_time of this ComputationResponse.

        :param query_time: The query_time of this ComputationResponse.
        :type: int
        """

        self._query_time = query_time

    @property
    def total_time(self):
        """
        Gets the total_time of this ComputationResponse.

        :return: The total_time of this ComputationResponse.
        :rtype: int
        """
        return self._total_time

    @total_time.setter
    def total_time(self, total_time):
        """
        Sets the total_time of this ComputationResponse.

        :param total_time: The total_time of this ComputationResponse.
        :type: int
        """

        self._total_time = total_time

    @property
    def totalnb(self):
        """
        Gets the totalnb of this ComputationResponse.

        :return: The totalnb of this ComputationResponse.
        :rtype: int
        """
        return self._totalnb

    @totalnb.setter
    def totalnb(self, totalnb):
        """
        Sets the totalnb of this ComputationResponse.

        :param totalnb: The totalnb of this ComputationResponse.
        :type: int
        """

        self._totalnb = totalnb

    @property
    def field(self):
        """
        Gets the field of this ComputationResponse.

        :return: The field of this ComputationResponse.
        :rtype: str
        """
        return self._field

    @field.setter
    def field(self, field):
        """
        Sets the field of this ComputationResponse.

        :param field: The field of this ComputationResponse.
        :type: str
        """

        self._field = field

    @property
    def metric(self):
        """
        Gets the metric of this ComputationResponse.

        :return: The metric of this ComputationResponse.
        :rtype: str
        """
        return self._metric

    @metric.setter
    def metric(self, metric):
        """
        Sets the metric of this ComputationResponse.

        :param metric: The metric of this ComputationResponse.
        :type: str
        """
        allowed_values = ["AVG", "MAX", "MIN", "SUM", "CARDINALITY", "SPANNING", "GEOBBOX", "GEOCENTROID"]
        if metric not in allowed_values:
            raise ValueError(
                "Invalid value for `metric` ({0}), must be one of {1}"
                .format(metric, allowed_values)
            )

        self._metric = metric

    @property
    def value(self):
        """
        Gets the value of this ComputationResponse.

        :return: The value of this ComputationResponse.
        :rtype: float
        """
        return self._value

    @value.setter
    def value(self, value):
        """
        Sets the value of this ComputationResponse.

        :param value: The value of this ComputationResponse.
        :type: float
        """

        self._value = value

    @property
    def geometry(self):
        """
        Gets the geometry of this ComputationResponse.

        :return: The geometry of this ComputationResponse.
        :rtype: object
        """
        return self._geometry

    @geometry.setter
    def geometry(self, geometry):
        """
        Sets the geometry of this ComputationResponse.

        :param geometry: The geometry of this ComputationResponse.
        :type: object
        """

        self._geometry = geometry

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

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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, ComputationResponse):
            return False

        return self.__dict__ == other.__dict__

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