# 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 AdiEmsWebApiV2DtoSchemaQuery(Model):
    """Represents the options used to make up a data source query.

    All required parameters must be populated in order to send to Azure.

    :param select: Required. An array specifying the fields to select and
     return as columns in the query results
    :type select: list[~emsapi.models.AdiEmsWebApiV2DtoSchemaSelectColumn]
    :param group_by: An array specifying the fields by which to group
     aggregate operations. If not specified, no grouping
     is performed
    :type group_by: list[~emsapi.models.AdiEmsWebApiV2DtoSchemaGroupByColumn]
    :param order_by: An array specifying the selected columns by which to
     order result rows. Results are always ordered by the
     results value, not by the display formatted value (configured to be
     returned by the format property). If
     not specified, results are returned in default database ordering
    :type order_by: list[~emsapi.models.AdiEmsWebApiV2DtoSchemaOrderByColumn]
    :param filter: A filter used to narrow the query results
    :type filter: ~emsapi.models.AdiEmsWebApiV2DtoSchemaFilter
    :param format: Value formatting that should be performed on results values
     before returning. If not specified, no results
     formatting is performed. This can be overridden by specifying a value for
     the Format property of a SelectColumn. Possible values include: 'none',
     'display'
    :type format: str or ~emsapi.models.enum
    :param distinct: Whether to remove duplicate rows from query results
     <b>before formatting</b> the results. Using a format
     value other than 'none' can reduce results precision, leading to cases
     where two distinct rows appear
     equivalent after formatting is applied. Defaults to false if not specified
    :type distinct: bool
    :param top: Identifies a subset of rows to return.
     The subset is formed by selecting only the first N rows of the set, where
     N is a positive integer provided
     as the value of this property. If not specified, all rows are returned
    :type top: int
    """

    _validation = {
        'select': {'required': True},
    }

    _attribute_map = {
        'select': {'key': 'select', 'type': '[AdiEmsWebApiV2DtoSchemaSelectColumn]'},
        'group_by': {'key': 'groupBy', 'type': '[AdiEmsWebApiV2DtoSchemaGroupByColumn]'},
        'order_by': {'key': 'orderBy', 'type': '[AdiEmsWebApiV2DtoSchemaOrderByColumn]'},
        'filter': {'key': 'filter', 'type': 'AdiEmsWebApiV2DtoSchemaFilter'},
        'format': {'key': 'format', 'type': 'str'},
        'distinct': {'key': 'distinct', 'type': 'bool'},
        'top': {'key': 'top', 'type': 'int'},
    }

    def __init__(self, **kwargs):
        super(AdiEmsWebApiV2DtoSchemaQuery, self).__init__(**kwargs)
        self.select = kwargs.get('select', None)
        self.group_by = kwargs.get('group_by', None)
        self.order_by = kwargs.get('order_by', None)
        self.filter = kwargs.get('filter', None)
        self.format = kwargs.get('format', None)
        self.distinct = kwargs.get('distinct', None)
        self.top = kwargs.get('top', None)
