1
// Package siteverification provides access to the Google Site Verification API.
3
// See https://developers.google.com/site-verification/
7
// import "google.golang.org/api/siteverification/v1"
9
// siteverificationService, err := siteverification.New(oauthHttpClient)
10
package siteverification
17
"google.golang.org/api/googleapi"
25
// Always reference these packages, just in case the auto-generated code
27
var _ = bytes.NewBuffer
30
var _ = json.NewDecoder
33
var _ = googleapi.Version
35
var _ = strings.Replace
37
const apiId = "siteVerification:v1"
38
const apiName = "siteVerification"
39
const apiVersion = "v1"
40
const basePath = "https://www.googleapis.com/siteVerification/v1/"
42
// OAuth2 scopes used by this API.
44
// Manage the list of sites and domains you control
45
SiteverificationScope = "https://www.googleapis.com/auth/siteverification"
47
// Manage your new site verifications with Google
48
SiteverificationVerify_onlyScope = "https://www.googleapis.com/auth/siteverification.verify_only"
51
func New(client *http.Client) (*Service, error) {
53
return nil, errors.New("client is nil")
55
s := &Service{client: client, BasePath: basePath}
56
s.WebResource = NewWebResourceService(s)
62
BasePath string // API endpoint base URL
64
WebResource *WebResourceService
67
func NewWebResourceService(s *Service) *WebResourceService {
68
rs := &WebResourceService{s: s}
72
type WebResourceService struct {
76
type SiteVerificationWebResourceGettokenRequest struct {
77
// Site: The site for which a verification token will be generated.
78
Site *SiteVerificationWebResourceGettokenRequestSite `json:"site,omitempty"`
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"`
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"`
92
// Type: The type of resource to be verified. Can be SITE or INET_DOMAIN
94
Type string `json:"type,omitempty"`
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"`
106
// Token: The verification token. The token must be placed appropriately
107
// in order for verification to succeed.
108
Token string `json:"token,omitempty"`
111
type SiteVerificationWebResourceListResponse struct {
112
// Items: The list of sites that are owned by the authenticated user.
113
Items []*SiteVerificationWebResourceResource `json:"items,omitempty"`
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
120
Id string `json:"id,omitempty"`
122
// Owners: The email addresses of all verified owners.
123
Owners []string `json:"owners,omitempty"`
125
// Site: The address and type of a site that is verified or will be
127
Site *SiteVerificationWebResourceResourceSite `json:"site,omitempty"`
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"`
136
// Type: The site type. Can be SITE or INET_DOMAIN (domain name).
137
Type string `json:"type,omitempty"`
140
// method id "siteVerification.webResource.delete":
142
type WebResourceDeleteCall struct {
145
opt_ map[string]interface{}
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{})}
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)
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))
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{
176
req.Header.Set("User-Agent", "google-api-go-client/0.5")
177
res, err := c.s.client.Do(req)
181
defer googleapi.CloseBody(res)
182
if err := googleapi.CheckResponse(res); err != nil {
187
// "description": "Relinquish ownership of a website or domain.",
188
// "httpMethod": "DELETE",
189
// "id": "siteVerification.webResource.delete",
190
// "parameterOrder": [
195
// "description": "The id of a verified site or domain.",
196
// "location": "path",
201
// "path": "webResource/{id}",
203
// "https://www.googleapis.com/auth/siteverification"
209
// method id "siteVerification.webResource.get":
211
type WebResourceGetCall struct {
214
opt_ map[string]interface{}
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{})}
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)
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))
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{
245
req.Header.Set("User-Agent", "google-api-go-client/0.5")
246
res, err := c.s.client.Do(req)
250
defer googleapi.CloseBody(res)
251
if err := googleapi.CheckResponse(res); err != nil {
254
var ret *SiteVerificationWebResourceResource
255
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
260
// "description": "Get the most current data for a website or domain.",
261
// "httpMethod": "GET",
262
// "id": "siteVerification.webResource.get",
263
// "parameterOrder": [
268
// "description": "The id of a verified site or domain.",
269
// "location": "path",
274
// "path": "webResource/{id}",
276
// "$ref": "SiteVerificationWebResourceResource"
279
// "https://www.googleapis.com/auth/siteverification"
285
// method id "siteVerification.webResource.getToken":
287
type WebResourceGetTokenCall struct {
289
siteverificationwebresourcegettokenrequest *SiteVerificationWebResourceGettokenRequest
290
opt_ map[string]interface{}
293
// GetToken: Get a verification token for placing on a website or
295
func (r *WebResourceService) GetToken(siteverificationwebresourcegettokenrequest *SiteVerificationWebResourceGettokenRequest) *WebResourceGetTokenCall {
296
c := &WebResourceGetTokenCall{s: r.s, opt_: make(map[string]interface{})}
297
c.siteverificationwebresourcegettokenrequest = siteverificationwebresourcegettokenrequest
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)
309
func (c *WebResourceGetTokenCall) Do() (*SiteVerificationWebResourceGettokenResponse, error) {
310
var body io.Reader = nil
311
body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourcegettokenrequest)
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))
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)
331
defer googleapi.CloseBody(res)
332
if err := googleapi.CheckResponse(res); err != nil {
335
var ret *SiteVerificationWebResourceGettokenResponse
336
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
341
// "description": "Get a verification token for placing on a website or domain.",
342
// "httpMethod": "POST",
343
// "id": "siteVerification.webResource.getToken",
346
// "$ref": "SiteVerificationWebResourceGettokenRequest"
349
// "$ref": "SiteVerificationWebResourceGettokenResponse"
352
// "https://www.googleapis.com/auth/siteverification",
353
// "https://www.googleapis.com/auth/siteverification.verify_only"
359
// method id "siteVerification.webResource.insert":
361
type WebResourceInsertCall struct {
363
verificationMethod string
364
siteverificationwebresourceresource *SiteVerificationWebResourceResource
365
opt_ map[string]interface{}
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
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)
384
func (c *WebResourceInsertCall) Do() (*SiteVerificationWebResourceResource, error) {
385
var body io.Reader = nil
386
body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource)
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))
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)
407
defer googleapi.CloseBody(res)
408
if err := googleapi.CheckResponse(res); err != nil {
411
var ret *SiteVerificationWebResourceResource
412
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
417
// "description": "Attempt verification of a website or domain.",
418
// "httpMethod": "POST",
419
// "id": "siteVerification.webResource.insert",
420
// "parameterOrder": [
421
// "verificationMethod"
424
// "verificationMethod": {
425
// "description": "The method to use for verifying a site or domain.",
426
// "location": "query",
431
// "path": "webResource",
433
// "$ref": "SiteVerificationWebResourceResource"
436
// "$ref": "SiteVerificationWebResourceResource"
439
// "https://www.googleapis.com/auth/siteverification",
440
// "https://www.googleapis.com/auth/siteverification.verify_only"
446
// method id "siteVerification.webResource.list":
448
type WebResourceListCall struct {
450
opt_ map[string]interface{}
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{})}
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)
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))
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)
483
defer googleapi.CloseBody(res)
484
if err := googleapi.CheckResponse(res); err != nil {
487
var ret *SiteVerificationWebResourceListResponse
488
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
493
// "description": "Get the list of your verified websites and domains.",
494
// "httpMethod": "GET",
495
// "id": "siteVerification.webResource.list",
496
// "path": "webResource",
498
// "$ref": "SiteVerificationWebResourceListResponse"
501
// "https://www.googleapis.com/auth/siteverification"
507
// method id "siteVerification.webResource.patch":
509
type WebResourcePatchCall struct {
512
siteverificationwebresourceresource *SiteVerificationWebResourceResource
513
opt_ map[string]interface{}
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{})}
521
c.siteverificationwebresourceresource = siteverificationwebresourceresource
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)
533
func (c *WebResourcePatchCall) Do() (*SiteVerificationWebResourceResource, error) {
534
var body io.Reader = nil
535
body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource)
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))
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{
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)
557
defer googleapi.CloseBody(res)
558
if err := googleapi.CheckResponse(res); err != nil {
561
var ret *SiteVerificationWebResourceResource
562
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
575
// "description": "The id of a verified site or domain.",
576
// "location": "path",
581
// "path": "webResource/{id}",
583
// "$ref": "SiteVerificationWebResourceResource"
586
// "$ref": "SiteVerificationWebResourceResource"
589
// "https://www.googleapis.com/auth/siteverification"
595
// method id "siteVerification.webResource.update":
597
type WebResourceUpdateCall struct {
600
siteverificationwebresourceresource *SiteVerificationWebResourceResource
601
opt_ map[string]interface{}
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{})}
608
c.siteverificationwebresourceresource = siteverificationwebresourceresource
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)
620
func (c *WebResourceUpdateCall) Do() (*SiteVerificationWebResourceResource, error) {
621
var body io.Reader = nil
622
body, err := googleapi.WithoutDataWrapper.JSONReader(c.siteverificationwebresourceresource)
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))
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{
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)
644
defer googleapi.CloseBody(res)
645
if err := googleapi.CheckResponse(res); err != nil {
648
var ret *SiteVerificationWebResourceResource
649
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
654
// "description": "Modify the list of owners for your website or domain.",
655
// "httpMethod": "PUT",
656
// "id": "siteVerification.webResource.update",
657
// "parameterOrder": [
662
// "description": "The id of a verified site or domain.",
663
// "location": "path",
668
// "path": "webResource/{id}",
670
// "$ref": "SiteVerificationWebResourceResource"
673
// "$ref": "SiteVerificationWebResourceResource"
676
// "https://www.googleapis.com/auth/siteverification"