You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2208 lines
68 KiB

  1. // Copyright 2019 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. // Code generated file. DO NOT EDIT.
  5. // Package customsearch provides access to the CustomSearch API.
  6. //
  7. // For product documentation, see: https://developers.google.com/custom-search/v1/using_rest
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/customsearch/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // customsearchService, err := customsearch.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // customsearchService, err := customsearch.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // customsearchService, err := customsearch.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package customsearch // import "google.golang.org/api/customsearch/v1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "customsearch:v1"
  67. const apiName = "customsearch"
  68. const apiVersion = "v1"
  69. const basePath = "https://www.googleapis.com/customsearch/"
  70. // NewService creates a new Service.
  71. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  72. client, endpoint, err := htransport.NewClient(ctx, opts...)
  73. if err != nil {
  74. return nil, err
  75. }
  76. s, err := New(client)
  77. if err != nil {
  78. return nil, err
  79. }
  80. if endpoint != "" {
  81. s.BasePath = endpoint
  82. }
  83. return s, nil
  84. }
  85. // New creates a new Service. It uses the provided http.Client for requests.
  86. //
  87. // Deprecated: please use NewService instead.
  88. // To provide a custom HTTP client, use option.WithHTTPClient.
  89. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  90. func New(client *http.Client) (*Service, error) {
  91. if client == nil {
  92. return nil, errors.New("client is nil")
  93. }
  94. s := &Service{client: client, BasePath: basePath}
  95. s.Cse = NewCseService(s)
  96. return s, nil
  97. }
  98. type Service struct {
  99. client *http.Client
  100. BasePath string // API endpoint base URL
  101. UserAgent string // optional additional User-Agent fragment
  102. Cse *CseService
  103. }
  104. func (s *Service) userAgent() string {
  105. if s.UserAgent == "" {
  106. return googleapi.UserAgent
  107. }
  108. return googleapi.UserAgent + " " + s.UserAgent
  109. }
  110. func NewCseService(s *Service) *CseService {
  111. rs := &CseService{s: s}
  112. rs.Siterestrict = NewCseSiterestrictService(s)
  113. return rs
  114. }
  115. type CseService struct {
  116. s *Service
  117. Siterestrict *CseSiterestrictService
  118. }
  119. func NewCseSiterestrictService(s *Service) *CseSiterestrictService {
  120. rs := &CseSiterestrictService{s: s}
  121. return rs
  122. }
  123. type CseSiterestrictService struct {
  124. s *Service
  125. }
  126. type Context struct {
  127. Facets [][]*ContextFacetsItem `json:"facets,omitempty"`
  128. Title string `json:"title,omitempty"`
  129. // ForceSendFields is a list of field names (e.g. "Facets") to
  130. // unconditionally include in API requests. By default, fields with
  131. // empty values are omitted from API requests. However, any non-pointer,
  132. // non-interface field appearing in ForceSendFields will be sent to the
  133. // server regardless of whether the field is empty or not. This may be
  134. // used to include empty fields in Patch requests.
  135. ForceSendFields []string `json:"-"`
  136. // NullFields is a list of field names (e.g. "Facets") to include in API
  137. // requests with the JSON null value. By default, fields with empty
  138. // values are omitted from API requests. However, any field with an
  139. // empty value appearing in NullFields will be sent to the server as
  140. // null. It is an error if a field in this list has a non-empty value.
  141. // This may be used to include null fields in Patch requests.
  142. NullFields []string `json:"-"`
  143. }
  144. func (s *Context) MarshalJSON() ([]byte, error) {
  145. type NoMethod Context
  146. raw := NoMethod(*s)
  147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  148. }
  149. type ContextFacetsItem struct {
  150. Anchor string `json:"anchor,omitempty"`
  151. Label string `json:"label,omitempty"`
  152. LabelWithOp string `json:"label_with_op,omitempty"`
  153. // ForceSendFields is a list of field names (e.g. "Anchor") to
  154. // unconditionally include in API requests. By default, fields with
  155. // empty values are omitted from API requests. However, any non-pointer,
  156. // non-interface field appearing in ForceSendFields will be sent to the
  157. // server regardless of whether the field is empty or not. This may be
  158. // used to include empty fields in Patch requests.
  159. ForceSendFields []string `json:"-"`
  160. // NullFields is a list of field names (e.g. "Anchor") to include in API
  161. // requests with the JSON null value. By default, fields with empty
  162. // values are omitted from API requests. However, any field with an
  163. // empty value appearing in NullFields will be sent to the server as
  164. // null. It is an error if a field in this list has a non-empty value.
  165. // This may be used to include null fields in Patch requests.
  166. NullFields []string `json:"-"`
  167. }
  168. func (s *ContextFacetsItem) MarshalJSON() ([]byte, error) {
  169. type NoMethod ContextFacetsItem
  170. raw := NoMethod(*s)
  171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  172. }
  173. type Promotion struct {
  174. BodyLines []*PromotionBodyLines `json:"bodyLines,omitempty"`
  175. DisplayLink string `json:"displayLink,omitempty"`
  176. HtmlTitle string `json:"htmlTitle,omitempty"`
  177. Image *PromotionImage `json:"image,omitempty"`
  178. Link string `json:"link,omitempty"`
  179. Title string `json:"title,omitempty"`
  180. // ForceSendFields is a list of field names (e.g. "BodyLines") to
  181. // unconditionally include in API requests. By default, fields with
  182. // empty values are omitted from API requests. However, any non-pointer,
  183. // non-interface field appearing in ForceSendFields will be sent to the
  184. // server regardless of whether the field is empty or not. This may be
  185. // used to include empty fields in Patch requests.
  186. ForceSendFields []string `json:"-"`
  187. // NullFields is a list of field names (e.g. "BodyLines") to include in
  188. // API requests with the JSON null value. By default, fields with empty
  189. // values are omitted from API requests. However, any field with an
  190. // empty value appearing in NullFields will be sent to the server as
  191. // null. It is an error if a field in this list has a non-empty value.
  192. // This may be used to include null fields in Patch requests.
  193. NullFields []string `json:"-"`
  194. }
  195. func (s *Promotion) MarshalJSON() ([]byte, error) {
  196. type NoMethod Promotion
  197. raw := NoMethod(*s)
  198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  199. }
  200. type PromotionBodyLines struct {
  201. HtmlTitle string `json:"htmlTitle,omitempty"`
  202. Link string `json:"link,omitempty"`
  203. Title string `json:"title,omitempty"`
  204. Url string `json:"url,omitempty"`
  205. // ForceSendFields is a list of field names (e.g. "HtmlTitle") to
  206. // unconditionally include in API requests. By default, fields with
  207. // empty values are omitted from API requests. However, any non-pointer,
  208. // non-interface field appearing in ForceSendFields will be sent to the
  209. // server regardless of whether the field is empty or not. This may be
  210. // used to include empty fields in Patch requests.
  211. ForceSendFields []string `json:"-"`
  212. // NullFields is a list of field names (e.g. "HtmlTitle") to include in
  213. // API requests with the JSON null value. By default, fields with empty
  214. // values are omitted from API requests. However, any field with an
  215. // empty value appearing in NullFields will be sent to the server as
  216. // null. It is an error if a field in this list has a non-empty value.
  217. // This may be used to include null fields in Patch requests.
  218. NullFields []string `json:"-"`
  219. }
  220. func (s *PromotionBodyLines) MarshalJSON() ([]byte, error) {
  221. type NoMethod PromotionBodyLines
  222. raw := NoMethod(*s)
  223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  224. }
  225. type PromotionImage struct {
  226. Height int64 `json:"height,omitempty"`
  227. Source string `json:"source,omitempty"`
  228. Width int64 `json:"width,omitempty"`
  229. // ForceSendFields is a list of field names (e.g. "Height") to
  230. // unconditionally include in API requests. By default, fields with
  231. // empty values are omitted from API requests. However, any non-pointer,
  232. // non-interface field appearing in ForceSendFields will be sent to the
  233. // server regardless of whether the field is empty or not. This may be
  234. // used to include empty fields in Patch requests.
  235. ForceSendFields []string `json:"-"`
  236. // NullFields is a list of field names (e.g. "Height") to include in API
  237. // requests with the JSON null value. By default, fields with empty
  238. // values are omitted from API requests. However, any field with an
  239. // empty value appearing in NullFields will be sent to the server as
  240. // null. It is an error if a field in this list has a non-empty value.
  241. // This may be used to include null fields in Patch requests.
  242. NullFields []string `json:"-"`
  243. }
  244. func (s *PromotionImage) MarshalJSON() ([]byte, error) {
  245. type NoMethod PromotionImage
  246. raw := NoMethod(*s)
  247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  248. }
  249. type Query struct {
  250. Count int64 `json:"count,omitempty"`
  251. Cr string `json:"cr,omitempty"`
  252. Cx string `json:"cx,omitempty"`
  253. DateRestrict string `json:"dateRestrict,omitempty"`
  254. DisableCnTwTranslation string `json:"disableCnTwTranslation,omitempty"`
  255. ExactTerms string `json:"exactTerms,omitempty"`
  256. ExcludeTerms string `json:"excludeTerms,omitempty"`
  257. FileType string `json:"fileType,omitempty"`
  258. Filter string `json:"filter,omitempty"`
  259. Gl string `json:"gl,omitempty"`
  260. GoogleHost string `json:"googleHost,omitempty"`
  261. HighRange string `json:"highRange,omitempty"`
  262. Hl string `json:"hl,omitempty"`
  263. Hq string `json:"hq,omitempty"`
  264. ImgColorType string `json:"imgColorType,omitempty"`
  265. ImgDominantColor string `json:"imgDominantColor,omitempty"`
  266. ImgSize string `json:"imgSize,omitempty"`
  267. ImgType string `json:"imgType,omitempty"`
  268. InputEncoding string `json:"inputEncoding,omitempty"`
  269. Language string `json:"language,omitempty"`
  270. LinkSite string `json:"linkSite,omitempty"`
  271. LowRange string `json:"lowRange,omitempty"`
  272. OrTerms string `json:"orTerms,omitempty"`
  273. OutputEncoding string `json:"outputEncoding,omitempty"`
  274. RelatedSite string `json:"relatedSite,omitempty"`
  275. Rights string `json:"rights,omitempty"`
  276. Safe string `json:"safe,omitempty"`
  277. SearchTerms string `json:"searchTerms,omitempty"`
  278. SearchType string `json:"searchType,omitempty"`
  279. SiteSearch string `json:"siteSearch,omitempty"`
  280. SiteSearchFilter string `json:"siteSearchFilter,omitempty"`
  281. Sort string `json:"sort,omitempty"`
  282. StartIndex int64 `json:"startIndex,omitempty"`
  283. StartPage int64 `json:"startPage,omitempty"`
  284. Title string `json:"title,omitempty"`
  285. TotalResults int64 `json:"totalResults,omitempty,string"`
  286. // ForceSendFields is a list of field names (e.g. "Count") to
  287. // unconditionally include in API requests. By default, fields with
  288. // empty values are omitted from API requests. However, any non-pointer,
  289. // non-interface field appearing in ForceSendFields will be sent to the
  290. // server regardless of whether the field is empty or not. This may be
  291. // used to include empty fields in Patch requests.
  292. ForceSendFields []string `json:"-"`
  293. // NullFields is a list of field names (e.g. "Count") to include in API
  294. // requests with the JSON null value. By default, fields with empty
  295. // values are omitted from API requests. However, any field with an
  296. // empty value appearing in NullFields will be sent to the server as
  297. // null. It is an error if a field in this list has a non-empty value.
  298. // This may be used to include null fields in Patch requests.
  299. NullFields []string `json:"-"`
  300. }
  301. func (s *Query) MarshalJSON() ([]byte, error) {
  302. type NoMethod Query
  303. raw := NoMethod(*s)
  304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  305. }
  306. type Result struct {
  307. CacheId string `json:"cacheId,omitempty"`
  308. DisplayLink string `json:"displayLink,omitempty"`
  309. FileFormat string `json:"fileFormat,omitempty"`
  310. FormattedUrl string `json:"formattedUrl,omitempty"`
  311. HtmlFormattedUrl string `json:"htmlFormattedUrl,omitempty"`
  312. HtmlSnippet string `json:"htmlSnippet,omitempty"`
  313. HtmlTitle string `json:"htmlTitle,omitempty"`
  314. Image *ResultImage `json:"image,omitempty"`
  315. Kind string `json:"kind,omitempty"`
  316. Labels []*ResultLabels `json:"labels,omitempty"`
  317. Link string `json:"link,omitempty"`
  318. Mime string `json:"mime,omitempty"`
  319. Pagemap map[string][]googleapi.RawMessage `json:"pagemap,omitempty"`
  320. Snippet string `json:"snippet,omitempty"`
  321. Title string `json:"title,omitempty"`
  322. // ForceSendFields is a list of field names (e.g. "CacheId") to
  323. // unconditionally include in API requests. By default, fields with
  324. // empty values are omitted from API requests. However, any non-pointer,
  325. // non-interface field appearing in ForceSendFields will be sent to the
  326. // server regardless of whether the field is empty or not. This may be
  327. // used to include empty fields in Patch requests.
  328. ForceSendFields []string `json:"-"`
  329. // NullFields is a list of field names (e.g. "CacheId") to include in
  330. // API requests with the JSON null value. By default, fields with empty
  331. // values are omitted from API requests. However, any field with an
  332. // empty value appearing in NullFields will be sent to the server as
  333. // null. It is an error if a field in this list has a non-empty value.
  334. // This may be used to include null fields in Patch requests.
  335. NullFields []string `json:"-"`
  336. }
  337. func (s *Result) MarshalJSON() ([]byte, error) {
  338. type NoMethod Result
  339. raw := NoMethod(*s)
  340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  341. }
  342. type ResultImage struct {
  343. ByteSize int64 `json:"byteSize,omitempty"`
  344. ContextLink string `json:"contextLink,omitempty"`
  345. Height int64 `json:"height,omitempty"`
  346. ThumbnailHeight int64 `json:"thumbnailHeight,omitempty"`
  347. ThumbnailLink string `json:"thumbnailLink,omitempty"`
  348. ThumbnailWidth int64 `json:"thumbnailWidth,omitempty"`
  349. Width int64 `json:"width,omitempty"`
  350. // ForceSendFields is a list of field names (e.g. "ByteSize") to
  351. // unconditionally include in API requests. By default, fields with
  352. // empty values are omitted from API requests. However, any non-pointer,
  353. // non-interface field appearing in ForceSendFields will be sent to the
  354. // server regardless of whether the field is empty or not. This may be
  355. // used to include empty fields in Patch requests.
  356. ForceSendFields []string `json:"-"`
  357. // NullFields is a list of field names (e.g. "ByteSize") to include in
  358. // API requests with the JSON null value. By default, fields with empty
  359. // values are omitted from API requests. However, any field with an
  360. // empty value appearing in NullFields will be sent to the server as
  361. // null. It is an error if a field in this list has a non-empty value.
  362. // This may be used to include null fields in Patch requests.
  363. NullFields []string `json:"-"`
  364. }
  365. func (s *ResultImage) MarshalJSON() ([]byte, error) {
  366. type NoMethod ResultImage
  367. raw := NoMethod(*s)
  368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  369. }
  370. type ResultLabels struct {
  371. DisplayName string `json:"displayName,omitempty"`
  372. LabelWithOp string `json:"label_with_op,omitempty"`
  373. Name string `json:"name,omitempty"`
  374. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  375. // unconditionally include in API requests. By default, fields with
  376. // empty values are omitted from API requests. However, any non-pointer,
  377. // non-interface field appearing in ForceSendFields will be sent to the
  378. // server regardless of whether the field is empty or not. This may be
  379. // used to include empty fields in Patch requests.
  380. ForceSendFields []string `json:"-"`
  381. // NullFields is a list of field names (e.g. "DisplayName") to include
  382. // in API requests with the JSON null value. By default, fields with
  383. // empty values are omitted from API requests. However, any field with
  384. // an empty value appearing in NullFields will be sent to the server as
  385. // null. It is an error if a field in this list has a non-empty value.
  386. // This may be used to include null fields in Patch requests.
  387. NullFields []string `json:"-"`
  388. }
  389. func (s *ResultLabels) MarshalJSON() ([]byte, error) {
  390. type NoMethod ResultLabels
  391. raw := NoMethod(*s)
  392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  393. }
  394. type Search struct {
  395. Context *Context `json:"context,omitempty"`
  396. Items []*Result `json:"items,omitempty"`
  397. Kind string `json:"kind,omitempty"`
  398. Promotions []*Promotion `json:"promotions,omitempty"`
  399. Queries map[string][]Query `json:"queries,omitempty"`
  400. SearchInformation *SearchSearchInformation `json:"searchInformation,omitempty"`
  401. Spelling *SearchSpelling `json:"spelling,omitempty"`
  402. Url *SearchUrl `json:"url,omitempty"`
  403. // ServerResponse contains the HTTP response code and headers from the
  404. // server.
  405. googleapi.ServerResponse `json:"-"`
  406. // ForceSendFields is a list of field names (e.g. "Context") to
  407. // unconditionally include in API requests. By default, fields with
  408. // empty values are omitted from API requests. However, any non-pointer,
  409. // non-interface field appearing in ForceSendFields will be sent to the
  410. // server regardless of whether the field is empty or not. This may be
  411. // used to include empty fields in Patch requests.
  412. ForceSendFields []string `json:"-"`
  413. // NullFields is a list of field names (e.g. "Context") to include in
  414. // API requests with the JSON null value. By default, fields with empty
  415. // values are omitted from API requests. However, any field with an
  416. // empty value appearing in NullFields will be sent to the server as
  417. // null. It is an error if a field in this list has a non-empty value.
  418. // This may be used to include null fields in Patch requests.
  419. NullFields []string `json:"-"`
  420. }
  421. func (s *Search) MarshalJSON() ([]byte, error) {
  422. type NoMethod Search
  423. raw := NoMethod(*s)
  424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  425. }
  426. type SearchSearchInformation struct {
  427. FormattedSearchTime string `json:"formattedSearchTime,omitempty"`
  428. FormattedTotalResults string `json:"formattedTotalResults,omitempty"`
  429. SearchTime float64 `json:"searchTime,omitempty"`
  430. TotalResults int64 `json:"totalResults,omitempty,string"`
  431. // ForceSendFields is a list of field names (e.g. "FormattedSearchTime")
  432. // to unconditionally include in API requests. By default, fields with
  433. // empty values are omitted from API requests. However, any non-pointer,
  434. // non-interface field appearing in ForceSendFields will be sent to the
  435. // server regardless of whether the field is empty or not. This may be
  436. // used to include empty fields in Patch requests.
  437. ForceSendFields []string `json:"-"`
  438. // NullFields is a list of field names (e.g. "FormattedSearchTime") to
  439. // include in API requests with the JSON null value. By default, fields
  440. // with empty values are omitted from API requests. However, any field
  441. // with an empty value appearing in NullFields will be sent to the
  442. // server as null. It is an error if a field in this list has a
  443. // non-empty value. This may be used to include null fields in Patch
  444. // requests.
  445. NullFields []string `json:"-"`
  446. }
  447. func (s *SearchSearchInformation) MarshalJSON() ([]byte, error) {
  448. type NoMethod SearchSearchInformation
  449. raw := NoMethod(*s)
  450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  451. }
  452. func (s *SearchSearchInformation) UnmarshalJSON(data []byte) error {
  453. type NoMethod SearchSearchInformation
  454. var s1 struct {
  455. SearchTime gensupport.JSONFloat64 `json:"searchTime"`
  456. *NoMethod
  457. }
  458. s1.NoMethod = (*NoMethod)(s)
  459. if err := json.Unmarshal(data, &s1); err != nil {
  460. return err
  461. }
  462. s.SearchTime = float64(s1.SearchTime)
  463. return nil
  464. }
  465. type SearchSpelling struct {
  466. CorrectedQuery string `json:"correctedQuery,omitempty"`
  467. HtmlCorrectedQuery string `json:"htmlCorrectedQuery,omitempty"`
  468. // ForceSendFields is a list of field names (e.g. "CorrectedQuery") to
  469. // unconditionally include in API requests. By default, fields with
  470. // empty values are omitted from API requests. However, any non-pointer,
  471. // non-interface field appearing in ForceSendFields will be sent to the
  472. // server regardless of whether the field is empty or not. This may be
  473. // used to include empty fields in Patch requests.
  474. ForceSendFields []string `json:"-"`
  475. // NullFields is a list of field names (e.g. "CorrectedQuery") to
  476. // include in API requests with the JSON null value. By default, fields
  477. // with empty values are omitted from API requests. However, any field
  478. // with an empty value appearing in NullFields will be sent to the
  479. // server as null. It is an error if a field in this list has a
  480. // non-empty value. This may be used to include null fields in Patch
  481. // requests.
  482. NullFields []string `json:"-"`
  483. }
  484. func (s *SearchSpelling) MarshalJSON() ([]byte, error) {
  485. type NoMethod SearchSpelling
  486. raw := NoMethod(*s)
  487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  488. }
  489. type SearchUrl struct {
  490. Template string `json:"template,omitempty"`
  491. Type string `json:"type,omitempty"`
  492. // ForceSendFields is a list of field names (e.g. "Template") to
  493. // unconditionally include in API requests. By default, fields with
  494. // empty values are omitted from API requests. However, any non-pointer,
  495. // non-interface field appearing in ForceSendFields will be sent to the
  496. // server regardless of whether the field is empty or not. This may be
  497. // used to include empty fields in Patch requests.
  498. ForceSendFields []string `json:"-"`
  499. // NullFields is a list of field names (e.g. "Template") to include in
  500. // API requests with the JSON null value. By default, fields with empty
  501. // values are omitted from API requests. However, any field with an
  502. // empty value appearing in NullFields will be sent to the server as
  503. // null. It is an error if a field in this list has a non-empty value.
  504. // This may be used to include null fields in Patch requests.
  505. NullFields []string `json:"-"`
  506. }
  507. func (s *SearchUrl) MarshalJSON() ([]byte, error) {
  508. type NoMethod SearchUrl
  509. raw := NoMethod(*s)
  510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  511. }
  512. // method id "search.cse.list":
  513. type CseListCall struct {
  514. s *Service
  515. urlParams_ gensupport.URLParams
  516. ifNoneMatch_ string
  517. ctx_ context.Context
  518. header_ http.Header
  519. }
  520. // List: Returns metadata about the search performed, metadata about the
  521. // custom search engine used for the search, and the search results.
  522. func (r *CseService) List(q string) *CseListCall {
  523. c := &CseListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  524. c.urlParams_.Set("q", q)
  525. return c
  526. }
  527. // C2coff sets the optional parameter "c2coff": Turns off the
  528. // translation between zh-CN and zh-TW.
  529. func (c *CseListCall) C2coff(c2coff string) *CseListCall {
  530. c.urlParams_.Set("c2coff", c2coff)
  531. return c
  532. }
  533. // Cr sets the optional parameter "cr": Country restrict(s).
  534. func (c *CseListCall) Cr(cr string) *CseListCall {
  535. c.urlParams_.Set("cr", cr)
  536. return c
  537. }
  538. // Cx sets the optional parameter "cx": The custom search engine ID to
  539. // scope this search query
  540. func (c *CseListCall) Cx(cx string) *CseListCall {
  541. c.urlParams_.Set("cx", cx)
  542. return c
  543. }
  544. // DateRestrict sets the optional parameter "dateRestrict": Specifies
  545. // all search results are from a time period
  546. func (c *CseListCall) DateRestrict(dateRestrict string) *CseListCall {
  547. c.urlParams_.Set("dateRestrict", dateRestrict)
  548. return c
  549. }
  550. // ExactTerms sets the optional parameter "exactTerms": Identifies a
  551. // phrase that all documents in the search results must contain
  552. func (c *CseListCall) ExactTerms(exactTerms string) *CseListCall {
  553. c.urlParams_.Set("exactTerms", exactTerms)
  554. return c
  555. }
  556. // ExcludeTerms sets the optional parameter "excludeTerms": Identifies a
  557. // word or phrase that should not appear in any documents in the search
  558. // results
  559. func (c *CseListCall) ExcludeTerms(excludeTerms string) *CseListCall {
  560. c.urlParams_.Set("excludeTerms", excludeTerms)
  561. return c
  562. }
  563. // FileType sets the optional parameter "fileType": Returns images of a
  564. // specified type. Some of the allowed values are: bmp, gif, png, jpg,
  565. // svg, pdf, ...
  566. func (c *CseListCall) FileType(fileType string) *CseListCall {
  567. c.urlParams_.Set("fileType", fileType)
  568. return c
  569. }
  570. // Filter sets the optional parameter "filter": Controls turning on or
  571. // off the duplicate content filter.
  572. //
  573. // Possible values:
  574. // "0" - Turns off duplicate content filter.
  575. // "1" - Turns on duplicate content filter.
  576. func (c *CseListCall) Filter(filter string) *CseListCall {
  577. c.urlParams_.Set("filter", filter)
  578. return c
  579. }
  580. // Gl sets the optional parameter "gl": Geolocation of end user.
  581. func (c *CseListCall) Gl(gl string) *CseListCall {
  582. c.urlParams_.Set("gl", gl)
  583. return c
  584. }
  585. // Googlehost sets the optional parameter "googlehost": The local Google
  586. // domain to use to perform the search.
  587. func (c *CseListCall) Googlehost(googlehost string) *CseListCall {
  588. c.urlParams_.Set("googlehost", googlehost)
  589. return c
  590. }
  591. // HighRange sets the optional parameter "highRange": Creates a range in
  592. // form as_nlo value..as_nhi value and attempts to append it to query
  593. func (c *CseListCall) HighRange(highRange string) *CseListCall {
  594. c.urlParams_.Set("highRange", highRange)
  595. return c
  596. }
  597. // Hl sets the optional parameter "hl": Sets the user interface
  598. // language.
  599. func (c *CseListCall) Hl(hl string) *CseListCall {
  600. c.urlParams_.Set("hl", hl)
  601. return c
  602. }
  603. // Hq sets the optional parameter "hq": Appends the extra query terms to
  604. // the query.
  605. func (c *CseListCall) Hq(hq string) *CseListCall {
  606. c.urlParams_.Set("hq", hq)
  607. return c
  608. }
  609. // ImgColorType sets the optional parameter "imgColorType": Returns
  610. // black and white, grayscale, or color images: mono, gray, and color.
  611. //
  612. // Possible values:
  613. // "color" - color
  614. // "gray" - gray
  615. // "mono" - mono
  616. func (c *CseListCall) ImgColorType(imgColorType string) *CseListCall {
  617. c.urlParams_.Set("imgColorType", imgColorType)
  618. return c
  619. }
  620. // ImgDominantColor sets the optional parameter "imgDominantColor":
  621. // Returns images of a specific dominant color: red, orange, yellow,
  622. // green, teal, blue, purple, pink, white, gray, black and brown.
  623. //
  624. // Possible values:
  625. // "black" - black
  626. // "blue" - blue
  627. // "brown" - brown
  628. // "gray" - gray
  629. // "green" - green
  630. // "orange" - orange
  631. // "pink" - pink
  632. // "purple" - purple
  633. // "red" - red
  634. // "teal" - teal
  635. // "white" - white
  636. // "yellow" - yellow
  637. func (c *CseListCall) ImgDominantColor(imgDominantColor string) *CseListCall {
  638. c.urlParams_.Set("imgDominantColor", imgDominantColor)
  639. return c
  640. }
  641. // ImgSize sets the optional parameter "imgSize": Returns images of a
  642. // specified size, where size can be one of: icon, small, medium, large,
  643. // xlarge, xxlarge, and huge.
  644. //
  645. // Possible values:
  646. // "huge" - huge
  647. // "icon" - icon
  648. // "large" - large
  649. // "medium" - medium
  650. // "small" - small
  651. // "xlarge" - xlarge
  652. // "xxlarge" - xxlarge
  653. func (c *CseListCall) ImgSize(imgSize string) *CseListCall {
  654. c.urlParams_.Set("imgSize", imgSize)
  655. return c
  656. }
  657. // ImgType sets the optional parameter "imgType": Returns images of a
  658. // type, which can be one of: clipart, face, lineart, news, and photo.
  659. //
  660. // Possible values:
  661. // "clipart" - clipart
  662. // "face" - face
  663. // "lineart" - lineart
  664. // "news" - news
  665. // "photo" - photo
  666. func (c *CseListCall) ImgType(imgType string) *CseListCall {
  667. c.urlParams_.Set("imgType", imgType)
  668. return c
  669. }
  670. // LinkSite sets the optional parameter "linkSite": Specifies that all
  671. // search results should contain a link to a particular URL
  672. func (c *CseListCall) LinkSite(linkSite string) *CseListCall {
  673. c.urlParams_.Set("linkSite", linkSite)
  674. return c
  675. }
  676. // LowRange sets the optional parameter "lowRange": Creates a range in
  677. // form as_nlo value..as_nhi value and attempts to append it to query
  678. func (c *CseListCall) LowRange(lowRange string) *CseListCall {
  679. c.urlParams_.Set("lowRange", lowRange)
  680. return c
  681. }
  682. // Lr sets the optional parameter "lr": The language restriction for the
  683. // search results
  684. //
  685. // Possible values:
  686. // "lang_ar" - Arabic
  687. // "lang_bg" - Bulgarian
  688. // "lang_ca" - Catalan
  689. // "lang_cs" - Czech
  690. // "lang_da" - Danish
  691. // "lang_de" - German
  692. // "lang_el" - Greek
  693. // "lang_en" - English
  694. // "lang_es" - Spanish
  695. // "lang_et" - Estonian
  696. // "lang_fi" - Finnish
  697. // "lang_fr" - French
  698. // "lang_hr" - Croatian
  699. // "lang_hu" - Hungarian
  700. // "lang_id" - Indonesian
  701. // "lang_is" - Icelandic
  702. // "lang_it" - Italian
  703. // "lang_iw" - Hebrew
  704. // "lang_ja" - Japanese
  705. // "lang_ko" - Korean
  706. // "lang_lt" - Lithuanian
  707. // "lang_lv" - Latvian
  708. // "lang_nl" - Dutch
  709. // "lang_no" - Norwegian
  710. // "lang_pl" - Polish
  711. // "lang_pt" - Portuguese
  712. // "lang_ro" - Romanian
  713. // "lang_ru" - Russian
  714. // "lang_sk" - Slovak
  715. // "lang_sl" - Slovenian
  716. // "lang_sr" - Serbian
  717. // "lang_sv" - Swedish
  718. // "lang_tr" - Turkish
  719. // "lang_zh-CN" - Chinese (Simplified)
  720. // "lang_zh-TW" - Chinese (Traditional)
  721. func (c *CseListCall) Lr(lr string) *CseListCall {
  722. c.urlParams_.Set("lr", lr)
  723. return c
  724. }
  725. // Num sets the optional parameter "num": Number of search results to
  726. // return
  727. func (c *CseListCall) Num(num int64) *CseListCall {
  728. c.urlParams_.Set("num", fmt.Sprint(num))
  729. return c
  730. }
  731. // OrTerms sets the optional parameter "orTerms": Provides additional
  732. // search terms to check for in a document, where each document in the
  733. // search results must contain at least one of the additional search
  734. // terms
  735. func (c *CseListCall) OrTerms(orTerms string) *CseListCall {
  736. c.urlParams_.Set("orTerms", orTerms)
  737. return c
  738. }
  739. // RelatedSite sets the optional parameter "relatedSite": Specifies that
  740. // all search results should be pages that are related to the specified
  741. // URL
  742. func (c *CseListCall) RelatedSite(relatedSite string) *CseListCall {
  743. c.urlParams_.Set("relatedSite", relatedSite)
  744. return c
  745. }
  746. // Rights sets the optional parameter "rights": Filters based on
  747. // licensing. Supported values include: cc_publicdomain, cc_attribute,
  748. // cc_sharealike, cc_noncommercial, cc_nonderived and combinations of
  749. // these.
  750. func (c *CseListCall) Rights(rights string) *CseListCall {
  751. c.urlParams_.Set("rights", rights)
  752. return c
  753. }
  754. // Safe sets the optional parameter "safe": Search safety level
  755. //
  756. // Possible values:
  757. // "active" - Enables safe search filtering.
  758. // "high" - (Deprecated) Same as active.
  759. // "medium" - (Deprecated) Same as active.
  760. // "off" (default) - Disables safe search filtering.
  761. func (c *CseListCall) Safe(safe string) *CseListCall {
  762. c.urlParams_.Set("safe", safe)
  763. return c
  764. }
  765. // SearchType sets the optional parameter "searchType": Specifies the
  766. // search type: image.
  767. //
  768. // Possible values:
  769. // "image" - custom image search
  770. func (c *CseListCall) SearchType(searchType string) *CseListCall {
  771. c.urlParams_.Set("searchType", searchType)
  772. return c
  773. }
  774. // SiteSearch sets the optional parameter "siteSearch": Specifies all
  775. // search results should be pages from a given site
  776. func (c *CseListCall) SiteSearch(siteSearch string) *CseListCall {
  777. c.urlParams_.Set("siteSearch", siteSearch)
  778. return c
  779. }
  780. // SiteSearchFilter sets the optional parameter "siteSearchFilter":
  781. // Controls whether to include or exclude results from the site named in
  782. // the as_sitesearch parameter
  783. //
  784. // Possible values:
  785. // "e" - exclude
  786. // "i" - include
  787. func (c *CseListCall) SiteSearchFilter(siteSearchFilter string) *CseListCall {
  788. c.urlParams_.Set("siteSearchFilter", siteSearchFilter)
  789. return c
  790. }
  791. // Sort sets the optional parameter "sort": The sort expression to apply
  792. // to the results
  793. func (c *CseListCall) Sort(sort string) *CseListCall {
  794. c.urlParams_.Set("sort", sort)
  795. return c
  796. }
  797. // Start sets the optional parameter "start": The index of the first
  798. // result to return
  799. func (c *CseListCall) Start(start int64) *CseListCall {
  800. c.urlParams_.Set("start", fmt.Sprint(start))
  801. return c
  802. }
  803. // Fields allows partial responses to be retrieved. See
  804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  805. // for more information.
  806. func (c *CseListCall) Fields(s ...googleapi.Field) *CseListCall {
  807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  808. return c
  809. }
  810. // IfNoneMatch sets the optional parameter which makes the operation
  811. // fail if the object's ETag matches the given value. This is useful for
  812. // getting updates only after the object has changed since the last
  813. // request. Use googleapi.IsNotModified to check whether the response
  814. // error from Do is the result of In-None-Match.
  815. func (c *CseListCall) IfNoneMatch(entityTag string) *CseListCall {
  816. c.ifNoneMatch_ = entityTag
  817. return c
  818. }
  819. // Context sets the context to be used in this call's Do method. Any
  820. // pending HTTP request will be aborted if the provided context is
  821. // canceled.
  822. func (c *CseListCall) Context(ctx context.Context) *CseListCall {
  823. c.ctx_ = ctx
  824. return c
  825. }
  826. // Header returns an http.Header that can be modified by the caller to
  827. // add HTTP headers to the request.
  828. func (c *CseListCall) Header() http.Header {
  829. if c.header_ == nil {
  830. c.header_ = make(http.Header)
  831. }
  832. return c.header_
  833. }
  834. func (c *CseListCall) doRequest(alt string) (*http.Response, error) {
  835. reqHeaders := make(http.Header)
  836. for k, v := range c.header_ {
  837. reqHeaders[k] = v
  838. }
  839. reqHeaders.Set("User-Agent", c.s.userAgent())
  840. if c.ifNoneMatch_ != "" {
  841. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  842. }
  843. var body io.Reader = nil
  844. c.urlParams_.Set("alt", alt)
  845. c.urlParams_.Set("prettyPrint", "false")
  846. urls := googleapi.ResolveRelative(c.s.BasePath, "v1")
  847. urls += "?" + c.urlParams_.Encode()
  848. req, err := http.NewRequest("GET", urls, body)
  849. if err != nil {
  850. return nil, err
  851. }
  852. req.Header = reqHeaders
  853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  854. }
  855. // Do executes the "search.cse.list" call.
  856. // Exactly one of *Search or error will be non-nil. Any non-2xx status
  857. // code is an error. Response headers are in either
  858. // *Search.ServerResponse.Header or (if a response was returned at all)
  859. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  860. // check whether the returned error was because http.StatusNotModified
  861. // was returned.
  862. func (c *CseListCall) Do(opts ...googleapi.CallOption) (*Search, error) {
  863. gensupport.SetOptions(c.urlParams_, opts...)
  864. res, err := c.doRequest("json")
  865. if res != nil && res.StatusCode == http.StatusNotModified {
  866. if res.Body != nil {
  867. res.Body.Close()
  868. }
  869. return nil, &googleapi.Error{
  870. Code: res.StatusCode,
  871. Header: res.Header,
  872. }
  873. }
  874. if err != nil {
  875. return nil, err
  876. }
  877. defer googleapi.CloseBody(res)
  878. if err := googleapi.CheckResponse(res); err != nil {
  879. return nil, err
  880. }
  881. ret := &Search{
  882. ServerResponse: googleapi.ServerResponse{
  883. Header: res.Header,
  884. HTTPStatusCode: res.StatusCode,
  885. },
  886. }
  887. target := &ret
  888. if err := gensupport.DecodeResponse(target, res); err != nil {
  889. return nil, err
  890. }
  891. return ret, nil
  892. // {
  893. // "description": "Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.",
  894. // "httpMethod": "GET",
  895. // "id": "search.cse.list",
  896. // "parameterOrder": [
  897. // "q"
  898. // ],
  899. // "parameters": {
  900. // "c2coff": {
  901. // "description": "Turns off the translation between zh-CN and zh-TW.",
  902. // "location": "query",
  903. // "type": "string"
  904. // },
  905. // "cr": {
  906. // "description": "Country restrict(s).",
  907. // "location": "query",
  908. // "type": "string"
  909. // },
  910. // "cx": {
  911. // "description": "The custom search engine ID to scope this search query",
  912. // "location": "query",
  913. // "type": "string"
  914. // },
  915. // "dateRestrict": {
  916. // "description": "Specifies all search results are from a time period",
  917. // "location": "query",
  918. // "type": "string"
  919. // },
  920. // "exactTerms": {
  921. // "description": "Identifies a phrase that all documents in the search results must contain",
  922. // "location": "query",
  923. // "type": "string"
  924. // },
  925. // "excludeTerms": {
  926. // "description": "Identifies a word or phrase that should not appear in any documents in the search results",
  927. // "location": "query",
  928. // "type": "string"
  929. // },
  930. // "fileType": {
  931. // "description": "Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...",
  932. // "location": "query",
  933. // "type": "string"
  934. // },
  935. // "filter": {
  936. // "description": "Controls turning on or off the duplicate content filter.",
  937. // "enum": [
  938. // "0",
  939. // "1"
  940. // ],
  941. // "enumDescriptions": [
  942. // "Turns off duplicate content filter.",
  943. // "Turns on duplicate content filter."
  944. // ],
  945. // "location": "query",
  946. // "type": "string"
  947. // },
  948. // "gl": {
  949. // "description": "Geolocation of end user.",
  950. // "location": "query",
  951. // "type": "string"
  952. // },
  953. // "googlehost": {
  954. // "description": "The local Google domain to use to perform the search.",
  955. // "location": "query",
  956. // "type": "string"
  957. // },
  958. // "highRange": {
  959. // "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query",
  960. // "location": "query",
  961. // "type": "string"
  962. // },
  963. // "hl": {
  964. // "description": "Sets the user interface language.",
  965. // "location": "query",
  966. // "type": "string"
  967. // },
  968. // "hq": {
  969. // "description": "Appends the extra query terms to the query.",
  970. // "location": "query",
  971. // "type": "string"
  972. // },
  973. // "imgColorType": {
  974. // "description": "Returns black and white, grayscale, or color images: mono, gray, and color.",
  975. // "enum": [
  976. // "color",
  977. // "gray",
  978. // "mono"
  979. // ],
  980. // "enumDescriptions": [
  981. // "color",
  982. // "gray",
  983. // "mono"
  984. // ],
  985. // "location": "query",
  986. // "type": "string"
  987. // },
  988. // "imgDominantColor": {
  989. // "description": "Returns images of a specific dominant color: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black and brown.",
  990. // "enum": [
  991. // "black",
  992. // "blue",
  993. // "brown",
  994. // "gray",
  995. // "green",
  996. // "orange",
  997. // "pink",
  998. // "purple",
  999. // "red",
  1000. // "teal",
  1001. // "white",
  1002. // "yellow"
  1003. // ],
  1004. // "enumDescriptions": [
  1005. // "black",
  1006. // "blue",
  1007. // "brown",
  1008. // "gray",
  1009. // "green",
  1010. // "orange",
  1011. // "pink",
  1012. // "purple",
  1013. // "red",
  1014. // "teal",
  1015. // "white",
  1016. // "yellow"
  1017. // ],
  1018. // "location": "query",
  1019. // "type": "string"
  1020. // },
  1021. // "imgSize": {
  1022. // "description": "Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.",
  1023. // "enum": [
  1024. // "huge",
  1025. // "icon",
  1026. // "large",
  1027. // "medium",
  1028. // "small",
  1029. // "xlarge",
  1030. // "xxlarge"
  1031. // ],
  1032. // "enumDescriptions": [
  1033. // "huge",
  1034. // "icon",
  1035. // "large",
  1036. // "medium",
  1037. // "small",
  1038. // "xlarge",
  1039. // "xxlarge"
  1040. // ],
  1041. // "location": "query",
  1042. // "type": "string"
  1043. // },
  1044. // "imgType": {
  1045. // "description": "Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.",
  1046. // "enum": [
  1047. // "clipart",
  1048. // "face",
  1049. // "lineart",
  1050. // "news",
  1051. // "photo"
  1052. // ],
  1053. // "enumDescriptions": [
  1054. // "clipart",
  1055. // "face",
  1056. // "lineart",
  1057. // "news",
  1058. // "photo"
  1059. // ],
  1060. // "location": "query",
  1061. // "type": "string"
  1062. // },
  1063. // "linkSite": {
  1064. // "description": "Specifies that all search results should contain a link to a particular URL",
  1065. // "location": "query",
  1066. // "type": "string"
  1067. // },
  1068. // "lowRange": {
  1069. // "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query",
  1070. // "location": "query",
  1071. // "type": "string"
  1072. // },
  1073. // "lr": {
  1074. // "description": "The language restriction for the search results",
  1075. // "enum": [
  1076. // "lang_ar",
  1077. // "lang_bg",
  1078. // "lang_ca",
  1079. // "lang_cs",
  1080. // "lang_da",
  1081. // "lang_de",
  1082. // "lang_el",
  1083. // "lang_en",
  1084. // "lang_es",
  1085. // "lang_et",
  1086. // "lang_fi",
  1087. // "lang_fr",
  1088. // "lang_hr",
  1089. // "lang_hu",
  1090. // "lang_id",
  1091. // "lang_is",
  1092. // "lang_it",
  1093. // "lang_iw",
  1094. // "lang_ja",
  1095. // "lang_ko",
  1096. // "lang_lt",
  1097. // "lang_lv",
  1098. // "lang_nl",
  1099. // "lang_no",
  1100. // "lang_pl",
  1101. // "lang_pt",
  1102. // "lang_ro",
  1103. // "lang_ru",
  1104. // "lang_sk",
  1105. // "lang_sl",
  1106. // "lang_sr",
  1107. // "lang_sv",
  1108. // "lang_tr",
  1109. // "lang_zh-CN",
  1110. // "lang_zh-TW"
  1111. // ],
  1112. // "enumDescriptions": [
  1113. // "Arabic",
  1114. // "Bulgarian",
  1115. // "Catalan",
  1116. // "Czech",
  1117. // "Danish",
  1118. // "German",
  1119. // "Greek",
  1120. // "English",
  1121. // "Spanish",
  1122. // "Estonian",
  1123. // "Finnish",
  1124. // "French",
  1125. // "Croatian",
  1126. // "Hungarian",
  1127. // "Indonesian",
  1128. // "Icelandic",
  1129. // "Italian",
  1130. // "Hebrew",
  1131. // "Japanese",
  1132. // "Korean",
  1133. // "Lithuanian",
  1134. // "Latvian",
  1135. // "Dutch",
  1136. // "Norwegian",
  1137. // "Polish",
  1138. // "Portuguese",
  1139. // "Romanian",
  1140. // "Russian",
  1141. // "Slovak",
  1142. // "Slovenian",
  1143. // "Serbian",
  1144. // "Swedish",
  1145. // "Turkish",
  1146. // "Chinese (Simplified)",
  1147. // "Chinese (Traditional)"
  1148. // ],
  1149. // "location": "query",
  1150. // "type": "string"
  1151. // },
  1152. // "num": {
  1153. // "default": "10",
  1154. // "description": "Number of search results to return",
  1155. // "format": "uint32",
  1156. // "location": "query",
  1157. // "type": "integer"
  1158. // },
  1159. // "orTerms": {
  1160. // "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",
  1161. // "location": "query",
  1162. // "type": "string"
  1163. // },
  1164. // "q": {
  1165. // "description": "Query",
  1166. // "location": "query",
  1167. // "required": true,
  1168. // "type": "string"
  1169. // },
  1170. // "relatedSite": {
  1171. // "description": "Specifies that all search results should be pages that are related to the specified URL",
  1172. // "location": "query",
  1173. // "type": "string"
  1174. // },
  1175. // "rights": {
  1176. // "description": "Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.",
  1177. // "location": "query",
  1178. // "type": "string"
  1179. // },
  1180. // "safe": {
  1181. // "default": "off",
  1182. // "description": "Search safety level",
  1183. // "enum": [
  1184. // "active",
  1185. // "high",
  1186. // "medium",
  1187. // "off"
  1188. // ],
  1189. // "enumDescriptions": [
  1190. // "Enables safe search filtering.",
  1191. // "(Deprecated) Same as active.",
  1192. // "(Deprecated) Same as active.",
  1193. // "Disables safe search filtering."
  1194. // ],
  1195. // "location": "query",
  1196. // "type": "string"
  1197. // },
  1198. // "searchType": {
  1199. // "description": "Specifies the search type: image.",
  1200. // "enum": [
  1201. // "image"
  1202. // ],
  1203. // "enumDescriptions": [
  1204. // "custom image search"
  1205. // ],
  1206. // "location": "query",
  1207. // "type": "string"
  1208. // },
  1209. // "siteSearch": {
  1210. // "description": "Specifies all search results should be pages from a given site",
  1211. // "location": "query",
  1212. // "type": "string"
  1213. // },
  1214. // "siteSearchFilter": {
  1215. // "description": "Controls whether to include or exclude results from the site named in the as_sitesearch parameter",
  1216. // "enum": [
  1217. // "e",
  1218. // "i"
  1219. // ],
  1220. // "enumDescriptions": [
  1221. // "exclude",
  1222. // "include"
  1223. // ],
  1224. // "location": "query",
  1225. // "type": "string"
  1226. // },
  1227. // "sort": {
  1228. // "description": "The sort expression to apply to the results",
  1229. // "location": "query",
  1230. // "type": "string"
  1231. // },
  1232. // "start": {
  1233. // "description": "The index of the first result to return",
  1234. // "format": "uint32",
  1235. // "location": "query",
  1236. // "type": "integer"
  1237. // }
  1238. // },
  1239. // "path": "v1",
  1240. // "response": {
  1241. // "$ref": "Search"
  1242. // }
  1243. // }
  1244. }
  1245. // method id "search.cse.siterestrict.list":
  1246. type CseSiterestrictListCall struct {
  1247. s *Service
  1248. urlParams_ gensupport.URLParams
  1249. ifNoneMatch_ string
  1250. ctx_ context.Context
  1251. header_ http.Header
  1252. }
  1253. // List: Returns metadata about the search performed, metadata about the
  1254. // custom search engine used for the search, and the search results.
  1255. // Uses a small set of url patterns.
  1256. func (r *CseSiterestrictService) List(q string) *CseSiterestrictListCall {
  1257. c := &CseSiterestrictListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1258. c.urlParams_.Set("q", q)
  1259. return c
  1260. }
  1261. // C2coff sets the optional parameter "c2coff": Turns off the
  1262. // translation between zh-CN and zh-TW.
  1263. func (c *CseSiterestrictListCall) C2coff(c2coff string) *CseSiterestrictListCall {
  1264. c.urlParams_.Set("c2coff", c2coff)
  1265. return c
  1266. }
  1267. // Cr sets the optional parameter "cr": Country restrict(s).
  1268. func (c *CseSiterestrictListCall) Cr(cr string) *CseSiterestrictListCall {
  1269. c.urlParams_.Set("cr", cr)
  1270. return c
  1271. }
  1272. // Cx sets the optional parameter "cx": The custom search engine ID to
  1273. // scope this search query
  1274. func (c *CseSiterestrictListCall) Cx(cx string) *CseSiterestrictListCall {
  1275. c.urlParams_.Set("cx", cx)
  1276. return c
  1277. }
  1278. // DateRestrict sets the optional parameter "dateRestrict": Specifies
  1279. // all search results are from a time period
  1280. func (c *CseSiterestrictListCall) DateRestrict(dateRestrict string) *CseSiterestrictListCall {
  1281. c.urlParams_.Set("dateRestrict", dateRestrict)
  1282. return c
  1283. }
  1284. // ExactTerms sets the optional parameter "exactTerms": Identifies a
  1285. // phrase that all documents in the search results must contain
  1286. func (c *CseSiterestrictListCall) ExactTerms(exactTerms string) *CseSiterestrictListCall {
  1287. c.urlParams_.Set("exactTerms", exactTerms)
  1288. return c
  1289. }
  1290. // ExcludeTerms sets the optional parameter "excludeTerms": Identifies a
  1291. // word or phrase that should not appear in any documents in the search
  1292. // results
  1293. func (c *CseSiterestrictListCall) ExcludeTerms(excludeTerms string) *CseSiterestrictListCall {
  1294. c.urlParams_.Set("excludeTerms", excludeTerms)
  1295. return c
  1296. }
  1297. // FileType sets the optional parameter "fileType": Returns images of a
  1298. // specified type. Some of the allowed values are: bmp, gif, png, jpg,
  1299. // svg, pdf, ...
  1300. func (c *CseSiterestrictListCall) FileType(fileType string) *CseSiterestrictListCall {
  1301. c.urlParams_.Set("fileType", fileType)
  1302. return c
  1303. }
  1304. // Filter sets the optional parameter "filter": Controls turning on or
  1305. // off the duplicate content filter.
  1306. //
  1307. // Possible values:
  1308. // "0" - Turns off duplicate content filter.
  1309. // "1" - Turns on duplicate content filter.
  1310. func (c *CseSiterestrictListCall) Filter(filter string) *CseSiterestrictListCall {
  1311. c.urlParams_.Set("filter", filter)
  1312. return c
  1313. }
  1314. // Gl sets the optional parameter "gl": Geolocation of end user.
  1315. func (c *CseSiterestrictListCall) Gl(gl string) *CseSiterestrictListCall {
  1316. c.urlParams_.Set("gl", gl)
  1317. return c
  1318. }
  1319. // Googlehost sets the optional parameter "googlehost": The local Google
  1320. // domain to use to perform the search.
  1321. func (c *CseSiterestrictListCall) Googlehost(googlehost string) *CseSiterestrictListCall {
  1322. c.urlParams_.Set("googlehost", googlehost)
  1323. return c
  1324. }
  1325. // HighRange sets the optional parameter "highRange": Creates a range in
  1326. // form as_nlo value..as_nhi value and attempts to append it to query
  1327. func (c *CseSiterestrictListCall) HighRange(highRange string) *CseSiterestrictListCall {
  1328. c.urlParams_.Set("highRange", highRange)
  1329. return c
  1330. }
  1331. // Hl sets the optional parameter "hl": Sets the user interface
  1332. // language.
  1333. func (c *CseSiterestrictListCall) Hl(hl string) *CseSiterestrictListCall {
  1334. c.urlParams_.Set("hl", hl)
  1335. return c
  1336. }
  1337. // Hq sets the optional parameter "hq": Appends the extra query terms to
  1338. // the query.
  1339. func (c *CseSiterestrictListCall) Hq(hq string) *CseSiterestrictListCall {
  1340. c.urlParams_.Set("hq", hq)
  1341. return c
  1342. }
  1343. // ImgColorType sets the optional parameter "imgColorType": Returns
  1344. // black and white, grayscale, or color images: mono, gray, and color.
  1345. //
  1346. // Possible values:
  1347. // "color" - color
  1348. // "gray" - gray
  1349. // "mono" - mono
  1350. func (c *CseSiterestrictListCall) ImgColorType(imgColorType string) *CseSiterestrictListCall {
  1351. c.urlParams_.Set("imgColorType", imgColorType)
  1352. return c
  1353. }
  1354. // ImgDominantColor sets the optional parameter "imgDominantColor":
  1355. // Returns images of a specific dominant color: red, orange, yellow,
  1356. // green, teal, blue, purple, pink, white, gray, black and brown.
  1357. //
  1358. // Possible values:
  1359. // "black" - black
  1360. // "blue" - blue
  1361. // "brown" - brown
  1362. // "gray" - gray
  1363. // "green" - green
  1364. // "orange" - orange
  1365. // "pink" - pink
  1366. // "purple" - purple
  1367. // "red" - red
  1368. // "teal" - teal
  1369. // "white" - white
  1370. // "yellow" - yellow
  1371. func (c *CseSiterestrictListCall) ImgDominantColor(imgDominantColor string) *CseSiterestrictListCall {
  1372. c.urlParams_.Set("imgDominantColor", imgDominantColor)
  1373. return c
  1374. }
  1375. // ImgSize sets the optional parameter "imgSize": Returns images of a
  1376. // specified size, where size can be one of: icon, small, medium, large,
  1377. // xlarge, xxlarge, and huge.
  1378. //
  1379. // Possible values:
  1380. // "huge" - huge
  1381. // "icon" - icon
  1382. // "large" - large
  1383. // "medium" - medium
  1384. // "small" - small
  1385. // "xlarge" - xlarge
  1386. // "xxlarge" - xxlarge
  1387. func (c *CseSiterestrictListCall) ImgSize(imgSize string) *CseSiterestrictListCall {
  1388. c.urlParams_.Set("imgSize", imgSize)
  1389. return c
  1390. }
  1391. // ImgType sets the optional parameter "imgType": Returns images of a
  1392. // type, which can be one of: clipart, face, lineart, news, and photo.
  1393. //
  1394. // Possible values:
  1395. // "clipart" - clipart
  1396. // "face" - face
  1397. // "lineart" - lineart
  1398. // "news" - news
  1399. // "photo" - photo
  1400. func (c *CseSiterestrictListCall) ImgType(imgType string) *CseSiterestrictListCall {
  1401. c.urlParams_.Set("imgType", imgType)
  1402. return c
  1403. }
  1404. // LinkSite sets the optional parameter "linkSite": Specifies that all
  1405. // search results should contain a link to a particular URL
  1406. func (c *CseSiterestrictListCall) LinkSite(linkSite string) *CseSiterestrictListCall {
  1407. c.urlParams_.Set("linkSite", linkSite)
  1408. return c
  1409. }
  1410. // LowRange sets the optional parameter "lowRange": Creates a range in
  1411. // form as_nlo value..as_nhi value and attempts to append it to query
  1412. func (c *CseSiterestrictListCall) LowRange(lowRange string) *CseSiterestrictListCall {
  1413. c.urlParams_.Set("lowRange", lowRange)
  1414. return c
  1415. }
  1416. // Lr sets the optional parameter "lr": The language restriction for the
  1417. // search results
  1418. //
  1419. // Possible values:
  1420. // "lang_ar" - Arabic
  1421. // "lang_bg" - Bulgarian
  1422. // "lang_ca" - Catalan
  1423. // "lang_cs" - Czech
  1424. // "lang_da" - Danish
  1425. // "lang_de" - German
  1426. // "lang_el" - Greek
  1427. // "lang_en" - English
  1428. // "lang_es" - Spanish
  1429. // "lang_et" - Estonian
  1430. // "lang_fi" - Finnish
  1431. // "lang_fr" - French
  1432. // "lang_hr" - Croatian
  1433. // "lang_hu" - Hungarian
  1434. // "lang_id" - Indonesian
  1435. // "lang_is" - Icelandic
  1436. // "lang_it" - Italian
  1437. // "lang_iw" - Hebrew
  1438. // "lang_ja" - Japanese
  1439. // "lang_ko" - Korean
  1440. // "lang_lt" - Lithuanian
  1441. // "lang_lv" - Latvian
  1442. // "lang_nl" - Dutch
  1443. // "lang_no" - Norwegian
  1444. // "lang_pl" - Polish
  1445. // "lang_pt" - Portuguese
  1446. // "lang_ro" - Romanian
  1447. // "lang_ru" - Russian
  1448. // "lang_sk" - Slovak
  1449. // "lang_sl" - Slovenian
  1450. // "lang_sr" - Serbian
  1451. // "lang_sv" - Swedish
  1452. // "lang_tr" - Turkish
  1453. // "lang_zh-CN" - Chinese (Simplified)
  1454. // "lang_zh-TW" - Chinese (Traditional)
  1455. func (c *CseSiterestrictListCall) Lr(lr string) *CseSiterestrictListCall {
  1456. c.urlParams_.Set("lr", lr)
  1457. return c
  1458. }
  1459. // Num sets the optional parameter "num": Number of search results to
  1460. // return
  1461. func (c *CseSiterestrictListCall) Num(num int64) *CseSiterestrictListCall {
  1462. c.urlParams_.Set("num", fmt.Sprint(num))
  1463. return c
  1464. }
  1465. // OrTerms sets the optional parameter "orTerms": Provides additional
  1466. // search terms to check for in a document, where each document in the
  1467. // search results must contain at least one of the additional search
  1468. // terms
  1469. func (c *CseSiterestrictListCall) OrTerms(orTerms string) *CseSiterestrictListCall {
  1470. c.urlParams_.Set("orTerms", orTerms)
  1471. return c
  1472. }
  1473. // RelatedSite sets the optional parameter "relatedSite": Specifies that
  1474. // all search results should be pages that are related to the specified
  1475. // URL
  1476. func (c *CseSiterestrictListCall) RelatedSite(relatedSite string) *CseSiterestrictListCall {
  1477. c.urlParams_.Set("relatedSite", relatedSite)
  1478. return c
  1479. }
  1480. // Rights sets the optional parameter "rights": Filters based on
  1481. // licensing. Supported values include: cc_publicdomain, cc_attribute,
  1482. // cc_sharealike, cc_noncommercial, cc_nonderived and combinations of
  1483. // these.
  1484. func (c *CseSiterestrictListCall) Rights(rights string) *CseSiterestrictListCall {
  1485. c.urlParams_.Set("rights", rights)
  1486. return c
  1487. }
  1488. // Safe sets the optional parameter "safe": Search safety level
  1489. //
  1490. // Possible values:
  1491. // "high" - Enables highest level of safe search filtering.
  1492. // "medium" - Enables moderate safe search filtering.
  1493. // "off" (default) - Disables safe search filtering.
  1494. func (c *CseSiterestrictListCall) Safe(safe string) *CseSiterestrictListCall {
  1495. c.urlParams_.Set("safe", safe)
  1496. return c
  1497. }
  1498. // SearchType sets the optional parameter "searchType": Specifies the
  1499. // search type: image.
  1500. //
  1501. // Possible values:
  1502. // "image" - custom image search
  1503. func (c *CseSiterestrictListCall) SearchType(searchType string) *CseSiterestrictListCall {
  1504. c.urlParams_.Set("searchType", searchType)
  1505. return c
  1506. }
  1507. // SiteSearch sets the optional parameter "siteSearch": Specifies all
  1508. // search results should be pages from a given site
  1509. func (c *CseSiterestrictListCall) SiteSearch(siteSearch string) *CseSiterestrictListCall {
  1510. c.urlParams_.Set("siteSearch", siteSearch)
  1511. return c
  1512. }
  1513. // SiteSearchFilter sets the optional parameter "siteSearchFilter":
  1514. // Controls whether to include or exclude results from the site named in
  1515. // the as_sitesearch parameter
  1516. //
  1517. // Possible values:
  1518. // "e" - exclude
  1519. // "i" - include
  1520. func (c *CseSiterestrictListCall) SiteSearchFilter(siteSearchFilter string) *CseSiterestrictListCall {
  1521. c.urlParams_.Set("siteSearchFilter", siteSearchFilter)
  1522. return c
  1523. }
  1524. // Sort sets the optional parameter "sort": The sort expression to apply
  1525. // to the results
  1526. func (c *CseSiterestrictListCall) Sort(sort string) *CseSiterestrictListCall {
  1527. c.urlParams_.Set("sort", sort)
  1528. return c
  1529. }
  1530. // Start sets the optional parameter "start": The index of the first
  1531. // result to return
  1532. func (c *CseSiterestrictListCall) Start(start int64) *CseSiterestrictListCall {
  1533. c.urlParams_.Set("start", fmt.Sprint(start))
  1534. return c
  1535. }
  1536. // Fields allows partial responses to be retrieved. See
  1537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1538. // for more information.
  1539. func (c *CseSiterestrictListCall) Fields(s ...googleapi.Field) *CseSiterestrictListCall {
  1540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1541. return c
  1542. }
  1543. // IfNoneMatch sets the optional parameter which makes the operation
  1544. // fail if the object's ETag matches the given value. This is useful for
  1545. // getting updates only after the object has changed since the last
  1546. // request. Use googleapi.IsNotModified to check whether the response
  1547. // error from Do is the result of In-None-Match.
  1548. func (c *CseSiterestrictListCall) IfNoneMatch(entityTag string) *CseSiterestrictListCall {
  1549. c.ifNoneMatch_ = entityTag
  1550. return c
  1551. }
  1552. // Context sets the context to be used in this call's Do method. Any
  1553. // pending HTTP request will be aborted if the provided context is
  1554. // canceled.
  1555. func (c *CseSiterestrictListCall) Context(ctx context.Context) *CseSiterestrictListCall {
  1556. c.ctx_ = ctx
  1557. return c
  1558. }
  1559. // Header returns an http.Header that can be modified by the caller to
  1560. // add HTTP headers to the request.
  1561. func (c *CseSiterestrictListCall) Header() http.Header {
  1562. if c.header_ == nil {
  1563. c.header_ = make(http.Header)
  1564. }
  1565. return c.header_
  1566. }
  1567. func (c *CseSiterestrictListCall) doRequest(alt string) (*http.Response, error) {
  1568. reqHeaders := make(http.Header)
  1569. for k, v := range c.header_ {
  1570. reqHeaders[k] = v
  1571. }
  1572. reqHeaders.Set("User-Agent", c.s.userAgent())
  1573. if c.ifNoneMatch_ != "" {
  1574. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1575. }
  1576. var body io.Reader = nil
  1577. c.urlParams_.Set("alt", alt)
  1578. c.urlParams_.Set("prettyPrint", "false")
  1579. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/siterestrict")
  1580. urls += "?" + c.urlParams_.Encode()
  1581. req, err := http.NewRequest("GET", urls, body)
  1582. if err != nil {
  1583. return nil, err
  1584. }
  1585. req.Header = reqHeaders
  1586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1587. }
  1588. // Do executes the "search.cse.siterestrict.list" call.
  1589. // Exactly one of *Search or error will be non-nil. Any non-2xx status
  1590. // code is an error. Response headers are in either
  1591. // *Search.ServerResponse.Header or (if a response was returned at all)
  1592. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1593. // check whether the returned error was because http.StatusNotModified
  1594. // was returned.
  1595. func (c *CseSiterestrictListCall) Do(opts ...googleapi.CallOption) (*Search, error) {
  1596. gensupport.SetOptions(c.urlParams_, opts...)
  1597. res, err := c.doRequest("json")
  1598. if res != nil && res.StatusCode == http.StatusNotModified {
  1599. if res.Body != nil {
  1600. res.Body.Close()
  1601. }
  1602. return nil, &googleapi.Error{
  1603. Code: res.StatusCode,
  1604. Header: res.Header,
  1605. }
  1606. }
  1607. if err != nil {
  1608. return nil, err
  1609. }
  1610. defer googleapi.CloseBody(res)
  1611. if err := googleapi.CheckResponse(res); err != nil {
  1612. return nil, err
  1613. }
  1614. ret := &Search{
  1615. ServerResponse: googleapi.ServerResponse{
  1616. Header: res.Header,
  1617. HTTPStatusCode: res.StatusCode,
  1618. },
  1619. }
  1620. target := &ret
  1621. if err := gensupport.DecodeResponse(target, res); err != nil {
  1622. return nil, err
  1623. }
  1624. return ret, nil
  1625. // {
  1626. // "description": "Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. Uses a small set of url patterns.",
  1627. // "httpMethod": "GET",
  1628. // "id": "search.cse.siterestrict.list",
  1629. // "parameterOrder": [
  1630. // "q"
  1631. // ],
  1632. // "parameters": {
  1633. // "c2coff": {
  1634. // "description": "Turns off the translation between zh-CN and zh-TW.",
  1635. // "location": "query",
  1636. // "type": "string"
  1637. // },
  1638. // "cr": {
  1639. // "description": "Country restrict(s).",
  1640. // "location": "query",
  1641. // "type": "string"
  1642. // },
  1643. // "cx": {
  1644. // "description": "The custom search engine ID to scope this search query",
  1645. // "location": "query",
  1646. // "type": "string"
  1647. // },
  1648. // "dateRestrict": {
  1649. // "description": "Specifies all search results are from a time period",
  1650. // "location": "query",
  1651. // "type": "string"
  1652. // },
  1653. // "exactTerms": {
  1654. // "description": "Identifies a phrase that all documents in the search results must contain",
  1655. // "location": "query",
  1656. // "type": "string"
  1657. // },
  1658. // "excludeTerms": {
  1659. // "description": "Identifies a word or phrase that should not appear in any documents in the search results",
  1660. // "location": "query",
  1661. // "type": "string"
  1662. // },
  1663. // "fileType": {
  1664. // "description": "Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...",
  1665. // "location": "query",
  1666. // "type": "string"
  1667. // },
  1668. // "filter": {
  1669. // "description": "Controls turning on or off the duplicate content filter.",
  1670. // "enum": [
  1671. // "0",
  1672. // "1"
  1673. // ],
  1674. // "enumDescriptions": [
  1675. // "Turns off duplicate content filter.",
  1676. // "Turns on duplicate content filter."
  1677. // ],
  1678. // "location": "query",
  1679. // "type": "string"
  1680. // },
  1681. // "gl": {
  1682. // "description": "Geolocation of end user.",
  1683. // "location": "query",
  1684. // "type": "string"
  1685. // },
  1686. // "googlehost": {
  1687. // "description": "The local Google domain to use to perform the search.",
  1688. // "location": "query",
  1689. // "type": "string"
  1690. // },
  1691. // "highRange": {
  1692. // "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query",
  1693. // "location": "query",
  1694. // "type": "string"
  1695. // },
  1696. // "hl": {
  1697. // "description": "Sets the user interface language.",
  1698. // "location": "query",
  1699. // "type": "string"
  1700. // },
  1701. // "hq": {
  1702. // "description": "Appends the extra query terms to the query.",
  1703. // "location": "query",
  1704. // "type": "string"
  1705. // },
  1706. // "imgColorType": {
  1707. // "description": "Returns black and white, grayscale, or color images: mono, gray, and color.",
  1708. // "enum": [
  1709. // "color",
  1710. // "gray",
  1711. // "mono"
  1712. // ],
  1713. // "enumDescriptions": [
  1714. // "color",
  1715. // "gray",
  1716. // "mono"
  1717. // ],
  1718. // "location": "query",
  1719. // "type": "string"
  1720. // },
  1721. // "imgDominantColor": {
  1722. // "description": "Returns images of a specific dominant color: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black and brown.",
  1723. // "enum": [
  1724. // "black",
  1725. // "blue",
  1726. // "brown",
  1727. // "gray",
  1728. // "green",
  1729. // "orange",
  1730. // "pink",
  1731. // "purple",
  1732. // "red",
  1733. // "teal",
  1734. // "white",
  1735. // "yellow"
  1736. // ],
  1737. // "enumDescriptions": [
  1738. // "black",
  1739. // "blue",
  1740. // "brown",
  1741. // "gray",
  1742. // "green",
  1743. // "orange",
  1744. // "pink",
  1745. // "purple",
  1746. // "red",
  1747. // "teal",
  1748. // "white",
  1749. // "yellow"
  1750. // ],
  1751. // "location": "query",
  1752. // "type": "string"
  1753. // },
  1754. // "imgSize": {
  1755. // "description": "Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.",
  1756. // "enum": [
  1757. // "huge",
  1758. // "icon",
  1759. // "large",
  1760. // "medium",
  1761. // "small",
  1762. // "xlarge",
  1763. // "xxlarge"
  1764. // ],
  1765. // "enumDescriptions": [
  1766. // "huge",
  1767. // "icon",
  1768. // "large",
  1769. // "medium",
  1770. // "small",
  1771. // "xlarge",
  1772. // "xxlarge"
  1773. // ],
  1774. // "location": "query",
  1775. // "type": "string"
  1776. // },
  1777. // "imgType": {
  1778. // "description": "Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.",
  1779. // "enum": [
  1780. // "clipart",
  1781. // "face",
  1782. // "lineart",
  1783. // "news",
  1784. // "photo"
  1785. // ],
  1786. // "enumDescriptions": [
  1787. // "clipart",
  1788. // "face",
  1789. // "lineart",
  1790. // "news",
  1791. // "photo"
  1792. // ],
  1793. // "location": "query",
  1794. // "type": "string"
  1795. // },
  1796. // "linkSite": {
  1797. // "description": "Specifies that all search results should contain a link to a particular URL",
  1798. // "location": "query",
  1799. // "type": "string"
  1800. // },
  1801. // "lowRange": {
  1802. // "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query",
  1803. // "location": "query",
  1804. // "type": "string"
  1805. // },
  1806. // "lr": {
  1807. // "description": "The language restriction for the search results",
  1808. // "enum": [
  1809. // "lang_ar",
  1810. // "lang_bg",
  1811. // "lang_ca",
  1812. // "lang_cs",
  1813. // "lang_da",
  1814. // "lang_de",
  1815. // "lang_el",
  1816. // "lang_en",
  1817. // "lang_es",
  1818. // "lang_et",
  1819. // "lang_fi",
  1820. // "lang_fr",
  1821. // "lang_hr",
  1822. // "lang_hu",
  1823. // "lang_id",
  1824. // "lang_is",
  1825. // "lang_it",
  1826. // "lang_iw",
  1827. // "lang_ja",
  1828. // "lang_ko",
  1829. // "lang_lt",
  1830. // "lang_lv",
  1831. // "lang_nl",
  1832. // "lang_no",
  1833. // "lang_pl",
  1834. // "lang_pt",
  1835. // "lang_ro",
  1836. // "lang_ru",
  1837. // "lang_sk",
  1838. // "lang_sl",
  1839. // "lang_sr",
  1840. // "lang_sv",
  1841. // "lang_tr",
  1842. // "lang_zh-CN",
  1843. // "lang_zh-TW"
  1844. // ],
  1845. // "enumDescriptions": [
  1846. // "Arabic",
  1847. // "Bulgarian",
  1848. // "Catalan",
  1849. // "Czech",
  1850. // "Danish",
  1851. // "German",
  1852. // "Greek",
  1853. // "English",
  1854. // "Spanish",
  1855. // "Estonian",
  1856. // "Finnish",
  1857. // "French",
  1858. // "Croatian",
  1859. // "Hungarian",
  1860. // "Indonesian",
  1861. // "Icelandic",
  1862. // "Italian",
  1863. // "Hebrew",
  1864. // "Japanese",
  1865. // "Korean",
  1866. // "Lithuanian",
  1867. // "Latvian",
  1868. // "Dutch",
  1869. // "Norwegian",
  1870. // "Polish",
  1871. // "Portuguese",
  1872. // "Romanian",
  1873. // "Russian",
  1874. // "Slovak",
  1875. // "Slovenian",
  1876. // "Serbian",
  1877. // "Swedish",
  1878. // "Turkish",
  1879. // "Chinese (Simplified)",
  1880. // "Chinese (Traditional)"
  1881. // ],
  1882. // "location": "query",
  1883. // "type": "string"
  1884. // },
  1885. // "num": {
  1886. // "default": "10",
  1887. // "description": "Number of search results to return",
  1888. // "format": "uint32",
  1889. // "location": "query",
  1890. // "type": "integer"
  1891. // },
  1892. // "orTerms": {
  1893. // "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",
  1894. // "location": "query",
  1895. // "type": "string"
  1896. // },
  1897. // "q": {
  1898. // "description": "Query",
  1899. // "location": "query",
  1900. // "required": true,
  1901. // "type": "string"
  1902. // },
  1903. // "relatedSite": {
  1904. // "description": "Specifies that all search results should be pages that are related to the specified URL",
  1905. // "location": "query",
  1906. // "type": "string"
  1907. // },
  1908. // "rights": {
  1909. // "description": "Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.",
  1910. // "location": "query",
  1911. // "type": "string"
  1912. // },
  1913. // "safe": {
  1914. // "default": "off",
  1915. // "description": "Search safety level",
  1916. // "enum": [
  1917. // "high",
  1918. // "medium",
  1919. // "off"
  1920. // ],
  1921. // "enumDescriptions": [
  1922. // "Enables highest level of safe search filtering.",
  1923. // "Enables moderate safe search filtering.",
  1924. // "Disables safe search filtering."
  1925. // ],
  1926. // "location": "query",
  1927. // "type": "string"
  1928. // },
  1929. // "searchType": {
  1930. // "description": "Specifies the search type: image.",
  1931. // "enum": [
  1932. // "image"
  1933. // ],
  1934. // "enumDescriptions": [
  1935. // "custom image search"
  1936. // ],
  1937. // "location": "query",
  1938. // "type": "string"
  1939. // },
  1940. // "siteSearch": {
  1941. // "description": "Specifies all search results should be pages from a given site",
  1942. // "location": "query",
  1943. // "type": "string"
  1944. // },
  1945. // "siteSearchFilter": {
  1946. // "description": "Controls whether to include or exclude results from the site named in the as_sitesearch parameter",
  1947. // "enum": [
  1948. // "e",
  1949. // "i"
  1950. // ],
  1951. // "enumDescriptions": [
  1952. // "exclude",
  1953. // "include"
  1954. // ],
  1955. // "location": "query",
  1956. // "type": "string"
  1957. // },
  1958. // "sort": {
  1959. // "description": "The sort expression to apply to the results",
  1960. // "location": "query",
  1961. // "type": "string"
  1962. // },
  1963. // "start": {
  1964. // "description": "The index of the first result to return",
  1965. // "format": "uint32",
  1966. // "location": "query",
  1967. // "type": "integer"
  1968. // }
  1969. // },
  1970. // "path": "v1/siterestrict",
  1971. // "response": {
  1972. // "$ref": "Search"
  1973. // }
  1974. // }
  1975. }