# coding: utf-8

"""
    Camunda BPM REST API

    OpenApi Spec for Camunda BPM REST API.  # noqa: E501

    The version of the OpenAPI document: 7.14.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from generic_camunda_client.configuration import Configuration


class DurationReportResultDto(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 = {
        'period': 'int',
        'period_unit': 'str',
        'minimum': 'int',
        'maximum': 'int',
        'average': 'int'
    }

    attribute_map = {
        'period': 'period',
        'period_unit': 'periodUnit',
        'minimum': 'minimum',
        'maximum': 'maximum',
        'average': 'average'
    }

    def __init__(self, period=None, period_unit=None, minimum=None, maximum=None, average=None, local_vars_configuration=None):  # noqa: E501
        """DurationReportResultDto - 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._period = None
        self._period_unit = None
        self._minimum = None
        self._maximum = None
        self._average = None
        self.discriminator = None

        if period is not None:
            self.period = period
        if period_unit is not None:
            self.period_unit = period_unit
        if minimum is not None:
            self.minimum = minimum
        if maximum is not None:
            self.maximum = maximum
        if average is not None:
            self.average = average

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

        Specifies a timespan within a year. **Note:** The period must be interpreted in conjunction with the returned `periodUnit`.  # noqa: E501

        :return: The period of this DurationReportResultDto.  # noqa: E501
        :rtype: int
        """
        return self._period

    @period.setter
    def period(self, period):
        """Sets the period of this DurationReportResultDto.

        Specifies a timespan within a year. **Note:** The period must be interpreted in conjunction with the returned `periodUnit`.  # noqa: E501

        :param period: The period of this DurationReportResultDto.  # noqa: E501
        :type: int
        """

        self._period = period

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

        The unit of the given period. Possible values are `MONTH` and `QUARTER`.  # noqa: E501

        :return: The period_unit of this DurationReportResultDto.  # noqa: E501
        :rtype: str
        """
        return self._period_unit

    @period_unit.setter
    def period_unit(self, period_unit):
        """Sets the period_unit of this DurationReportResultDto.

        The unit of the given period. Possible values are `MONTH` and `QUARTER`.  # noqa: E501

        :param period_unit: The period_unit of this DurationReportResultDto.  # noqa: E501
        :type: str
        """
        allowed_values = ["MONTH", "QUARTER"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and period_unit not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `period_unit` ({0}), must be one of {1}"  # noqa: E501
                .format(period_unit, allowed_values)
            )

        self._period_unit = period_unit

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

        The smallest duration in milliseconds of all completed process instances which were started in the given period.  # noqa: E501

        :return: The minimum of this DurationReportResultDto.  # noqa: E501
        :rtype: int
        """
        return self._minimum

    @minimum.setter
    def minimum(self, minimum):
        """Sets the minimum of this DurationReportResultDto.

        The smallest duration in milliseconds of all completed process instances which were started in the given period.  # noqa: E501

        :param minimum: The minimum of this DurationReportResultDto.  # noqa: E501
        :type: int
        """

        self._minimum = minimum

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

        The greatest duration in milliseconds of all completed process instances which were started in the given period.  # noqa: E501

        :return: The maximum of this DurationReportResultDto.  # noqa: E501
        :rtype: int
        """
        return self._maximum

    @maximum.setter
    def maximum(self, maximum):
        """Sets the maximum of this DurationReportResultDto.

        The greatest duration in milliseconds of all completed process instances which were started in the given period.  # noqa: E501

        :param maximum: The maximum of this DurationReportResultDto.  # noqa: E501
        :type: int
        """

        self._maximum = maximum

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

        The average duration in milliseconds of all completed process instances which were started in the given period.  # noqa: E501

        :return: The average of this DurationReportResultDto.  # noqa: E501
        :rtype: int
        """
        return self._average

    @average.setter
    def average(self, average):
        """Sets the average of this DurationReportResultDto.

        The average duration in milliseconds of all completed process instances which were started in the given period.  # noqa: E501

        :param average: The average of this DurationReportResultDto.  # noqa: E501
        :type: int
        """

        self._average = average

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

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