Class: MicrosoftGraph::Models::BucketAggregationDefinition

Inherits:
Object
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/bucket_aggregation_definition.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new bucketAggregationDefinition and sets the default values.



49
50
51
# File 'lib/models/bucket_aggregation_definition.rb', line 49

def initialize()
    @additional_data = Hash.new
end

Class Method Details

.create_from_discriminator_value(parse_node) ⇒ Object

Creates a new instance of the appropriate class based on discriminator value

Parameters:

  • parse_node

    The parse node to use to read the discriminator value and create the object

Returns:

  • a bucket_aggregation_definition

Raises:

  • (StandardError)


57
58
59
60
# File 'lib/models/bucket_aggregation_definition.rb', line 57

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return BucketAggregationDefinition.new
end

Instance Method Details

#additional_dataObject

Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Returns:

  • a i_dictionary



34
35
36
# File 'lib/models/bucket_aggregation_definition.rb', line 34

def additional_data
    return @additional_data
end

#additional_data=(value) ⇒ Object

Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Parameters:

  • value

    Value to set for the additionalData property.

Returns:

  • a void



42
43
44
# File 'lib/models/bucket_aggregation_definition.rb', line 42

def additional_data=(value)
    @additional_data = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



65
66
67
68
69
70
71
72
73
74
# File 'lib/models/bucket_aggregation_definition.rb', line 65

def get_field_deserializers()
    return {
        "isDescending" => lambda {|n| @is_descending = n.get_boolean_value() },
        "minimumCount" => lambda {|n| @minimum_count = n.get_number_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "prefixFilter" => lambda {|n| @prefix_filter = n.get_string_value() },
        "ranges" => lambda {|n| @ranges = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::BucketAggregationRange.create_from_discriminator_value(pn) }) },
        "sortBy" => lambda {|n| @sort_by = n.get_enum_value(MicrosoftGraph::Models::BucketAggregationSortProperty) },
    }
end

#is_descendingObject

Gets the isDescending property value. True to specify the sort order as descending. The default is false, with the sort order as ascending. Optional.

Returns:

  • a boolean



79
80
81
# File 'lib/models/bucket_aggregation_definition.rb', line 79

def is_descending
    return @is_descending
end

#is_descending=(value) ⇒ Object

Sets the isDescending property value. True to specify the sort order as descending. The default is false, with the sort order as ascending. Optional.

Parameters:

  • value

    Value to set for the isDescending property.

Returns:

  • a void



87
88
89
# File 'lib/models/bucket_aggregation_definition.rb', line 87

def is_descending=(value)
    @is_descending = value
end

#minimum_countObject

Gets the minimumCount property value. The minimum number of items that should be present in the aggregation to be returned in a bucket. Optional.

Returns:

  • a integer



94
95
96
# File 'lib/models/bucket_aggregation_definition.rb', line 94

def minimum_count
    return @minimum_count
end

#minimum_count=(value) ⇒ Object

Sets the minimumCount property value. The minimum number of items that should be present in the aggregation to be returned in a bucket. Optional.

Parameters:

  • value

    Value to set for the minimumCount property.

Returns:

  • a void



102
103
104
# File 'lib/models/bucket_aggregation_definition.rb', line 102

def minimum_count=(value)
    @minimum_count = value
end

#odata_typeObject

Gets the @odata.type property value. The OdataType property

Returns:

  • a string



109
110
111
# File 'lib/models/bucket_aggregation_definition.rb', line 109

def odata_type
    return @odata_type
end

#odata_type=(value) ⇒ Object

Sets the @odata.type property value. The OdataType property

Parameters:

  • value

    Value to set for the @odata.type property.

Returns:

  • a void



117
118
119
# File 'lib/models/bucket_aggregation_definition.rb', line 117

def odata_type=(value)
    @odata_type = value
end

#prefix_filterObject

Gets the prefixFilter property value. A filter to define a matching criteria. The key should start with the specified prefix to be returned in the response. Optional.

Returns:

  • a string



124
125
126
# File 'lib/models/bucket_aggregation_definition.rb', line 124

def prefix_filter
    return @prefix_filter
end

#prefix_filter=(value) ⇒ Object

Sets the prefixFilter property value. A filter to define a matching criteria. The key should start with the specified prefix to be returned in the response. Optional.

Parameters:

  • value

    Value to set for the prefixFilter property.

Returns:

  • a void



132
133
134
# File 'lib/models/bucket_aggregation_definition.rb', line 132

def prefix_filter=(value)
    @prefix_filter = value
end

#rangesObject

Gets the ranges property value. Specifies the manual ranges to compute the aggregations. This is only valid for non-string refiners of date or numeric type. Optional.

Returns:

  • a bucket_aggregation_range



139
140
141
# File 'lib/models/bucket_aggregation_definition.rb', line 139

def ranges
    return @ranges
end

#ranges=(value) ⇒ Object

Sets the ranges property value. Specifies the manual ranges to compute the aggregations. This is only valid for non-string refiners of date or numeric type. Optional.

Parameters:

  • value

    Value to set for the ranges property.

Returns:

  • a void



147
148
149
# File 'lib/models/bucket_aggregation_definition.rb', line 147

def ranges=(value)
    @ranges = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


155
156
157
158
159
160
161
162
163
164
# File 'lib/models/bucket_aggregation_definition.rb', line 155

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_boolean_value("isDescending", @is_descending)
    writer.write_number_value("minimumCount", @minimum_count)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_string_value("prefixFilter", @prefix_filter)
    writer.write_collection_of_object_values("ranges", @ranges)
    writer.write_enum_value("sortBy", @sort_by)
    writer.write_additional_data(@additional_data)
end

#sort_byObject

Gets the sortBy property value. The sortBy property

Returns:

  • a bucket_aggregation_sort_property



169
170
171
# File 'lib/models/bucket_aggregation_definition.rb', line 169

def sort_by
    return @sort_by
end

#sort_by=(value) ⇒ Object

Sets the sortBy property value. The sortBy property

Parameters:

  • value

    Value to set for the sortBy property.

Returns:

  • a void



177
178
179
# File 'lib/models/bucket_aggregation_definition.rb', line 177

def sort_by=(value)
    @sort_by = value
end