Class: Google::Apis::CustomsearchV1::CustomSearchAPIService
- Inherits:
-
Google::Apis::Core::BaseService
- Object
- Google::Apis::Core::BaseService
- Google::Apis::CustomsearchV1::CustomSearchAPIService
- Defined in:
- lib/google/apis/customsearch_v1/service.rb
Overview
Custom Search API
Searches over a website or collection of websites
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://customsearch.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#initialize ⇒ CustomSearchAPIService
constructor
A new instance of CustomSearchAPIService.
-
#list_cse_siterestricts(c2coff: nil, cr: nil, cx: nil, date_restrict: nil, enable_alternate_search_handler: nil, exact_terms: nil, exclude_terms: nil, file_type: nil, filter: nil, gl: nil, googlehost: nil, high_range: nil, hl: nil, hq: nil, img_color_type: nil, img_dominant_color: nil, img_size: nil, img_type: nil, link_site: nil, low_range: nil, lr: nil, num: nil, or_terms: nil, q: nil, related_site: nil, rights: nil, safe: nil, search_type: nil, site_search: nil, site_search_filter: nil, snippet_length: nil, sort: nil, start: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CustomsearchV1::Search
Returns metadata about the search performed, metadata about the engine used for the search, and the search results.
-
#list_cses(c2coff: nil, cr: nil, cx: nil, date_restrict: nil, enable_alternate_search_handler: nil, exact_terms: nil, exclude_terms: nil, file_type: nil, filter: nil, gl: nil, googlehost: nil, high_range: nil, hl: nil, hq: nil, img_color_type: nil, img_dominant_color: nil, img_size: nil, img_type: nil, link_site: nil, low_range: nil, lr: nil, num: nil, or_terms: nil, q: nil, related_site: nil, rights: nil, safe: nil, search_type: nil, site_search: nil, site_search_filter: nil, snippet_length: nil, sort: nil, start: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CustomsearchV1::Search
Returns metadata about the search performed, metadata about the engine used for the search, and the search results.
Constructor Details
#initialize ⇒ CustomSearchAPIService
Returns a new instance of CustomSearchAPIService.
47 48 49 50 51 52 |
# File 'lib/google/apis/customsearch_v1/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-customsearch_v1', client_version: Google::Apis::CustomsearchV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
40 41 42 |
# File 'lib/google/apis/customsearch_v1/service.rb', line 40 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
45 46 47 |
# File 'lib/google/apis/customsearch_v1/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#list_cse_siterestricts(c2coff: nil, cr: nil, cx: nil, date_restrict: nil, enable_alternate_search_handler: nil, exact_terms: nil, exclude_terms: nil, file_type: nil, filter: nil, gl: nil, googlehost: nil, high_range: nil, hl: nil, hq: nil, img_color_type: nil, img_dominant_color: nil, img_size: nil, img_type: nil, link_site: nil, low_range: nil, lr: nil, num: nil, or_terms: nil, q: nil, related_site: nil, rights: nil, safe: nil, search_type: nil, site_search: nil, site_search_filter: nil, snippet_length: nil, sort: nil, start: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CustomsearchV1::Search
Returns metadata about the search performed, metadata about the engine used for the search, and the search results. Uses a small set of url patterns.
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
# File 'lib/google/apis/customsearch_v1/service.rb', line 430 def list_cse_siterestricts(c2coff: nil, cr: nil, cx: nil, date_restrict: nil, enable_alternate_search_handler: nil, exact_terms: nil, exclude_terms: nil, file_type: nil, filter: nil, gl: nil, googlehost: nil, high_range: nil, hl: nil, hq: nil, img_color_type: nil, img_dominant_color: nil, img_size: nil, img_type: nil, link_site: nil, low_range: nil, lr: nil, num: nil, or_terms: nil, q: nil, related_site: nil, rights: nil, safe: nil, search_type: nil, site_search: nil, site_search_filter: nil, snippet_length: nil, sort: nil, start: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'customsearch/v1/siterestrict', ) command.response_representation = Google::Apis::CustomsearchV1::Search::Representation command.response_class = Google::Apis::CustomsearchV1::Search command.query['c2coff'] = c2coff unless c2coff.nil? command.query['cr'] = cr unless cr.nil? command.query['cx'] = cx unless cx.nil? command.query['dateRestrict'] = date_restrict unless date_restrict.nil? command.query['enableAlternateSearchHandler'] = enable_alternate_search_handler unless enable_alternate_search_handler.nil? command.query['exactTerms'] = exact_terms unless exact_terms.nil? command.query['excludeTerms'] = exclude_terms unless exclude_terms.nil? command.query['fileType'] = file_type unless file_type.nil? command.query['filter'] = filter unless filter.nil? command.query['gl'] = gl unless gl.nil? command.query['googlehost'] = googlehost unless googlehost.nil? command.query['highRange'] = high_range unless high_range.nil? command.query['hl'] = hl unless hl.nil? command.query['hq'] = hq unless hq.nil? command.query['imgColorType'] = img_color_type unless img_color_type.nil? command.query['imgDominantColor'] = img_dominant_color unless img_dominant_color.nil? command.query['imgSize'] = img_size unless img_size.nil? command.query['imgType'] = img_type unless img_type.nil? command.query['linkSite'] = link_site unless link_site.nil? command.query['lowRange'] = low_range unless low_range.nil? command.query['lr'] = lr unless lr.nil? command.query['num'] = num unless num.nil? command.query['orTerms'] = or_terms unless or_terms.nil? command.query['q'] = q unless q.nil? command.query['relatedSite'] = unless .nil? command.query['rights'] = rights unless rights.nil? command.query['safe'] = safe unless safe.nil? command.query['searchType'] = search_type unless search_type.nil? command.query['siteSearch'] = site_search unless site_search.nil? command.query['siteSearchFilter'] = site_search_filter unless site_search_filter.nil? command.query['snippetLength'] = snippet_length unless snippet_length.nil? command.query['sort'] = sort unless sort.nil? command.query['start'] = start unless start.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_cses(c2coff: nil, cr: nil, cx: nil, date_restrict: nil, enable_alternate_search_handler: nil, exact_terms: nil, exclude_terms: nil, file_type: nil, filter: nil, gl: nil, googlehost: nil, high_range: nil, hl: nil, hq: nil, img_color_type: nil, img_dominant_color: nil, img_size: nil, img_type: nil, link_site: nil, low_range: nil, lr: nil, num: nil, or_terms: nil, q: nil, related_site: nil, rights: nil, safe: nil, search_type: nil, site_search: nil, site_search_filter: nil, snippet_length: nil, sort: nil, start: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CustomsearchV1::Search
Returns metadata about the search performed, metadata about the engine used for the search, and the search results.
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/google/apis/customsearch_v1/service.rb', line 221 def list_cses(c2coff: nil, cr: nil, cx: nil, date_restrict: nil, enable_alternate_search_handler: nil, exact_terms: nil, exclude_terms: nil, file_type: nil, filter: nil, gl: nil, googlehost: nil, high_range: nil, hl: nil, hq: nil, img_color_type: nil, img_dominant_color: nil, img_size: nil, img_type: nil, link_site: nil, low_range: nil, lr: nil, num: nil, or_terms: nil, q: nil, related_site: nil, rights: nil, safe: nil, search_type: nil, site_search: nil, site_search_filter: nil, snippet_length: nil, sort: nil, start: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'customsearch/v1', ) command.response_representation = Google::Apis::CustomsearchV1::Search::Representation command.response_class = Google::Apis::CustomsearchV1::Search command.query['c2coff'] = c2coff unless c2coff.nil? command.query['cr'] = cr unless cr.nil? command.query['cx'] = cx unless cx.nil? command.query['dateRestrict'] = date_restrict unless date_restrict.nil? command.query['enableAlternateSearchHandler'] = enable_alternate_search_handler unless enable_alternate_search_handler.nil? command.query['exactTerms'] = exact_terms unless exact_terms.nil? command.query['excludeTerms'] = exclude_terms unless exclude_terms.nil? command.query['fileType'] = file_type unless file_type.nil? command.query['filter'] = filter unless filter.nil? command.query['gl'] = gl unless gl.nil? command.query['googlehost'] = googlehost unless googlehost.nil? command.query['highRange'] = high_range unless high_range.nil? command.query['hl'] = hl unless hl.nil? command.query['hq'] = hq unless hq.nil? command.query['imgColorType'] = img_color_type unless img_color_type.nil? command.query['imgDominantColor'] = img_dominant_color unless img_dominant_color.nil? command.query['imgSize'] = img_size unless img_size.nil? command.query['imgType'] = img_type unless img_type.nil? command.query['linkSite'] = link_site unless link_site.nil? command.query['lowRange'] = low_range unless low_range.nil? command.query['lr'] = lr unless lr.nil? command.query['num'] = num unless num.nil? command.query['orTerms'] = or_terms unless or_terms.nil? command.query['q'] = q unless q.nil? command.query['relatedSite'] = unless .nil? command.query['rights'] = rights unless rights.nil? command.query['safe'] = safe unless safe.nil? command.query['searchType'] = search_type unless search_type.nil? command.query['siteSearch'] = site_search unless site_search.nil? command.query['siteSearchFilter'] = site_search_filter unless site_search_filter.nil? command.query['snippetLength'] = snippet_length unless snippet_length.nil? command.query['sort'] = sort unless sort.nil? command.query['start'] = start unless start.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |