# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class MeasureAggregate(Model):
    """Represents an aggregate.

    :param operation: Possible values include: 'sum', 'avg', 'min', 'max',
     'count', 'countDistinct', 'first', 'last', 'argMax', 'argMin'
    :type operation: str or ~dynamics.customerinsights.api.models.enum
    :param field: Gets the field on which the aggregate operation is applied
    :type field: str
    :param alias: Gets the alias for the field
    :type alias: str
    :param display_name: Gets the display name for the aggregate
    :type display_name: str
    :param order: Gets the order for the aggregate
    :type order: int
    :param operation_scope: Possible values include: 'rollup'
    :type operation_scope: str or ~dynamics.customerinsights.api.models.enum
    :param aggregates: Gets list of aggregates of the measure.
    :type aggregates:
     list[~dynamics.customerinsights.api.models.MeasureAggregate]
    :param is_included: Gets a value indicating whether to display the field
     in results. Default value: False .
    :type is_included: bool
    """

    _attribute_map = {
        'operation': {'key': 'operation', 'type': 'str'},
        'field': {'key': 'field', 'type': 'str'},
        'alias': {'key': 'alias', 'type': 'str'},
        'display_name': {'key': 'displayName', 'type': 'str'},
        'order': {'key': 'order', 'type': 'int'},
        'operation_scope': {'key': 'operationScope', 'type': 'str'},
        'aggregates': {'key': 'aggregates', 'type': '[MeasureAggregate]'},
        'is_included': {'key': 'isIncluded', 'type': 'bool'},
    }

    def __init__(self, *, operation=None, field: str=None, alias: str=None, display_name: str=None, order: int=None, operation_scope=None, aggregates=None, is_included: bool=False, **kwargs) -> None:
        super(MeasureAggregate, self).__init__(**kwargs)
        self.operation = operation
        self.field = field
        self.alias = alias
        self.display_name = display_name
        self.order = order
        self.operation_scope = operation_scope
        self.aggregates = aggregates
        self.is_included = is_included
