Class: Google::Apis::CustomsearchV1::Result

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/customsearch_v1/classes.rb,
generated/google/apis/customsearch_v1/representations.rb,
generated/google/apis/customsearch_v1/representations.rb

Overview

A custom search result.

Defined Under Namespace

Classes: Image, Label

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Result

Returns a new instance of Result.



230
231
232
# File 'generated/google/apis/customsearch_v1/classes.rb', line 230

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cache_idString

Indicates the ID of Google's cached version of the search result. Corresponds to the JSON property cacheId

Returns:

  • (String)


152
153
154
# File 'generated/google/apis/customsearch_v1/classes.rb', line 152

def cache_id
  @cache_id
end

An abridged version of this search result’s URL, e.g. www.example.com. Corresponds to the JSON property displayLink

Returns:

  • (String)


157
158
159
# File 'generated/google/apis/customsearch_v1/classes.rb', line 157

def display_link
  @display_link
end

#file_formatString

The file format of the search result. Corresponds to the JSON property fileFormat

Returns:

  • (String)


162
163
164
# File 'generated/google/apis/customsearch_v1/classes.rb', line 162

def file_format
  @file_format
end

#formatted_urlString

The URL displayed after the snippet for each search result. Corresponds to the JSON property formattedUrl

Returns:

  • (String)


167
168
169
# File 'generated/google/apis/customsearch_v1/classes.rb', line 167

def formatted_url
  @formatted_url
end

#html_formatted_urlString

The HTML-formatted URL displayed after the snippet for each search result. Corresponds to the JSON property htmlFormattedUrl

Returns:

  • (String)


172
173
174
# File 'generated/google/apis/customsearch_v1/classes.rb', line 172

def html_formatted_url
  @html_formatted_url
end

#html_snippetString

The snippet of the search result, in HTML. Corresponds to the JSON property htmlSnippet

Returns:

  • (String)


177
178
179
# File 'generated/google/apis/customsearch_v1/classes.rb', line 177

def html_snippet
  @html_snippet
end

#html_titleString

The title of the search result, in HTML. Corresponds to the JSON property htmlTitle

Returns:

  • (String)


182
183
184
# File 'generated/google/apis/customsearch_v1/classes.rb', line 182

def html_title
  @html_title
end

#imageGoogle::Apis::CustomsearchV1::Result::Image

Image belonging to a custom search result. Corresponds to the JSON property image



187
188
189
# File 'generated/google/apis/customsearch_v1/classes.rb', line 187

def image
  @image
end

#kindString

A unique identifier for the type of current object. For this API, it is customsearch#result. Corresponds to the JSON property kind

Returns:

  • (String)


193
194
195
# File 'generated/google/apis/customsearch_v1/classes.rb', line 193

def kind
  @kind
end

#labelsArray<Google::Apis::CustomsearchV1::Result::Label>

Encapsulates all information about refinement labels. Corresponds to the JSON property labels



199
200
201
# File 'generated/google/apis/customsearch_v1/classes.rb', line 199

def labels
  @labels
end

The full URL to which the search result is pointing, e.g. http://www.example.com/foo/bar. Corresponds to the JSON property link

Returns:

  • (String)


205
206
207
# File 'generated/google/apis/customsearch_v1/classes.rb', line 205

def link
  @link
end

#mimeString

The MIME type of the search result. Corresponds to the JSON property mime

Returns:

  • (String)


210
211
212
# File 'generated/google/apis/customsearch_v1/classes.rb', line 210

def mime
  @mime
end

#pagemapHash<String,Object>

Contains PageMap information for this search result. Corresponds to the JSON property pagemap

Returns:

  • (Hash<String,Object>)


218
219
220
# File 'generated/google/apis/customsearch_v1/classes.rb', line 218

def pagemap
  @pagemap
end

#snippetString

The snippet of the search result, in plain text. Corresponds to the JSON property snippet

Returns:

  • (String)


223
224
225
# File 'generated/google/apis/customsearch_v1/classes.rb', line 223

def snippet
  @snippet
end

#titleString

The title of the search result, in plain text. Corresponds to the JSON property title

Returns:

  • (String)


228
229
230
# File 'generated/google/apis/customsearch_v1/classes.rb', line 228

def title
  @title
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'generated/google/apis/customsearch_v1/classes.rb', line 235

def update!(**args)
  @cache_id = args[:cache_id] if args.key?(:cache_id)
  @display_link = args[:display_link] if args.key?(:display_link)
  @file_format = args[:file_format] if args.key?(:file_format)
  @formatted_url = args[:formatted_url] if args.key?(:formatted_url)
  @html_formatted_url = args[:html_formatted_url] if args.key?(:html_formatted_url)
  @html_snippet = args[:html_snippet] if args.key?(:html_snippet)
  @html_title = args[:html_title] if args.key?(:html_title)
  @image = args[:image] if args.key?(:image)
  @kind = args[:kind] if args.key?(:kind)
  @labels = args[:labels] if args.key?(:labels)
  @link = args[:link] if args.key?(:link)
  @mime = args[:mime] if args.key?(:mime)
  @pagemap = args[:pagemap] if args.key?(:pagemap)
  @snippet = args[:snippet] if args.key?(:snippet)
  @title = args[:title] if args.key?(:title)
end