~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/siteverification/v1/siteverification-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 siteverification provides access to the Google Site Verification API.
 
2
//
 
3
// See https://developers.google.com/site-verification/
 
4
//
 
5
// Usage example:
 
6
//
 
7
//   import "google.golang.org/api/siteverification/v1"
 
8
//   ...
 
9
//   siteverificationService, err := siteverification.New(oauthHttpClient)
 
10
package siteverification
 
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 = "siteVerification:v1"
 
38
const apiName = "siteVerification"
 
39
const apiVersion = "v1"
 
40
const basePath = "https://www.googleapis.com/siteVerification/v1/"
 
41
 
 
42
// OAuth2 scopes used by this API.
 
43
const (
 
44
        // Manage the list of sites and domains you control
 
45
        SiteverificationScope = "https://www.googleapis.com/auth/siteverification"
 
46
 
 
47
        // Manage your new site verifications with Google
 
48
        SiteverificationVerify_onlyScope = "https://www.googleapis.com/auth/siteverification.verify_only"
 
49
)
 
50
 
 
51
func New(client *http.Client) (*Service, error) {
 
52
        if client == nil {
 
53
                return nil, errors.New("client is nil")
 
54
        }
 
55
        s := &Service{client: client, BasePath: basePath}
 
56
        s.WebResource = NewWebResourceService(s)
 
57
        return s, nil
 
58
}
 
59
 
 
60
type Service struct {
 
61
        client   *http.Client
 
62
        BasePath string // API endpoint base URL
 
63
 
 
64
        WebResource *WebResourceService
 
65
}
 
66
 
 
67
func NewWebResourceService(s *Service) *WebResourceService {
 
68
        rs := &WebResourceService{s: s}
 
69
        return rs
 
70
}
 
71
 
 
72
type WebResourceService struct {
 
73
        s *Service
 
74
}
 
75
 
 
76
type SiteVerificationWebResourceGettokenRequest struct {
 
77
        // Site: The site for which a verification token will be generated.
 
78
        Site *SiteVerificationWebResourceGettokenRequestSite `json:"site,omitempty"`
 
79
 
 
80
        // VerificationMethod: The verification method that will be used to
 
81
        // verify this site. For sites, 'FILE' or 'META' methods may be used.
 
82
        // For domains, only 'DNS' may be used.
 
83
        VerificationMethod string `json:"verificationMethod,omitempty"`
 
84
}
 
85
 
 
86
type SiteVerificationWebResourceGettokenRequestSite struct {
 
87
        // Identifier: The site identifier. If the type is set to SITE, the
 
88
        // identifier is a URL. If the type is set to INET_DOMAIN, the site
 
89
        // identifier is a domain name.
 
90
        Identifier string `json:"identifier,omitempty"`
 
91
 
 
92
        // Type: The type of resource to be verified. Can be SITE or INET_DOMAIN
 
93
        // (domain name).
 
94
        Type string `json:"type,omitempty"`
 
95
}
 
96
 
 
97
type SiteVerificationWebResourceGettokenResponse struct {
 
98
        // Method: The verification method to use in conjunction with this
 
99
        // token. For FILE, the token should be placed in the top-level
 
100
        // directory of the site, stored inside a file of the same name. For
 
101
        // META, the token should be placed in the HEAD tag of the default page
 
102
        // that is loaded for the site. For DNS, the token should be placed in a
 
103
        // TXT record of the domain.
 
104
        Method string `json:"method,omitempty"`
 
105
 
 
106
        // Token: The verification token. The token must be placed appropriately
 
107
        // in order for verification to succeed.
 
108
        Token string `json:"token,omitempty"`
 
109
}
 
110
 
 
111
type SiteVerificationWebResourceListResponse struct {
 
112
        // Items: The list of sites that are owned by the authenticated user.
 
113
        Items []*SiteVerificationWebResourceResource `json:"items,omitempty"`
 
114
}
 
115
 
 
116
type SiteVerificationWebResourceResource struct {
 
117
        // Id: The string used to identify this site. This value should be used
 
118
        // in the "id" portion of the REST URL for the Get, Update, and Delete
 
119
        // operations.
 
120
        Id string `json:"id,omitempty"`
 
121
 
 
122
        // Owners: The email addresses of all verified owners.
 
123
        Owners []string `json:"owners,omitempty"`
 
124
 
 
125
        // Site: The address and type of a site that is verified or will be
 
126
        // verified.
 
127
        Site *SiteVerificationWebResourceResourceSite `json:"site,omitempty"`
 
128
}
 
129
 
 
130
type SiteVerificationWebResourceResourceSite struct {
 
131
        // Identifier: The site identifier. If the type is set to SITE, the
 
132
        // identifier is a URL. If the type is set to INET_DOMAIN, the site
 
133
        // identifier is a domain name.
 
134
        Identifier string `json:"identifier,omitempty"`
 
135
 
 
136
        // Type: The site type. Can be SITE or INET_DOMAIN (domain name).
 
137
        Type string `json:"type,omitempty"`
 
138
}
 
139
 
 
140
// method id "siteVerification.webResource.delete":
 
141
 
 
142
type WebResourceDeleteCall struct {
 
143
        s    *Service
 
144
        id   string
 
145
        opt_ map[string]interface{}
 
146
}
 
147
 
 
148
// Delete: Relinquish ownership of a website or domain.
 
149
func (r *WebResourceService) Delete(id string) *WebResourceDeleteCall {
 
150
        c := &WebResourceDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
151
        c.id = id
 
152
        return c
 
153
}
 
154
 
 
155
// Fields allows partial responses to be retrieved.
 
156
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
157
// for more information.
 
158
func (c *WebResourceDeleteCall) Fields(s ...googleapi.Field) *WebResourceDeleteCall {
 
159
        c.opt_["fields"] = googleapi.CombineFields(s)
 
160
        return c
 
161
}
 
162
 
 
163
func (c *WebResourceDeleteCall) Do() error {
 
164
        var body io.Reader = nil
 
165
        params := make(url.Values)
 
166
        params.Set("alt", "json")
 
167
        if v, ok := c.opt_["fields"]; ok {
 
168
                params.Set("fields", fmt.Sprintf("%v", v))
 
169
        }
 
170
        urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}")
 
171
        urls += "?" + params.Encode()
 
172
        req, _ := http.NewRequest("DELETE", urls, body)
 
173
        googleapi.Expand(req.URL, map[string]string{
 
174
                "id": c.id,
 
175
        })
 
176
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
177
        res, err := c.s.client.Do(req)
 
178
        if err != nil {
 
179
                return err
 
180
        }
 
181
        defer googleapi.CloseBody(res)
 
182
        if err := googleapi.CheckResponse(res); err != nil {
 
183
                return err
 
184
        }
 
185
        return nil
 
186
        // {
 
187
        //   "description": "Relinquish ownership of a website or domain.",
 
188
        //   "httpMethod": "DELETE",
 
189
        //   "id": "siteVerification.webResource.delete",
 
190
        //   "parameterOrder": [
 
191
        //     "id"
 
192
        //   ],
 
193
        //   "parameters": {
 
194
        //     "id": {
 
195
        //       "description": "The id of a verified site or domain.",
 
196
        //       "location": "path",
 
197
        //       "required": true,
 
198
        //       "type": "string"
 
199
        //     }
 
200
        //   },
 
201
        //   "path": "webResource/{id}",
 
202
        //   "scopes": [
 
203
        //     "https://www.googleapis.com/auth/siteverification"
 
204
        //   ]
 
205
        // }
 
206
 
 
207
}
 
208
 
 
209
// method id "siteVerification.webResource.get":
 
210
 
 
211
type WebResourceGetCall struct {
 
212
        s    *Service
 
213
        id   string
 
214
        opt_ map[string]interface{}
 
215
}
 
216
 
 
217
// Get: Get the most current data for a website or domain.
 
218
func (r *WebResourceService) Get(id string) *WebResourceGetCall {
 
219
        c := &WebResourceGetCall{s: r.s, opt_: make(map[string]interface{})}
 
220
        c.id = id
 
221
        return c
 
222
}
 
223
 
 
224
// Fields allows partial responses to be retrieved.
 
225
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
226
// for more information.
 
227
func (c *WebResourceGetCall) Fields(s ...googleapi.Field) *WebResourceGetCall {
 
228
        c.opt_["fields"] = googleapi.CombineFields(s)
 
229
        return c
 
230
}
 
231
 
 
232
func (c *WebResourceGetCall) Do() (*SiteVerificationWebResourceResource, error) {
 
233
        var body io.Reader = nil
 
234
        params := make(url.Values)
 
235
        params.Set("alt", "json")
 
236
        if v, ok := c.opt_["fields"]; ok {
 
237
                params.Set("fields", fmt.Sprintf("%v", v))
 
238
        }
 
239
        urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}")
 
240
        urls += "?" + params.Encode()
 
241
        req, _ := http.NewRequest("GET", urls, body)
 
242
        googleapi.Expand(req.URL, map[string]string{
 
243
                "id": c.id,
 
244
        })
 
245
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
246
        res, err := c.s.client.Do(req)
 
247
        if err != nil {
 
248
                return nil, err
 
249
        }
 
250
        defer googleapi.CloseBody(res)
 
251
        if err := googleapi.CheckResponse(res); err != nil {
 
252
                return nil, err
 
253
        }
 
254
        var ret *SiteVerificationWebResourceResource
 
255
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
256
                return nil, err
 
257
        }
 
258
        return ret, nil
 
259
        // {
 
260
        //   "description": "Get the most current data for a website or domain.",
 
261
        //   "httpMethod": "GET",
 
262
        //   "id": "siteVerification.webResource.get",
 
263
        //   "parameterOrder": [
 
264
        //     "id"
 
265
        //   ],
 
266
        //   "parameters": {
 
267
        //     "id": {
 
268
        //       "description": "The id of a verified site or domain.",
 
269
        //       "location": "path",
 
270
        //       "required": true,
 
271
        //       "type": "string"
 
272
        //     }
 
273
        //   },
 
274
        //   "path": "webResource/{id}",
 
275
        //   "response": {
 
276
        //     "$ref": "SiteVerificationWebResourceResource"
 
277
        //   },
 
278
        //   "scopes": [
 
279
        //     "https://www.googleapis.com/auth/siteverification"
 
280
        //   ]
 
281
        // }
 
282
 
 
283
}
 
284
 
 
285
// method id "siteVerification.webResource.getToken":
 
286
 
 
287
type WebResourceGetTokenCall struct {
 
288
        s                                          *Service
 
289
        siteverificationwebresourcegettokenrequest *SiteVerificationWebResourceGettokenRequest
 
290
        opt_                                       map[string]interface{}
 
291
}
 
292
 
 
293
// GetToken: Get a verification token for placing on a website or
 
294
// domain.
 
295
func (r *WebResourceService) GetToken(siteverificationwebresourcegettokenrequest *SiteVerificationWebResourceGettokenRequest) *WebResourceGetTokenCall {
 
296
        c := &WebResourceGetTokenCall{s: r.s, opt_: make(map[string]interface{})}
 
297
        c.siteverificationwebresourcegettokenrequest = siteverificationwebresourcegettokenrequest
 
298
        return c
 
299
}
 
300
 
 
301
// Fields allows partial responses to be retrieved.
 
302
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
303
// for more information.
 
304
func (c *WebResourceGetTokenCall) Fields(s ...googleapi.Field) *WebResourceGetTokenCall {
 
305
        c.opt_["fields"] = googleapi.CombineFields(s)
 
306
        return c
 
307
}
 
308
 
 
309
func (c *WebResourceGetTokenCall) Do() (*SiteVerificationWebResourceGettokenResponse, error) {
 
310
        var body io.Reader = nil
 
311
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourcegettokenrequest)
 
312
        if err != nil {
 
313
                return nil, err
 
314
        }
 
315
        ctype := "application/json"
 
316
        params := make(url.Values)
 
317
        params.Set("alt", "json")
 
318
        if v, ok := c.opt_["fields"]; ok {
 
319
                params.Set("fields", fmt.Sprintf("%v", v))
 
320
        }
 
321
        urls := googleapi.ResolveRelative(c.s.BasePath, "token")
 
322
        urls += "?" + params.Encode()
 
323
        req, _ := http.NewRequest("POST", urls, body)
 
324
        googleapi.SetOpaque(req.URL)
 
325
        req.Header.Set("Content-Type", ctype)
 
326
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
327
        res, err := c.s.client.Do(req)
 
328
        if err != nil {
 
329
                return nil, err
 
330
        }
 
331
        defer googleapi.CloseBody(res)
 
332
        if err := googleapi.CheckResponse(res); err != nil {
 
333
                return nil, err
 
334
        }
 
335
        var ret *SiteVerificationWebResourceGettokenResponse
 
336
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
337
                return nil, err
 
338
        }
 
339
        return ret, nil
 
340
        // {
 
341
        //   "description": "Get a verification token for placing on a website or domain.",
 
342
        //   "httpMethod": "POST",
 
343
        //   "id": "siteVerification.webResource.getToken",
 
344
        //   "path": "token",
 
345
        //   "request": {
 
346
        //     "$ref": "SiteVerificationWebResourceGettokenRequest"
 
347
        //   },
 
348
        //   "response": {
 
349
        //     "$ref": "SiteVerificationWebResourceGettokenResponse"
 
350
        //   },
 
351
        //   "scopes": [
 
352
        //     "https://www.googleapis.com/auth/siteverification",
 
353
        //     "https://www.googleapis.com/auth/siteverification.verify_only"
 
354
        //   ]
 
355
        // }
 
356
 
 
357
}
 
358
 
 
359
// method id "siteVerification.webResource.insert":
 
360
 
 
361
type WebResourceInsertCall struct {
 
362
        s                                   *Service
 
363
        verificationMethod                  string
 
364
        siteverificationwebresourceresource *SiteVerificationWebResourceResource
 
365
        opt_                                map[string]interface{}
 
366
}
 
367
 
 
368
// Insert: Attempt verification of a website or domain.
 
369
func (r *WebResourceService) Insert(verificationMethod string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourceInsertCall {
 
370
        c := &WebResourceInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
371
        c.verificationMethod = verificationMethod
 
372
        c.siteverificationwebresourceresource = siteverificationwebresourceresource
 
373
        return c
 
374
}
 
375
 
 
376
// Fields allows partial responses to be retrieved.
 
377
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
378
// for more information.
 
379
func (c *WebResourceInsertCall) Fields(s ...googleapi.Field) *WebResourceInsertCall {
 
380
        c.opt_["fields"] = googleapi.CombineFields(s)
 
381
        return c
 
382
}
 
383
 
 
384
func (c *WebResourceInsertCall) Do() (*SiteVerificationWebResourceResource, error) {
 
385
        var body io.Reader = nil
 
386
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource)
 
387
        if err != nil {
 
388
                return nil, err
 
389
        }
 
390
        ctype := "application/json"
 
391
        params := make(url.Values)
 
392
        params.Set("alt", "json")
 
393
        params.Set("verificationMethod", fmt.Sprintf("%v", c.verificationMethod))
 
394
        if v, ok := c.opt_["fields"]; ok {
 
395
                params.Set("fields", fmt.Sprintf("%v", v))
 
396
        }
 
397
        urls := googleapi.ResolveRelative(c.s.BasePath, "webResource")
 
398
        urls += "?" + params.Encode()
 
399
        req, _ := http.NewRequest("POST", urls, body)
 
400
        googleapi.SetOpaque(req.URL)
 
401
        req.Header.Set("Content-Type", ctype)
 
402
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
403
        res, err := c.s.client.Do(req)
 
404
        if err != nil {
 
405
                return nil, err
 
406
        }
 
407
        defer googleapi.CloseBody(res)
 
408
        if err := googleapi.CheckResponse(res); err != nil {
 
409
                return nil, err
 
410
        }
 
411
        var ret *SiteVerificationWebResourceResource
 
412
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
413
                return nil, err
 
414
        }
 
415
        return ret, nil
 
416
        // {
 
417
        //   "description": "Attempt verification of a website or domain.",
 
418
        //   "httpMethod": "POST",
 
419
        //   "id": "siteVerification.webResource.insert",
 
420
        //   "parameterOrder": [
 
421
        //     "verificationMethod"
 
422
        //   ],
 
423
        //   "parameters": {
 
424
        //     "verificationMethod": {
 
425
        //       "description": "The method to use for verifying a site or domain.",
 
426
        //       "location": "query",
 
427
        //       "required": true,
 
428
        //       "type": "string"
 
429
        //     }
 
430
        //   },
 
431
        //   "path": "webResource",
 
432
        //   "request": {
 
433
        //     "$ref": "SiteVerificationWebResourceResource"
 
434
        //   },
 
435
        //   "response": {
 
436
        //     "$ref": "SiteVerificationWebResourceResource"
 
437
        //   },
 
438
        //   "scopes": [
 
439
        //     "https://www.googleapis.com/auth/siteverification",
 
440
        //     "https://www.googleapis.com/auth/siteverification.verify_only"
 
441
        //   ]
 
442
        // }
 
443
 
 
444
}
 
445
 
 
446
// method id "siteVerification.webResource.list":
 
447
 
 
448
type WebResourceListCall struct {
 
449
        s    *Service
 
450
        opt_ map[string]interface{}
 
451
}
 
452
 
 
453
// List: Get the list of your verified websites and domains.
 
454
func (r *WebResourceService) List() *WebResourceListCall {
 
455
        c := &WebResourceListCall{s: r.s, opt_: make(map[string]interface{})}
 
456
        return c
 
457
}
 
458
 
 
459
// Fields allows partial responses to be retrieved.
 
460
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
461
// for more information.
 
462
func (c *WebResourceListCall) Fields(s ...googleapi.Field) *WebResourceListCall {
 
463
        c.opt_["fields"] = googleapi.CombineFields(s)
 
464
        return c
 
465
}
 
466
 
 
467
func (c *WebResourceListCall) Do() (*SiteVerificationWebResourceListResponse, error) {
 
468
        var body io.Reader = nil
 
469
        params := make(url.Values)
 
470
        params.Set("alt", "json")
 
471
        if v, ok := c.opt_["fields"]; ok {
 
472
                params.Set("fields", fmt.Sprintf("%v", v))
 
473
        }
 
474
        urls := googleapi.ResolveRelative(c.s.BasePath, "webResource")
 
475
        urls += "?" + params.Encode()
 
476
        req, _ := http.NewRequest("GET", urls, body)
 
477
        googleapi.SetOpaque(req.URL)
 
478
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
479
        res, err := c.s.client.Do(req)
 
480
        if err != nil {
 
481
                return nil, err
 
482
        }
 
483
        defer googleapi.CloseBody(res)
 
484
        if err := googleapi.CheckResponse(res); err != nil {
 
485
                return nil, err
 
486
        }
 
487
        var ret *SiteVerificationWebResourceListResponse
 
488
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
489
                return nil, err
 
490
        }
 
491
        return ret, nil
 
492
        // {
 
493
        //   "description": "Get the list of your verified websites and domains.",
 
494
        //   "httpMethod": "GET",
 
495
        //   "id": "siteVerification.webResource.list",
 
496
        //   "path": "webResource",
 
497
        //   "response": {
 
498
        //     "$ref": "SiteVerificationWebResourceListResponse"
 
499
        //   },
 
500
        //   "scopes": [
 
501
        //     "https://www.googleapis.com/auth/siteverification"
 
502
        //   ]
 
503
        // }
 
504
 
 
505
}
 
506
 
 
507
// method id "siteVerification.webResource.patch":
 
508
 
 
509
type WebResourcePatchCall struct {
 
510
        s                                   *Service
 
511
        id                                  string
 
512
        siteverificationwebresourceresource *SiteVerificationWebResourceResource
 
513
        opt_                                map[string]interface{}
 
514
}
 
515
 
 
516
// Patch: Modify the list of owners for your website or domain. This
 
517
// method supports patch semantics.
 
518
func (r *WebResourceService) Patch(id string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourcePatchCall {
 
519
        c := &WebResourcePatchCall{s: r.s, opt_: make(map[string]interface{})}
 
520
        c.id = id
 
521
        c.siteverificationwebresourceresource = siteverificationwebresourceresource
 
522
        return c
 
523
}
 
524
 
 
525
// Fields allows partial responses to be retrieved.
 
526
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
527
// for more information.
 
528
func (c *WebResourcePatchCall) Fields(s ...googleapi.Field) *WebResourcePatchCall {
 
529
        c.opt_["fields"] = googleapi.CombineFields(s)
 
530
        return c
 
531
}
 
532
 
 
533
func (c *WebResourcePatchCall) Do() (*SiteVerificationWebResourceResource, error) {
 
534
        var body io.Reader = nil
 
535
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource)
 
536
        if err != nil {
 
537
                return nil, err
 
538
        }
 
539
        ctype := "application/json"
 
540
        params := make(url.Values)
 
541
        params.Set("alt", "json")
 
542
        if v, ok := c.opt_["fields"]; ok {
 
543
                params.Set("fields", fmt.Sprintf("%v", v))
 
544
        }
 
545
        urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}")
 
546
        urls += "?" + params.Encode()
 
547
        req, _ := http.NewRequest("PATCH", urls, body)
 
548
        googleapi.Expand(req.URL, map[string]string{
 
549
                "id": c.id,
 
550
        })
 
551
        req.Header.Set("Content-Type", ctype)
 
552
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
553
        res, err := c.s.client.Do(req)
 
554
        if err != nil {
 
555
                return nil, err
 
556
        }
 
557
        defer googleapi.CloseBody(res)
 
558
        if err := googleapi.CheckResponse(res); err != nil {
 
559
                return nil, err
 
560
        }
 
561
        var ret *SiteVerificationWebResourceResource
 
562
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
563
                return nil, err
 
564
        }
 
565
        return ret, nil
 
566
        // {
 
567
        //   "description": "Modify the list of owners for your website or domain. This method supports patch semantics.",
 
568
        //   "httpMethod": "PATCH",
 
569
        //   "id": "siteVerification.webResource.patch",
 
570
        //   "parameterOrder": [
 
571
        //     "id"
 
572
        //   ],
 
573
        //   "parameters": {
 
574
        //     "id": {
 
575
        //       "description": "The id of a verified site or domain.",
 
576
        //       "location": "path",
 
577
        //       "required": true,
 
578
        //       "type": "string"
 
579
        //     }
 
580
        //   },
 
581
        //   "path": "webResource/{id}",
 
582
        //   "request": {
 
583
        //     "$ref": "SiteVerificationWebResourceResource"
 
584
        //   },
 
585
        //   "response": {
 
586
        //     "$ref": "SiteVerificationWebResourceResource"
 
587
        //   },
 
588
        //   "scopes": [
 
589
        //     "https://www.googleapis.com/auth/siteverification"
 
590
        //   ]
 
591
        // }
 
592
 
 
593
}
 
594
 
 
595
// method id "siteVerification.webResource.update":
 
596
 
 
597
type WebResourceUpdateCall struct {
 
598
        s                                   *Service
 
599
        id                                  string
 
600
        siteverificationwebresourceresource *SiteVerificationWebResourceResource
 
601
        opt_                                map[string]interface{}
 
602
}
 
603
 
 
604
// Update: Modify the list of owners for your website or domain.
 
605
func (r *WebResourceService) Update(id string, siteverificationwebresourceresource *SiteVerificationWebResourceResource) *WebResourceUpdateCall {
 
606
        c := &WebResourceUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
607
        c.id = id
 
608
        c.siteverificationwebresourceresource = siteverificationwebresourceresource
 
609
        return c
 
610
}
 
611
 
 
612
// Fields allows partial responses to be retrieved.
 
613
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
614
// for more information.
 
615
func (c *WebResourceUpdateCall) Fields(s ...googleapi.Field) *WebResourceUpdateCall {
 
616
        c.opt_["fields"] = googleapi.CombineFields(s)
 
617
        return c
 
618
}
 
619
 
 
620
func (c *WebResourceUpdateCall) Do() (*SiteVerificationWebResourceResource, error) {
 
621
        var body io.Reader = nil
 
622
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource)
 
623
        if err != nil {
 
624
                return nil, err
 
625
        }
 
626
        ctype := "application/json"
 
627
        params := make(url.Values)
 
628
        params.Set("alt", "json")
 
629
        if v, ok := c.opt_["fields"]; ok {
 
630
                params.Set("fields", fmt.Sprintf("%v", v))
 
631
        }
 
632
        urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}")
 
633
        urls += "?" + params.Encode()
 
634
        req, _ := http.NewRequest("PUT", urls, body)
 
635
        googleapi.Expand(req.URL, map[string]string{
 
636
                "id": c.id,
 
637
        })
 
638
        req.Header.Set("Content-Type", ctype)
 
639
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
640
        res, err := c.s.client.Do(req)
 
641
        if err != nil {
 
642
                return nil, err
 
643
        }
 
644
        defer googleapi.CloseBody(res)
 
645
        if err := googleapi.CheckResponse(res); err != nil {
 
646
                return nil, err
 
647
        }
 
648
        var ret *SiteVerificationWebResourceResource
 
649
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
650
                return nil, err
 
651
        }
 
652
        return ret, nil
 
653
        // {
 
654
        //   "description": "Modify the list of owners for your website or domain.",
 
655
        //   "httpMethod": "PUT",
 
656
        //   "id": "siteVerification.webResource.update",
 
657
        //   "parameterOrder": [
 
658
        //     "id"
 
659
        //   ],
 
660
        //   "parameters": {
 
661
        //     "id": {
 
662
        //       "description": "The id of a verified site or domain.",
 
663
        //       "location": "path",
 
664
        //       "required": true,
 
665
        //       "type": "string"
 
666
        //     }
 
667
        //   },
 
668
        //   "path": "webResource/{id}",
 
669
        //   "request": {
 
670
        //     "$ref": "SiteVerificationWebResourceResource"
 
671
        //   },
 
672
        //   "response": {
 
673
        //     "$ref": "SiteVerificationWebResourceResource"
 
674
        //   },
 
675
        //   "scopes": [
 
676
        //     "https://www.googleapis.com/auth/siteverification"
 
677
        //   ]
 
678
        // }
 
679
 
 
680
}