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

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/customsearch_v1/classes.rb,
lib/google/apis/customsearch_v1/representations.rb,
lib/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

Constructor Details

#initialize(**args) ⇒ Search

Returns a new instance of Search.



386
387
388
# File 'lib/google/apis/customsearch_v1/classes.rb', line 386

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


346
347
348
# File 'lib/google/apis/customsearch_v1/classes.rb', line 346

def context
  @context
end

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

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



351
352
353
# File 'lib/google/apis/customsearch_v1/classes.rb', line 351

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)


357
358
359
# File 'lib/google/apis/customsearch_v1/classes.rb', line 357

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



364
365
366
# File 'lib/google/apis/customsearch_v1/classes.rb', line 364

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



369
370
371
# File 'lib/google/apis/customsearch_v1/classes.rb', line 369

def queries
  @queries
end

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

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



374
375
376
# File 'lib/google/apis/customsearch_v1/classes.rb', line 374

def search_information
  @search_information
end

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

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



379
380
381
# File 'lib/google/apis/customsearch_v1/classes.rb', line 379

def spelling
  @spelling
end

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

OpenSearch template and URL. Corresponds to the JSON property url



384
385
386
# File 'lib/google/apis/customsearch_v1/classes.rb', line 384

def url
  @url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



391
392
393
394
395
396
397
398
399
400
# File 'lib/google/apis/customsearch_v1/classes.rb', line 391

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