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

module Azure::ResourceGraph::Mgmt::V2019_04_01
  module Models
    #
    # The options for facet evaluation
    #
    class FacetRequestOptions

      include MsRestAzure

      # @return [String] The column name or query expression to sort on.
      # Defaults to count if not present.
      attr_accessor :sort_by

      # @return [FacetSortOrder] The sorting order by the selected column
      # (count by default). Possible values include: 'asc', 'desc'. Default
      # value: 'desc' .
      attr_accessor :sort_order

      # @return [String] Specifies the filter condition for the 'where' clause
      # which will be run on main query's result, just before the actual
      # faceting.
      attr_accessor :filter

      # @return [Integer] The maximum number of facet rows that should be
      # returned.
      attr_accessor :top


      #
      # Mapper for FacetRequestOptions class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'FacetRequestOptions',
          type: {
            name: 'Composite',
            class_name: 'FacetRequestOptions',
            model_properties: {
              sort_by: {
                client_side_validation: true,
                required: false,
                serialized_name: 'sortBy',
                type: {
                  name: 'String'
                }
              },
              sort_order: {
                client_side_validation: true,
                required: false,
                serialized_name: 'sortOrder',
                default_value: 'desc',
                type: {
                  name: 'Enum',
                  module: 'FacetSortOrder'
                }
              },
              filter: {
                client_side_validation: true,
                required: false,
                serialized_name: 'filter',
                type: {
                  name: 'String'
                }
              },
              top: {
                client_side_validation: true,
                required: false,
                serialized_name: '$top',
                constraints: {
                  InclusiveMaximum: 1000,
                  InclusiveMinimum: 1
                },
                type: {
                  name: 'Number'
                }
              }
            }
          }
        }
      end
    end
  end
end
