Class: MicrosoftGraph::Models::SearchHit

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new searchHit and sets the default values.



55
56
57
# File 'lib/models/search_hit.rb', line 55

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 search_hit

Raises:

  • (StandardError)


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

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



40
41
42
# File 'lib/models/search_hit.rb', line 40

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



48
49
50
# File 'lib/models/search_hit.rb', line 48

def additional_data=(value)
    @additional_data = value
end

#content_sourceObject

Gets the contentSource property value. The name of the content source that the externalItem is part of.

Returns:

  • a string



62
63
64
# File 'lib/models/search_hit.rb', line 62

def content_source
    return @content_source
end

#content_source=(value) ⇒ Object

Sets the contentSource property value. The name of the content source that the externalItem is part of.

Parameters:

  • value

    Value to set for the contentSource property.

Returns:

  • a void



70
71
72
# File 'lib/models/search_hit.rb', line 70

def content_source=(value)
    @content_source = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/models/search_hit.rb', line 86

def get_field_deserializers()
    return {
        "contentSource" => lambda {|n| @content_source = n.get_string_value() },
        "hitId" => lambda {|n| @hit_id = n.get_string_value() },
        "isCollapsed" => lambda {|n| @is_collapsed = n.get_boolean_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "rank" => lambda {|n| @rank = n.get_number_value() },
        "resource" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },
        "resultTemplateId" => lambda {|n| @result_template_id = n.get_string_value() },
        "summary" => lambda {|n| @summary = n.get_string_value() },
    }
end

#hit_idObject

Gets the hitId property value. The internal identifier for the item. The format of the identifier varies based on the entity type. For details, see hitId format.

Returns:

  • a string



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

def hit_id
    return @hit_id
end

#hit_id=(value) ⇒ Object

Sets the hitId property value. The internal identifier for the item. The format of the identifier varies based on the entity type. For details, see hitId format.

Parameters:

  • value

    Value to set for the hitId property.

Returns:

  • a void



110
111
112
# File 'lib/models/search_hit.rb', line 110

def hit_id=(value)
    @hit_id = value
end

#is_collapsedObject

Gets the isCollapsed property value. Indicates whether the current result is collapsed when the collapseProperties property in the searchRequest is used.

Returns:

  • a boolean



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

def is_collapsed
    return @is_collapsed
end

#is_collapsed=(value) ⇒ Object

Sets the isCollapsed property value. Indicates whether the current result is collapsed when the collapseProperties property in the searchRequest is used.

Parameters:

  • value

    Value to set for the isCollapsed property.

Returns:

  • a void



125
126
127
# File 'lib/models/search_hit.rb', line 125

def is_collapsed=(value)
    @is_collapsed = value
end

#odata_typeObject

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

Returns:

  • a string



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

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



140
141
142
# File 'lib/models/search_hit.rb', line 140

def odata_type=(value)
    @odata_type = value
end

#rankObject

Gets the rank property value. The rank or the order of the result.

Returns:

  • a integer



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

def rank
    return @rank
end

#rank=(value) ⇒ Object

Sets the rank property value. The rank or the order of the result.

Parameters:

  • value

    Value to set for the rank property.

Returns:

  • a void



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

def rank=(value)
    @rank = value
end

#resourceObject

Gets the resource property value. The resource property

Returns:

  • a entity



162
163
164
# File 'lib/models/search_hit.rb', line 162

def resource
    return @resource
end

#resource=(value) ⇒ Object

Sets the resource property value. The resource property

Parameters:

  • value

    Value to set for the resource property.

Returns:

  • a void



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

def resource=(value)
    @resource = value
end

#result_template_idObject

Gets the resultTemplateId property value. ID of the result template used to render the search result. This ID must map to a display layout in the resultTemplates dictionary that is also included in the searchResponse.

Returns:

  • a string



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

def result_template_id
    return @result_template_id
end

#result_template_id=(value) ⇒ Object

Sets the resultTemplateId property value. ID of the result template used to render the search result. This ID must map to a display layout in the resultTemplates dictionary that is also included in the searchResponse.

Parameters:

  • value

    Value to set for the resultTemplateId property.

Returns:

  • a void



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

def result_template_id=(value)
    @result_template_id = 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)


193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/models/search_hit.rb', line 193

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_string_value("contentSource", @content_source)
    writer.write_string_value("hitId", @hit_id)
    writer.write_boolean_value("isCollapsed", @is_collapsed)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_number_value("rank", @rank)
    writer.write_object_value("resource", @resource)
    writer.write_string_value("resultTemplateId", @result_template_id)
    writer.write_string_value("summary", @summary)
    writer.write_additional_data(@additional_data)
end

#summaryObject

Gets the summary property value. A summary of the result, if a summary is available.

Returns:

  • a string



209
210
211
# File 'lib/models/search_hit.rb', line 209

def summary
    return @summary
end

#summary=(value) ⇒ Object

Sets the summary property value. A summary of the result, if a summary is available.

Parameters:

  • value

    Value to set for the summary property.

Returns:

  • a void



217
218
219
# File 'lib/models/search_hit.rb', line 217

def summary=(value)
    @summary = value
end