~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/customsearch/v1/customsearch-gen.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
11
 
 
12
import (
 
13
        "bytes"
 
14
        "encoding/json"
 
15
        "errors"
 
16
        "fmt"
 
17
        "google.golang.org/api/googleapi"
 
18
        "io"
 
19
        "net/http"
 
20
        "net/url"
 
21
        "strconv"
 
22
        "strings"
 
23
)
 
24
 
 
25
// Always reference these packages, just in case the auto-generated code
 
26
// below doesn't.
 
27
var _ = bytes.NewBuffer
 
28
var _ = strconv.Itoa
 
29
var _ = fmt.Sprintf
 
30
var _ = json.NewDecoder
 
31
var _ = io.Copy
 
32
var _ = url.Parse
 
33
var _ = googleapi.Version
 
34
var _ = errors.New
 
35
var _ = strings.Replace
 
36
 
 
37
const apiId = "customsearch:v1"
 
38
const apiName = "customsearch"
 
39
const apiVersion = "v1"
 
40
const basePath = "https://www.googleapis.com/customsearch/"
 
41
 
 
42
func New(client *http.Client) (*Service, error) {
 
43
        if client == nil {
 
44
                return nil, errors.New("client is nil")
 
45
        }
 
46
        s := &Service{client: client, BasePath: basePath}
 
47
        s.Cse = NewCseService(s)
 
48
        return s, nil
 
49
}
 
50
 
 
51
type Service struct {
 
52
        client   *http.Client
 
53
        BasePath string // API endpoint base URL
 
54
 
 
55
        Cse *CseService
 
56
}
 
57
 
 
58
func NewCseService(s *Service) *CseService {
 
59
        rs := &CseService{s: s}
 
60
        return rs
 
61
}
 
62
 
 
63
type CseService struct {
 
64
        s *Service
 
65
}
 
66
 
 
67
type Context struct {
 
68
        Facets [][]*ContextFacetsItem `json:"facets,omitempty"`
 
69
 
 
70
        Title string `json:"title,omitempty"`
 
71
}
 
72
 
 
73
type ContextFacetsItem struct {
 
74
        Anchor string `json:"anchor,omitempty"`
 
75
 
 
76
        Label string `json:"label,omitempty"`
 
77
 
 
78
        Label_with_op string `json:"label_with_op,omitempty"`
 
79
}
 
80
 
 
81
type Promotion struct {
 
82
        BodyLines []*PromotionBodyLines `json:"bodyLines,omitempty"`
 
83
 
 
84
        DisplayLink string `json:"displayLink,omitempty"`
 
85
 
 
86
        HtmlTitle string `json:"htmlTitle,omitempty"`
 
87
 
 
88
        Image *PromotionImage `json:"image,omitempty"`
 
89
 
 
90
        Link string `json:"link,omitempty"`
 
91
 
 
92
        Title string `json:"title,omitempty"`
 
93
}
 
94
 
 
95
type PromotionBodyLines struct {
 
96
        HtmlTitle string `json:"htmlTitle,omitempty"`
 
97
 
 
98
        Link string `json:"link,omitempty"`
 
99
 
 
100
        Title string `json:"title,omitempty"`
 
101
 
 
102
        Url string `json:"url,omitempty"`
 
103
}
 
104
 
 
105
type PromotionImage struct {
 
106
        Height int64 `json:"height,omitempty"`
 
107
 
 
108
        Source string `json:"source,omitempty"`
 
109
 
 
110
        Width int64 `json:"width,omitempty"`
 
111
}
 
112
 
 
113
type Query struct {
 
114
        Count int64 `json:"count,omitempty"`
 
115
 
 
116
        Cr string `json:"cr,omitempty"`
 
117
 
 
118
        Cref string `json:"cref,omitempty"`
 
119
 
 
120
        Cx string `json:"cx,omitempty"`
 
121
 
 
122
        DateRestrict string `json:"dateRestrict,omitempty"`
 
123
 
 
124
        DisableCnTwTranslation string `json:"disableCnTwTranslation,omitempty"`
 
125
 
 
126
        ExactTerms string `json:"exactTerms,omitempty"`
 
127
 
 
128
        ExcludeTerms string `json:"excludeTerms,omitempty"`
 
129
 
 
130
        FileType string `json:"fileType,omitempty"`
 
131
 
 
132
        Filter string `json:"filter,omitempty"`
 
133
 
 
134
        Gl string `json:"gl,omitempty"`
 
135
 
 
136
        GoogleHost string `json:"googleHost,omitempty"`
 
137
 
 
138
        HighRange string `json:"highRange,omitempty"`
 
139
 
 
140
        Hl string `json:"hl,omitempty"`
 
141
 
 
142
        Hq string `json:"hq,omitempty"`
 
143
 
 
144
        ImgColorType string `json:"imgColorType,omitempty"`
 
145
 
 
146
        ImgDominantColor string `json:"imgDominantColor,omitempty"`
 
147
 
 
148
        ImgSize string `json:"imgSize,omitempty"`
 
149
 
 
150
        ImgType string `json:"imgType,omitempty"`
 
151
 
 
152
        InputEncoding string `json:"inputEncoding,omitempty"`
 
153
 
 
154
        Language string `json:"language,omitempty"`
 
155
 
 
156
        LinkSite string `json:"linkSite,omitempty"`
 
157
 
 
158
        LowRange string `json:"lowRange,omitempty"`
 
159
 
 
160
        OrTerms string `json:"orTerms,omitempty"`
 
161
 
 
162
        OutputEncoding string `json:"outputEncoding,omitempty"`
 
163
 
 
164
        RelatedSite string `json:"relatedSite,omitempty"`
 
165
 
 
166
        Rights string `json:"rights,omitempty"`
 
167
 
 
168
        Safe string `json:"safe,omitempty"`
 
169
 
 
170
        SearchTerms string `json:"searchTerms,omitempty"`
 
171
 
 
172
        SearchType string `json:"searchType,omitempty"`
 
173
 
 
174
        SiteSearch string `json:"siteSearch,omitempty"`
 
175
 
 
176
        SiteSearchFilter string `json:"siteSearchFilter,omitempty"`
 
177
 
 
178
        Sort string `json:"sort,omitempty"`
 
179
 
 
180
        StartIndex int64 `json:"startIndex,omitempty"`
 
181
 
 
182
        StartPage int64 `json:"startPage,omitempty"`
 
183
 
 
184
        Title string `json:"title,omitempty"`
 
185
 
 
186
        TotalResults int64 `json:"totalResults,omitempty,string"`
 
187
}
 
188
 
 
189
type Result struct {
 
190
        CacheId string `json:"cacheId,omitempty"`
 
191
 
 
192
        DisplayLink string `json:"displayLink,omitempty"`
 
193
 
 
194
        FileFormat string `json:"fileFormat,omitempty"`
 
195
 
 
196
        FormattedUrl string `json:"formattedUrl,omitempty"`
 
197
 
 
198
        HtmlFormattedUrl string `json:"htmlFormattedUrl,omitempty"`
 
199
 
 
200
        HtmlSnippet string `json:"htmlSnippet,omitempty"`
 
201
 
 
202
        HtmlTitle string `json:"htmlTitle,omitempty"`
 
203
 
 
204
        Image *ResultImage `json:"image,omitempty"`
 
205
 
 
206
        Kind string `json:"kind,omitempty"`
 
207
 
 
208
        Labels []*ResultLabels `json:"labels,omitempty"`
 
209
 
 
210
        Link string `json:"link,omitempty"`
 
211
 
 
212
        Mime string `json:"mime,omitempty"`
 
213
 
 
214
        Pagemap *ResultPagemap `json:"pagemap,omitempty"`
 
215
 
 
216
        Snippet string `json:"snippet,omitempty"`
 
217
 
 
218
        Title string `json:"title,omitempty"`
 
219
}
 
220
 
 
221
type ResultImage struct {
 
222
        ByteSize int64 `json:"byteSize,omitempty"`
 
223
 
 
224
        ContextLink string `json:"contextLink,omitempty"`
 
225
 
 
226
        Height int64 `json:"height,omitempty"`
 
227
 
 
228
        ThumbnailHeight int64 `json:"thumbnailHeight,omitempty"`
 
229
 
 
230
        ThumbnailLink string `json:"thumbnailLink,omitempty"`
 
231
 
 
232
        ThumbnailWidth int64 `json:"thumbnailWidth,omitempty"`
 
233
 
 
234
        Width int64 `json:"width,omitempty"`
 
235
}
 
236
 
 
237
type ResultLabels struct {
 
238
        DisplayName string `json:"displayName,omitempty"`
 
239
 
 
240
        Label_with_op string `json:"label_with_op,omitempty"`
 
241
 
 
242
        Name string `json:"name,omitempty"`
 
243
}
 
244
 
 
245
type ResultPagemap struct {
 
246
}
 
247
 
 
248
type Search struct {
 
249
        Context *Context `json:"context,omitempty"`
 
250
 
 
251
        Items []*Result `json:"items,omitempty"`
 
252
 
 
253
        Kind string `json:"kind,omitempty"`
 
254
 
 
255
        Promotions []*Promotion `json:"promotions,omitempty"`
 
256
 
 
257
        Queries map[string][]Query `json:"queries,omitempty"`
 
258
 
 
259
        SearchInformation *SearchSearchInformation `json:"searchInformation,omitempty"`
 
260
 
 
261
        Spelling *SearchSpelling `json:"spelling,omitempty"`
 
262
 
 
263
        Url *SearchUrl `json:"url,omitempty"`
 
264
}
 
265
 
 
266
type SearchSearchInformation struct {
 
267
        FormattedSearchTime string `json:"formattedSearchTime,omitempty"`
 
268
 
 
269
        FormattedTotalResults string `json:"formattedTotalResults,omitempty"`
 
270
 
 
271
        SearchTime float64 `json:"searchTime,omitempty"`
 
272
 
 
273
        TotalResults int64 `json:"totalResults,omitempty,string"`
 
274
}
 
275
 
 
276
type SearchSpelling struct {
 
277
        CorrectedQuery string `json:"correctedQuery,omitempty"`
 
278
 
 
279
        HtmlCorrectedQuery string `json:"htmlCorrectedQuery,omitempty"`
 
280
}
 
281
 
 
282
type SearchUrl struct {
 
283
        Template string `json:"template,omitempty"`
 
284
 
 
285
        Type string `json:"type,omitempty"`
 
286
}
 
287
 
 
288
// method id "search.cse.list":
 
289
 
 
290
type CseListCall struct {
 
291
        s    *Service
 
292
        q    string
 
293
        opt_ map[string]interface{}
 
294
}
 
295
 
 
296
// List: Returns metadata about the search performed, metadata about the
 
297
// custom search engine used for the search, and the search results.
 
298
func (r *CseService) List(q string) *CseListCall {
 
299
        c := &CseListCall{s: r.s, opt_: make(map[string]interface{})}
 
300
        c.q = q
 
301
        return c
 
302
}
 
303
 
 
304
// C2coff sets the optional parameter "c2coff": Turns off the
 
305
// translation between zh-CN and zh-TW.
 
306
func (c *CseListCall) C2coff(c2coff string) *CseListCall {
 
307
        c.opt_["c2coff"] = c2coff
 
308
        return c
 
309
}
 
310
 
 
311
// Cr sets the optional parameter "cr": Country restrict(s).
 
312
func (c *CseListCall) Cr(cr string) *CseListCall {
 
313
        c.opt_["cr"] = cr
 
314
        return c
 
315
}
 
316
 
 
317
// Cref sets the optional parameter "cref": The URL of a linked custom
 
318
// search engine
 
319
func (c *CseListCall) Cref(cref string) *CseListCall {
 
320
        c.opt_["cref"] = cref
 
321
        return c
 
322
}
 
323
 
 
324
// Cx sets the optional parameter "cx": The custom search engine ID to
 
325
// scope this search query
 
326
func (c *CseListCall) Cx(cx string) *CseListCall {
 
327
        c.opt_["cx"] = cx
 
328
        return c
 
329
}
 
330
 
 
331
// DateRestrict sets the optional parameter "dateRestrict": Specifies
 
332
// all search results are from a time period
 
333
func (c *CseListCall) DateRestrict(dateRestrict string) *CseListCall {
 
334
        c.opt_["dateRestrict"] = dateRestrict
 
335
        return c
 
336
}
 
337
 
 
338
// ExactTerms sets the optional parameter "exactTerms": Identifies a
 
339
// phrase that all documents in the search results must contain
 
340
func (c *CseListCall) ExactTerms(exactTerms string) *CseListCall {
 
341
        c.opt_["exactTerms"] = exactTerms
 
342
        return c
 
343
}
 
344
 
 
345
// ExcludeTerms sets the optional parameter "excludeTerms": Identifies a
 
346
// word or phrase that should not appear in any documents in the search
 
347
// results
 
348
func (c *CseListCall) ExcludeTerms(excludeTerms string) *CseListCall {
 
349
        c.opt_["excludeTerms"] = excludeTerms
 
350
        return c
 
351
}
 
352
 
 
353
// FileType sets the optional parameter "fileType": Returns images of a
 
354
// specified type. Some of the allowed values are: bmp, gif, png, jpg,
 
355
// svg, pdf, ...
 
356
func (c *CseListCall) FileType(fileType string) *CseListCall {
 
357
        c.opt_["fileType"] = fileType
 
358
        return c
 
359
}
 
360
 
 
361
// Filter sets the optional parameter "filter": Controls turning on or
 
362
// off the duplicate content filter.
 
363
func (c *CseListCall) Filter(filter string) *CseListCall {
 
364
        c.opt_["filter"] = filter
 
365
        return c
 
366
}
 
367
 
 
368
// Gl sets the optional parameter "gl": Geolocation of end user.
 
369
func (c *CseListCall) Gl(gl string) *CseListCall {
 
370
        c.opt_["gl"] = gl
 
371
        return c
 
372
}
 
373
 
 
374
// Googlehost sets the optional parameter "googlehost": The local Google
 
375
// domain to use to perform the search.
 
376
func (c *CseListCall) Googlehost(googlehost string) *CseListCall {
 
377
        c.opt_["googlehost"] = googlehost
 
378
        return c
 
379
}
 
380
 
 
381
// HighRange sets the optional parameter "highRange": Creates a range in
 
382
// form as_nlo value..as_nhi value and attempts to append it to query
 
383
func (c *CseListCall) HighRange(highRange string) *CseListCall {
 
384
        c.opt_["highRange"] = highRange
 
385
        return c
 
386
}
 
387
 
 
388
// Hl sets the optional parameter "hl": Sets the user interface
 
389
// language.
 
390
func (c *CseListCall) Hl(hl string) *CseListCall {
 
391
        c.opt_["hl"] = hl
 
392
        return c
 
393
}
 
394
 
 
395
// Hq sets the optional parameter "hq": Appends the extra query terms to
 
396
// the query.
 
397
func (c *CseListCall) Hq(hq string) *CseListCall {
 
398
        c.opt_["hq"] = hq
 
399
        return c
 
400
}
 
401
 
 
402
// ImgColorType sets the optional parameter "imgColorType": Returns
 
403
// black and white, grayscale, or color images: mono, gray, and color.
 
404
func (c *CseListCall) ImgColorType(imgColorType string) *CseListCall {
 
405
        c.opt_["imgColorType"] = imgColorType
 
406
        return c
 
407
}
 
408
 
 
409
// ImgDominantColor sets the optional parameter "imgDominantColor":
 
410
// Returns images of a specific dominant color: yellow, green, teal,
 
411
// blue, purple, pink, white, gray, black and brown.
 
412
func (c *CseListCall) ImgDominantColor(imgDominantColor string) *CseListCall {
 
413
        c.opt_["imgDominantColor"] = imgDominantColor
 
414
        return c
 
415
}
 
416
 
 
417
// ImgSize sets the optional parameter "imgSize": Returns images of a
 
418
// specified size, where size can be one of: icon, small, medium, large,
 
419
// xlarge, xxlarge, and huge.
 
420
func (c *CseListCall) ImgSize(imgSize string) *CseListCall {
 
421
        c.opt_["imgSize"] = imgSize
 
422
        return c
 
423
}
 
424
 
 
425
// ImgType sets the optional parameter "imgType": Returns images of a
 
426
// type, which can be one of: clipart, face, lineart, news, and photo.
 
427
func (c *CseListCall) ImgType(imgType string) *CseListCall {
 
428
        c.opt_["imgType"] = imgType
 
429
        return c
 
430
}
 
431
 
 
432
// LinkSite sets the optional parameter "linkSite": Specifies that all
 
433
// search results should contain a link to a particular URL
 
434
func (c *CseListCall) LinkSite(linkSite string) *CseListCall {
 
435
        c.opt_["linkSite"] = linkSite
 
436
        return c
 
437
}
 
438
 
 
439
// LowRange sets the optional parameter "lowRange": Creates a range in
 
440
// form as_nlo value..as_nhi value and attempts to append it to query
 
441
func (c *CseListCall) LowRange(lowRange string) *CseListCall {
 
442
        c.opt_["lowRange"] = lowRange
 
443
        return c
 
444
}
 
445
 
 
446
// Lr sets the optional parameter "lr": The language restriction for the
 
447
// search results
 
448
func (c *CseListCall) Lr(lr string) *CseListCall {
 
449
        c.opt_["lr"] = lr
 
450
        return c
 
451
}
 
452
 
 
453
// Num sets the optional parameter "num": Number of search results to
 
454
// return
 
455
func (c *CseListCall) Num(num int64) *CseListCall {
 
456
        c.opt_["num"] = num
 
457
        return c
 
458
}
 
459
 
 
460
// OrTerms sets the optional parameter "orTerms": Provides additional
 
461
// search terms to check for in a document, where each document in the
 
462
// search results must contain at least one of the additional search
 
463
// terms
 
464
func (c *CseListCall) OrTerms(orTerms string) *CseListCall {
 
465
        c.opt_["orTerms"] = orTerms
 
466
        return c
 
467
}
 
468
 
 
469
// RelatedSite sets the optional parameter "relatedSite": Specifies that
 
470
// all search results should be pages that are related to the specified
 
471
// URL
 
472
func (c *CseListCall) RelatedSite(relatedSite string) *CseListCall {
 
473
        c.opt_["relatedSite"] = relatedSite
 
474
        return c
 
475
}
 
476
 
 
477
// Rights sets the optional parameter "rights": Filters based on
 
478
// licensing. Supported values include: cc_publicdomain, cc_attribute,
 
479
// cc_sharealike, cc_noncommercial, cc_nonderived and combinations of
 
480
// these.
 
481
func (c *CseListCall) Rights(rights string) *CseListCall {
 
482
        c.opt_["rights"] = rights
 
483
        return c
 
484
}
 
485
 
 
486
// Safe sets the optional parameter "safe": Search safety level
 
487
func (c *CseListCall) Safe(safe string) *CseListCall {
 
488
        c.opt_["safe"] = safe
 
489
        return c
 
490
}
 
491
 
 
492
// SearchType sets the optional parameter "searchType": Specifies the
 
493
// search type: image.
 
494
func (c *CseListCall) SearchType(searchType string) *CseListCall {
 
495
        c.opt_["searchType"] = searchType
 
496
        return c
 
497
}
 
498
 
 
499
// SiteSearch sets the optional parameter "siteSearch": Specifies all
 
500
// search results should be pages from a given site
 
501
func (c *CseListCall) SiteSearch(siteSearch string) *CseListCall {
 
502
        c.opt_["siteSearch"] = siteSearch
 
503
        return c
 
504
}
 
505
 
 
506
// SiteSearchFilter sets the optional parameter "siteSearchFilter":
 
507
// Controls whether to include or exclude results from the site named in
 
508
// the as_sitesearch parameter
 
509
func (c *CseListCall) SiteSearchFilter(siteSearchFilter string) *CseListCall {
 
510
        c.opt_["siteSearchFilter"] = siteSearchFilter
 
511
        return c
 
512
}
 
513
 
 
514
// Sort sets the optional parameter "sort": The sort expression to apply
 
515
// to the results
 
516
func (c *CseListCall) Sort(sort string) *CseListCall {
 
517
        c.opt_["sort"] = sort
 
518
        return c
 
519
}
 
520
 
 
521
// Start sets the optional parameter "start": The index of the first
 
522
// result to return
 
523
func (c *CseListCall) Start(start int64) *CseListCall {
 
524
        c.opt_["start"] = start
 
525
        return c
 
526
}
 
527
 
 
528
// Fields allows partial responses to be retrieved.
 
529
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
530
// for more information.
 
531
func (c *CseListCall) Fields(s ...googleapi.Field) *CseListCall {
 
532
        c.opt_["fields"] = googleapi.CombineFields(s)
 
533
        return c
 
534
}
 
535
 
 
536
func (c *CseListCall) Do() (*Search, error) {
 
537
        var body io.Reader = nil
 
538
        params := make(url.Values)
 
539
        params.Set("alt", "json")
 
540
        params.Set("q", fmt.Sprintf("%v", c.q))
 
541
        if v, ok := c.opt_["c2coff"]; ok {
 
542
                params.Set("c2coff", fmt.Sprintf("%v", v))
 
543
        }
 
544
        if v, ok := c.opt_["cr"]; ok {
 
545
                params.Set("cr", fmt.Sprintf("%v", v))
 
546
        }
 
547
        if v, ok := c.opt_["cref"]; ok {
 
548
                params.Set("cref", fmt.Sprintf("%v", v))
 
549
        }
 
550
        if v, ok := c.opt_["cx"]; ok {
 
551
                params.Set("cx", fmt.Sprintf("%v", v))
 
552
        }
 
553
        if v, ok := c.opt_["dateRestrict"]; ok {
 
554
                params.Set("dateRestrict", fmt.Sprintf("%v", v))
 
555
        }
 
556
        if v, ok := c.opt_["exactTerms"]; ok {
 
557
                params.Set("exactTerms", fmt.Sprintf("%v", v))
 
558
        }
 
559
        if v, ok := c.opt_["excludeTerms"]; ok {
 
560
                params.Set("excludeTerms", fmt.Sprintf("%v", v))
 
561
        }
 
562
        if v, ok := c.opt_["fileType"]; ok {
 
563
                params.Set("fileType", fmt.Sprintf("%v", v))
 
564
        }
 
565
        if v, ok := c.opt_["filter"]; ok {
 
566
                params.Set("filter", fmt.Sprintf("%v", v))
 
567
        }
 
568
        if v, ok := c.opt_["gl"]; ok {
 
569
                params.Set("gl", fmt.Sprintf("%v", v))
 
570
        }
 
571
        if v, ok := c.opt_["googlehost"]; ok {
 
572
                params.Set("googlehost", fmt.Sprintf("%v", v))
 
573
        }
 
574
        if v, ok := c.opt_["highRange"]; ok {
 
575
                params.Set("highRange", fmt.Sprintf("%v", v))
 
576
        }
 
577
        if v, ok := c.opt_["hl"]; ok {
 
578
                params.Set("hl", fmt.Sprintf("%v", v))
 
579
        }
 
580
        if v, ok := c.opt_["hq"]; ok {
 
581
                params.Set("hq", fmt.Sprintf("%v", v))
 
582
        }
 
583
        if v, ok := c.opt_["imgColorType"]; ok {
 
584
                params.Set("imgColorType", fmt.Sprintf("%v", v))
 
585
        }
 
586
        if v, ok := c.opt_["imgDominantColor"]; ok {
 
587
                params.Set("imgDominantColor", fmt.Sprintf("%v", v))
 
588
        }
 
589
        if v, ok := c.opt_["imgSize"]; ok {
 
590
                params.Set("imgSize", fmt.Sprintf("%v", v))
 
591
        }
 
592
        if v, ok := c.opt_["imgType"]; ok {
 
593
                params.Set("imgType", fmt.Sprintf("%v", v))
 
594
        }
 
595
        if v, ok := c.opt_["linkSite"]; ok {
 
596
                params.Set("linkSite", fmt.Sprintf("%v", v))
 
597
        }
 
598
        if v, ok := c.opt_["lowRange"]; ok {
 
599
                params.Set("lowRange", fmt.Sprintf("%v", v))
 
600
        }
 
601
        if v, ok := c.opt_["lr"]; ok {
 
602
                params.Set("lr", fmt.Sprintf("%v", v))
 
603
        }
 
604
        if v, ok := c.opt_["num"]; ok {
 
605
                params.Set("num", fmt.Sprintf("%v", v))
 
606
        }
 
607
        if v, ok := c.opt_["orTerms"]; ok {
 
608
                params.Set("orTerms", fmt.Sprintf("%v", v))
 
609
        }
 
610
        if v, ok := c.opt_["relatedSite"]; ok {
 
611
                params.Set("relatedSite", fmt.Sprintf("%v", v))
 
612
        }
 
613
        if v, ok := c.opt_["rights"]; ok {
 
614
                params.Set("rights", fmt.Sprintf("%v", v))
 
615
        }
 
616
        if v, ok := c.opt_["safe"]; ok {
 
617
                params.Set("safe", fmt.Sprintf("%v", v))
 
618
        }
 
619
        if v, ok := c.opt_["searchType"]; ok {
 
620
                params.Set("searchType", fmt.Sprintf("%v", v))
 
621
        }
 
622
        if v, ok := c.opt_["siteSearch"]; ok {
 
623
                params.Set("siteSearch", fmt.Sprintf("%v", v))
 
624
        }
 
625
        if v, ok := c.opt_["siteSearchFilter"]; ok {
 
626
                params.Set("siteSearchFilter", fmt.Sprintf("%v", v))
 
627
        }
 
628
        if v, ok := c.opt_["sort"]; ok {
 
629
                params.Set("sort", fmt.Sprintf("%v", v))
 
630
        }
 
631
        if v, ok := c.opt_["start"]; ok {
 
632
                params.Set("start", fmt.Sprintf("%v", v))
 
633
        }
 
634
        if v, ok := c.opt_["fields"]; ok {
 
635
                params.Set("fields", fmt.Sprintf("%v", v))
 
636
        }
 
637
        urls := googleapi.ResolveRelative(c.s.BasePath, "v1")
 
638
        urls += "?" + params.Encode()
 
639
        req, _ := http.NewRequest("GET", urls, body)
 
640
        googleapi.SetOpaque(req.URL)
 
641
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
642
        res, err := c.s.client.Do(req)
 
643
        if err != nil {
 
644
                return nil, err
 
645
        }
 
646
        defer googleapi.CloseBody(res)
 
647
        if err := googleapi.CheckResponse(res); err != nil {
 
648
                return nil, err
 
649
        }
 
650
        var ret *Search
 
651
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
652
                return nil, err
 
653
        }
 
654
        return ret, nil
 
655
        // {
 
656
        //   "description": "Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.",
 
657
        //   "httpMethod": "GET",
 
658
        //   "id": "search.cse.list",
 
659
        //   "parameterOrder": [
 
660
        //     "q"
 
661
        //   ],
 
662
        //   "parameters": {
 
663
        //     "c2coff": {
 
664
        //       "description": "Turns off the translation between zh-CN and zh-TW.",
 
665
        //       "location": "query",
 
666
        //       "type": "string"
 
667
        //     },
 
668
        //     "cr": {
 
669
        //       "description": "Country restrict(s).",
 
670
        //       "location": "query",
 
671
        //       "type": "string"
 
672
        //     },
 
673
        //     "cref": {
 
674
        //       "description": "The URL of a linked custom search engine",
 
675
        //       "location": "query",
 
676
        //       "type": "string"
 
677
        //     },
 
678
        //     "cx": {
 
679
        //       "description": "The custom search engine ID to scope this search query",
 
680
        //       "location": "query",
 
681
        //       "type": "string"
 
682
        //     },
 
683
        //     "dateRestrict": {
 
684
        //       "description": "Specifies all search results are from a time period",
 
685
        //       "location": "query",
 
686
        //       "type": "string"
 
687
        //     },
 
688
        //     "exactTerms": {
 
689
        //       "description": "Identifies a phrase that all documents in the search results must contain",
 
690
        //       "location": "query",
 
691
        //       "type": "string"
 
692
        //     },
 
693
        //     "excludeTerms": {
 
694
        //       "description": "Identifies a word or phrase that should not appear in any documents in the search results",
 
695
        //       "location": "query",
 
696
        //       "type": "string"
 
697
        //     },
 
698
        //     "fileType": {
 
699
        //       "description": "Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...",
 
700
        //       "location": "query",
 
701
        //       "type": "string"
 
702
        //     },
 
703
        //     "filter": {
 
704
        //       "description": "Controls turning on or off the duplicate content filter.",
 
705
        //       "enum": [
 
706
        //         "0",
 
707
        //         "1"
 
708
        //       ],
 
709
        //       "enumDescriptions": [
 
710
        //         "Turns off duplicate content filter.",
 
711
        //         "Turns on duplicate content filter."
 
712
        //       ],
 
713
        //       "location": "query",
 
714
        //       "type": "string"
 
715
        //     },
 
716
        //     "gl": {
 
717
        //       "description": "Geolocation of end user.",
 
718
        //       "location": "query",
 
719
        //       "type": "string"
 
720
        //     },
 
721
        //     "googlehost": {
 
722
        //       "description": "The local Google domain to use to perform the search.",
 
723
        //       "location": "query",
 
724
        //       "type": "string"
 
725
        //     },
 
726
        //     "highRange": {
 
727
        //       "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query",
 
728
        //       "location": "query",
 
729
        //       "type": "string"
 
730
        //     },
 
731
        //     "hl": {
 
732
        //       "description": "Sets the user interface language.",
 
733
        //       "location": "query",
 
734
        //       "type": "string"
 
735
        //     },
 
736
        //     "hq": {
 
737
        //       "description": "Appends the extra query terms to the query.",
 
738
        //       "location": "query",
 
739
        //       "type": "string"
 
740
        //     },
 
741
        //     "imgColorType": {
 
742
        //       "description": "Returns black and white, grayscale, or color images: mono, gray, and color.",
 
743
        //       "enum": [
 
744
        //         "color",
 
745
        //         "gray",
 
746
        //         "mono"
 
747
        //       ],
 
748
        //       "enumDescriptions": [
 
749
        //         "color",
 
750
        //         "gray",
 
751
        //         "mono"
 
752
        //       ],
 
753
        //       "location": "query",
 
754
        //       "type": "string"
 
755
        //     },
 
756
        //     "imgDominantColor": {
 
757
        //       "description": "Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown.",
 
758
        //       "enum": [
 
759
        //         "black",
 
760
        //         "blue",
 
761
        //         "brown",
 
762
        //         "gray",
 
763
        //         "green",
 
764
        //         "pink",
 
765
        //         "purple",
 
766
        //         "teal",
 
767
        //         "white",
 
768
        //         "yellow"
 
769
        //       ],
 
770
        //       "enumDescriptions": [
 
771
        //         "black",
 
772
        //         "blue",
 
773
        //         "brown",
 
774
        //         "gray",
 
775
        //         "green",
 
776
        //         "pink",
 
777
        //         "purple",
 
778
        //         "teal",
 
779
        //         "white",
 
780
        //         "yellow"
 
781
        //       ],
 
782
        //       "location": "query",
 
783
        //       "type": "string"
 
784
        //     },
 
785
        //     "imgSize": {
 
786
        //       "description": "Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.",
 
787
        //       "enum": [
 
788
        //         "huge",
 
789
        //         "icon",
 
790
        //         "large",
 
791
        //         "medium",
 
792
        //         "small",
 
793
        //         "xlarge",
 
794
        //         "xxlarge"
 
795
        //       ],
 
796
        //       "enumDescriptions": [
 
797
        //         "huge",
 
798
        //         "icon",
 
799
        //         "large",
 
800
        //         "medium",
 
801
        //         "small",
 
802
        //         "xlarge",
 
803
        //         "xxlarge"
 
804
        //       ],
 
805
        //       "location": "query",
 
806
        //       "type": "string"
 
807
        //     },
 
808
        //     "imgType": {
 
809
        //       "description": "Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.",
 
810
        //       "enum": [
 
811
        //         "clipart",
 
812
        //         "face",
 
813
        //         "lineart",
 
814
        //         "news",
 
815
        //         "photo"
 
816
        //       ],
 
817
        //       "enumDescriptions": [
 
818
        //         "clipart",
 
819
        //         "face",
 
820
        //         "lineart",
 
821
        //         "news",
 
822
        //         "photo"
 
823
        //       ],
 
824
        //       "location": "query",
 
825
        //       "type": "string"
 
826
        //     },
 
827
        //     "linkSite": {
 
828
        //       "description": "Specifies that all search results should contain a link to a particular URL",
 
829
        //       "location": "query",
 
830
        //       "type": "string"
 
831
        //     },
 
832
        //     "lowRange": {
 
833
        //       "description": "Creates a range in form as_nlo value..as_nhi value and attempts to append it to query",
 
834
        //       "location": "query",
 
835
        //       "type": "string"
 
836
        //     },
 
837
        //     "lr": {
 
838
        //       "description": "The language restriction for the search results",
 
839
        //       "enum": [
 
840
        //         "lang_ar",
 
841
        //         "lang_bg",
 
842
        //         "lang_ca",
 
843
        //         "lang_cs",
 
844
        //         "lang_da",
 
845
        //         "lang_de",
 
846
        //         "lang_el",
 
847
        //         "lang_en",
 
848
        //         "lang_es",
 
849
        //         "lang_et",
 
850
        //         "lang_fi",
 
851
        //         "lang_fr",
 
852
        //         "lang_hr",
 
853
        //         "lang_hu",
 
854
        //         "lang_id",
 
855
        //         "lang_is",
 
856
        //         "lang_it",
 
857
        //         "lang_iw",
 
858
        //         "lang_ja",
 
859
        //         "lang_ko",
 
860
        //         "lang_lt",
 
861
        //         "lang_lv",
 
862
        //         "lang_nl",
 
863
        //         "lang_no",
 
864
        //         "lang_pl",
 
865
        //         "lang_pt",
 
866
        //         "lang_ro",
 
867
        //         "lang_ru",
 
868
        //         "lang_sk",
 
869
        //         "lang_sl",
 
870
        //         "lang_sr",
 
871
        //         "lang_sv",
 
872
        //         "lang_tr",
 
873
        //         "lang_zh-CN",
 
874
        //         "lang_zh-TW"
 
875
        //       ],
 
876
        //       "enumDescriptions": [
 
877
        //         "Arabic",
 
878
        //         "Bulgarian",
 
879
        //         "Catalan",
 
880
        //         "Czech",
 
881
        //         "Danish",
 
882
        //         "German",
 
883
        //         "Greek",
 
884
        //         "English",
 
885
        //         "Spanish",
 
886
        //         "Estonian",
 
887
        //         "Finnish",
 
888
        //         "French",
 
889
        //         "Croatian",
 
890
        //         "Hungarian",
 
891
        //         "Indonesian",
 
892
        //         "Icelandic",
 
893
        //         "Italian",
 
894
        //         "Hebrew",
 
895
        //         "Japanese",
 
896
        //         "Korean",
 
897
        //         "Lithuanian",
 
898
        //         "Latvian",
 
899
        //         "Dutch",
 
900
        //         "Norwegian",
 
901
        //         "Polish",
 
902
        //         "Portuguese",
 
903
        //         "Romanian",
 
904
        //         "Russian",
 
905
        //         "Slovak",
 
906
        //         "Slovenian",
 
907
        //         "Serbian",
 
908
        //         "Swedish",
 
909
        //         "Turkish",
 
910
        //         "Chinese (Simplified)",
 
911
        //         "Chinese (Traditional)"
 
912
        //       ],
 
913
        //       "location": "query",
 
914
        //       "type": "string"
 
915
        //     },
 
916
        //     "num": {
 
917
        //       "default": "10",
 
918
        //       "description": "Number of search results to return",
 
919
        //       "format": "uint32",
 
920
        //       "location": "query",
 
921
        //       "type": "integer"
 
922
        //     },
 
923
        //     "orTerms": {
 
924
        //       "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",
 
925
        //       "location": "query",
 
926
        //       "type": "string"
 
927
        //     },
 
928
        //     "q": {
 
929
        //       "description": "Query",
 
930
        //       "location": "query",
 
931
        //       "required": true,
 
932
        //       "type": "string"
 
933
        //     },
 
934
        //     "relatedSite": {
 
935
        //       "description": "Specifies that all search results should be pages that are related to the specified URL",
 
936
        //       "location": "query",
 
937
        //       "type": "string"
 
938
        //     },
 
939
        //     "rights": {
 
940
        //       "description": "Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.",
 
941
        //       "location": "query",
 
942
        //       "type": "string"
 
943
        //     },
 
944
        //     "safe": {
 
945
        //       "default": "off",
 
946
        //       "description": "Search safety level",
 
947
        //       "enum": [
 
948
        //         "high",
 
949
        //         "medium",
 
950
        //         "off"
 
951
        //       ],
 
952
        //       "enumDescriptions": [
 
953
        //         "Enables highest level of safe search filtering.",
 
954
        //         "Enables moderate safe search filtering.",
 
955
        //         "Disables safe search filtering."
 
956
        //       ],
 
957
        //       "location": "query",
 
958
        //       "type": "string"
 
959
        //     },
 
960
        //     "searchType": {
 
961
        //       "description": "Specifies the search type: image.",
 
962
        //       "enum": [
 
963
        //         "image"
 
964
        //       ],
 
965
        //       "enumDescriptions": [
 
966
        //         "custom image search"
 
967
        //       ],
 
968
        //       "location": "query",
 
969
        //       "type": "string"
 
970
        //     },
 
971
        //     "siteSearch": {
 
972
        //       "description": "Specifies all search results should be pages from a given site",
 
973
        //       "location": "query",
 
974
        //       "type": "string"
 
975
        //     },
 
976
        //     "siteSearchFilter": {
 
977
        //       "description": "Controls whether to include or exclude results from the site named in the as_sitesearch parameter",
 
978
        //       "enum": [
 
979
        //         "e",
 
980
        //         "i"
 
981
        //       ],
 
982
        //       "enumDescriptions": [
 
983
        //         "exclude",
 
984
        //         "include"
 
985
        //       ],
 
986
        //       "location": "query",
 
987
        //       "type": "string"
 
988
        //     },
 
989
        //     "sort": {
 
990
        //       "description": "The sort expression to apply to the results",
 
991
        //       "location": "query",
 
992
        //       "type": "string"
 
993
        //     },
 
994
        //     "start": {
 
995
        //       "description": "The index of the first result to return",
 
996
        //       "format": "uint32",
 
997
        //       "location": "query",
 
998
        //       "type": "integer"
 
999
        //     }
 
1000
        //   },
 
1001
        //   "path": "v1",
 
1002
        //   "response": {
 
1003
        //     "$ref": "Search"
 
1004
        //   }
 
1005
        // }
 
1006
 
 
1007
}