Class: Google::Apis::CustomsearchV1::Search

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

Response to a custom search request.

Defined Under Namespace

Classes: Queries, SearchInformation, Spelling, Url

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) ⇒ Search

Returns a new instance of Search.



395
396
397
# File 'generated/google/apis/customsearch_v1/classes.rb', line 395

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

Instance Attribute Details

#contextHash<String,Object>

Metadata and refinements associated with the given search engine, including:

  • The name of the search engine that was used for the query.
  • A set of facet objects (refinements) you can use for refining a search. Corresponds to the JSON property context

Returns:

  • (Hash<String,Object>)


354
355
356
# File 'generated/google/apis/customsearch_v1/classes.rb', line 354

def context
  @context
end

#itemsArray<Google::Apis::CustomsearchV1::Result>

The current set of custom search results. Corresponds to the JSON property items



359
360
361
# File 'generated/google/apis/customsearch_v1/classes.rb', line 359

def items
  @items
end

#kindString

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

Returns:

  • (String)


365
366
367
# File 'generated/google/apis/customsearch_v1/classes.rb', line 365

def kind
  @kind
end

#promotionsArray<Google::Apis::CustomsearchV1::Promotion>

The set of promotions. Present only if the custom search engine's configuration files define any promotions for the given query. Corresponds to the JSON property promotions



373
374
375
# File 'generated/google/apis/customsearch_v1/classes.rb', line 373

def promotions
  @promotions
end

#queriesGoogle::Apis::CustomsearchV1::Search::Queries

Query metadata for the previous, current, and next pages of results. Corresponds to the JSON property queries



378
379
380
# File 'generated/google/apis/customsearch_v1/classes.rb', line 378

def queries
  @queries
end

#search_informationGoogle::Apis::CustomsearchV1::Search::SearchInformation

Metadata about a search operation. Corresponds to the JSON property searchInformation



383
384
385
# File 'generated/google/apis/customsearch_v1/classes.rb', line 383

def search_information
  @search_information
end

#spellingGoogle::Apis::CustomsearchV1::Search::Spelling

Spell correction information for a query. Corresponds to the JSON property spelling



388
389
390
# File 'generated/google/apis/customsearch_v1/classes.rb', line 388

def spelling
  @spelling
end

#urlGoogle::Apis::CustomsearchV1::Search::Url

OpenSearch template and URL. Corresponds to the JSON property url



393
394
395
# File 'generated/google/apis/customsearch_v1/classes.rb', line 393

def url
  @url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



400
401
402
403
404
405
406
407
408
409
# File 'generated/google/apis/customsearch_v1/classes.rb', line 400

def update!(**args)
  @context = args[:context] if args.key?(:context)
  @items = args[:items] if args.key?(:items)
  @kind = args[:kind] if args.key?(:kind)
  @promotions = args[:promotions] if args.key?(:promotions)
  @queries = args[:queries] if args.key?(:queries)
  @search_information = args[:search_information] if args.key?(:search_information)
  @spelling = args[:spelling] if args.key?(:spelling)
  @url = args[:url] if args.key?(:url)
end