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

Constructor Details

#initialize(**args) ⇒ Search

Returns a new instance of Search.



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

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


349
350
351
# File 'generated/google/apis/customsearch_v1/classes.rb', line 349

def context
  @context
end

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

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



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

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)


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

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



367
368
369
# File 'generated/google/apis/customsearch_v1/classes.rb', line 367

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



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

def queries
  @queries
end

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

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



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

def search_information
  @search_information
end

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

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



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

def spelling
  @spelling
end

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

OpenSearch template and URL. Corresponds to the JSON property url



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

def url
  @url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



394
395
396
397
398
399
400
401
402
403
# File 'generated/google/apis/customsearch_v1/classes.rb', line 394

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