1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package customsearch provides access to the Custom Search API. 8// 9// For product documentation, see: https://developers.google.com/custom-search/v1/introduction 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/customsearch/v1" 16// ... 17// ctx := context.Background() 18// customsearchService, err := customsearch.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// customsearchService, err := customsearch.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// customsearchService, err := customsearch.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package customsearch // import "google.golang.org/api/customsearch/v1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "customsearch:v1" 75const apiName = "customsearch" 76const apiVersion = "v1" 77const basePath = "https://customsearch.googleapis.com/" 78const mtlsBasePath = "https://customsearch.mtls.googleapis.com/" 79 80// NewService creates a new Service. 81func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 82 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 83 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 84 client, endpoint, err := htransport.NewClient(ctx, opts...) 85 if err != nil { 86 return nil, err 87 } 88 s, err := New(client) 89 if err != nil { 90 return nil, err 91 } 92 if endpoint != "" { 93 s.BasePath = endpoint 94 } 95 return s, nil 96} 97 98// New creates a new Service. It uses the provided http.Client for requests. 99// 100// Deprecated: please use NewService instead. 101// To provide a custom HTTP client, use option.WithHTTPClient. 102// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 103func New(client *http.Client) (*Service, error) { 104 if client == nil { 105 return nil, errors.New("client is nil") 106 } 107 s := &Service{client: client, BasePath: basePath} 108 s.Cse = NewCseService(s) 109 return s, nil 110} 111 112type Service struct { 113 client *http.Client 114 BasePath string // API endpoint base URL 115 UserAgent string // optional additional User-Agent fragment 116 117 Cse *CseService 118} 119 120func (s *Service) userAgent() string { 121 if s.UserAgent == "" { 122 return googleapi.UserAgent 123 } 124 return googleapi.UserAgent + " " + s.UserAgent 125} 126 127func NewCseService(s *Service) *CseService { 128 rs := &CseService{s: s} 129 rs.Siterestrict = NewCseSiterestrictService(s) 130 return rs 131} 132 133type CseService struct { 134 s *Service 135 136 Siterestrict *CseSiterestrictService 137} 138 139func NewCseSiterestrictService(s *Service) *CseSiterestrictService { 140 rs := &CseSiterestrictService{s: s} 141 return rs 142} 143 144type CseSiterestrictService struct { 145 s *Service 146} 147 148// Promotion: Promotion result. 149type Promotion struct { 150 // BodyLines: An array of block objects for this promotion. See Google 151 // WebSearch Protocol reference 152 // (https://developers.google.com/custom-search/docs/xml_results) for 153 // more information. 154 BodyLines []*PromotionBodyLines `json:"bodyLines,omitempty"` 155 156 // DisplayLink: An abridged version of this search's result URL, e.g. 157 // www.example.com. 158 DisplayLink string `json:"displayLink,omitempty"` 159 160 // HtmlTitle: The title of the promotion, in HTML. 161 HtmlTitle string `json:"htmlTitle,omitempty"` 162 163 // Image: Image belonging to a promotion. 164 Image *PromotionImage `json:"image,omitempty"` 165 166 // Link: The URL of the promotion. 167 Link string `json:"link,omitempty"` 168 169 // Title: The title of the promotion. 170 Title string `json:"title,omitempty"` 171 172 // ForceSendFields is a list of field names (e.g. "BodyLines") to 173 // unconditionally include in API requests. By default, fields with 174 // empty or default values are omitted from API requests. However, any 175 // non-pointer, non-interface field appearing in ForceSendFields will be 176 // sent to the server regardless of whether the field is empty or not. 177 // This may be used to include empty fields in Patch requests. 178 ForceSendFields []string `json:"-"` 179 180 // NullFields is a list of field names (e.g. "BodyLines") to include in 181 // API requests with the JSON null value. By default, fields with empty 182 // values are omitted from API requests. However, any field with an 183 // empty value appearing in NullFields will be sent to the server as 184 // null. It is an error if a field in this list has a non-empty value. 185 // This may be used to include null fields in Patch requests. 186 NullFields []string `json:"-"` 187} 188 189func (s *Promotion) MarshalJSON() ([]byte, error) { 190 type NoMethod Promotion 191 raw := NoMethod(*s) 192 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 193} 194 195// PromotionBodyLines: Block object belonging to a promotion. 196type PromotionBodyLines struct { 197 // HtmlTitle: The block object's text in HTML, if it has text. 198 HtmlTitle string `json:"htmlTitle,omitempty"` 199 200 // Link: The anchor text of the block object's link, if it has a link. 201 Link string `json:"link,omitempty"` 202 203 // Title: The block object's text, if it has text. 204 Title string `json:"title,omitempty"` 205 206 // Url: The URL of the block object's link, if it has one. 207 Url string `json:"url,omitempty"` 208 209 // ForceSendFields is a list of field names (e.g. "HtmlTitle") to 210 // unconditionally include in API requests. By default, fields with 211 // empty or default values are omitted from API requests. However, any 212 // non-pointer, non-interface field appearing in ForceSendFields will be 213 // sent to the server regardless of whether the field is empty or not. 214 // This may be used to include empty fields in Patch requests. 215 ForceSendFields []string `json:"-"` 216 217 // NullFields is a list of field names (e.g. "HtmlTitle") to include in 218 // API requests with the JSON null value. By default, fields with empty 219 // values are omitted from API requests. However, any field with an 220 // empty value appearing in NullFields will be sent to the server as 221 // null. It is an error if a field in this list has a non-empty value. 222 // This may be used to include null fields in Patch requests. 223 NullFields []string `json:"-"` 224} 225 226func (s *PromotionBodyLines) MarshalJSON() ([]byte, error) { 227 type NoMethod PromotionBodyLines 228 raw := NoMethod(*s) 229 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 230} 231 232// PromotionImage: Image belonging to a promotion. 233type PromotionImage struct { 234 // Height: Image height in pixels. 235 Height int64 `json:"height,omitempty"` 236 237 // Source: URL of the image for this promotion link. 238 Source string `json:"source,omitempty"` 239 240 // Width: Image width in pixels. 241 Width int64 `json:"width,omitempty"` 242 243 // ForceSendFields is a list of field names (e.g. "Height") to 244 // unconditionally include in API requests. By default, fields with 245 // empty or default values are omitted from API requests. However, any 246 // non-pointer, non-interface field appearing in ForceSendFields will be 247 // sent to the server regardless of whether the field is empty or not. 248 // This may be used to include empty fields in Patch requests. 249 ForceSendFields []string `json:"-"` 250 251 // NullFields is a list of field names (e.g. "Height") to include in API 252 // requests with the JSON null value. By default, fields with empty 253 // values are omitted from API requests. However, any field with an 254 // empty value appearing in NullFields will be sent to the server as 255 // null. It is an error if a field in this list has a non-empty value. 256 // This may be used to include null fields in Patch requests. 257 NullFields []string `json:"-"` 258} 259 260func (s *PromotionImage) MarshalJSON() ([]byte, error) { 261 type NoMethod PromotionImage 262 raw := NoMethod(*s) 263 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 264} 265 266// Result: A custom search result. 267type Result struct { 268 // CacheId: Indicates the ID of Google's cached version of the search 269 // result. 270 CacheId string `json:"cacheId,omitempty"` 271 272 // DisplayLink: An abridged version of this search result’s URL, e.g. 273 // www.example.com. 274 DisplayLink string `json:"displayLink,omitempty"` 275 276 // FileFormat: The file format of the search result. 277 FileFormat string `json:"fileFormat,omitempty"` 278 279 // FormattedUrl: The URL displayed after the snippet for each search 280 // result. 281 FormattedUrl string `json:"formattedUrl,omitempty"` 282 283 // HtmlFormattedUrl: The HTML-formatted URL displayed after the snippet 284 // for each search result. 285 HtmlFormattedUrl string `json:"htmlFormattedUrl,omitempty"` 286 287 // HtmlSnippet: The snippet of the search result, in HTML. 288 HtmlSnippet string `json:"htmlSnippet,omitempty"` 289 290 // HtmlTitle: The title of the search result, in HTML. 291 HtmlTitle string `json:"htmlTitle,omitempty"` 292 293 // Image: Image belonging to a custom search result. 294 Image *ResultImage `json:"image,omitempty"` 295 296 // Kind: A unique identifier for the type of current object. For this 297 // API, it is `customsearch#result.` 298 Kind string `json:"kind,omitempty"` 299 300 // Labels: Encapsulates all information about refinement labels 301 // (https://developers.google.com/custom-search/docs/xml_results). 302 Labels []*ResultLabels `json:"labels,omitempty"` 303 304 // Link: The full URL to which the search result is pointing, e.g. 305 // http://www.example.com/foo/bar. 306 Link string `json:"link,omitempty"` 307 308 // Mime: The MIME type of the search result. 309 Mime string `json:"mime,omitempty"` 310 311 // Pagemap: Contains PageMap 312 // (https://developers.google.com/custom-search/docs/structured_data#pagemaps) 313 // information for this search result. 314 Pagemap googleapi.RawMessage `json:"pagemap,omitempty"` 315 316 // Snippet: The snippet of the search result, in plain text. 317 Snippet string `json:"snippet,omitempty"` 318 319 // Title: The title of the search result, in plain text. 320 Title string `json:"title,omitempty"` 321 322 // ForceSendFields is a list of field names (e.g. "CacheId") to 323 // unconditionally include in API requests. By default, fields with 324 // empty or default values are omitted from API requests. However, any 325 // non-pointer, non-interface field appearing in ForceSendFields will be 326 // sent to the server regardless of whether the field is empty or not. 327 // This may be used to include empty fields in Patch requests. 328 ForceSendFields []string `json:"-"` 329 330 // NullFields is a list of field names (e.g. "CacheId") to include in 331 // API requests with the JSON null value. By default, fields with empty 332 // values are omitted from API requests. However, any field with an 333 // empty value appearing in NullFields will be sent to the server as 334 // null. It is an error if a field in this list has a non-empty value. 335 // This may be used to include null fields in Patch requests. 336 NullFields []string `json:"-"` 337} 338 339func (s *Result) MarshalJSON() ([]byte, error) { 340 type NoMethod Result 341 raw := NoMethod(*s) 342 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 343} 344 345// ResultImage: Image belonging to a custom search result. 346type ResultImage struct { 347 // ByteSize: The size of the image, in pixels. 348 ByteSize int64 `json:"byteSize,omitempty"` 349 350 // ContextLink: A URL pointing to the webpage hosting the image. 351 ContextLink string `json:"contextLink,omitempty"` 352 353 // Height: The height of the image, in pixels. 354 Height int64 `json:"height,omitempty"` 355 356 // ThumbnailHeight: The height of the thumbnail image, in pixels. 357 ThumbnailHeight int64 `json:"thumbnailHeight,omitempty"` 358 359 // ThumbnailLink: A URL to the thumbnail image. 360 ThumbnailLink string `json:"thumbnailLink,omitempty"` 361 362 // ThumbnailWidth: The width of the thumbnail image, in pixels. 363 ThumbnailWidth int64 `json:"thumbnailWidth,omitempty"` 364 365 // Width: The width of the image, in pixels. 366 Width int64 `json:"width,omitempty"` 367 368 // ForceSendFields is a list of field names (e.g. "ByteSize") to 369 // unconditionally include in API requests. By default, fields with 370 // empty or default values are omitted from API requests. However, any 371 // non-pointer, non-interface field appearing in ForceSendFields will be 372 // sent to the server regardless of whether the field is empty or not. 373 // This may be used to include empty fields in Patch requests. 374 ForceSendFields []string `json:"-"` 375 376 // NullFields is a list of field names (e.g. "ByteSize") to include in 377 // API requests with the JSON null value. By default, fields with empty 378 // values are omitted from API requests. However, any field with an 379 // empty value appearing in NullFields will be sent to the server as 380 // null. It is an error if a field in this list has a non-empty value. 381 // This may be used to include null fields in Patch requests. 382 NullFields []string `json:"-"` 383} 384 385func (s *ResultImage) MarshalJSON() ([]byte, error) { 386 type NoMethod ResultImage 387 raw := NoMethod(*s) 388 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 389} 390 391// ResultLabels: Refinement label associated with a custom search 392// result. 393type ResultLabels struct { 394 // DisplayName: The display name of a refinement label. This is the name 395 // you should display in your user interface. 396 DisplayName string `json:"displayName,omitempty"` 397 398 // LabelWithOp: Refinement label and the associated refinement 399 // operation. 400 LabelWithOp string `json:"label_with_op,omitempty"` 401 402 // Name: The name of a refinement label, which you can use to refine 403 // searches. Don't display this in your user interface; instead, use 404 // displayName. 405 Name string `json:"name,omitempty"` 406 407 // ForceSendFields is a list of field names (e.g. "DisplayName") to 408 // unconditionally include in API requests. By default, fields with 409 // empty or default values are omitted from API requests. However, any 410 // non-pointer, non-interface field appearing in ForceSendFields will be 411 // sent to the server regardless of whether the field is empty or not. 412 // This may be used to include empty fields in Patch requests. 413 ForceSendFields []string `json:"-"` 414 415 // NullFields is a list of field names (e.g. "DisplayName") to include 416 // in API requests with the JSON null value. By default, fields with 417 // empty values are omitted from API requests. However, any field with 418 // an empty value appearing in NullFields will be sent to the server as 419 // null. It is an error if a field in this list has a non-empty value. 420 // This may be used to include null fields in Patch requests. 421 NullFields []string `json:"-"` 422} 423 424func (s *ResultLabels) MarshalJSON() ([]byte, error) { 425 type NoMethod ResultLabels 426 raw := NoMethod(*s) 427 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 428} 429 430// Search: Response to a custom search request. 431type Search struct { 432 // Context: Metadata and refinements associated with the given search 433 // engine, including: * The name of the search engine that was used for 434 // the query. * A set of facet objects 435 // (https://developers.google.com/custom-search/docs/refinements#create) 436 // (refinements) you can use for refining a search. 437 Context googleapi.RawMessage `json:"context,omitempty"` 438 439 // Items: The current set of custom search results. 440 Items []*Result `json:"items,omitempty"` 441 442 // Kind: Unique identifier for the type of current object. For this API, 443 // it is customsearch#search. 444 Kind string `json:"kind,omitempty"` 445 446 // Promotions: The set of promotions 447 // (https://developers.google.com/custom-search/docs/promotions). 448 // Present only if the custom search engine's configuration files define 449 // any promotions for the given query. 450 Promotions []*Promotion `json:"promotions,omitempty"` 451 452 // Queries: Query metadata for the previous, current, and next pages of 453 // results. 454 Queries *SearchQueries `json:"queries,omitempty"` 455 456 // SearchInformation: Metadata about a search operation. 457 SearchInformation *SearchSearchInformation `json:"searchInformation,omitempty"` 458 459 // Spelling: Spell correction information for a query. 460 Spelling *SearchSpelling `json:"spelling,omitempty"` 461 462 // Url: OpenSearch template and URL. 463 Url *SearchUrl `json:"url,omitempty"` 464 465 // ServerResponse contains the HTTP response code and headers from the 466 // server. 467 googleapi.ServerResponse `json:"-"` 468 469 // ForceSendFields is a list of field names (e.g. "Context") to 470 // unconditionally include in API requests. By default, fields with 471 // empty or default values are omitted from API requests. However, any 472 // non-pointer, non-interface field appearing in ForceSendFields will be 473 // sent to the server regardless of whether the field is empty or not. 474 // This may be used to include empty fields in Patch requests. 475 ForceSendFields []string `json:"-"` 476 477 // NullFields is a list of field names (e.g. "Context") to include in 478 // API requests with the JSON null value. By default, fields with empty 479 // values are omitted from API requests. However, any field with an 480 // empty value appearing in NullFields will be sent to the server as 481 // null. It is an error if a field in this list has a non-empty value. 482 // This may be used to include null fields in Patch requests. 483 NullFields []string `json:"-"` 484} 485 486func (s *Search) MarshalJSON() ([]byte, error) { 487 type NoMethod Search 488 raw := NoMethod(*s) 489 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 490} 491 492// SearchQueries: Query metadata for the previous, current, and next 493// pages of results. 494type SearchQueries struct { 495 // NextPage: Metadata representing the next page of results, if 496 // applicable. 497 NextPage []*SearchQueriesNextPage `json:"nextPage,omitempty"` 498 499 // PreviousPage: Metadata representing the previous page of results, if 500 // applicable. 501 PreviousPage []*SearchQueriesPreviousPage `json:"previousPage,omitempty"` 502 503 // Request: Metadata representing the current request. 504 Request []*SearchQueriesRequest `json:"request,omitempty"` 505 506 // ForceSendFields is a list of field names (e.g. "NextPage") to 507 // unconditionally include in API requests. By default, fields with 508 // empty or default values are omitted from API requests. However, any 509 // non-pointer, non-interface field appearing in ForceSendFields will be 510 // sent to the server regardless of whether the field is empty or not. 511 // This may be used to include empty fields in Patch requests. 512 ForceSendFields []string `json:"-"` 513 514 // NullFields is a list of field names (e.g. "NextPage") to include in 515 // API requests with the JSON null value. By default, fields with empty 516 // values are omitted from API requests. However, any field with an 517 // empty value appearing in NullFields will be sent to the server as 518 // null. It is an error if a field in this list has a non-empty value. 519 // This may be used to include null fields in Patch requests. 520 NullFields []string `json:"-"` 521} 522 523func (s *SearchQueries) MarshalJSON() ([]byte, error) { 524 type NoMethod SearchQueries 525 raw := NoMethod(*s) 526 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 527} 528 529// SearchQueriesNextPage: Custom search request metadata. 530type SearchQueriesNextPage struct { 531 // Count: Number of search results returned in this set. 532 Count int64 `json:"count,omitempty"` 533 534 // Cr: Restricts search results to documents originating in a particular 535 // country. You may use Boolean operators 536 // (https://developers.google.com/custom-search/docs/xml_results#booleanOperators) 537 // in the `cr` parameter's value. Google WebSearch determines the 538 // country of a document by analyzing the following: * The top-level 539 // domain (TLD) of the document's URL. * The geographic location of the 540 // web server's IP address. See Country (cr) Parameter Values 541 // (https://developers.google.com/custom-search/docs/xml_results#countryCollections) 542 // for a list of valid values for this parameter. 543 Cr string `json:"cr,omitempty"` 544 545 // Cx: The identifier of an engine created using the Programmable Search 546 // Engine Control Panel (https://programmablesearchengine.google.com/). 547 // This is a custom property not defined in the OpenSearch spec. This 548 // parameter is **required**. 549 Cx string `json:"cx,omitempty"` 550 551 // DateRestrict: Restricts results to URLs based on date. Supported 552 // values include: * `d[number]`: requests results from the specified 553 // number of past days. * `w[number]`: requests results from the 554 // specified number of past weeks. * `m[number]`: requests results from 555 // the specified number of past months. * `y[number]`: requests results 556 // from the specified number of past years. 557 DateRestrict string `json:"dateRestrict,omitempty"` 558 559 // DisableCnTwTranslation: Enables or disables the Simplified and 560 // Traditional Chinese Search 561 // (https://developers.google.com/custom-search/docs/xml_results#chineseSearch) 562 // feature. Supported values are: * `0`: enabled (default) * `1`: 563 // disabled 564 DisableCnTwTranslation string `json:"disableCnTwTranslation,omitempty"` 565 566 // ExactTerms: Identifies a phrase that all documents in the search 567 // results must contain. 568 ExactTerms string `json:"exactTerms,omitempty"` 569 570 // ExcludeTerms: Identifies a word or phrase that should not appear in 571 // any documents in the search results. 572 ExcludeTerms string `json:"excludeTerms,omitempty"` 573 574 // FileType: Restricts results to files of a specified extension. 575 // Filetypes supported by Google include: * Adobe Portable Document 576 // Format (`pdf`) * Adobe PostScript (`ps`) * Lotus 1-2-3 (`wk1`, `wk2`, 577 // `wk3`, `wk4`, `wk5`, `wki`, `wks`, `wku`) * Lotus WordPro (`lwp`) * 578 // Macwrite (`mw`) * Microsoft Excel (`xls`) * Microsoft PowerPoint 579 // (`ppt`) * Microsoft Word (`doc`) * Microsoft Works (`wks`, `wps`, 580 // `wdb`) * Microsoft Write (`wri`) * Rich Text Format (`rtf`) * 581 // Shockwave Flash (`swf`) * Text (`ans`, `txt`). Additional filetypes 582 // may be added in the future. An up-to-date list can always be found in 583 // Google's file type FAQ 584 // (https://support.google.com/webmasters/answer/35287). 585 FileType string `json:"fileType,omitempty"` 586 587 // Filter: Activates or deactivates the automatic filtering of Google 588 // search results. See Automatic Filtering 589 // (https://developers.google.com/custom-search/docs/xml_results#automaticFiltering) 590 // for more information about Google's search results filters. Valid 591 // values for this parameter are: * `0`: Disabled * `1`: Enabled 592 // (default) **Note**: By default, Google applies filtering to all 593 // search results to improve the quality of those results. 594 Filter string `json:"filter,omitempty"` 595 596 // Gl: Boosts search results whose country of origin matches the 597 // parameter value. See Country Codes 598 // (https://developers.google.com/custom-search/docs/xml_results#countryCodes) 599 // for a list of valid values. Specifying a `gl` parameter value in 600 // WebSearch requests should improve the relevance of results. This is 601 // particularly true for international customers and, even more 602 // specifically, for customers in English-speaking countries other than 603 // the United States. 604 Gl string `json:"gl,omitempty"` 605 606 // GoogleHost: Specifies the Google domain (for example, google.com, 607 // google.de, or google.fr) to which the search should be limited. 608 GoogleHost string `json:"googleHost,omitempty"` 609 610 // HighRange: Specifies the ending value for a search range. Use 611 // `cse:lowRange` and `cse:highrange` to append an inclusive search 612 // range of `lowRange...highRange` to the query. 613 HighRange string `json:"highRange,omitempty"` 614 615 // Hl: Specifies the interface language (host language) of your user 616 // interface. Explicitly setting this parameter improves the performance 617 // and the quality of your search results. See the Interface Languages 618 // (https://developers.google.com/custom-search/docs/xml_results#wsInterfaceLanguages) 619 // section of Internationalizing Queries and Results Presentation 620 // (https://developers.google.com/custom-search/docs/xml_results#wsInternationalizing) 621 // for more information, and Supported Interface Languages 622 // (https://developers.google.com/custom-search/docs/xml_results_appendices#interfaceLanguages) 623 // for a list of supported languages. 624 Hl string `json:"hl,omitempty"` 625 626 // Hq: Appends the specified query terms to the query, as if they were 627 // combined with a logical `AND` operator. 628 Hq string `json:"hq,omitempty"` 629 630 // ImgColorType: Restricts results to images of a specified color type. 631 // Supported values are: * `mono` (black and white) * `gray` (grayscale) 632 // * `color` (color) 633 ImgColorType string `json:"imgColorType,omitempty"` 634 635 // ImgDominantColor: Restricts results to images with a specific 636 // dominant color. Supported values are: * `red` * `orange` * `yellow` * 637 // `green` * `teal` * `blue` * `purple` * `pink` * `white` * `gray` * 638 // `black` * `brown` 639 ImgDominantColor string `json:"imgDominantColor,omitempty"` 640 641 // ImgSize: Restricts results to images of a specified size. Supported 642 // values are: * `icon` (small) * `small | medium | large | xlarge` 643 // (medium) * `xxlarge` (large) * `huge` (extra-large) 644 ImgSize string `json:"imgSize,omitempty"` 645 646 // ImgType: Restricts results to images of a specified type. Supported 647 // values are: * `clipart` (Clip art) * `face` (Face) * `lineart` (Line 648 // drawing) * `photo` (Photo) * `animated` (Animated) * `stock` (Stock) 649 ImgType string `json:"imgType,omitempty"` 650 651 // InputEncoding: The character encoding supported for search requests. 652 InputEncoding string `json:"inputEncoding,omitempty"` 653 654 // Language: The language of the search results. 655 Language string `json:"language,omitempty"` 656 657 // LinkSite: Specifies that all results should contain a link to a 658 // specific URL. 659 LinkSite string `json:"linkSite,omitempty"` 660 661 // LowRange: Specifies the starting value for a search range. Use 662 // `cse:lowRange` and `cse:highrange` to append an inclusive search 663 // range of `lowRange...highRange` to the query. 664 LowRange string `json:"lowRange,omitempty"` 665 666 // OrTerms: Provides additional search terms to check for in a document, 667 // where each document in the search results must contain at least one 668 // of the additional search terms. You can also use the Boolean OR 669 // (https://developers.google.com/custom-search/docs/xml_results#BooleanOrqt) 670 // query term for this type of query. 671 OrTerms string `json:"orTerms,omitempty"` 672 673 // OutputEncoding: The character encoding supported for search results. 674 OutputEncoding string `json:"outputEncoding,omitempty"` 675 676 // RelatedSite: Specifies that all search results should be pages that 677 // are related to the specified URL. The parameter value should be a 678 // URL. 679 RelatedSite string `json:"relatedSite,omitempty"` 680 681 // Rights: Filters based on licensing. Supported values include: * 682 // `cc_publicdomain` * `cc_attribute` * `cc_sharealike` * 683 // `cc_noncommercial` * `cc_nonderived` 684 Rights string `json:"rights,omitempty"` 685 686 // Safe: Specifies the SafeSearch level 687 // (https://developers.google.com/custom-search/docs/xml_results#safeSearchLevels) 688 // used for filtering out adult results. This is a custom property not 689 // defined in the OpenSearch spec. Valid parameter values are: * 690 // "off": Disable SafeSearch * "active": Enable SafeSearch 691 Safe string `json:"safe,omitempty"` 692 693 // SearchTerms: The search terms entered by the user. 694 SearchTerms string `json:"searchTerms,omitempty"` 695 696 // SearchType: Allowed values are `web` or `image`. If unspecified, 697 // results are limited to webpages. 698 SearchType string `json:"searchType,omitempty"` 699 700 // SiteSearch: Restricts results to URLs from a specified site. 701 SiteSearch string `json:"siteSearch,omitempty"` 702 703 // SiteSearchFilter: Specifies whether to include or exclude results 704 // from the site named in the `sitesearch` parameter. Supported values 705 // are: * `i`: include content from site * `e`: exclude content from 706 // site 707 SiteSearchFilter string `json:"siteSearchFilter,omitempty"` 708 709 // Sort: Specifies that results should be sorted according to the 710 // specified expression. For example, sort by date. 711 Sort string `json:"sort,omitempty"` 712 713 // StartIndex: The index of the current set of search results into the 714 // total set of results, where the index of the first result is 1. 715 StartIndex int64 `json:"startIndex,omitempty"` 716 717 // StartPage: The page number of this set of results, where the page 718 // length is set by the `count` property. 719 StartPage int64 `json:"startPage,omitempty"` 720 721 // Title: A description of the query. 722 Title string `json:"title,omitempty"` 723 724 // TotalResults: Estimated number of total search results. May not be 725 // accurate. 726 TotalResults int64 `json:"totalResults,omitempty,string"` 727 728 // ForceSendFields is a list of field names (e.g. "Count") to 729 // unconditionally include in API requests. By default, fields with 730 // empty or default values are omitted from API requests. However, any 731 // non-pointer, non-interface field appearing in ForceSendFields will be 732 // sent to the server regardless of whether the field is empty or not. 733 // This may be used to include empty fields in Patch requests. 734 ForceSendFields []string `json:"-"` 735 736 // NullFields is a list of field names (e.g. "Count") to include in API 737 // requests with the JSON null value. By default, fields with empty 738 // values are omitted from API requests. However, any field with an 739 // empty value appearing in NullFields will be sent to the server as 740 // null. It is an error if a field in this list has a non-empty value. 741 // This may be used to include null fields in Patch requests. 742 NullFields []string `json:"-"` 743} 744 745func (s *SearchQueriesNextPage) MarshalJSON() ([]byte, error) { 746 type NoMethod SearchQueriesNextPage 747 raw := NoMethod(*s) 748 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 749} 750 751// SearchQueriesPreviousPage: Custom search request metadata. 752type SearchQueriesPreviousPage struct { 753 // Count: Number of search results returned in this set. 754 Count int64 `json:"count,omitempty"` 755 756 // Cr: Restricts search results to documents originating in a particular 757 // country. You may use Boolean operators 758 // (https://developers.google.com/custom-search/docs/xml_results#booleanOperators) 759 // in the `cr` parameter's value. Google WebSearch determines the 760 // country of a document by analyzing the following: * The top-level 761 // domain (TLD) of the document's URL. * The geographic location of the 762 // web server's IP address. See Country (cr) Parameter Values 763 // (https://developers.google.com/custom-search/docs/xml_results#countryCollections) 764 // for a list of valid values for this parameter. 765 Cr string `json:"cr,omitempty"` 766 767 // Cx: The identifier of an engine created using the Programmable Search 768 // Engine Control Panel (https://programmablesearchengine.google.com/). 769 // This is a custom property not defined in the OpenSearch spec. This 770 // parameter is **required**. 771 Cx string `json:"cx,omitempty"` 772 773 // DateRestrict: Restricts results to URLs based on date. Supported 774 // values include: * `d[number]`: requests results from the specified 775 // number of past days. * `w[number]`: requests results from the 776 // specified number of past weeks. * `m[number]`: requests results from 777 // the specified number of past months. * `y[number]`: requests results 778 // from the specified number of past years. 779 DateRestrict string `json:"dateRestrict,omitempty"` 780 781 // DisableCnTwTranslation: Enables or disables the Simplified and 782 // Traditional Chinese Search 783 // (https://developers.google.com/custom-search/docs/xml_results#chineseSearch) 784 // feature. Supported values are: * `0`: enabled (default) * `1`: 785 // disabled 786 DisableCnTwTranslation string `json:"disableCnTwTranslation,omitempty"` 787 788 // ExactTerms: Identifies a phrase that all documents in the search 789 // results must contain. 790 ExactTerms string `json:"exactTerms,omitempty"` 791 792 // ExcludeTerms: Identifies a word or phrase that should not appear in 793 // any documents in the search results. 794 ExcludeTerms string `json:"excludeTerms,omitempty"` 795 796 // FileType: Restricts results to files of a specified extension. 797 // Filetypes supported by Google include: * Adobe Portable Document 798 // Format (`pdf`) * Adobe PostScript (`ps`) * Lotus 1-2-3 (`wk1`, `wk2`, 799 // `wk3`, `wk4`, `wk5`, `wki`, `wks`, `wku`) * Lotus WordPro (`lwp`) * 800 // Macwrite (`mw`) * Microsoft Excel (`xls`) * Microsoft PowerPoint 801 // (`ppt`) * Microsoft Word (`doc`) * Microsoft Works (`wks`, `wps`, 802 // `wdb`) * Microsoft Write (`wri`) * Rich Text Format (`rtf`) * 803 // Shockwave Flash (`swf`) * Text (`ans`, `txt`). Additional filetypes 804 // may be added in the future. An up-to-date list can always be found in 805 // Google's file type FAQ 806 // (https://support.google.com/webmasters/answer/35287). 807 FileType string `json:"fileType,omitempty"` 808 809 // Filter: Activates or deactivates the automatic filtering of Google 810 // search results. See Automatic Filtering 811 // (https://developers.google.com/custom-search/docs/xml_results#automaticFiltering) 812 // for more information about Google's search results filters. Valid 813 // values for this parameter are: * `0`: Disabled * `1`: Enabled 814 // (default) **Note**: By default, Google applies filtering to all 815 // search results to improve the quality of those results. 816 Filter string `json:"filter,omitempty"` 817 818 // Gl: Boosts search results whose country of origin matches the 819 // parameter value. See Country Codes 820 // (https://developers.google.com/custom-search/docs/xml_results#countryCodes) 821 // for a list of valid values. Specifying a `gl` parameter value in 822 // WebSearch requests should improve the relevance of results. This is 823 // particularly true for international customers and, even more 824 // specifically, for customers in English-speaking countries other than 825 // the United States. 826 Gl string `json:"gl,omitempty"` 827 828 // GoogleHost: Specifies the Google domain (for example, google.com, 829 // google.de, or google.fr) to which the search should be limited. 830 GoogleHost string `json:"googleHost,omitempty"` 831 832 // HighRange: Specifies the ending value for a search range. Use 833 // `cse:lowRange` and `cse:highrange` to append an inclusive search 834 // range of `lowRange...highRange` to the query. 835 HighRange string `json:"highRange,omitempty"` 836 837 // Hl: Specifies the interface language (host language) of your user 838 // interface. Explicitly setting this parameter improves the performance 839 // and the quality of your search results. See the Interface Languages 840 // (https://developers.google.com/custom-search/docs/xml_results#wsInterfaceLanguages) 841 // section of Internationalizing Queries and Results Presentation 842 // (https://developers.google.com/custom-search/docs/xml_results#wsInternationalizing) 843 // for more information, and Supported Interface Languages 844 // (https://developers.google.com/custom-search/docs/xml_results_appendices#interfaceLanguages) 845 // for a list of supported languages. 846 Hl string `json:"hl,omitempty"` 847 848 // Hq: Appends the specified query terms to the query, as if they were 849 // combined with a logical `AND` operator. 850 Hq string `json:"hq,omitempty"` 851 852 // ImgColorType: Restricts results to images of a specified color type. 853 // Supported values are: * `mono` (black and white) * `gray` (grayscale) 854 // * `color` (color) 855 ImgColorType string `json:"imgColorType,omitempty"` 856 857 // ImgDominantColor: Restricts results to images with a specific 858 // dominant color. Supported values are: * `red` * `orange` * `yellow` * 859 // `green` * `teal` * `blue` * `purple` * `pink` * `white` * `gray` * 860 // `black` * `brown` 861 ImgDominantColor string `json:"imgDominantColor,omitempty"` 862 863 // ImgSize: Restricts results to images of a specified size. Supported 864 // values are: * `icon` (small) * `small | medium | large | xlarge` 865 // (medium) * `xxlarge` (large) * `huge` (extra-large) 866 ImgSize string `json:"imgSize,omitempty"` 867 868 // ImgType: Restricts results to images of a specified type. Supported 869 // values are: * `clipart` (Clip art) * `face` (Face) * `lineart` (Line 870 // drawing) * `photo` (Photo) * `animated` (Animated) * `stock` (Stock) 871 ImgType string `json:"imgType,omitempty"` 872 873 // InputEncoding: The character encoding supported for search requests. 874 InputEncoding string `json:"inputEncoding,omitempty"` 875 876 // Language: The language of the search results. 877 Language string `json:"language,omitempty"` 878 879 // LinkSite: Specifies that all results should contain a link to a 880 // specific URL. 881 LinkSite string `json:"linkSite,omitempty"` 882 883 // LowRange: Specifies the starting value for a search range. Use 884 // `cse:lowRange` and `cse:highrange` to append an inclusive search 885 // range of `lowRange...highRange` to the query. 886 LowRange string `json:"lowRange,omitempty"` 887 888 // OrTerms: Provides additional search terms to check for in a document, 889 // where each document in the search results must contain at least one 890 // of the additional search terms. You can also use the Boolean OR 891 // (https://developers.google.com/custom-search/docs/xml_results#BooleanOrqt) 892 // query term for this type of query. 893 OrTerms string `json:"orTerms,omitempty"` 894 895 // OutputEncoding: The character encoding supported for search results. 896 OutputEncoding string `json:"outputEncoding,omitempty"` 897 898 // RelatedSite: Specifies that all search results should be pages that 899 // are related to the specified URL. The parameter value should be a 900 // URL. 901 RelatedSite string `json:"relatedSite,omitempty"` 902 903 // Rights: Filters based on licensing. Supported values include: * 904 // `cc_publicdomain` * `cc_attribute` * `cc_sharealike` * 905 // `cc_noncommercial` * `cc_nonderived` 906 Rights string `json:"rights,omitempty"` 907 908 // Safe: Specifies the SafeSearch level 909 // (https://developers.google.com/custom-search/docs/xml_results#safeSearchLevels) 910 // used for filtering out adult results. This is a custom property not 911 // defined in the OpenSearch spec. Valid parameter values are: * 912 // "off": Disable SafeSearch * "active": Enable SafeSearch 913 Safe string `json:"safe,omitempty"` 914 915 // SearchTerms: The search terms entered by the user. 916 SearchTerms string `json:"searchTerms,omitempty"` 917 918 // SearchType: Allowed values are `web` or `image`. If unspecified, 919 // results are limited to webpages. 920 SearchType string `json:"searchType,omitempty"` 921 922 // SiteSearch: Restricts results to URLs from a specified site. 923 SiteSearch string `json:"siteSearch,omitempty"` 924 925 // SiteSearchFilter: Specifies whether to include or exclude results 926 // from the site named in the `sitesearch` parameter. Supported values 927 // are: * `i`: include content from site * `e`: exclude content from 928 // site 929 SiteSearchFilter string `json:"siteSearchFilter,omitempty"` 930 931 // Sort: Specifies that results should be sorted according to the 932 // specified expression. For example, sort by date. 933 Sort string `json:"sort,omitempty"` 934 935 // StartIndex: The index of the current set of search results into the 936 // total set of results, where the index of the first result is 1. 937 StartIndex int64 `json:"startIndex,omitempty"` 938 939 // StartPage: The page number of this set of results, where the page 940 // length is set by the `count` property. 941 StartPage int64 `json:"startPage,omitempty"` 942 943 // Title: A description of the query. 944 Title string `json:"title,omitempty"` 945 946 // TotalResults: Estimated number of total search results. May not be 947 // accurate. 948 TotalResults int64 `json:"totalResults,omitempty,string"` 949 950 // ForceSendFields is a list of field names (e.g. "Count") to 951 // unconditionally include in API requests. By default, fields with 952 // empty or default values are omitted from API requests. However, any 953 // non-pointer, non-interface field appearing in ForceSendFields will be 954 // sent to the server regardless of whether the field is empty or not. 955 // This may be used to include empty fields in Patch requests. 956 ForceSendFields []string `json:"-"` 957 958 // NullFields is a list of field names (e.g. "Count") to include in API 959 // requests with the JSON null value. By default, fields with empty 960 // values are omitted from API requests. However, any field with an 961 // empty value appearing in NullFields will be sent to the server as 962 // null. It is an error if a field in this list has a non-empty value. 963 // This may be used to include null fields in Patch requests. 964 NullFields []string `json:"-"` 965} 966 967func (s *SearchQueriesPreviousPage) MarshalJSON() ([]byte, error) { 968 type NoMethod SearchQueriesPreviousPage 969 raw := NoMethod(*s) 970 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 971} 972 973// SearchQueriesRequest: Custom search request metadata. 974type SearchQueriesRequest struct { 975 // Count: Number of search results returned in this set. 976 Count int64 `json:"count,omitempty"` 977 978 // Cr: Restricts search results to documents originating in a particular 979 // country. You may use Boolean operators 980 // (https://developers.google.com/custom-search/docs/xml_results#booleanOperators) 981 // in the `cr` parameter's value. Google WebSearch determines the 982 // country of a document by analyzing the following: * The top-level 983 // domain (TLD) of the document's URL. * The geographic location of the 984 // web server's IP address. See Country (cr) Parameter Values 985 // (https://developers.google.com/custom-search/docs/xml_results#countryCollections) 986 // for a list of valid values for this parameter. 987 Cr string `json:"cr,omitempty"` 988 989 // Cx: The identifier of an engine created using the Programmable Search 990 // Engine Control Panel (https://programmablesearchengine.google.com/). 991 // This is a custom property not defined in the OpenSearch spec. This 992 // parameter is **required**. 993 Cx string `json:"cx,omitempty"` 994 995 // DateRestrict: Restricts results to URLs based on date. Supported 996 // values include: * `d[number]`: requests results from the specified 997 // number of past days. * `w[number]`: requests results from the 998 // specified number of past weeks. * `m[number]`: requests results from 999 // the specified number of past months. * `y[number]`: requests results 1000 // from the specified number of past years. 1001 DateRestrict string `json:"dateRestrict,omitempty"` 1002 1003 // DisableCnTwTranslation: Enables or disables the Simplified and 1004 // Traditional Chinese Search 1005 // (https://developers.google.com/custom-search/docs/xml_results#chineseSearch) 1006 // feature. Supported values are: * `0`: enabled (default) * `1`: 1007 // disabled 1008 DisableCnTwTranslation string `json:"disableCnTwTranslation,omitempty"` 1009 1010 // ExactTerms: Identifies a phrase that all documents in the search 1011 // results must contain. 1012 ExactTerms string `json:"exactTerms,omitempty"` 1013 1014 // ExcludeTerms: Identifies a word or phrase that should not appear in 1015 // any documents in the search results. 1016 ExcludeTerms string `json:"excludeTerms,omitempty"` 1017 1018 // FileType: Restricts results to files of a specified extension. 1019 // Filetypes supported by Google include: * Adobe Portable Document 1020 // Format (`pdf`) * Adobe PostScript (`ps`) * Lotus 1-2-3 (`wk1`, `wk2`, 1021 // `wk3`, `wk4`, `wk5`, `wki`, `wks`, `wku`) * Lotus WordPro (`lwp`) * 1022 // Macwrite (`mw`) * Microsoft Excel (`xls`) * Microsoft PowerPoint 1023 // (`ppt`) * Microsoft Word (`doc`) * Microsoft Works (`wks`, `wps`, 1024 // `wdb`) * Microsoft Write (`wri`) * Rich Text Format (`rtf`) * 1025 // Shockwave Flash (`swf`) * Text (`ans`, `txt`). Additional filetypes 1026 // may be added in the future. An up-to-date list can always be found in 1027 // Google's file type FAQ 1028 // (https://support.google.com/webmasters/answer/35287). 1029 FileType string `json:"fileType,omitempty"` 1030 1031 // Filter: Activates or deactivates the automatic filtering of Google 1032 // search results. See Automatic Filtering 1033 // (https://developers.google.com/custom-search/docs/xml_results#automaticFiltering) 1034 // for more information about Google's search results filters. Valid 1035 // values for this parameter are: * `0`: Disabled * `1`: Enabled 1036 // (default) **Note**: By default, Google applies filtering to all 1037 // search results to improve the quality of those results. 1038 Filter string `json:"filter,omitempty"` 1039 1040 // Gl: Boosts search results whose country of origin matches the 1041 // parameter value. See Country Codes 1042 // (https://developers.google.com/custom-search/docs/xml_results#countryCodes) 1043 // for a list of valid values. Specifying a `gl` parameter value in 1044 // WebSearch requests should improve the relevance of results. This is 1045 // particularly true for international customers and, even more 1046 // specifically, for customers in English-speaking countries other than 1047 // the United States. 1048 Gl string `json:"gl,omitempty"` 1049 1050 // GoogleHost: Specifies the Google domain (for example, google.com, 1051 // google.de, or google.fr) to which the search should be limited. 1052 GoogleHost string `json:"googleHost,omitempty"` 1053 1054 // HighRange: Specifies the ending value for a search range. Use 1055 // `cse:lowRange` and `cse:highrange` to append an inclusive search 1056 // range of `lowRange...highRange` to the query. 1057 HighRange string `json:"highRange,omitempty"` 1058 1059 // Hl: Specifies the interface language (host language) of your user 1060 // interface. Explicitly setting this parameter improves the performance 1061 // and the quality of your search results. See the Interface Languages 1062 // (https://developers.google.com/custom-search/docs/xml_results#wsInterfaceLanguages) 1063 // section of Internationalizing Queries and Results Presentation 1064 // (https://developers.google.com/custom-search/docs/xml_results#wsInternationalizing) 1065 // for more information, and Supported Interface Languages 1066 // (https://developers.google.com/custom-search/docs/xml_results_appendices#interfaceLanguages) 1067 // for a list of supported languages. 1068 Hl string `json:"hl,omitempty"` 1069 1070 // Hq: Appends the specified query terms to the query, as if they were 1071 // combined with a logical `AND` operator. 1072 Hq string `json:"hq,omitempty"` 1073 1074 // ImgColorType: Restricts results to images of a specified color type. 1075 // Supported values are: * `mono` (black and white) * `gray` (grayscale) 1076 // * `color` (color) 1077 ImgColorType string `json:"imgColorType,omitempty"` 1078 1079 // ImgDominantColor: Restricts results to images with a specific 1080 // dominant color. Supported values are: * `red` * `orange` * `yellow` * 1081 // `green` * `teal` * `blue` * `purple` * `pink` * `white` * `gray` * 1082 // `black` * `brown` 1083 ImgDominantColor string `json:"imgDominantColor,omitempty"` 1084 1085 // ImgSize: Restricts results to images of a specified size. Supported 1086 // values are: * `icon` (small) * `small | medium | large | xlarge` 1087 // (medium) * `xxlarge` (large) * `huge` (extra-large) 1088 ImgSize string `json:"imgSize,omitempty"` 1089 1090 // ImgType: Restricts results to images of a specified type. Supported 1091 // values are: * `clipart` (Clip art) * `face` (Face) * `lineart` (Line 1092 // drawing) * `photo` (Photo) * `animated` (Animated) * `stock` (Stock) 1093 ImgType string `json:"imgType,omitempty"` 1094 1095 // InputEncoding: The character encoding supported for search requests. 1096 InputEncoding string `json:"inputEncoding,omitempty"` 1097 1098 // Language: The language of the search results. 1099 Language string `json:"language,omitempty"` 1100 1101 // LinkSite: Specifies that all results should contain a link to a 1102 // specific URL. 1103 LinkSite string `json:"linkSite,omitempty"` 1104 1105 // LowRange: Specifies the starting value for a search range. Use 1106 // `cse:lowRange` and `cse:highrange` to append an inclusive search 1107 // range of `lowRange...highRange` to the query. 1108 LowRange string `json:"lowRange,omitempty"` 1109 1110 // OrTerms: Provides additional search terms to check for in a document, 1111 // where each document in the search results must contain at least one 1112 // of the additional search terms. You can also use the Boolean OR 1113 // (https://developers.google.com/custom-search/docs/xml_results#BooleanOrqt) 1114 // query term for this type of query. 1115 OrTerms string `json:"orTerms,omitempty"` 1116 1117 // OutputEncoding: The character encoding supported for search results. 1118 OutputEncoding string `json:"outputEncoding,omitempty"` 1119 1120 // RelatedSite: Specifies that all search results should be pages that 1121 // are related to the specified URL. The parameter value should be a 1122 // URL. 1123 RelatedSite string `json:"relatedSite,omitempty"` 1124 1125 // Rights: Filters based on licensing. Supported values include: * 1126 // `cc_publicdomain` * `cc_attribute` * `cc_sharealike` * 1127 // `cc_noncommercial` * `cc_nonderived` 1128 Rights string `json:"rights,omitempty"` 1129 1130 // Safe: Specifies the SafeSearch level 1131 // (https://developers.google.com/custom-search/docs/xml_results#safeSearchLevels) 1132 // used for filtering out adult results. This is a custom property not 1133 // defined in the OpenSearch spec. Valid parameter values are: * 1134 // "off": Disable SafeSearch * "active": Enable SafeSearch 1135 Safe string `json:"safe,omitempty"` 1136 1137 // SearchTerms: The search terms entered by the user. 1138 SearchTerms string `json:"searchTerms,omitempty"` 1139 1140 // SearchType: Allowed values are `web` or `image`. If unspecified, 1141 // results are limited to webpages. 1142 SearchType string `json:"searchType,omitempty"` 1143 1144 // SiteSearch: Restricts results to URLs from a specified site. 1145 SiteSearch string `json:"siteSearch,omitempty"` 1146 1147 // SiteSearchFilter: Specifies whether to include or exclude results 1148 // from the site named in the `sitesearch` parameter. Supported values 1149 // are: * `i`: include content from site * `e`: exclude content from 1150 // site 1151 SiteSearchFilter string `json:"siteSearchFilter,omitempty"` 1152 1153 // Sort: Specifies that results should be sorted according to the 1154 // specified expression. For example, sort by date. 1155 Sort string `json:"sort,omitempty"` 1156 1157 // StartIndex: The index of the current set of search results into the 1158 // total set of results, where the index of the first result is 1. 1159 StartIndex int64 `json:"startIndex,omitempty"` 1160 1161 // StartPage: The page number of this set of results, where the page 1162 // length is set by the `count` property. 1163 StartPage int64 `json:"startPage,omitempty"` 1164 1165 // Title: A description of the query. 1166 Title string `json:"title,omitempty"` 1167 1168 // TotalResults: Estimated number of total search results. May not be 1169 // accurate. 1170 TotalResults int64 `json:"totalResults,omitempty,string"` 1171 1172 // ForceSendFields is a list of field names (e.g. "Count") to 1173 // unconditionally include in API requests. By default, fields with 1174 // empty or default values are omitted from API requests. However, any 1175 // non-pointer, non-interface field appearing in ForceSendFields will be 1176 // sent to the server regardless of whether the field is empty or not. 1177 // This may be used to include empty fields in Patch requests. 1178 ForceSendFields []string `json:"-"` 1179 1180 // NullFields is a list of field names (e.g. "Count") to include in API 1181 // requests with the JSON null value. By default, fields with empty 1182 // values are omitted from API requests. However, any field with an 1183 // empty value appearing in NullFields will be sent to the server as 1184 // null. It is an error if a field in this list has a non-empty value. 1185 // This may be used to include null fields in Patch requests. 1186 NullFields []string `json:"-"` 1187} 1188 1189func (s *SearchQueriesRequest) MarshalJSON() ([]byte, error) { 1190 type NoMethod SearchQueriesRequest 1191 raw := NoMethod(*s) 1192 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1193} 1194 1195// SearchSearchInformation: Metadata about a search operation. 1196type SearchSearchInformation struct { 1197 // FormattedSearchTime: The time taken for the server to return search 1198 // results, formatted according to locale style. 1199 FormattedSearchTime string `json:"formattedSearchTime,omitempty"` 1200 1201 // FormattedTotalResults: The total number of search results, formatted 1202 // according to locale style. 1203 FormattedTotalResults string `json:"formattedTotalResults,omitempty"` 1204 1205 // SearchTime: The time taken for the server to return search results. 1206 SearchTime float64 `json:"searchTime,omitempty"` 1207 1208 // TotalResults: The total number of search results returned by the 1209 // query. 1210 TotalResults string `json:"totalResults,omitempty"` 1211 1212 // ForceSendFields is a list of field names (e.g. "FormattedSearchTime") 1213 // to unconditionally include in API requests. By default, fields with 1214 // empty or default values are omitted from API requests. However, any 1215 // non-pointer, non-interface field appearing in ForceSendFields will be 1216 // sent to the server regardless of whether the field is empty or not. 1217 // This may be used to include empty fields in Patch requests. 1218 ForceSendFields []string `json:"-"` 1219 1220 // NullFields is a list of field names (e.g. "FormattedSearchTime") to 1221 // include in API requests with the JSON null value. By default, fields 1222 // with empty values are omitted from API requests. However, any field 1223 // with an empty value appearing in NullFields will be sent to the 1224 // server as null. It is an error if a field in this list has a 1225 // non-empty value. This may be used to include null fields in Patch 1226 // requests. 1227 NullFields []string `json:"-"` 1228} 1229 1230func (s *SearchSearchInformation) MarshalJSON() ([]byte, error) { 1231 type NoMethod SearchSearchInformation 1232 raw := NoMethod(*s) 1233 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1234} 1235 1236func (s *SearchSearchInformation) UnmarshalJSON(data []byte) error { 1237 type NoMethod SearchSearchInformation 1238 var s1 struct { 1239 SearchTime gensupport.JSONFloat64 `json:"searchTime"` 1240 *NoMethod 1241 } 1242 s1.NoMethod = (*NoMethod)(s) 1243 if err := json.Unmarshal(data, &s1); err != nil { 1244 return err 1245 } 1246 s.SearchTime = float64(s1.SearchTime) 1247 return nil 1248} 1249 1250// SearchSpelling: Spell correction information for a query. 1251type SearchSpelling struct { 1252 // CorrectedQuery: The corrected query. 1253 CorrectedQuery string `json:"correctedQuery,omitempty"` 1254 1255 // HtmlCorrectedQuery: The corrected query, formatted in HTML. 1256 HtmlCorrectedQuery string `json:"htmlCorrectedQuery,omitempty"` 1257 1258 // ForceSendFields is a list of field names (e.g. "CorrectedQuery") to 1259 // unconditionally include in API requests. By default, fields with 1260 // empty or default values are omitted from API requests. However, any 1261 // non-pointer, non-interface field appearing in ForceSendFields will be 1262 // sent to the server regardless of whether the field is empty or not. 1263 // This may be used to include empty fields in Patch requests. 1264 ForceSendFields []string `json:"-"` 1265 1266 // NullFields is a list of field names (e.g. "CorrectedQuery") to 1267 // include in API requests with the JSON null value. By default, fields 1268 // with empty values are omitted from API requests. However, any field 1269 // with an empty value appearing in NullFields will be sent to the 1270 // server as null. It is an error if a field in this list has a 1271 // non-empty value. This may be used to include null fields in Patch 1272 // requests. 1273 NullFields []string `json:"-"` 1274} 1275 1276func (s *SearchSpelling) MarshalJSON() ([]byte, error) { 1277 type NoMethod SearchSpelling 1278 raw := NoMethod(*s) 1279 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1280} 1281 1282// SearchUrl: OpenSearch template and URL. 1283type SearchUrl struct { 1284 // Template: The actual OpenSearch template 1285 // (http://www.opensearch.org/specifications/opensearch/1.1#opensearch_url_template_syntax) 1286 // for this API. 1287 Template string `json:"template,omitempty"` 1288 1289 // Type: The MIME type of the OpenSearch URL template for the Custom 1290 // Search JSON API. 1291 Type string `json:"type,omitempty"` 1292 1293 // ForceSendFields is a list of field names (e.g. "Template") to 1294 // unconditionally include in API requests. By default, fields with 1295 // empty or default values are omitted from API requests. However, any 1296 // non-pointer, non-interface field appearing in ForceSendFields will be 1297 // sent to the server regardless of whether the field is empty or not. 1298 // This may be used to include empty fields in Patch requests. 1299 ForceSendFields []string `json:"-"` 1300 1301 // NullFields is a list of field names (e.g. "Template") to include in 1302 // API requests with the JSON null value. By default, fields with empty 1303 // values are omitted from API requests. However, any field with an 1304 // empty value appearing in NullFields will be sent to the server as 1305 // null. It is an error if a field in this list has a non-empty value. 1306 // This may be used to include null fields in Patch requests. 1307 NullFields []string `json:"-"` 1308} 1309 1310func (s *SearchUrl) MarshalJSON() ([]byte, error) { 1311 type NoMethod SearchUrl 1312 raw := NoMethod(*s) 1313 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1314} 1315 1316// method id "search.cse.list": 1317 1318type CseListCall struct { 1319 s *Service 1320 urlParams_ gensupport.URLParams 1321 ifNoneMatch_ string 1322 ctx_ context.Context 1323 header_ http.Header 1324} 1325 1326// List: Returns metadata about the search performed, metadata about the 1327// engine used for the search, and the search results. 1328func (r *CseService) List() *CseListCall { 1329 c := &CseListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1330 return c 1331} 1332 1333// C2coff sets the optional parameter "c2coff": Enables or disables 1334// Simplified and Traditional Chinese Search 1335// (https://developers.google.com/custom-search/docs/xml_results#chineseSearch). 1336// The default value for this parameter is 0 (zero), meaning that the 1337// feature is enabled. Supported values are: * `1`: Disabled * `0`: 1338// Enabled (default) 1339func (c *CseListCall) C2coff(c2coff string) *CseListCall { 1340 c.urlParams_.Set("c2coff", c2coff) 1341 return c 1342} 1343 1344// Cr sets the optional parameter "cr": Restricts search results to 1345// documents originating in a particular country. You may use Boolean 1346// operators 1347// (https://developers.google.com/custom-search/docs/xml_results_appendices#booleanOperators) 1348// in the cr parameter's value. Google Search determines the country of 1349// a document by analyzing: * the top-level domain (TLD) of the 1350// document's URL * the geographic location of the Web server's IP 1351// address See the Country Parameter Values 1352// (https://developers.google.com/custom-search/docs/xml_results_appendices#countryCollections) 1353// page for a list of valid values for this parameter. 1354func (c *CseListCall) Cr(cr string) *CseListCall { 1355 c.urlParams_.Set("cr", cr) 1356 return c 1357} 1358 1359// Cx sets the optional parameter "cx": The Programmable Search Engine 1360// ID to use for this request. 1361func (c *CseListCall) Cx(cx string) *CseListCall { 1362 c.urlParams_.Set("cx", cx) 1363 return c 1364} 1365 1366// DateRestrict sets the optional parameter "dateRestrict": Restricts 1367// results to URLs based on date. Supported values include: * 1368// `d[number]`: requests results from the specified number of past days. 1369// * `w[number]`: requests results from the specified number of past 1370// weeks. * `m[number]`: requests results from the specified number of 1371// past months. * `y[number]`: requests results from the specified 1372// number of past years. 1373func (c *CseListCall) DateRestrict(dateRestrict string) *CseListCall { 1374 c.urlParams_.Set("dateRestrict", dateRestrict) 1375 return c 1376} 1377 1378// ExactTerms sets the optional parameter "exactTerms": Identifies a 1379// phrase that all documents in the search results must contain. 1380func (c *CseListCall) ExactTerms(exactTerms string) *CseListCall { 1381 c.urlParams_.Set("exactTerms", exactTerms) 1382 return c 1383} 1384 1385// ExcludeTerms sets the optional parameter "excludeTerms": Identifies a 1386// word or phrase that should not appear in any documents in the search 1387// results. 1388func (c *CseListCall) ExcludeTerms(excludeTerms string) *CseListCall { 1389 c.urlParams_.Set("excludeTerms", excludeTerms) 1390 return c 1391} 1392 1393// FileType sets the optional parameter "fileType": Restricts results to 1394// files of a specified extension. A list of file types indexable by 1395// Google can be found in Search Console Help Center 1396// (https://support.google.com/webmasters/answer/35287). 1397func (c *CseListCall) FileType(fileType string) *CseListCall { 1398 c.urlParams_.Set("fileType", fileType) 1399 return c 1400} 1401 1402// Filter sets the optional parameter "filter": Controls turning on or 1403// off the duplicate content filter. * See Automatic Filtering 1404// (https://developers.google.com/custom-search/docs/xml_results#automaticFiltering) 1405// for more information about Google's search results filters. Note that 1406// host crowding filtering applies only to multi-site searches. * By 1407// default, Google applies filtering to all search results to improve 1408// the quality of those results. Acceptable values are: * `0`: Turns off 1409// duplicate content filter. * `1`: Turns on duplicate content filter. 1410func (c *CseListCall) Filter(filter string) *CseListCall { 1411 c.urlParams_.Set("filter", filter) 1412 return c 1413} 1414 1415// Gl sets the optional parameter "gl": Geolocation of end user. * The 1416// `gl` parameter value is a two-letter country code. The `gl` parameter 1417// boosts search results whose country of origin matches the parameter 1418// value. See the Country Codes 1419// (https://developers.google.com/custom-search/docs/xml_results_appendices#countryCodes) 1420// page for a list of valid values. * Specifying a `gl` parameter value 1421// should lead to more relevant results. This is particularly true for 1422// international customers and, even more specifically, for customers in 1423// English- speaking countries other than the United States. 1424func (c *CseListCall) Gl(gl string) *CseListCall { 1425 c.urlParams_.Set("gl", gl) 1426 return c 1427} 1428 1429// Googlehost sets the optional parameter "googlehost": **Deprecated**. 1430// Use the `gl` parameter for a similar effect. The local Google domain 1431// (for example, google.com, google.de, or google.fr) to use to perform 1432// the search. 1433func (c *CseListCall) Googlehost(googlehost string) *CseListCall { 1434 c.urlParams_.Set("googlehost", googlehost) 1435 return c 1436} 1437 1438// HighRange sets the optional parameter "highRange": Specifies the 1439// ending value for a search range. * Use `lowRange` and `highRange` to 1440// append an inclusive search range of `lowRange...highRange` to the 1441// query. 1442func (c *CseListCall) HighRange(highRange string) *CseListCall { 1443 c.urlParams_.Set("highRange", highRange) 1444 return c 1445} 1446 1447// Hl sets the optional parameter "hl": Sets the user interface 1448// language. * Explicitly setting this parameter improves the 1449// performance and the quality of your search results. * See the 1450// Interface Languages 1451// (https://developers.google.com/custom-search/docs/xml_results#wsInterfaceLanguages) 1452// section of Internationalizing Queries and Results Presentation 1453// (https://developers.google.com/custom-search/docs/xml_results#wsInternationalizing) 1454// for more information, and (Supported Interface 1455// Languages)[https://developers.google.com/custom-search/docs/xml_result 1456// s_appendices#interfaceLanguages] for a list of supported languages. 1457func (c *CseListCall) Hl(hl string) *CseListCall { 1458 c.urlParams_.Set("hl", hl) 1459 return c 1460} 1461 1462// Hq sets the optional parameter "hq": Appends the specified query 1463// terms to the query, as if they were combined with a logical AND 1464// operator. 1465func (c *CseListCall) Hq(hq string) *CseListCall { 1466 c.urlParams_.Set("hq", hq) 1467 return c 1468} 1469 1470// ImgColorType sets the optional parameter "imgColorType": Returns 1471// black and white, grayscale, transparent, or color images. Acceptable 1472// values are: * "color" * "gray" * "mono": black and white * 1473// "trans": transparent background 1474// 1475// Possible values: 1476// "imgColorTypeUndefined" - No image color type specified. 1477// "mono" - Black and white images only. 1478// "gray" - Grayscale images only. 1479// "color" - Color images only. 1480// "trans" - Images with transparent background 1481func (c *CseListCall) ImgColorType(imgColorType string) *CseListCall { 1482 c.urlParams_.Set("imgColorType", imgColorType) 1483 return c 1484} 1485 1486// ImgDominantColor sets the optional parameter "imgDominantColor": 1487// Returns images of a specific dominant color. Acceptable values are: * 1488// "black" * "blue" * "brown" * "gray" * "green" * "orange" 1489// * "pink" * "purple" * "red" * "teal" * "white" * "yellow" 1490// 1491// Possible values: 1492// "imgDominantColorUndefined" - No dominant color specified. 1493// "black" - Predominantly black images only. 1494// "blue" - Predominantly blue images only. 1495// "brown" - Predominantly brown images only. 1496// "gray" - Predominantly gray images only. 1497// "green" - Predominantly green images only. 1498// "orange" - Predominantly orange images only. 1499// "pink" - Predominantly pink images only. 1500// "purple" - Predominantly purple images only. 1501// "red" - Predominantly red images only. 1502// "teal" - Predominantly teal images only. 1503// "white" - Predominantly white images only. 1504// "yellow" - Predominantly yellow images only. 1505func (c *CseListCall) ImgDominantColor(imgDominantColor string) *CseListCall { 1506 c.urlParams_.Set("imgDominantColor", imgDominantColor) 1507 return c 1508} 1509 1510// ImgSize sets the optional parameter "imgSize": Returns images of a 1511// specified size. Acceptable values are: * "huge" * "icon" * 1512// "large" * "medium" * "small" * "xlarge" * "xxlarge" 1513// 1514// Possible values: 1515// "imgSizeUndefined" - No image size specified. 1516// "HUGE" - Only the largest possible images. 1517// "ICON" - Only very small icon-sized images. 1518// "LARGE" - Only large images. 1519// "MEDIUM" - Only medium images. 1520// "SMALL" - Only small images. 1521// "XLARGE" - Only very large images. 1522// "XXLARGE" - Only extremely large images. 1523func (c *CseListCall) ImgSize(imgSize string) *CseListCall { 1524 c.urlParams_.Set("imgSize", imgSize) 1525 return c 1526} 1527 1528// ImgType sets the optional parameter "imgType": Returns images of a 1529// type. Acceptable values are: * "clipart" * "face" * "lineart" * 1530// "stock" * "photo" * "animated" 1531// 1532// Possible values: 1533// "imgTypeUndefined" - No image type specified. 1534// "clipart" - Clipart-style images only. 1535// "face" - Images of faces only. 1536// "lineart" - Line art images only. 1537// "stock" - Stock images only. 1538// "photo" - Photo images only. 1539// "animated" - Animated images only. 1540func (c *CseListCall) ImgType(imgType string) *CseListCall { 1541 c.urlParams_.Set("imgType", imgType) 1542 return c 1543} 1544 1545// LinkSite sets the optional parameter "linkSite": Specifies that all 1546// search results should contain a link to a particular URL. 1547func (c *CseListCall) LinkSite(linkSite string) *CseListCall { 1548 c.urlParams_.Set("linkSite", linkSite) 1549 return c 1550} 1551 1552// LowRange sets the optional parameter "lowRange": Specifies the 1553// starting value for a search range. Use `lowRange` and `highRange` to 1554// append an inclusive search range of `lowRange...highRange` to the 1555// query. 1556func (c *CseListCall) LowRange(lowRange string) *CseListCall { 1557 c.urlParams_.Set("lowRange", lowRange) 1558 return c 1559} 1560 1561// Lr sets the optional parameter "lr": Restricts the search to 1562// documents written in a particular language (e.g., `lr=lang_ja`). 1563// Acceptable values are: * "lang_ar": Arabic * "lang_bg": Bulgarian 1564// * "lang_ca": Catalan * "lang_cs": Czech * "lang_da": Danish * 1565// "lang_de": German * "lang_el": Greek * "lang_en": English * 1566// "lang_es": Spanish * "lang_et": Estonian * "lang_fi": Finnish * 1567// "lang_fr": French * "lang_hr": Croatian * "lang_hu": Hungarian 1568// * "lang_id": Indonesian * "lang_is": Icelandic * "lang_it": 1569// Italian * "lang_iw": Hebrew * "lang_ja": Japanese * "lang_ko": 1570// Korean * "lang_lt": Lithuanian * "lang_lv": Latvian * 1571// "lang_nl": Dutch * "lang_no": Norwegian * "lang_pl": Polish * 1572// "lang_pt": Portuguese * "lang_ro": Romanian * "lang_ru": 1573// Russian * "lang_sk": Slovak * "lang_sl": Slovenian * "lang_sr": 1574// Serbian * "lang_sv": Swedish * "lang_tr": Turkish * 1575// "lang_zh-CN": Chinese (Simplified) * "lang_zh-TW": Chinese 1576// (Traditional) 1577func (c *CseListCall) Lr(lr string) *CseListCall { 1578 c.urlParams_.Set("lr", lr) 1579 return c 1580} 1581 1582// Num sets the optional parameter "num": Number of search results to 1583// return. * Valid values are integers between 1 and 10, inclusive. 1584func (c *CseListCall) Num(num int64) *CseListCall { 1585 c.urlParams_.Set("num", fmt.Sprint(num)) 1586 return c 1587} 1588 1589// OrTerms sets the optional parameter "orTerms": Provides additional 1590// search terms to check for in a document, where each document in the 1591// search results must contain at least one of the additional search 1592// terms. 1593func (c *CseListCall) OrTerms(orTerms string) *CseListCall { 1594 c.urlParams_.Set("orTerms", orTerms) 1595 return c 1596} 1597 1598// Q sets the optional parameter "q": Query 1599func (c *CseListCall) Q(q string) *CseListCall { 1600 c.urlParams_.Set("q", q) 1601 return c 1602} 1603 1604// RelatedSite sets the optional parameter "relatedSite": Specifies that 1605// all search results should be pages that are related to the specified 1606// URL. 1607func (c *CseListCall) RelatedSite(relatedSite string) *CseListCall { 1608 c.urlParams_.Set("relatedSite", relatedSite) 1609 return c 1610} 1611 1612// Rights sets the optional parameter "rights": Filters based on 1613// licensing. Supported values include: `cc_publicdomain`, 1614// `cc_attribute`, `cc_sharealike`, `cc_noncommercial`, `cc_nonderived` 1615// and combinations of these. See typical combinations 1616// (https://wiki.creativecommons.org/wiki/CC_Search_integration). 1617func (c *CseListCall) Rights(rights string) *CseListCall { 1618 c.urlParams_.Set("rights", rights) 1619 return c 1620} 1621 1622// Safe sets the optional parameter "safe": Search safety level. 1623// Acceptable values are: * "active": Enables SafeSearch filtering. * 1624// "off": Disables SafeSearch filtering. (default) 1625// 1626// Possible values: 1627// "safeUndefined" - SafeSearch mode unspecified. (Falls back to 1628// engine's configuration.) 1629// "active" - Turn SafeSearch on. 1630// "high" - Deprecated, equivalent to "active". 1631// "medium" - Deprecated, equivalent to "active". 1632// "off" - Turn SafeSearch off. 1633func (c *CseListCall) Safe(safe string) *CseListCall { 1634 c.urlParams_.Set("safe", safe) 1635 return c 1636} 1637 1638// SearchType sets the optional parameter "searchType": Specifies the 1639// search type: `image`. If unspecified, results are limited to 1640// webpages. Acceptable values are: * "image": custom image search. 1641// 1642// Possible values: 1643// "searchTypeUndefined" - Search type unspecified (defaults to web 1644// search). 1645// "image" - Image search. 1646func (c *CseListCall) SearchType(searchType string) *CseListCall { 1647 c.urlParams_.Set("searchType", searchType) 1648 return c 1649} 1650 1651// SiteSearch sets the optional parameter "siteSearch": Specifies a 1652// given site which should always be included or excluded from results 1653// (see `siteSearchFilter` parameter, below). 1654func (c *CseListCall) SiteSearch(siteSearch string) *CseListCall { 1655 c.urlParams_.Set("siteSearch", siteSearch) 1656 return c 1657} 1658 1659// SiteSearchFilter sets the optional parameter "siteSearchFilter": 1660// Controls whether to include or exclude results from the site named in 1661// the `siteSearch` parameter. Acceptable values are: * "e": exclude * 1662// "i": include 1663// 1664// Possible values: 1665// "siteSearchFilterUndefined" - Filter mode unspecified. 1666// "e" - Exclude results from the listed sites. 1667// "i" - Include only results from the listed sites. 1668func (c *CseListCall) SiteSearchFilter(siteSearchFilter string) *CseListCall { 1669 c.urlParams_.Set("siteSearchFilter", siteSearchFilter) 1670 return c 1671} 1672 1673// Sort sets the optional parameter "sort": The sort expression to apply 1674// to the results. The sort parameter specifies that the results be 1675// sorted according to the specified expression i.e. sort by date. 1676// Example: sort=date 1677// (https://developers.google.com/custom-search/docs/structured_search#sort-by-attribute). 1678func (c *CseListCall) Sort(sort string) *CseListCall { 1679 c.urlParams_.Set("sort", sort) 1680 return c 1681} 1682 1683// Start sets the optional parameter "start": The index of the first 1684// result to return. The default number of results per page is 10, so 1685// `&start=11` would start at the top of the second page of results. 1686// **Note**: The JSON API will never return more than 100 results, even 1687// if more than 100 documents match the query, so setting the sum of 1688// `start + num` to a number greater than 100 will produce an error. 1689// Also note that the maximum value for `num` is 10. 1690func (c *CseListCall) Start(start int64) *CseListCall { 1691 c.urlParams_.Set("start", fmt.Sprint(start)) 1692 return c 1693} 1694 1695// Fields allows partial responses to be retrieved. See 1696// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1697// for more information. 1698func (c *CseListCall) Fields(s ...googleapi.Field) *CseListCall { 1699 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1700 return c 1701} 1702 1703// IfNoneMatch sets the optional parameter which makes the operation 1704// fail if the object's ETag matches the given value. This is useful for 1705// getting updates only after the object has changed since the last 1706// request. Use googleapi.IsNotModified to check whether the response 1707// error from Do is the result of In-None-Match. 1708func (c *CseListCall) IfNoneMatch(entityTag string) *CseListCall { 1709 c.ifNoneMatch_ = entityTag 1710 return c 1711} 1712 1713// Context sets the context to be used in this call's Do method. Any 1714// pending HTTP request will be aborted if the provided context is 1715// canceled. 1716func (c *CseListCall) Context(ctx context.Context) *CseListCall { 1717 c.ctx_ = ctx 1718 return c 1719} 1720 1721// Header returns an http.Header that can be modified by the caller to 1722// add HTTP headers to the request. 1723func (c *CseListCall) Header() http.Header { 1724 if c.header_ == nil { 1725 c.header_ = make(http.Header) 1726 } 1727 return c.header_ 1728} 1729 1730func (c *CseListCall) doRequest(alt string) (*http.Response, error) { 1731 reqHeaders := make(http.Header) 1732 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 1733 for k, v := range c.header_ { 1734 reqHeaders[k] = v 1735 } 1736 reqHeaders.Set("User-Agent", c.s.userAgent()) 1737 if c.ifNoneMatch_ != "" { 1738 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1739 } 1740 var body io.Reader = nil 1741 c.urlParams_.Set("alt", alt) 1742 c.urlParams_.Set("prettyPrint", "false") 1743 urls := googleapi.ResolveRelative(c.s.BasePath, "customsearch/v1") 1744 urls += "?" + c.urlParams_.Encode() 1745 req, err := http.NewRequest("GET", urls, body) 1746 if err != nil { 1747 return nil, err 1748 } 1749 req.Header = reqHeaders 1750 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1751} 1752 1753// Do executes the "search.cse.list" call. 1754// Exactly one of *Search or error will be non-nil. Any non-2xx status 1755// code is an error. Response headers are in either 1756// *Search.ServerResponse.Header or (if a response was returned at all) 1757// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1758// check whether the returned error was because http.StatusNotModified 1759// was returned. 1760func (c *CseListCall) Do(opts ...googleapi.CallOption) (*Search, error) { 1761 gensupport.SetOptions(c.urlParams_, opts...) 1762 res, err := c.doRequest("json") 1763 if res != nil && res.StatusCode == http.StatusNotModified { 1764 if res.Body != nil { 1765 res.Body.Close() 1766 } 1767 return nil, &googleapi.Error{ 1768 Code: res.StatusCode, 1769 Header: res.Header, 1770 } 1771 } 1772 if err != nil { 1773 return nil, err 1774 } 1775 defer googleapi.CloseBody(res) 1776 if err := googleapi.CheckResponse(res); err != nil { 1777 return nil, err 1778 } 1779 ret := &Search{ 1780 ServerResponse: googleapi.ServerResponse{ 1781 Header: res.Header, 1782 HTTPStatusCode: res.StatusCode, 1783 }, 1784 } 1785 target := &ret 1786 if err := gensupport.DecodeResponse(target, res); err != nil { 1787 return nil, err 1788 } 1789 return ret, nil 1790 // { 1791 // "description": "Returns metadata about the search performed, metadata about the engine used for the search, and the search results.", 1792 // "flatPath": "customsearch/v1", 1793 // "httpMethod": "GET", 1794 // "id": "search.cse.list", 1795 // "parameterOrder": [], 1796 // "parameters": { 1797 // "c2coff": { 1798 // "description": "Enables or disables [Simplified and Traditional Chinese Search](https://developers.google.com/custom-search/docs/xml_results#chineseSearch). The default value for this parameter is 0 (zero), meaning that the feature is enabled. Supported values are: * `1`: Disabled * `0`: Enabled (default)", 1799 // "location": "query", 1800 // "type": "string" 1801 // }, 1802 // "cr": { 1803 // "description": "Restricts search results to documents originating in a particular country. You may use [Boolean operators](https://developers.google.com/custom-search/docs/xml_results_appendices#booleanOperators) in the cr parameter's value. Google Search determines the country of a document by analyzing: * the top-level domain (TLD) of the document's URL * the geographic location of the Web server's IP address See the [Country Parameter Values](https://developers.google.com/custom-search/docs/xml_results_appendices#countryCollections) page for a list of valid values for this parameter.", 1804 // "location": "query", 1805 // "type": "string" 1806 // }, 1807 // "cx": { 1808 // "description": "The Programmable Search Engine ID to use for this request.", 1809 // "location": "query", 1810 // "type": "string" 1811 // }, 1812 // "dateRestrict": { 1813 // "description": "Restricts results to URLs based on date. Supported values include: * `d[number]`: requests results from the specified number of past days. * `w[number]`: requests results from the specified number of past weeks. * `m[number]`: requests results from the specified number of past months. * `y[number]`: requests results from the specified number of past years.", 1814 // "location": "query", 1815 // "type": "string" 1816 // }, 1817 // "exactTerms": { 1818 // "description": "Identifies a phrase that all documents in the search results must contain.", 1819 // "location": "query", 1820 // "type": "string" 1821 // }, 1822 // "excludeTerms": { 1823 // "description": "Identifies a word or phrase that should not appear in any documents in the search results.", 1824 // "location": "query", 1825 // "type": "string" 1826 // }, 1827 // "fileType": { 1828 // "description": "Restricts results to files of a specified extension. A list of file types indexable by Google can be found in Search Console [Help Center](https://support.google.com/webmasters/answer/35287).", 1829 // "location": "query", 1830 // "type": "string" 1831 // }, 1832 // "filter": { 1833 // "description": "Controls turning on or off the duplicate content filter. * See [Automatic Filtering](https://developers.google.com/custom-search/docs/xml_results#automaticFiltering) for more information about Google's search results filters. Note that host crowding filtering applies only to multi-site searches. * By default, Google applies filtering to all search results to improve the quality of those results. Acceptable values are: * `0`: Turns off duplicate content filter. * `1`: Turns on duplicate content filter.", 1834 // "location": "query", 1835 // "type": "string" 1836 // }, 1837 // "gl": { 1838 // "description": "Geolocation of end user. * The `gl` parameter value is a two-letter country code. The `gl` parameter boosts search results whose country of origin matches the parameter value. See the [Country Codes](https://developers.google.com/custom-search/docs/xml_results_appendices#countryCodes) page for a list of valid values. * Specifying a `gl` parameter value should lead to more relevant results. This is particularly true for international customers and, even more specifically, for customers in English- speaking countries other than the United States.", 1839 // "location": "query", 1840 // "type": "string" 1841 // }, 1842 // "googlehost": { 1843 // "description": "**Deprecated**. Use the `gl` parameter for a similar effect. The local Google domain (for example, google.com, google.de, or google.fr) to use to perform the search.", 1844 // "location": "query", 1845 // "type": "string" 1846 // }, 1847 // "highRange": { 1848 // "description": "Specifies the ending value for a search range. * Use `lowRange` and `highRange` to append an inclusive search range of `lowRange...highRange` to the query.", 1849 // "location": "query", 1850 // "type": "string" 1851 // }, 1852 // "hl": { 1853 // "description": "Sets the user interface language. * Explicitly setting this parameter improves the performance and the quality of your search results. * See the [Interface Languages](https://developers.google.com/custom-search/docs/xml_results#wsInterfaceLanguages) section of [Internationalizing Queries and Results Presentation](https://developers.google.com/custom-search/docs/xml_results#wsInternationalizing) for more information, and (Supported Interface Languages)[https://developers.google.com/custom-search/docs/xml_results_appendices#interfaceLanguages] for a list of supported languages.", 1854 // "location": "query", 1855 // "type": "string" 1856 // }, 1857 // "hq": { 1858 // "description": "Appends the specified query terms to the query, as if they were combined with a logical AND operator.", 1859 // "location": "query", 1860 // "type": "string" 1861 // }, 1862 // "imgColorType": { 1863 // "description": "Returns black and white, grayscale, transparent, or color images. Acceptable values are: * `\"color\"` * `\"gray\"` * `\"mono\"`: black and white * `\"trans\"`: transparent background", 1864 // "enum": [ 1865 // "imgColorTypeUndefined", 1866 // "mono", 1867 // "gray", 1868 // "color", 1869 // "trans" 1870 // ], 1871 // "enumDescriptions": [ 1872 // "No image color type specified.", 1873 // "Black and white images only.", 1874 // "Grayscale images only.", 1875 // "Color images only.", 1876 // "Images with transparent background" 1877 // ], 1878 // "location": "query", 1879 // "type": "string" 1880 // }, 1881 // "imgDominantColor": { 1882 // "description": "Returns images of a specific dominant color. Acceptable values are: * `\"black\"` * `\"blue\"` * `\"brown\"` * `\"gray\"` * `\"green\"` * `\"orange\"` * `\"pink\"` * `\"purple\"` * `\"red\"` * `\"teal\"` * `\"white\"` * `\"yellow\"`", 1883 // "enum": [ 1884 // "imgDominantColorUndefined", 1885 // "black", 1886 // "blue", 1887 // "brown", 1888 // "gray", 1889 // "green", 1890 // "orange", 1891 // "pink", 1892 // "purple", 1893 // "red", 1894 // "teal", 1895 // "white", 1896 // "yellow" 1897 // ], 1898 // "enumDescriptions": [ 1899 // "No dominant color specified.", 1900 // "Predominantly black images only.", 1901 // "Predominantly blue images only.", 1902 // "Predominantly brown images only.", 1903 // "Predominantly gray images only.", 1904 // "Predominantly green images only.", 1905 // "Predominantly orange images only.", 1906 // "Predominantly pink images only.", 1907 // "Predominantly purple images only.", 1908 // "Predominantly red images only.", 1909 // "Predominantly teal images only.", 1910 // "Predominantly white images only.", 1911 // "Predominantly yellow images only." 1912 // ], 1913 // "location": "query", 1914 // "type": "string" 1915 // }, 1916 // "imgSize": { 1917 // "description": "Returns images of a specified size. Acceptable values are: * `\"huge\"` * `\"icon\"` * `\"large\"` * `\"medium\"` * `\"small\"` * `\"xlarge\"` * `\"xxlarge\"`", 1918 // "enum": [ 1919 // "imgSizeUndefined", 1920 // "HUGE", 1921 // "ICON", 1922 // "LARGE", 1923 // "MEDIUM", 1924 // "SMALL", 1925 // "XLARGE", 1926 // "XXLARGE" 1927 // ], 1928 // "enumDescriptions": [ 1929 // "No image size specified.", 1930 // "Only the largest possible images.", 1931 // "Only very small icon-sized images.", 1932 // "Only large images.", 1933 // "Only medium images.", 1934 // "Only small images.", 1935 // "Only very large images.", 1936 // "Only extremely large images." 1937 // ], 1938 // "location": "query", 1939 // "type": "string" 1940 // }, 1941 // "imgType": { 1942 // "description": "Returns images of a type. Acceptable values are: * `\"clipart\"` * `\"face\"` * `\"lineart\"` * `\"stock\"` * `\"photo\"` * `\"animated\"`", 1943 // "enum": [ 1944 // "imgTypeUndefined", 1945 // "clipart", 1946 // "face", 1947 // "lineart", 1948 // "stock", 1949 // "photo", 1950 // "animated" 1951 // ], 1952 // "enumDescriptions": [ 1953 // "No image type specified.", 1954 // "Clipart-style images only.", 1955 // "Images of faces only.", 1956 // "Line art images only.", 1957 // "Stock images only.", 1958 // "Photo images only.", 1959 // "Animated images only." 1960 // ], 1961 // "location": "query", 1962 // "type": "string" 1963 // }, 1964 // "linkSite": { 1965 // "description": "Specifies that all search results should contain a link to a particular URL.", 1966 // "location": "query", 1967 // "type": "string" 1968 // }, 1969 // "lowRange": { 1970 // "description": "Specifies the starting value for a search range. Use `lowRange` and `highRange` to append an inclusive search range of `lowRange...highRange` to the query.", 1971 // "location": "query", 1972 // "type": "string" 1973 // }, 1974 // "lr": { 1975 // "description": "Restricts the search to documents written in a particular language (e.g., `lr=lang_ja`). Acceptable values are: * `\"lang_ar\"`: Arabic * `\"lang_bg\"`: Bulgarian * `\"lang_ca\"`: Catalan * `\"lang_cs\"`: Czech * `\"lang_da\"`: Danish * `\"lang_de\"`: German * `\"lang_el\"`: Greek * `\"lang_en\"`: English * `\"lang_es\"`: Spanish * `\"lang_et\"`: Estonian * `\"lang_fi\"`: Finnish * `\"lang_fr\"`: French * `\"lang_hr\"`: Croatian * `\"lang_hu\"`: Hungarian * `\"lang_id\"`: Indonesian * `\"lang_is\"`: Icelandic * `\"lang_it\"`: Italian * `\"lang_iw\"`: Hebrew * `\"lang_ja\"`: Japanese * `\"lang_ko\"`: Korean * `\"lang_lt\"`: Lithuanian * `\"lang_lv\"`: Latvian * `\"lang_nl\"`: Dutch * `\"lang_no\"`: Norwegian * `\"lang_pl\"`: Polish * `\"lang_pt\"`: Portuguese * `\"lang_ro\"`: Romanian * `\"lang_ru\"`: Russian * `\"lang_sk\"`: Slovak * `\"lang_sl\"`: Slovenian * `\"lang_sr\"`: Serbian * `\"lang_sv\"`: Swedish * `\"lang_tr\"`: Turkish * `\"lang_zh-CN\"`: Chinese (Simplified) * `\"lang_zh-TW\"`: Chinese (Traditional)", 1976 // "location": "query", 1977 // "type": "string" 1978 // }, 1979 // "num": { 1980 // "description": "Number of search results to return. * Valid values are integers between 1 and 10, inclusive.", 1981 // "format": "int32", 1982 // "location": "query", 1983 // "type": "integer" 1984 // }, 1985 // "orTerms": { 1986 // "description": "Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms.", 1987 // "location": "query", 1988 // "type": "string" 1989 // }, 1990 // "q": { 1991 // "description": "Query", 1992 // "location": "query", 1993 // "type": "string" 1994 // }, 1995 // "relatedSite": { 1996 // "description": "Specifies that all search results should be pages that are related to the specified URL.", 1997 // "location": "query", 1998 // "type": "string" 1999 // }, 2000 // "rights": { 2001 // "description": "Filters based on licensing. Supported values include: `cc_publicdomain`, `cc_attribute`, `cc_sharealike`, `cc_noncommercial`, `cc_nonderived` and combinations of these. See [typical combinations](https://wiki.creativecommons.org/wiki/CC_Search_integration).", 2002 // "location": "query", 2003 // "type": "string" 2004 // }, 2005 // "safe": { 2006 // "description": "Search safety level. Acceptable values are: * `\"active\"`: Enables SafeSearch filtering. * `\"off\"`: Disables SafeSearch filtering. (default)", 2007 // "enum": [ 2008 // "safeUndefined", 2009 // "active", 2010 // "high", 2011 // "medium", 2012 // "off" 2013 // ], 2014 // "enumDescriptions": [ 2015 // "SafeSearch mode unspecified. (Falls back to engine's configuration.)", 2016 // "Turn SafeSearch on.", 2017 // "Deprecated, equivalent to \"active\".", 2018 // "Deprecated, equivalent to \"active\".", 2019 // "Turn SafeSearch off." 2020 // ], 2021 // "location": "query", 2022 // "type": "string" 2023 // }, 2024 // "searchType": { 2025 // "description": "Specifies the search type: `image`. If unspecified, results are limited to webpages. Acceptable values are: * `\"image\"`: custom image search.", 2026 // "enum": [ 2027 // "searchTypeUndefined", 2028 // "image" 2029 // ], 2030 // "enumDescriptions": [ 2031 // "Search type unspecified (defaults to web search).", 2032 // "Image search." 2033 // ], 2034 // "location": "query", 2035 // "type": "string" 2036 // }, 2037 // "siteSearch": { 2038 // "description": "Specifies a given site which should always be included or excluded from results (see `siteSearchFilter` parameter, below).", 2039 // "location": "query", 2040 // "type": "string" 2041 // }, 2042 // "siteSearchFilter": { 2043 // "description": "Controls whether to include or exclude results from the site named in the `siteSearch` parameter. Acceptable values are: * `\"e\"`: exclude * `\"i\"`: include", 2044 // "enum": [ 2045 // "siteSearchFilterUndefined", 2046 // "e", 2047 // "i" 2048 // ], 2049 // "enumDescriptions": [ 2050 // "Filter mode unspecified.", 2051 // "Exclude results from the listed sites.", 2052 // "Include only results from the listed sites." 2053 // ], 2054 // "location": "query", 2055 // "type": "string" 2056 // }, 2057 // "sort": { 2058 // "description": "The sort expression to apply to the results. The sort parameter specifies that the results be sorted according to the specified expression i.e. sort by date. [Example: sort=date](https://developers.google.com/custom-search/docs/structured_search#sort-by-attribute).", 2059 // "location": "query", 2060 // "type": "string" 2061 // }, 2062 // "start": { 2063 // "description": "The index of the first result to return. The default number of results per page is 10, so `\u0026start=11` would start at the top of the second page of results. **Note**: The JSON API will never return more than 100 results, even if more than 100 documents match the query, so setting the sum of `start + num` to a number greater than 100 will produce an error. Also note that the maximum value for `num` is 10.", 2064 // "format": "uint32", 2065 // "location": "query", 2066 // "type": "integer" 2067 // } 2068 // }, 2069 // "path": "customsearch/v1", 2070 // "response": { 2071 // "$ref": "Search" 2072 // } 2073 // } 2074 2075} 2076 2077// method id "search.cse.siterestrict.list": 2078 2079type CseSiterestrictListCall struct { 2080 s *Service 2081 urlParams_ gensupport.URLParams 2082 ifNoneMatch_ string 2083 ctx_ context.Context 2084 header_ http.Header 2085} 2086 2087// List: Returns metadata about the search performed, metadata about the 2088// engine used for the search, and the search results. Uses a small set 2089// of url patterns. 2090func (r *CseSiterestrictService) List() *CseSiterestrictListCall { 2091 c := &CseSiterestrictListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2092 return c 2093} 2094 2095// C2coff sets the optional parameter "c2coff": Enables or disables 2096// Simplified and Traditional Chinese Search 2097// (https://developers.google.com/custom-search/docs/xml_results#chineseSearch). 2098// The default value for this parameter is 0 (zero), meaning that the 2099// feature is enabled. Supported values are: * `1`: Disabled * `0`: 2100// Enabled (default) 2101func (c *CseSiterestrictListCall) C2coff(c2coff string) *CseSiterestrictListCall { 2102 c.urlParams_.Set("c2coff", c2coff) 2103 return c 2104} 2105 2106// Cr sets the optional parameter "cr": Restricts search results to 2107// documents originating in a particular country. You may use Boolean 2108// operators 2109// (https://developers.google.com/custom-search/docs/xml_results_appendices#booleanOperators) 2110// in the cr parameter's value. Google Search determines the country of 2111// a document by analyzing: * the top-level domain (TLD) of the 2112// document's URL * the geographic location of the Web server's IP 2113// address See the Country Parameter Values 2114// (https://developers.google.com/custom-search/docs/xml_results_appendices#countryCollections) 2115// page for a list of valid values for this parameter. 2116func (c *CseSiterestrictListCall) Cr(cr string) *CseSiterestrictListCall { 2117 c.urlParams_.Set("cr", cr) 2118 return c 2119} 2120 2121// Cx sets the optional parameter "cx": The Programmable Search Engine 2122// ID to use for this request. 2123func (c *CseSiterestrictListCall) Cx(cx string) *CseSiterestrictListCall { 2124 c.urlParams_.Set("cx", cx) 2125 return c 2126} 2127 2128// DateRestrict sets the optional parameter "dateRestrict": Restricts 2129// results to URLs based on date. Supported values include: * 2130// `d[number]`: requests results from the specified number of past days. 2131// * `w[number]`: requests results from the specified number of past 2132// weeks. * `m[number]`: requests results from the specified number of 2133// past months. * `y[number]`: requests results from the specified 2134// number of past years. 2135func (c *CseSiterestrictListCall) DateRestrict(dateRestrict string) *CseSiterestrictListCall { 2136 c.urlParams_.Set("dateRestrict", dateRestrict) 2137 return c 2138} 2139 2140// ExactTerms sets the optional parameter "exactTerms": Identifies a 2141// phrase that all documents in the search results must contain. 2142func (c *CseSiterestrictListCall) ExactTerms(exactTerms string) *CseSiterestrictListCall { 2143 c.urlParams_.Set("exactTerms", exactTerms) 2144 return c 2145} 2146 2147// ExcludeTerms sets the optional parameter "excludeTerms": Identifies a 2148// word or phrase that should not appear in any documents in the search 2149// results. 2150func (c *CseSiterestrictListCall) ExcludeTerms(excludeTerms string) *CseSiterestrictListCall { 2151 c.urlParams_.Set("excludeTerms", excludeTerms) 2152 return c 2153} 2154 2155// FileType sets the optional parameter "fileType": Restricts results to 2156// files of a specified extension. A list of file types indexable by 2157// Google can be found in Search Console Help Center 2158// (https://support.google.com/webmasters/answer/35287). 2159func (c *CseSiterestrictListCall) FileType(fileType string) *CseSiterestrictListCall { 2160 c.urlParams_.Set("fileType", fileType) 2161 return c 2162} 2163 2164// Filter sets the optional parameter "filter": Controls turning on or 2165// off the duplicate content filter. * See Automatic Filtering 2166// (https://developers.google.com/custom-search/docs/xml_results#automaticFiltering) 2167// for more information about Google's search results filters. Note that 2168// host crowding filtering applies only to multi-site searches. * By 2169// default, Google applies filtering to all search results to improve 2170// the quality of those results. Acceptable values are: * `0`: Turns off 2171// duplicate content filter. * `1`: Turns on duplicate content filter. 2172func (c *CseSiterestrictListCall) Filter(filter string) *CseSiterestrictListCall { 2173 c.urlParams_.Set("filter", filter) 2174 return c 2175} 2176 2177// Gl sets the optional parameter "gl": Geolocation of end user. * The 2178// `gl` parameter value is a two-letter country code. The `gl` parameter 2179// boosts search results whose country of origin matches the parameter 2180// value. See the Country Codes 2181// (https://developers.google.com/custom-search/docs/xml_results_appendices#countryCodes) 2182// page for a list of valid values. * Specifying a `gl` parameter value 2183// should lead to more relevant results. This is particularly true for 2184// international customers and, even more specifically, for customers in 2185// English- speaking countries other than the United States. 2186func (c *CseSiterestrictListCall) Gl(gl string) *CseSiterestrictListCall { 2187 c.urlParams_.Set("gl", gl) 2188 return c 2189} 2190 2191// Googlehost sets the optional parameter "googlehost": **Deprecated**. 2192// Use the `gl` parameter for a similar effect. The local Google domain 2193// (for example, google.com, google.de, or google.fr) to use to perform 2194// the search. 2195func (c *CseSiterestrictListCall) Googlehost(googlehost string) *CseSiterestrictListCall { 2196 c.urlParams_.Set("googlehost", googlehost) 2197 return c 2198} 2199 2200// HighRange sets the optional parameter "highRange": Specifies the 2201// ending value for a search range. * Use `lowRange` and `highRange` to 2202// append an inclusive search range of `lowRange...highRange` to the 2203// query. 2204func (c *CseSiterestrictListCall) HighRange(highRange string) *CseSiterestrictListCall { 2205 c.urlParams_.Set("highRange", highRange) 2206 return c 2207} 2208 2209// Hl sets the optional parameter "hl": Sets the user interface 2210// language. * Explicitly setting this parameter improves the 2211// performance and the quality of your search results. * See the 2212// Interface Languages 2213// (https://developers.google.com/custom-search/docs/xml_results#wsInterfaceLanguages) 2214// section of Internationalizing Queries and Results Presentation 2215// (https://developers.google.com/custom-search/docs/xml_results#wsInternationalizing) 2216// for more information, and (Supported Interface 2217// Languages)[https://developers.google.com/custom-search/docs/xml_result 2218// s_appendices#interfaceLanguages] for a list of supported languages. 2219func (c *CseSiterestrictListCall) Hl(hl string) *CseSiterestrictListCall { 2220 c.urlParams_.Set("hl", hl) 2221 return c 2222} 2223 2224// Hq sets the optional parameter "hq": Appends the specified query 2225// terms to the query, as if they were combined with a logical AND 2226// operator. 2227func (c *CseSiterestrictListCall) Hq(hq string) *CseSiterestrictListCall { 2228 c.urlParams_.Set("hq", hq) 2229 return c 2230} 2231 2232// ImgColorType sets the optional parameter "imgColorType": Returns 2233// black and white, grayscale, transparent, or color images. Acceptable 2234// values are: * "color" * "gray" * "mono": black and white * 2235// "trans": transparent background 2236// 2237// Possible values: 2238// "imgColorTypeUndefined" - No image color type specified. 2239// "mono" - Black and white images only. 2240// "gray" - Grayscale images only. 2241// "color" - Color images only. 2242// "trans" - Images with transparent background 2243func (c *CseSiterestrictListCall) ImgColorType(imgColorType string) *CseSiterestrictListCall { 2244 c.urlParams_.Set("imgColorType", imgColorType) 2245 return c 2246} 2247 2248// ImgDominantColor sets the optional parameter "imgDominantColor": 2249// Returns images of a specific dominant color. Acceptable values are: * 2250// "black" * "blue" * "brown" * "gray" * "green" * "orange" 2251// * "pink" * "purple" * "red" * "teal" * "white" * "yellow" 2252// 2253// Possible values: 2254// "imgDominantColorUndefined" - No dominant color specified. 2255// "black" - Predominantly black images only. 2256// "blue" - Predominantly blue images only. 2257// "brown" - Predominantly brown images only. 2258// "gray" - Predominantly gray images only. 2259// "green" - Predominantly green images only. 2260// "orange" - Predominantly orange images only. 2261// "pink" - Predominantly pink images only. 2262// "purple" - Predominantly purple images only. 2263// "red" - Predominantly red images only. 2264// "teal" - Predominantly teal images only. 2265// "white" - Predominantly white images only. 2266// "yellow" - Predominantly yellow images only. 2267func (c *CseSiterestrictListCall) ImgDominantColor(imgDominantColor string) *CseSiterestrictListCall { 2268 c.urlParams_.Set("imgDominantColor", imgDominantColor) 2269 return c 2270} 2271 2272// ImgSize sets the optional parameter "imgSize": Returns images of a 2273// specified size. Acceptable values are: * "huge" * "icon" * 2274// "large" * "medium" * "small" * "xlarge" * "xxlarge" 2275// 2276// Possible values: 2277// "imgSizeUndefined" - No image size specified. 2278// "HUGE" - Only the largest possible images. 2279// "ICON" - Only very small icon-sized images. 2280// "LARGE" - Only large images. 2281// "MEDIUM" - Only medium images. 2282// "SMALL" - Only small images. 2283// "XLARGE" - Only very large images. 2284// "XXLARGE" - Only extremely large images. 2285func (c *CseSiterestrictListCall) ImgSize(imgSize string) *CseSiterestrictListCall { 2286 c.urlParams_.Set("imgSize", imgSize) 2287 return c 2288} 2289 2290// ImgType sets the optional parameter "imgType": Returns images of a 2291// type. Acceptable values are: * "clipart" * "face" * "lineart" * 2292// "stock" * "photo" * "animated" 2293// 2294// Possible values: 2295// "imgTypeUndefined" - No image type specified. 2296// "clipart" - Clipart-style images only. 2297// "face" - Images of faces only. 2298// "lineart" - Line art images only. 2299// "stock" - Stock images only. 2300// "photo" - Photo images only. 2301// "animated" - Animated images only. 2302func (c *CseSiterestrictListCall) ImgType(imgType string) *CseSiterestrictListCall { 2303 c.urlParams_.Set("imgType", imgType) 2304 return c 2305} 2306 2307// LinkSite sets the optional parameter "linkSite": Specifies that all 2308// search results should contain a link to a particular URL. 2309func (c *CseSiterestrictListCall) LinkSite(linkSite string) *CseSiterestrictListCall { 2310 c.urlParams_.Set("linkSite", linkSite) 2311 return c 2312} 2313 2314// LowRange sets the optional parameter "lowRange": Specifies the 2315// starting value for a search range. Use `lowRange` and `highRange` to 2316// append an inclusive search range of `lowRange...highRange` to the 2317// query. 2318func (c *CseSiterestrictListCall) LowRange(lowRange string) *CseSiterestrictListCall { 2319 c.urlParams_.Set("lowRange", lowRange) 2320 return c 2321} 2322 2323// Lr sets the optional parameter "lr": Restricts the search to 2324// documents written in a particular language (e.g., `lr=lang_ja`). 2325// Acceptable values are: * "lang_ar": Arabic * "lang_bg": Bulgarian 2326// * "lang_ca": Catalan * "lang_cs": Czech * "lang_da": Danish * 2327// "lang_de": German * "lang_el": Greek * "lang_en": English * 2328// "lang_es": Spanish * "lang_et": Estonian * "lang_fi": Finnish * 2329// "lang_fr": French * "lang_hr": Croatian * "lang_hu": Hungarian 2330// * "lang_id": Indonesian * "lang_is": Icelandic * "lang_it": 2331// Italian * "lang_iw": Hebrew * "lang_ja": Japanese * "lang_ko": 2332// Korean * "lang_lt": Lithuanian * "lang_lv": Latvian * 2333// "lang_nl": Dutch * "lang_no": Norwegian * "lang_pl": Polish * 2334// "lang_pt": Portuguese * "lang_ro": Romanian * "lang_ru": 2335// Russian * "lang_sk": Slovak * "lang_sl": Slovenian * "lang_sr": 2336// Serbian * "lang_sv": Swedish * "lang_tr": Turkish * 2337// "lang_zh-CN": Chinese (Simplified) * "lang_zh-TW": Chinese 2338// (Traditional) 2339func (c *CseSiterestrictListCall) Lr(lr string) *CseSiterestrictListCall { 2340 c.urlParams_.Set("lr", lr) 2341 return c 2342} 2343 2344// Num sets the optional parameter "num": Number of search results to 2345// return. * Valid values are integers between 1 and 10, inclusive. 2346func (c *CseSiterestrictListCall) Num(num int64) *CseSiterestrictListCall { 2347 c.urlParams_.Set("num", fmt.Sprint(num)) 2348 return c 2349} 2350 2351// OrTerms sets the optional parameter "orTerms": Provides additional 2352// search terms to check for in a document, where each document in the 2353// search results must contain at least one of the additional search 2354// terms. 2355func (c *CseSiterestrictListCall) OrTerms(orTerms string) *CseSiterestrictListCall { 2356 c.urlParams_.Set("orTerms", orTerms) 2357 return c 2358} 2359 2360// Q sets the optional parameter "q": Query 2361func (c *CseSiterestrictListCall) Q(q string) *CseSiterestrictListCall { 2362 c.urlParams_.Set("q", q) 2363 return c 2364} 2365 2366// RelatedSite sets the optional parameter "relatedSite": Specifies that 2367// all search results should be pages that are related to the specified 2368// URL. 2369func (c *CseSiterestrictListCall) RelatedSite(relatedSite string) *CseSiterestrictListCall { 2370 c.urlParams_.Set("relatedSite", relatedSite) 2371 return c 2372} 2373 2374// Rights sets the optional parameter "rights": Filters based on 2375// licensing. Supported values include: `cc_publicdomain`, 2376// `cc_attribute`, `cc_sharealike`, `cc_noncommercial`, `cc_nonderived` 2377// and combinations of these. See typical combinations 2378// (https://wiki.creativecommons.org/wiki/CC_Search_integration). 2379func (c *CseSiterestrictListCall) Rights(rights string) *CseSiterestrictListCall { 2380 c.urlParams_.Set("rights", rights) 2381 return c 2382} 2383 2384// Safe sets the optional parameter "safe": Search safety level. 2385// Acceptable values are: * "active": Enables SafeSearch filtering. * 2386// "off": Disables SafeSearch filtering. (default) 2387// 2388// Possible values: 2389// "safeUndefined" - SafeSearch mode unspecified. (Falls back to 2390// engine's configuration.) 2391// "active" - Turn SafeSearch on. 2392// "high" - Deprecated, equivalent to "active". 2393// "medium" - Deprecated, equivalent to "active". 2394// "off" - Turn SafeSearch off. 2395func (c *CseSiterestrictListCall) Safe(safe string) *CseSiterestrictListCall { 2396 c.urlParams_.Set("safe", safe) 2397 return c 2398} 2399 2400// SearchType sets the optional parameter "searchType": Specifies the 2401// search type: `image`. If unspecified, results are limited to 2402// webpages. Acceptable values are: * "image": custom image search. 2403// 2404// Possible values: 2405// "searchTypeUndefined" - Search type unspecified (defaults to web 2406// search). 2407// "image" - Image search. 2408func (c *CseSiterestrictListCall) SearchType(searchType string) *CseSiterestrictListCall { 2409 c.urlParams_.Set("searchType", searchType) 2410 return c 2411} 2412 2413// SiteSearch sets the optional parameter "siteSearch": Specifies a 2414// given site which should always be included or excluded from results 2415// (see `siteSearchFilter` parameter, below). 2416func (c *CseSiterestrictListCall) SiteSearch(siteSearch string) *CseSiterestrictListCall { 2417 c.urlParams_.Set("siteSearch", siteSearch) 2418 return c 2419} 2420 2421// SiteSearchFilter sets the optional parameter "siteSearchFilter": 2422// Controls whether to include or exclude results from the site named in 2423// the `siteSearch` parameter. Acceptable values are: * "e": exclude * 2424// "i": include 2425// 2426// Possible values: 2427// "siteSearchFilterUndefined" - Filter mode unspecified. 2428// "e" - Exclude results from the listed sites. 2429// "i" - Include only results from the listed sites. 2430func (c *CseSiterestrictListCall) SiteSearchFilter(siteSearchFilter string) *CseSiterestrictListCall { 2431 c.urlParams_.Set("siteSearchFilter", siteSearchFilter) 2432 return c 2433} 2434 2435// Sort sets the optional parameter "sort": The sort expression to apply 2436// to the results. The sort parameter specifies that the results be 2437// sorted according to the specified expression i.e. sort by date. 2438// Example: sort=date 2439// (https://developers.google.com/custom-search/docs/structured_search#sort-by-attribute). 2440func (c *CseSiterestrictListCall) Sort(sort string) *CseSiterestrictListCall { 2441 c.urlParams_.Set("sort", sort) 2442 return c 2443} 2444 2445// Start sets the optional parameter "start": The index of the first 2446// result to return. The default number of results per page is 10, so 2447// `&start=11` would start at the top of the second page of results. 2448// **Note**: The JSON API will never return more than 100 results, even 2449// if more than 100 documents match the query, so setting the sum of 2450// `start + num` to a number greater than 100 will produce an error. 2451// Also note that the maximum value for `num` is 10. 2452func (c *CseSiterestrictListCall) Start(start int64) *CseSiterestrictListCall { 2453 c.urlParams_.Set("start", fmt.Sprint(start)) 2454 return c 2455} 2456 2457// Fields allows partial responses to be retrieved. See 2458// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2459// for more information. 2460func (c *CseSiterestrictListCall) Fields(s ...googleapi.Field) *CseSiterestrictListCall { 2461 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2462 return c 2463} 2464 2465// IfNoneMatch sets the optional parameter which makes the operation 2466// fail if the object's ETag matches the given value. This is useful for 2467// getting updates only after the object has changed since the last 2468// request. Use googleapi.IsNotModified to check whether the response 2469// error from Do is the result of In-None-Match. 2470func (c *CseSiterestrictListCall) IfNoneMatch(entityTag string) *CseSiterestrictListCall { 2471 c.ifNoneMatch_ = entityTag 2472 return c 2473} 2474 2475// Context sets the context to be used in this call's Do method. Any 2476// pending HTTP request will be aborted if the provided context is 2477// canceled. 2478func (c *CseSiterestrictListCall) Context(ctx context.Context) *CseSiterestrictListCall { 2479 c.ctx_ = ctx 2480 return c 2481} 2482 2483// Header returns an http.Header that can be modified by the caller to 2484// add HTTP headers to the request. 2485func (c *CseSiterestrictListCall) Header() http.Header { 2486 if c.header_ == nil { 2487 c.header_ = make(http.Header) 2488 } 2489 return c.header_ 2490} 2491 2492func (c *CseSiterestrictListCall) doRequest(alt string) (*http.Response, error) { 2493 reqHeaders := make(http.Header) 2494 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 2495 for k, v := range c.header_ { 2496 reqHeaders[k] = v 2497 } 2498 reqHeaders.Set("User-Agent", c.s.userAgent()) 2499 if c.ifNoneMatch_ != "" { 2500 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2501 } 2502 var body io.Reader = nil 2503 c.urlParams_.Set("alt", alt) 2504 c.urlParams_.Set("prettyPrint", "false") 2505 urls := googleapi.ResolveRelative(c.s.BasePath, "customsearch/v1/siterestrict") 2506 urls += "?" + c.urlParams_.Encode() 2507 req, err := http.NewRequest("GET", urls, body) 2508 if err != nil { 2509 return nil, err 2510 } 2511 req.Header = reqHeaders 2512 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2513} 2514 2515// Do executes the "search.cse.siterestrict.list" call. 2516// Exactly one of *Search or error will be non-nil. Any non-2xx status 2517// code is an error. Response headers are in either 2518// *Search.ServerResponse.Header or (if a response was returned at all) 2519// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2520// check whether the returned error was because http.StatusNotModified 2521// was returned. 2522func (c *CseSiterestrictListCall) Do(opts ...googleapi.CallOption) (*Search, error) { 2523 gensupport.SetOptions(c.urlParams_, opts...) 2524 res, err := c.doRequest("json") 2525 if res != nil && res.StatusCode == http.StatusNotModified { 2526 if res.Body != nil { 2527 res.Body.Close() 2528 } 2529 return nil, &googleapi.Error{ 2530 Code: res.StatusCode, 2531 Header: res.Header, 2532 } 2533 } 2534 if err != nil { 2535 return nil, err 2536 } 2537 defer googleapi.CloseBody(res) 2538 if err := googleapi.CheckResponse(res); err != nil { 2539 return nil, err 2540 } 2541 ret := &Search{ 2542 ServerResponse: googleapi.ServerResponse{ 2543 Header: res.Header, 2544 HTTPStatusCode: res.StatusCode, 2545 }, 2546 } 2547 target := &ret 2548 if err := gensupport.DecodeResponse(target, res); err != nil { 2549 return nil, err 2550 } 2551 return ret, nil 2552 // { 2553 // "description": "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.", 2554 // "flatPath": "customsearch/v1/siterestrict", 2555 // "httpMethod": "GET", 2556 // "id": "search.cse.siterestrict.list", 2557 // "parameterOrder": [], 2558 // "parameters": { 2559 // "c2coff": { 2560 // "description": "Enables or disables [Simplified and Traditional Chinese Search](https://developers.google.com/custom-search/docs/xml_results#chineseSearch). The default value for this parameter is 0 (zero), meaning that the feature is enabled. Supported values are: * `1`: Disabled * `0`: Enabled (default)", 2561 // "location": "query", 2562 // "type": "string" 2563 // }, 2564 // "cr": { 2565 // "description": "Restricts search results to documents originating in a particular country. You may use [Boolean operators](https://developers.google.com/custom-search/docs/xml_results_appendices#booleanOperators) in the cr parameter's value. Google Search determines the country of a document by analyzing: * the top-level domain (TLD) of the document's URL * the geographic location of the Web server's IP address See the [Country Parameter Values](https://developers.google.com/custom-search/docs/xml_results_appendices#countryCollections) page for a list of valid values for this parameter.", 2566 // "location": "query", 2567 // "type": "string" 2568 // }, 2569 // "cx": { 2570 // "description": "The Programmable Search Engine ID to use for this request.", 2571 // "location": "query", 2572 // "type": "string" 2573 // }, 2574 // "dateRestrict": { 2575 // "description": "Restricts results to URLs based on date. Supported values include: * `d[number]`: requests results from the specified number of past days. * `w[number]`: requests results from the specified number of past weeks. * `m[number]`: requests results from the specified number of past months. * `y[number]`: requests results from the specified number of past years.", 2576 // "location": "query", 2577 // "type": "string" 2578 // }, 2579 // "exactTerms": { 2580 // "description": "Identifies a phrase that all documents in the search results must contain.", 2581 // "location": "query", 2582 // "type": "string" 2583 // }, 2584 // "excludeTerms": { 2585 // "description": "Identifies a word or phrase that should not appear in any documents in the search results.", 2586 // "location": "query", 2587 // "type": "string" 2588 // }, 2589 // "fileType": { 2590 // "description": "Restricts results to files of a specified extension. A list of file types indexable by Google can be found in Search Console [Help Center](https://support.google.com/webmasters/answer/35287).", 2591 // "location": "query", 2592 // "type": "string" 2593 // }, 2594 // "filter": { 2595 // "description": "Controls turning on or off the duplicate content filter. * See [Automatic Filtering](https://developers.google.com/custom-search/docs/xml_results#automaticFiltering) for more information about Google's search results filters. Note that host crowding filtering applies only to multi-site searches. * By default, Google applies filtering to all search results to improve the quality of those results. Acceptable values are: * `0`: Turns off duplicate content filter. * `1`: Turns on duplicate content filter.", 2596 // "location": "query", 2597 // "type": "string" 2598 // }, 2599 // "gl": { 2600 // "description": "Geolocation of end user. * The `gl` parameter value is a two-letter country code. The `gl` parameter boosts search results whose country of origin matches the parameter value. See the [Country Codes](https://developers.google.com/custom-search/docs/xml_results_appendices#countryCodes) page for a list of valid values. * Specifying a `gl` parameter value should lead to more relevant results. This is particularly true for international customers and, even more specifically, for customers in English- speaking countries other than the United States.", 2601 // "location": "query", 2602 // "type": "string" 2603 // }, 2604 // "googlehost": { 2605 // "description": "**Deprecated**. Use the `gl` parameter for a similar effect. The local Google domain (for example, google.com, google.de, or google.fr) to use to perform the search.", 2606 // "location": "query", 2607 // "type": "string" 2608 // }, 2609 // "highRange": { 2610 // "description": "Specifies the ending value for a search range. * Use `lowRange` and `highRange` to append an inclusive search range of `lowRange...highRange` to the query.", 2611 // "location": "query", 2612 // "type": "string" 2613 // }, 2614 // "hl": { 2615 // "description": "Sets the user interface language. * Explicitly setting this parameter improves the performance and the quality of your search results. * See the [Interface Languages](https://developers.google.com/custom-search/docs/xml_results#wsInterfaceLanguages) section of [Internationalizing Queries and Results Presentation](https://developers.google.com/custom-search/docs/xml_results#wsInternationalizing) for more information, and (Supported Interface Languages)[https://developers.google.com/custom-search/docs/xml_results_appendices#interfaceLanguages] for a list of supported languages.", 2616 // "location": "query", 2617 // "type": "string" 2618 // }, 2619 // "hq": { 2620 // "description": "Appends the specified query terms to the query, as if they were combined with a logical AND operator.", 2621 // "location": "query", 2622 // "type": "string" 2623 // }, 2624 // "imgColorType": { 2625 // "description": "Returns black and white, grayscale, transparent, or color images. Acceptable values are: * `\"color\"` * `\"gray\"` * `\"mono\"`: black and white * `\"trans\"`: transparent background", 2626 // "enum": [ 2627 // "imgColorTypeUndefined", 2628 // "mono", 2629 // "gray", 2630 // "color", 2631 // "trans" 2632 // ], 2633 // "enumDescriptions": [ 2634 // "No image color type specified.", 2635 // "Black and white images only.", 2636 // "Grayscale images only.", 2637 // "Color images only.", 2638 // "Images with transparent background" 2639 // ], 2640 // "location": "query", 2641 // "type": "string" 2642 // }, 2643 // "imgDominantColor": { 2644 // "description": "Returns images of a specific dominant color. Acceptable values are: * `\"black\"` * `\"blue\"` * `\"brown\"` * `\"gray\"` * `\"green\"` * `\"orange\"` * `\"pink\"` * `\"purple\"` * `\"red\"` * `\"teal\"` * `\"white\"` * `\"yellow\"`", 2645 // "enum": [ 2646 // "imgDominantColorUndefined", 2647 // "black", 2648 // "blue", 2649 // "brown", 2650 // "gray", 2651 // "green", 2652 // "orange", 2653 // "pink", 2654 // "purple", 2655 // "red", 2656 // "teal", 2657 // "white", 2658 // "yellow" 2659 // ], 2660 // "enumDescriptions": [ 2661 // "No dominant color specified.", 2662 // "Predominantly black images only.", 2663 // "Predominantly blue images only.", 2664 // "Predominantly brown images only.", 2665 // "Predominantly gray images only.", 2666 // "Predominantly green images only.", 2667 // "Predominantly orange images only.", 2668 // "Predominantly pink images only.", 2669 // "Predominantly purple images only.", 2670 // "Predominantly red images only.", 2671 // "Predominantly teal images only.", 2672 // "Predominantly white images only.", 2673 // "Predominantly yellow images only." 2674 // ], 2675 // "location": "query", 2676 // "type": "string" 2677 // }, 2678 // "imgSize": { 2679 // "description": "Returns images of a specified size. Acceptable values are: * `\"huge\"` * `\"icon\"` * `\"large\"` * `\"medium\"` * `\"small\"` * `\"xlarge\"` * `\"xxlarge\"`", 2680 // "enum": [ 2681 // "imgSizeUndefined", 2682 // "HUGE", 2683 // "ICON", 2684 // "LARGE", 2685 // "MEDIUM", 2686 // "SMALL", 2687 // "XLARGE", 2688 // "XXLARGE" 2689 // ], 2690 // "enumDescriptions": [ 2691 // "No image size specified.", 2692 // "Only the largest possible images.", 2693 // "Only very small icon-sized images.", 2694 // "Only large images.", 2695 // "Only medium images.", 2696 // "Only small images.", 2697 // "Only very large images.", 2698 // "Only extremely large images." 2699 // ], 2700 // "location": "query", 2701 // "type": "string" 2702 // }, 2703 // "imgType": { 2704 // "description": "Returns images of a type. Acceptable values are: * `\"clipart\"` * `\"face\"` * `\"lineart\"` * `\"stock\"` * `\"photo\"` * `\"animated\"`", 2705 // "enum": [ 2706 // "imgTypeUndefined", 2707 // "clipart", 2708 // "face", 2709 // "lineart", 2710 // "stock", 2711 // "photo", 2712 // "animated" 2713 // ], 2714 // "enumDescriptions": [ 2715 // "No image type specified.", 2716 // "Clipart-style images only.", 2717 // "Images of faces only.", 2718 // "Line art images only.", 2719 // "Stock images only.", 2720 // "Photo images only.", 2721 // "Animated images only." 2722 // ], 2723 // "location": "query", 2724 // "type": "string" 2725 // }, 2726 // "linkSite": { 2727 // "description": "Specifies that all search results should contain a link to a particular URL.", 2728 // "location": "query", 2729 // "type": "string" 2730 // }, 2731 // "lowRange": { 2732 // "description": "Specifies the starting value for a search range. Use `lowRange` and `highRange` to append an inclusive search range of `lowRange...highRange` to the query.", 2733 // "location": "query", 2734 // "type": "string" 2735 // }, 2736 // "lr": { 2737 // "description": "Restricts the search to documents written in a particular language (e.g., `lr=lang_ja`). Acceptable values are: * `\"lang_ar\"`: Arabic * `\"lang_bg\"`: Bulgarian * `\"lang_ca\"`: Catalan * `\"lang_cs\"`: Czech * `\"lang_da\"`: Danish * `\"lang_de\"`: German * `\"lang_el\"`: Greek * `\"lang_en\"`: English * `\"lang_es\"`: Spanish * `\"lang_et\"`: Estonian * `\"lang_fi\"`: Finnish * `\"lang_fr\"`: French * `\"lang_hr\"`: Croatian * `\"lang_hu\"`: Hungarian * `\"lang_id\"`: Indonesian * `\"lang_is\"`: Icelandic * `\"lang_it\"`: Italian * `\"lang_iw\"`: Hebrew * `\"lang_ja\"`: Japanese * `\"lang_ko\"`: Korean * `\"lang_lt\"`: Lithuanian * `\"lang_lv\"`: Latvian * `\"lang_nl\"`: Dutch * `\"lang_no\"`: Norwegian * `\"lang_pl\"`: Polish * `\"lang_pt\"`: Portuguese * `\"lang_ro\"`: Romanian * `\"lang_ru\"`: Russian * `\"lang_sk\"`: Slovak * `\"lang_sl\"`: Slovenian * `\"lang_sr\"`: Serbian * `\"lang_sv\"`: Swedish * `\"lang_tr\"`: Turkish * `\"lang_zh-CN\"`: Chinese (Simplified) * `\"lang_zh-TW\"`: Chinese (Traditional)", 2738 // "location": "query", 2739 // "type": "string" 2740 // }, 2741 // "num": { 2742 // "description": "Number of search results to return. * Valid values are integers between 1 and 10, inclusive.", 2743 // "format": "int32", 2744 // "location": "query", 2745 // "type": "integer" 2746 // }, 2747 // "orTerms": { 2748 // "description": "Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms.", 2749 // "location": "query", 2750 // "type": "string" 2751 // }, 2752 // "q": { 2753 // "description": "Query", 2754 // "location": "query", 2755 // "type": "string" 2756 // }, 2757 // "relatedSite": { 2758 // "description": "Specifies that all search results should be pages that are related to the specified URL.", 2759 // "location": "query", 2760 // "type": "string" 2761 // }, 2762 // "rights": { 2763 // "description": "Filters based on licensing. Supported values include: `cc_publicdomain`, `cc_attribute`, `cc_sharealike`, `cc_noncommercial`, `cc_nonderived` and combinations of these. See [typical combinations](https://wiki.creativecommons.org/wiki/CC_Search_integration).", 2764 // "location": "query", 2765 // "type": "string" 2766 // }, 2767 // "safe": { 2768 // "description": "Search safety level. Acceptable values are: * `\"active\"`: Enables SafeSearch filtering. * `\"off\"`: Disables SafeSearch filtering. (default)", 2769 // "enum": [ 2770 // "safeUndefined", 2771 // "active", 2772 // "high", 2773 // "medium", 2774 // "off" 2775 // ], 2776 // "enumDescriptions": [ 2777 // "SafeSearch mode unspecified. (Falls back to engine's configuration.)", 2778 // "Turn SafeSearch on.", 2779 // "Deprecated, equivalent to \"active\".", 2780 // "Deprecated, equivalent to \"active\".", 2781 // "Turn SafeSearch off." 2782 // ], 2783 // "location": "query", 2784 // "type": "string" 2785 // }, 2786 // "searchType": { 2787 // "description": "Specifies the search type: `image`. If unspecified, results are limited to webpages. Acceptable values are: * `\"image\"`: custom image search.", 2788 // "enum": [ 2789 // "searchTypeUndefined", 2790 // "image" 2791 // ], 2792 // "enumDescriptions": [ 2793 // "Search type unspecified (defaults to web search).", 2794 // "Image search." 2795 // ], 2796 // "location": "query", 2797 // "type": "string" 2798 // }, 2799 // "siteSearch": { 2800 // "description": "Specifies a given site which should always be included or excluded from results (see `siteSearchFilter` parameter, below).", 2801 // "location": "query", 2802 // "type": "string" 2803 // }, 2804 // "siteSearchFilter": { 2805 // "description": "Controls whether to include or exclude results from the site named in the `siteSearch` parameter. Acceptable values are: * `\"e\"`: exclude * `\"i\"`: include", 2806 // "enum": [ 2807 // "siteSearchFilterUndefined", 2808 // "e", 2809 // "i" 2810 // ], 2811 // "enumDescriptions": [ 2812 // "Filter mode unspecified.", 2813 // "Exclude results from the listed sites.", 2814 // "Include only results from the listed sites." 2815 // ], 2816 // "location": "query", 2817 // "type": "string" 2818 // }, 2819 // "sort": { 2820 // "description": "The sort expression to apply to the results. The sort parameter specifies that the results be sorted according to the specified expression i.e. sort by date. [Example: sort=date](https://developers.google.com/custom-search/docs/structured_search#sort-by-attribute).", 2821 // "location": "query", 2822 // "type": "string" 2823 // }, 2824 // "start": { 2825 // "description": "The index of the first result to return. The default number of results per page is 10, so `\u0026start=11` would start at the top of the second page of results. **Note**: The JSON API will never return more than 100 results, even if more than 100 documents match the query, so setting the sum of `start + num` to a number greater than 100 will produce an error. Also note that the maximum value for `num` is 10.", 2826 // "format": "uint32", 2827 // "location": "query", 2828 // "type": "integer" 2829 // } 2830 // }, 2831 // "path": "customsearch/v1/siterestrict", 2832 // "response": { 2833 // "$ref": "Search" 2834 // } 2835 // } 2836 2837} 2838