Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

2135 lignes
66 KiB

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