Class: MicrosoftGraph::Models::SearchRequest

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new searchRequest and sets the default values.



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

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

Raises:

  • (StandardError)


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

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return SearchRequest.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.



64
65
66
# File 'lib/models/search_request.rb', line 64

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.



72
73
74
# File 'lib/models/search_request.rb', line 72

def additional_data=(value)
    @additional_data = value
end

#aggregation_filtersObject

Gets the aggregationFilters property value. Contains one or more filters to obtain search results aggregated and filtered to a specific value of a field. Optional.Build this filter based on a prior search that aggregates by the same field. From the response of the prior search, identify the searchBucket that filters results to the specific value of the field, use the string in its aggregationFilterToken property, and build an aggregation filter string in the format ‘field:/’aggregationFilterToken/”. If multiple values for the same field need to be provided, use the strings in its aggregationFilterToken property and build an aggregation filter string in the format ‘field:or(/’aggregationFilterToken1/‘,/’aggregationFilterToken2/‘)’. For example, searching and aggregating drive items by file type returns a searchBucket for the file type docx in the response. You can conveniently use the aggregationFilterToken returned for this searchBucket in a subsequent search query and filter matches down to drive items of the docx file type. Example 1 and example 2 show the actual requests and responses.



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

def aggregation_filters
    return @aggregation_filters
end

#aggregation_filters=(value) ⇒ Object

Sets the aggregationFilters property value. Contains one or more filters to obtain search results aggregated and filtered to a specific value of a field. Optional.Build this filter based on a prior search that aggregates by the same field. From the response of the prior search, identify the searchBucket that filters results to the specific value of the field, use the string in its aggregationFilterToken property, and build an aggregation filter string in the format ‘field:/’aggregationFilterToken/”. If multiple values for the same field need to be provided, use the strings in its aggregationFilterToken property and build an aggregation filter string in the format ‘field:or(/’aggregationFilterToken1/‘,/’aggregationFilterToken2/‘)’. For example, searching and aggregating drive items by file type returns a searchBucket for the file type docx in the response. You can conveniently use the aggregationFilterToken returned for this searchBucket in a subsequent search query and filter matches down to drive items of the docx file type. Example 1 and example 2 show the actual requests and responses.



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

def aggregation_filters=(value)
    @aggregation_filters = value
end

#aggregationsObject

Gets the aggregations property value. Specifies aggregations (also known as refiners) to be returned alongside search results. Optional.



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

def aggregations
    return @aggregations
end

#aggregations=(value) ⇒ Object

Sets the aggregations property value. Specifies aggregations (also known as refiners) to be returned alongside search results. Optional.



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

def aggregations=(value)
    @aggregations = value
end

#collapse_propertiesObject

Gets the collapseProperties property value. Contains the ordered collection of fields and limit to collapse results. Optional.



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

def collapse_properties
    return @collapse_properties
end

#collapse_properties=(value) ⇒ Object

Sets the collapseProperties property value. Contains the ordered collection of fields and limit to collapse results. Optional.



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

def collapse_properties=(value)
    @collapse_properties = value
end

#content_sourcesObject

Gets the contentSources property value. Contains the connection to be targeted.



131
132
133
# File 'lib/models/search_request.rb', line 131

def content_sources
    return @content_sources
end

#content_sources=(value) ⇒ Object

Sets the contentSources property value. Contains the connection to be targeted.



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

def content_sources=(value)
    @content_sources = value
end

#enable_top_resultsObject

Gets the enableTopResults property value. This triggers hybrid sort for messages : the first 3 messages are the most relevant. This property is only applicable to entityType=message. Optional.



155
156
157
# File 'lib/models/search_request.rb', line 155

def enable_top_results
    return @enable_top_results
end

#enable_top_results=(value) ⇒ Object

Sets the enableTopResults property value. This triggers hybrid sort for messages : the first 3 messages are the most relevant. This property is only applicable to entityType=message. Optional.



163
164
165
# File 'lib/models/search_request.rb', line 163

def enable_top_results=(value)
    @enable_top_results = value
end

#entity_typesObject

Gets the entityTypes property value. One or more types of resources expected in the response. Possible values are: event, message, driveItem, externalItem, site, list, listItem, drive, chatMessage, person, acronym, bookmark. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum:chatMessage, person, acronym, bookmark. See known limitations for those combinations of two or more entity types that are supported in the same search request. Required.



170
171
172
# File 'lib/models/search_request.rb', line 170

def entity_types
    return @entity_types
end

#entity_types=(value) ⇒ Object

Sets the entityTypes property value. One or more types of resources expected in the response. Possible values are: event, message, driveItem, externalItem, site, list, listItem, drive, chatMessage, person, acronym, bookmark. Note that you must use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum:chatMessage, person, acronym, bookmark. See known limitations for those combinations of two or more entity types that are supported in the same search request. Required.



178
179
180
# File 'lib/models/search_request.rb', line 178

def entity_types=(value)
    @entity_types = value
end

#fieldsObject

Gets the fields property value. Contains the fields to be returned for each resource object specified in entityTypes, allowing customization of the fields returned by default; otherwise, including additional fields such as custom managed properties from SharePoint and OneDrive, or custom fields in externalItem from the content that Microsoft Graph connectors bring in. The fields property can use the semantic labels applied to properties. For example, if a property is labeled as title, you can retrieve it using the following syntax: label_title. Optional.



185
186
187
# File 'lib/models/search_request.rb', line 185

def fields
    return @fields
end

#fields=(value) ⇒ Object

Sets the fields property value. Contains the fields to be returned for each resource object specified in entityTypes, allowing customization of the fields returned by default; otherwise, including additional fields such as custom managed properties from SharePoint and OneDrive, or custom fields in externalItem from the content that Microsoft Graph connectors bring in. The fields property can use the semantic labels applied to properties. For example, if a property is labeled as title, you can retrieve it using the following syntax: label_title. Optional.



193
194
195
# File 'lib/models/search_request.rb', line 193

def fields=(value)
    @fields = value
end

#fromObject

Gets the from property value. Specifies the offset for the search results. Offset 0 returns the very first result. Optional.



200
201
202
# File 'lib/models/search_request.rb', line 200

def from
    return @from
end

#from=(value) ⇒ Object

Sets the from property value. Specifies the offset for the search results. Offset 0 returns the very first result. Optional.



208
209
210
# File 'lib/models/search_request.rb', line 208

def from=(value)
    @from = value
end

#get_field_deserializersObject

The deserialization information for the current model



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/models/search_request.rb', line 215

def get_field_deserializers()
    return {
        "aggregationFilters" => lambda {|n| @aggregation_filters = n.get_collection_of_primitive_values(String) },
        "aggregations" => lambda {|n| @aggregations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AggregationOption.create_from_discriminator_value(pn) }) },
        "collapseProperties" => lambda {|n| @collapse_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CollapseProperty.create_from_discriminator_value(pn) }) },
        "contentSources" => lambda {|n| @content_sources = n.get_collection_of_primitive_values(String) },
        "enableTopResults" => lambda {|n| @enable_top_results = n.get_boolean_value() },
        "entityTypes" => lambda {|n| @entity_types = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::EntityType.create_from_discriminator_value(pn) }) },
        "fields" => lambda {|n| @fields = n.get_collection_of_primitive_values(String) },
        "from" => lambda {|n| @from = n.get_number_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "query" => lambda {|n| @query = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SearchQuery.create_from_discriminator_value(pn) }) },
        "queryAlterationOptions" => lambda {|n| @query_alteration_options = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SearchAlterationOptions.create_from_discriminator_value(pn) }) },
        "region" => lambda {|n| @region = n.get_string_value() },
        "resultTemplateOptions" => lambda {|n| @result_template_options = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultTemplateOption.create_from_discriminator_value(pn) }) },
        "sharePointOneDriveOptions" => lambda {|n| @share_point_one_drive_options = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharePointOneDriveOptions.create_from_discriminator_value(pn) }) },
        "size" => lambda {|n| @size = n.get_number_value() },
        "sortProperties" => lambda {|n| @sort_properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SortProperty.create_from_discriminator_value(pn) }) },
    }
end

#odata_typeObject

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



239
240
241
# File 'lib/models/search_request.rb', line 239

def odata_type
    return @odata_type
end

#odata_type=(value) ⇒ Object

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



247
248
249
# File 'lib/models/search_request.rb', line 247

def odata_type=(value)
    @odata_type = value
end

#queryObject

Gets the query property value. The query property



254
255
256
# File 'lib/models/search_request.rb', line 254

def query
    return @query
end

#query=(value) ⇒ Object

Sets the query property value. The query property



262
263
264
# File 'lib/models/search_request.rb', line 262

def query=(value)
    @query = value
end

#query_alteration_optionsObject

Gets the queryAlterationOptions property value. Query alteration options formatted in a JSON blob that contains two optional flags related to spelling correction. Optional.



269
270
271
# File 'lib/models/search_request.rb', line 269

def query_alteration_options
    return @query_alteration_options
end

#query_alteration_options=(value) ⇒ Object

Sets the queryAlterationOptions property value. Query alteration options formatted in a JSON blob that contains two optional flags related to spelling correction. Optional.



277
278
279
# File 'lib/models/search_request.rb', line 277

def query_alteration_options=(value)
    @query_alteration_options = value
end

#regionObject

Gets the region property value. The geographic location for the search. Required for searches that use application permissions. For details, see Get the region value.



284
285
286
# File 'lib/models/search_request.rb', line 284

def region
    return @region
end

#region=(value) ⇒ Object

Sets the region property value. The geographic location for the search. Required for searches that use application permissions. For details, see Get the region value.



292
293
294
# File 'lib/models/search_request.rb', line 292

def region=(value)
    @region = value
end

#result_template_optionsObject

Gets the resultTemplateOptions property value. Provides the search result template options to render search results from connectors.



299
300
301
# File 'lib/models/search_request.rb', line 299

def result_template_options
    return @result_template_options
end

#result_template_options=(value) ⇒ Object

Sets the resultTemplateOptions property value. Provides the search result template options to render search results from connectors.



307
308
309
# File 'lib/models/search_request.rb', line 307

def result_template_options=(value)
    @result_template_options = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Raises:

  • (StandardError)


315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/models/search_request.rb', line 315

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_collection_of_primitive_values("aggregationFilters", @aggregation_filters)
    writer.write_collection_of_object_values("aggregations", @aggregations)
    writer.write_collection_of_object_values("collapseProperties", @collapse_properties)
    writer.write_collection_of_primitive_values("contentSources", @content_sources)
    writer.write_boolean_value("enableTopResults", @enable_top_results)
    writer.write_collection_of_object_values("entityTypes", @entity_types)
    writer.write_collection_of_primitive_values("fields", @fields)
    writer.write_number_value("from", @from)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_object_value("query", @query)
    writer.write_object_value("queryAlterationOptions", @query_alteration_options)
    writer.write_string_value("region", @region)
    writer.write_object_value("resultTemplateOptions", @result_template_options)
    writer.write_object_value("sharePointOneDriveOptions", @share_point_one_drive_options)
    writer.write_number_value("size", @size)
    writer.write_collection_of_object_values("sortProperties", @sort_properties)
    writer.write_additional_data(@additional_data)
end

#share_point_one_drive_optionsObject

Gets the sharePointOneDriveOptions property value. Indicates the kind of contents to be searched when a search is performed using application permissions. Optional.



339
340
341
# File 'lib/models/search_request.rb', line 339

def share_point_one_drive_options
    return @share_point_one_drive_options
end

#share_point_one_drive_options=(value) ⇒ Object

Sets the sharePointOneDriveOptions property value. Indicates the kind of contents to be searched when a search is performed using application permissions. Optional.



347
348
349
# File 'lib/models/search_request.rb', line 347

def share_point_one_drive_options=(value)
    @share_point_one_drive_options = value
end

#sizeObject

Gets the size property value. The size of the page to be retrieved. The maximum value is 500. Optional.



354
355
356
# File 'lib/models/search_request.rb', line 354

def size
    return @size
end

#size=(value) ⇒ Object

Sets the size property value. The size of the page to be retrieved. The maximum value is 500. Optional.



362
363
364
# File 'lib/models/search_request.rb', line 362

def size=(value)
    @size = value
end

#sort_propertiesObject

Gets the sortProperties property value. Contains the ordered collection of fields and direction to sort results. There can be at most 5 sort properties in the collection. Optional.



369
370
371
# File 'lib/models/search_request.rb', line 369

def sort_properties
    return @sort_properties
end

#sort_properties=(value) ⇒ Object

Sets the sortProperties property value. Contains the ordered collection of fields and direction to sort results. There can be at most 5 sort properties in the collection. Optional.



377
378
379
# File 'lib/models/search_request.rb', line 377

def sort_properties=(value)
    @sort_properties = value
end