1
// Package webmasters provides access to the Webmaster Tools API.
3
// See https://developers.google.com/webmaster-tools/v3/welcome
7
// import "google.golang.org/api/webmasters/v3"
9
// webmastersService, err := webmasters.New(oauthHttpClient)
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 = "webmasters:v3"
38
const apiName = "webmasters"
39
const apiVersion = "v3"
40
const basePath = "https://www.googleapis.com/webmasters/v3/"
42
// OAuth2 scopes used by this API.
44
// View and modify Webmaster Tools data for your verified sites
45
WebmastersScope = "https://www.googleapis.com/auth/webmasters"
47
// View Webmaster Tools data for your verified sites
48
WebmastersReadonlyScope = "https://www.googleapis.com/auth/webmasters.readonly"
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.Sitemaps = NewSitemapsService(s)
57
s.Sites = NewSitesService(s)
58
s.Urlcrawlerrorscounts = NewUrlcrawlerrorscountsService(s)
59
s.Urlcrawlerrorssamples = NewUrlcrawlerrorssamplesService(s)
65
BasePath string // API endpoint base URL
67
Sitemaps *SitemapsService
71
Urlcrawlerrorscounts *UrlcrawlerrorscountsService
73
Urlcrawlerrorssamples *UrlcrawlerrorssamplesService
76
func NewSitemapsService(s *Service) *SitemapsService {
77
rs := &SitemapsService{s: s}
81
type SitemapsService struct {
85
func NewSitesService(s *Service) *SitesService {
86
rs := &SitesService{s: s}
90
type SitesService struct {
94
func NewUrlcrawlerrorscountsService(s *Service) *UrlcrawlerrorscountsService {
95
rs := &UrlcrawlerrorscountsService{s: s}
99
type UrlcrawlerrorscountsService struct {
103
func NewUrlcrawlerrorssamplesService(s *Service) *UrlcrawlerrorssamplesService {
104
rs := &UrlcrawlerrorssamplesService{s: s}
108
type UrlcrawlerrorssamplesService struct {
112
type SitemapsListResponse struct {
113
// Sitemap: Information about a sitemap entry.
114
Sitemap []*WmxSitemap `json:"sitemap,omitempty"`
117
type SitesListResponse struct {
118
// SiteEntry: Access level information for a Webmaster Tools site.
119
SiteEntry []*WmxSite `json:"siteEntry,omitempty"`
122
type UrlCrawlErrorCount struct {
123
// Count: The error count at the given timestamp.
124
Count int64 `json:"count,omitempty,string"`
126
// Timestamp: The time (well, date) when errors were detected, in RFC
128
Timestamp string `json:"timestamp,omitempty"`
131
type UrlCrawlErrorCountsPerType struct {
132
// Category: The crawl error type.
133
Category string `json:"category,omitempty"`
135
// Entries: The error count entries time series.
136
Entries []*UrlCrawlErrorCount `json:"entries,omitempty"`
138
// Platform: Corresponding to the user agent that made the request.
139
Platform string `json:"platform,omitempty"`
142
type UrlCrawlErrorsCountsQueryResponse struct {
143
// CountPerTypes: The time series of the number of URL crawl errors for
144
// per error category and platform.
145
CountPerTypes []*UrlCrawlErrorCountsPerType `json:"countPerTypes,omitempty"`
148
type UrlCrawlErrorsSample struct {
149
// First_detected: The time the error was first detected, in RFC 3339
151
First_detected string `json:"first_detected,omitempty"`
153
// Last_crawled: The time when the URL was last crawled, in RFC 3339
155
Last_crawled string `json:"last_crawled,omitempty"`
157
// PageUrl: The URL of an error, relative to the site.
158
PageUrl string `json:"pageUrl,omitempty"`
160
// ResponseCode: The HTTP response code, if any.
161
ResponseCode int64 `json:"responseCode,omitempty"`
163
// UrlDetails: Additional details about the URL, set only when calling
165
UrlDetails *UrlSampleDetails `json:"urlDetails,omitempty"`
168
type UrlCrawlErrorsSamplesListResponse struct {
169
// UrlCrawlErrorSample: Information about the sample URL and its crawl
171
UrlCrawlErrorSample []*UrlCrawlErrorsSample `json:"urlCrawlErrorSample,omitempty"`
174
type UrlSampleDetails struct {
175
// ContainingSitemaps: List of sitemaps pointing at this URL.
176
ContainingSitemaps []string `json:"containingSitemaps,omitempty"`
178
// LinkedFromUrls: A sample set of URLs linking to this URL.
179
LinkedFromUrls []string `json:"linkedFromUrls,omitempty"`
182
type WmxSite struct {
183
// PermissionLevel: The user's permission level for the site.
184
PermissionLevel string `json:"permissionLevel,omitempty"`
186
// SiteUrl: The URL of the site.
187
SiteUrl string `json:"siteUrl,omitempty"`
190
type WmxSitemap struct {
191
// Contents: The various content types in the sitemap.
192
Contents []*WmxSitemapContent `json:"contents,omitempty"`
194
// Errors: Number of errors in the sitemap - issues with the sitemap
195
// itself, that needs to be fixed before it can be processed correctly.
196
Errors int64 `json:"errors,omitempty,string"`
198
// IsPending: If true, the sitemap has not been processed.
199
IsPending bool `json:"isPending,omitempty"`
201
// IsSitemapsIndex: If true, the sitemap is a collection of sitemaps.
202
IsSitemapsIndex bool `json:"isSitemapsIndex,omitempty"`
204
// LastDownloaded: Date & time in which this sitemap was last
205
// downloaded. Date format is in RFC 3339 format (yyyy-mm-dd).
206
LastDownloaded string `json:"lastDownloaded,omitempty"`
208
// LastSubmitted: Date & time in which this sitemap was submitted. Date
209
// format is in RFC 3339 format (yyyy-mm-dd).
210
LastSubmitted string `json:"lastSubmitted,omitempty"`
212
// Path: The url of the sitemap.
213
Path string `json:"path,omitempty"`
215
// Type: The type of the sitemap (for example "sitemap").
216
Type string `json:"type,omitempty"`
218
// Warnings: Number of warnings for the sitemap - issues with URLs in
220
Warnings int64 `json:"warnings,omitempty,string"`
223
type WmxSitemapContent struct {
224
// Indexed: The number of URLs from the sitemap that were indexed (of
225
// the content type).
226
Indexed int64 `json:"indexed,omitempty,string"`
228
// Submitted: The number of URLs in the sitemap (of the content type).
229
Submitted int64 `json:"submitted,omitempty,string"`
231
// Type: The specific type of content in this sitemap (for example
233
Type string `json:"type,omitempty"`
236
// method id "webmasters.sitemaps.delete":
238
type SitemapsDeleteCall struct {
242
opt_ map[string]interface{}
245
// Delete: Deletes a sitemap from this site.
246
func (r *SitemapsService) Delete(siteUrl string, feedpath string) *SitemapsDeleteCall {
247
c := &SitemapsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
249
c.feedpath = feedpath
253
// Fields allows partial responses to be retrieved.
254
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
255
// for more information.
256
func (c *SitemapsDeleteCall) Fields(s ...googleapi.Field) *SitemapsDeleteCall {
257
c.opt_["fields"] = googleapi.CombineFields(s)
261
func (c *SitemapsDeleteCall) Do() error {
262
var body io.Reader = nil
263
params := make(url.Values)
264
params.Set("alt", "json")
265
if v, ok := c.opt_["fields"]; ok {
266
params.Set("fields", fmt.Sprintf("%v", v))
268
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/sitemaps/{feedpath}")
269
urls += "?" + params.Encode()
270
req, _ := http.NewRequest("DELETE", urls, body)
271
googleapi.Expand(req.URL, map[string]string{
272
"siteUrl": c.siteUrl,
273
"feedpath": c.feedpath,
275
req.Header.Set("User-Agent", "google-api-go-client/0.5")
276
res, err := c.s.client.Do(req)
280
defer googleapi.CloseBody(res)
281
if err := googleapi.CheckResponse(res); err != nil {
286
// "description": "Deletes a sitemap from this site.",
287
// "httpMethod": "DELETE",
288
// "id": "webmasters.sitemaps.delete",
289
// "parameterOrder": [
295
// "description": "The URL of the actual sitemap (for example http://www.example.com/sitemap.xml).",
296
// "location": "path",
301
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
302
// "location": "path",
307
// "path": "sites/{siteUrl}/sitemaps/{feedpath}",
309
// "https://www.googleapis.com/auth/webmasters"
315
// method id "webmasters.sitemaps.get":
317
type SitemapsGetCall struct {
321
opt_ map[string]interface{}
324
// Get: Retrieves information about a specific sitemap.
325
func (r *SitemapsService) Get(siteUrl string, feedpath string) *SitemapsGetCall {
326
c := &SitemapsGetCall{s: r.s, opt_: make(map[string]interface{})}
328
c.feedpath = feedpath
332
// Fields allows partial responses to be retrieved.
333
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
334
// for more information.
335
func (c *SitemapsGetCall) Fields(s ...googleapi.Field) *SitemapsGetCall {
336
c.opt_["fields"] = googleapi.CombineFields(s)
340
func (c *SitemapsGetCall) Do() (*WmxSitemap, error) {
341
var body io.Reader = nil
342
params := make(url.Values)
343
params.Set("alt", "json")
344
if v, ok := c.opt_["fields"]; ok {
345
params.Set("fields", fmt.Sprintf("%v", v))
347
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/sitemaps/{feedpath}")
348
urls += "?" + params.Encode()
349
req, _ := http.NewRequest("GET", urls, body)
350
googleapi.Expand(req.URL, map[string]string{
351
"siteUrl": c.siteUrl,
352
"feedpath": c.feedpath,
354
req.Header.Set("User-Agent", "google-api-go-client/0.5")
355
res, err := c.s.client.Do(req)
359
defer googleapi.CloseBody(res)
360
if err := googleapi.CheckResponse(res); err != nil {
364
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
369
// "description": "Retrieves information about a specific sitemap.",
370
// "httpMethod": "GET",
371
// "id": "webmasters.sitemaps.get",
372
// "parameterOrder": [
378
// "description": "The URL of the actual sitemap (for example http://www.example.com/sitemap.xml).",
379
// "location": "path",
384
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
385
// "location": "path",
390
// "path": "sites/{siteUrl}/sitemaps/{feedpath}",
392
// "$ref": "WmxSitemap"
395
// "https://www.googleapis.com/auth/webmasters",
396
// "https://www.googleapis.com/auth/webmasters.readonly"
402
// method id "webmasters.sitemaps.list":
404
type SitemapsListCall struct {
407
opt_ map[string]interface{}
410
// List: Lists sitemaps uploaded to the site.
411
func (r *SitemapsService) List(siteUrl string) *SitemapsListCall {
412
c := &SitemapsListCall{s: r.s, opt_: make(map[string]interface{})}
417
// SitemapIndex sets the optional parameter "sitemapIndex": A URL of a
418
// site's sitemap index.
419
func (c *SitemapsListCall) SitemapIndex(sitemapIndex string) *SitemapsListCall {
420
c.opt_["sitemapIndex"] = sitemapIndex
424
// Fields allows partial responses to be retrieved.
425
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
426
// for more information.
427
func (c *SitemapsListCall) Fields(s ...googleapi.Field) *SitemapsListCall {
428
c.opt_["fields"] = googleapi.CombineFields(s)
432
func (c *SitemapsListCall) Do() (*SitemapsListResponse, error) {
433
var body io.Reader = nil
434
params := make(url.Values)
435
params.Set("alt", "json")
436
if v, ok := c.opt_["sitemapIndex"]; ok {
437
params.Set("sitemapIndex", fmt.Sprintf("%v", v))
439
if v, ok := c.opt_["fields"]; ok {
440
params.Set("fields", fmt.Sprintf("%v", v))
442
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/sitemaps")
443
urls += "?" + params.Encode()
444
req, _ := http.NewRequest("GET", urls, body)
445
googleapi.Expand(req.URL, map[string]string{
446
"siteUrl": c.siteUrl,
448
req.Header.Set("User-Agent", "google-api-go-client/0.5")
449
res, err := c.s.client.Do(req)
453
defer googleapi.CloseBody(res)
454
if err := googleapi.CheckResponse(res); err != nil {
457
var ret *SitemapsListResponse
458
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
463
// "description": "Lists sitemaps uploaded to the site.",
464
// "httpMethod": "GET",
465
// "id": "webmasters.sitemaps.list",
466
// "parameterOrder": [
471
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
472
// "location": "path",
477
// "description": "A URL of a site's sitemap index.",
478
// "location": "query",
482
// "path": "sites/{siteUrl}/sitemaps",
484
// "$ref": "SitemapsListResponse"
487
// "https://www.googleapis.com/auth/webmasters",
488
// "https://www.googleapis.com/auth/webmasters.readonly"
494
// method id "webmasters.sitemaps.submit":
496
type SitemapsSubmitCall struct {
500
opt_ map[string]interface{}
503
// Submit: Submits a sitemap for a site.
504
func (r *SitemapsService) Submit(siteUrl string, feedpath string) *SitemapsSubmitCall {
505
c := &SitemapsSubmitCall{s: r.s, opt_: make(map[string]interface{})}
507
c.feedpath = feedpath
511
// Fields allows partial responses to be retrieved.
512
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
513
// for more information.
514
func (c *SitemapsSubmitCall) Fields(s ...googleapi.Field) *SitemapsSubmitCall {
515
c.opt_["fields"] = googleapi.CombineFields(s)
519
func (c *SitemapsSubmitCall) Do() error {
520
var body io.Reader = nil
521
params := make(url.Values)
522
params.Set("alt", "json")
523
if v, ok := c.opt_["fields"]; ok {
524
params.Set("fields", fmt.Sprintf("%v", v))
526
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/sitemaps/{feedpath}")
527
urls += "?" + params.Encode()
528
req, _ := http.NewRequest("PUT", urls, body)
529
googleapi.Expand(req.URL, map[string]string{
530
"siteUrl": c.siteUrl,
531
"feedpath": c.feedpath,
533
req.Header.Set("User-Agent", "google-api-go-client/0.5")
534
res, err := c.s.client.Do(req)
538
defer googleapi.CloseBody(res)
539
if err := googleapi.CheckResponse(res); err != nil {
544
// "description": "Submits a sitemap for a site.",
545
// "httpMethod": "PUT",
546
// "id": "webmasters.sitemaps.submit",
547
// "parameterOrder": [
553
// "description": "The URL of the sitemap to add.",
554
// "location": "path",
559
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
560
// "location": "path",
565
// "path": "sites/{siteUrl}/sitemaps/{feedpath}",
567
// "https://www.googleapis.com/auth/webmasters"
573
// method id "webmasters.sites.add":
575
type SitesAddCall struct {
578
opt_ map[string]interface{}
581
// Add: Adds a site to the set of the user's sites in Webmaster Tools.
582
func (r *SitesService) Add(siteUrl string) *SitesAddCall {
583
c := &SitesAddCall{s: r.s, opt_: make(map[string]interface{})}
588
// Fields allows partial responses to be retrieved.
589
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
590
// for more information.
591
func (c *SitesAddCall) Fields(s ...googleapi.Field) *SitesAddCall {
592
c.opt_["fields"] = googleapi.CombineFields(s)
596
func (c *SitesAddCall) Do() error {
597
var body io.Reader = nil
598
params := make(url.Values)
599
params.Set("alt", "json")
600
if v, ok := c.opt_["fields"]; ok {
601
params.Set("fields", fmt.Sprintf("%v", v))
603
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}")
604
urls += "?" + params.Encode()
605
req, _ := http.NewRequest("PUT", urls, body)
606
googleapi.Expand(req.URL, map[string]string{
607
"siteUrl": c.siteUrl,
609
req.Header.Set("User-Agent", "google-api-go-client/0.5")
610
res, err := c.s.client.Do(req)
614
defer googleapi.CloseBody(res)
615
if err := googleapi.CheckResponse(res); err != nil {
620
// "description": "Adds a site to the set of the user's sites in Webmaster Tools.",
621
// "httpMethod": "PUT",
622
// "id": "webmasters.sites.add",
623
// "parameterOrder": [
628
// "description": "The URL of the site to add.",
629
// "location": "path",
634
// "path": "sites/{siteUrl}",
636
// "https://www.googleapis.com/auth/webmasters"
642
// method id "webmasters.sites.delete":
644
type SitesDeleteCall struct {
647
opt_ map[string]interface{}
650
// Delete: Removes a site from the set of the user's Webmaster Tools
652
func (r *SitesService) Delete(siteUrl string) *SitesDeleteCall {
653
c := &SitesDeleteCall{s: r.s, opt_: make(map[string]interface{})}
658
// Fields allows partial responses to be retrieved.
659
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
660
// for more information.
661
func (c *SitesDeleteCall) Fields(s ...googleapi.Field) *SitesDeleteCall {
662
c.opt_["fields"] = googleapi.CombineFields(s)
666
func (c *SitesDeleteCall) Do() error {
667
var body io.Reader = nil
668
params := make(url.Values)
669
params.Set("alt", "json")
670
if v, ok := c.opt_["fields"]; ok {
671
params.Set("fields", fmt.Sprintf("%v", v))
673
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}")
674
urls += "?" + params.Encode()
675
req, _ := http.NewRequest("DELETE", urls, body)
676
googleapi.Expand(req.URL, map[string]string{
677
"siteUrl": c.siteUrl,
679
req.Header.Set("User-Agent", "google-api-go-client/0.5")
680
res, err := c.s.client.Do(req)
684
defer googleapi.CloseBody(res)
685
if err := googleapi.CheckResponse(res); err != nil {
690
// "description": "Removes a site from the set of the user's Webmaster Tools sites.",
691
// "httpMethod": "DELETE",
692
// "id": "webmasters.sites.delete",
693
// "parameterOrder": [
698
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
699
// "location": "path",
704
// "path": "sites/{siteUrl}",
706
// "https://www.googleapis.com/auth/webmasters"
712
// method id "webmasters.sites.get":
714
type SitesGetCall struct {
717
opt_ map[string]interface{}
720
// Get: Retrieves information about specific site.
721
func (r *SitesService) Get(siteUrl string) *SitesGetCall {
722
c := &SitesGetCall{s: r.s, opt_: make(map[string]interface{})}
727
// Fields allows partial responses to be retrieved.
728
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
729
// for more information.
730
func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
731
c.opt_["fields"] = googleapi.CombineFields(s)
735
func (c *SitesGetCall) Do() (*WmxSite, error) {
736
var body io.Reader = nil
737
params := make(url.Values)
738
params.Set("alt", "json")
739
if v, ok := c.opt_["fields"]; ok {
740
params.Set("fields", fmt.Sprintf("%v", v))
742
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}")
743
urls += "?" + params.Encode()
744
req, _ := http.NewRequest("GET", urls, body)
745
googleapi.Expand(req.URL, map[string]string{
746
"siteUrl": c.siteUrl,
748
req.Header.Set("User-Agent", "google-api-go-client/0.5")
749
res, err := c.s.client.Do(req)
753
defer googleapi.CloseBody(res)
754
if err := googleapi.CheckResponse(res); err != nil {
758
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
763
// "description": "Retrieves information about specific site.",
764
// "httpMethod": "GET",
765
// "id": "webmasters.sites.get",
766
// "parameterOrder": [
771
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
772
// "location": "path",
777
// "path": "sites/{siteUrl}",
782
// "https://www.googleapis.com/auth/webmasters",
783
// "https://www.googleapis.com/auth/webmasters.readonly"
789
// method id "webmasters.sites.list":
791
type SitesListCall struct {
793
opt_ map[string]interface{}
796
// List: Lists your Webmaster Tools sites.
797
func (r *SitesService) List() *SitesListCall {
798
c := &SitesListCall{s: r.s, opt_: make(map[string]interface{})}
802
// Fields allows partial responses to be retrieved.
803
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
804
// for more information.
805
func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
806
c.opt_["fields"] = googleapi.CombineFields(s)
810
func (c *SitesListCall) Do() (*SitesListResponse, error) {
811
var body io.Reader = nil
812
params := make(url.Values)
813
params.Set("alt", "json")
814
if v, ok := c.opt_["fields"]; ok {
815
params.Set("fields", fmt.Sprintf("%v", v))
817
urls := googleapi.ResolveRelative(c.s.BasePath, "sites")
818
urls += "?" + params.Encode()
819
req, _ := http.NewRequest("GET", urls, body)
820
googleapi.SetOpaque(req.URL)
821
req.Header.Set("User-Agent", "google-api-go-client/0.5")
822
res, err := c.s.client.Do(req)
826
defer googleapi.CloseBody(res)
827
if err := googleapi.CheckResponse(res); err != nil {
830
var ret *SitesListResponse
831
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
836
// "description": "Lists your Webmaster Tools sites.",
837
// "httpMethod": "GET",
838
// "id": "webmasters.sites.list",
841
// "$ref": "SitesListResponse"
844
// "https://www.googleapis.com/auth/webmasters",
845
// "https://www.googleapis.com/auth/webmasters.readonly"
851
// method id "webmasters.urlcrawlerrorscounts.query":
853
type UrlcrawlerrorscountsQueryCall struct {
856
opt_ map[string]interface{}
859
// Query: Retrieves a time series of the number of URL crawl errors per
860
// error category and platform.
861
func (r *UrlcrawlerrorscountsService) Query(siteUrl string) *UrlcrawlerrorscountsQueryCall {
862
c := &UrlcrawlerrorscountsQueryCall{s: r.s, opt_: make(map[string]interface{})}
867
// Category sets the optional parameter "category": The crawl error
868
// category, for example 'serverError'. If not specified, we return
869
// results for all categories.
870
func (c *UrlcrawlerrorscountsQueryCall) Category(category string) *UrlcrawlerrorscountsQueryCall {
871
c.opt_["category"] = category
875
// LatestCountsOnly sets the optional parameter "latestCountsOnly": If
876
// true, returns only the latest crawl error counts.
877
func (c *UrlcrawlerrorscountsQueryCall) LatestCountsOnly(latestCountsOnly bool) *UrlcrawlerrorscountsQueryCall {
878
c.opt_["latestCountsOnly"] = latestCountsOnly
882
// Platform sets the optional parameter "platform": The user agent type
883
// (platform) that made the request, for example 'web'. If not
884
// specified, we return results for all platforms.
885
func (c *UrlcrawlerrorscountsQueryCall) Platform(platform string) *UrlcrawlerrorscountsQueryCall {
886
c.opt_["platform"] = platform
890
// Fields allows partial responses to be retrieved.
891
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
892
// for more information.
893
func (c *UrlcrawlerrorscountsQueryCall) Fields(s ...googleapi.Field) *UrlcrawlerrorscountsQueryCall {
894
c.opt_["fields"] = googleapi.CombineFields(s)
898
func (c *UrlcrawlerrorscountsQueryCall) Do() (*UrlCrawlErrorsCountsQueryResponse, error) {
899
var body io.Reader = nil
900
params := make(url.Values)
901
params.Set("alt", "json")
902
if v, ok := c.opt_["category"]; ok {
903
params.Set("category", fmt.Sprintf("%v", v))
905
if v, ok := c.opt_["latestCountsOnly"]; ok {
906
params.Set("latestCountsOnly", fmt.Sprintf("%v", v))
908
if v, ok := c.opt_["platform"]; ok {
909
params.Set("platform", fmt.Sprintf("%v", v))
911
if v, ok := c.opt_["fields"]; ok {
912
params.Set("fields", fmt.Sprintf("%v", v))
914
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/urlCrawlErrorsCounts/query")
915
urls += "?" + params.Encode()
916
req, _ := http.NewRequest("GET", urls, body)
917
googleapi.Expand(req.URL, map[string]string{
918
"siteUrl": c.siteUrl,
920
req.Header.Set("User-Agent", "google-api-go-client/0.5")
921
res, err := c.s.client.Do(req)
925
defer googleapi.CloseBody(res)
926
if err := googleapi.CheckResponse(res); err != nil {
929
var ret *UrlCrawlErrorsCountsQueryResponse
930
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
935
// "description": "Retrieves a time series of the number of URL crawl errors per error category and platform.",
936
// "httpMethod": "GET",
937
// "id": "webmasters.urlcrawlerrorscounts.query",
938
// "parameterOrder": [
943
// "description": "The crawl error category, for example 'serverError'. If not specified, we return results for all categories.",
945
// "authPermissions",
946
// "manyToOneRedirect",
954
// "enumDescriptions": [
964
// "location": "query",
967
// "latestCountsOnly": {
968
// "default": "true",
969
// "description": "If true, returns only the latest crawl error counts.",
970
// "location": "query",
974
// "description": "The user agent type (platform) that made the request, for example 'web'. If not specified, we return results for all platforms.",
980
// "enumDescriptions": [
985
// "location": "query",
989
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
990
// "location": "path",
995
// "path": "sites/{siteUrl}/urlCrawlErrorsCounts/query",
997
// "$ref": "UrlCrawlErrorsCountsQueryResponse"
1000
// "https://www.googleapis.com/auth/webmasters",
1001
// "https://www.googleapis.com/auth/webmasters.readonly"
1007
// method id "webmasters.urlcrawlerrorssamples.get":
1009
type UrlcrawlerrorssamplesGetCall struct {
1015
opt_ map[string]interface{}
1018
// Get: Retrieves details about crawl errors for a site's sample URL.
1019
func (r *UrlcrawlerrorssamplesService) Get(siteUrl string, url string, category string, platform string) *UrlcrawlerrorssamplesGetCall {
1020
c := &UrlcrawlerrorssamplesGetCall{s: r.s, opt_: make(map[string]interface{})}
1023
c.category = category
1024
c.platform = platform
1028
// Fields allows partial responses to be retrieved.
1029
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1030
// for more information.
1031
func (c *UrlcrawlerrorssamplesGetCall) Fields(s ...googleapi.Field) *UrlcrawlerrorssamplesGetCall {
1032
c.opt_["fields"] = googleapi.CombineFields(s)
1036
func (c *UrlcrawlerrorssamplesGetCall) Do() (*UrlCrawlErrorsSample, error) {
1037
var body io.Reader = nil
1038
params := make(url.Values)
1039
params.Set("alt", "json")
1040
params.Set("category", fmt.Sprintf("%v", c.category))
1041
params.Set("platform", fmt.Sprintf("%v", c.platform))
1042
if v, ok := c.opt_["fields"]; ok {
1043
params.Set("fields", fmt.Sprintf("%v", v))
1045
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/urlCrawlErrorsSamples/{url}")
1046
urls += "?" + params.Encode()
1047
req, _ := http.NewRequest("GET", urls, body)
1048
googleapi.Expand(req.URL, map[string]string{
1049
"siteUrl": c.siteUrl,
1052
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1053
res, err := c.s.client.Do(req)
1057
defer googleapi.CloseBody(res)
1058
if err := googleapi.CheckResponse(res); err != nil {
1061
var ret *UrlCrawlErrorsSample
1062
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1067
// "description": "Retrieves details about crawl errors for a site's sample URL.",
1068
// "httpMethod": "GET",
1069
// "id": "webmasters.urlcrawlerrorssamples.get",
1070
// "parameterOrder": [
1078
// "description": "The crawl error category, for example 'authPermissions'",
1080
// "authPermissions",
1081
// "manyToOneRedirect",
1089
// "enumDescriptions": [
1099
// "location": "query",
1100
// "required": true,
1104
// "description": "The user agent type (platform) that made the request, for example 'web'",
1107
// "smartphoneOnly",
1110
// "enumDescriptions": [
1115
// "location": "query",
1116
// "required": true,
1120
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
1121
// "location": "path",
1122
// "required": true,
1126
// "description": "The relative path (without the site) of the sample URL; must be one of the URLs returned by list",
1127
// "location": "path",
1128
// "required": true,
1132
// "path": "sites/{siteUrl}/urlCrawlErrorsSamples/{url}",
1134
// "$ref": "UrlCrawlErrorsSample"
1137
// "https://www.googleapis.com/auth/webmasters",
1138
// "https://www.googleapis.com/auth/webmasters.readonly"
1144
// method id "webmasters.urlcrawlerrorssamples.list":
1146
type UrlcrawlerrorssamplesListCall struct {
1151
opt_ map[string]interface{}
1154
// List: Lists a site's sample URLs for the specified crawl error
1155
// category and platform.
1156
func (r *UrlcrawlerrorssamplesService) List(siteUrl string, category string, platform string) *UrlcrawlerrorssamplesListCall {
1157
c := &UrlcrawlerrorssamplesListCall{s: r.s, opt_: make(map[string]interface{})}
1159
c.category = category
1160
c.platform = platform
1164
// Fields allows partial responses to be retrieved.
1165
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1166
// for more information.
1167
func (c *UrlcrawlerrorssamplesListCall) Fields(s ...googleapi.Field) *UrlcrawlerrorssamplesListCall {
1168
c.opt_["fields"] = googleapi.CombineFields(s)
1172
func (c *UrlcrawlerrorssamplesListCall) Do() (*UrlCrawlErrorsSamplesListResponse, error) {
1173
var body io.Reader = nil
1174
params := make(url.Values)
1175
params.Set("alt", "json")
1176
params.Set("category", fmt.Sprintf("%v", c.category))
1177
params.Set("platform", fmt.Sprintf("%v", c.platform))
1178
if v, ok := c.opt_["fields"]; ok {
1179
params.Set("fields", fmt.Sprintf("%v", v))
1181
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/urlCrawlErrorsSamples")
1182
urls += "?" + params.Encode()
1183
req, _ := http.NewRequest("GET", urls, body)
1184
googleapi.Expand(req.URL, map[string]string{
1185
"siteUrl": c.siteUrl,
1187
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1188
res, err := c.s.client.Do(req)
1192
defer googleapi.CloseBody(res)
1193
if err := googleapi.CheckResponse(res); err != nil {
1196
var ret *UrlCrawlErrorsSamplesListResponse
1197
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1202
// "description": "Lists a site's sample URLs for the specified crawl error category and platform.",
1203
// "httpMethod": "GET",
1204
// "id": "webmasters.urlcrawlerrorssamples.list",
1205
// "parameterOrder": [
1212
// "description": "The crawl error category, for example 'authPermissions'",
1214
// "authPermissions",
1215
// "manyToOneRedirect",
1223
// "enumDescriptions": [
1233
// "location": "query",
1234
// "required": true,
1238
// "description": "The user agent type (platform) that made the request, for example 'web'",
1241
// "smartphoneOnly",
1244
// "enumDescriptions": [
1249
// "location": "query",
1250
// "required": true,
1254
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
1255
// "location": "path",
1256
// "required": true,
1260
// "path": "sites/{siteUrl}/urlCrawlErrorsSamples",
1262
// "$ref": "UrlCrawlErrorsSamplesListResponse"
1265
// "https://www.googleapis.com/auth/webmasters",
1266
// "https://www.googleapis.com/auth/webmasters.readonly"
1272
// method id "webmasters.urlcrawlerrorssamples.markAsFixed":
1274
type UrlcrawlerrorssamplesMarkAsFixedCall struct {
1280
opt_ map[string]interface{}
1283
// MarkAsFixed: Marks the provided site's sample URL as fixed, and
1284
// removes it from the samples list.
1285
func (r *UrlcrawlerrorssamplesService) MarkAsFixed(siteUrl string, url string, category string, platform string) *UrlcrawlerrorssamplesMarkAsFixedCall {
1286
c := &UrlcrawlerrorssamplesMarkAsFixedCall{s: r.s, opt_: make(map[string]interface{})}
1289
c.category = category
1290
c.platform = platform
1294
// Fields allows partial responses to be retrieved.
1295
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1296
// for more information.
1297
func (c *UrlcrawlerrorssamplesMarkAsFixedCall) Fields(s ...googleapi.Field) *UrlcrawlerrorssamplesMarkAsFixedCall {
1298
c.opt_["fields"] = googleapi.CombineFields(s)
1302
func (c *UrlcrawlerrorssamplesMarkAsFixedCall) Do() error {
1303
var body io.Reader = nil
1304
params := make(url.Values)
1305
params.Set("alt", "json")
1306
params.Set("category", fmt.Sprintf("%v", c.category))
1307
params.Set("platform", fmt.Sprintf("%v", c.platform))
1308
if v, ok := c.opt_["fields"]; ok {
1309
params.Set("fields", fmt.Sprintf("%v", v))
1311
urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/urlCrawlErrorsSamples/{url}")
1312
urls += "?" + params.Encode()
1313
req, _ := http.NewRequest("DELETE", urls, body)
1314
googleapi.Expand(req.URL, map[string]string{
1315
"siteUrl": c.siteUrl,
1318
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1319
res, err := c.s.client.Do(req)
1323
defer googleapi.CloseBody(res)
1324
if err := googleapi.CheckResponse(res); err != nil {
1329
// "description": "Marks the provided site's sample URL as fixed, and removes it from the samples list.",
1330
// "httpMethod": "DELETE",
1331
// "id": "webmasters.urlcrawlerrorssamples.markAsFixed",
1332
// "parameterOrder": [
1340
// "description": "The crawl error category, for example 'authPermissions'",
1342
// "authPermissions",
1343
// "manyToOneRedirect",
1351
// "enumDescriptions": [
1361
// "location": "query",
1362
// "required": true,
1366
// "description": "The user agent type (platform) that made the request, for example 'web'",
1369
// "smartphoneOnly",
1372
// "enumDescriptions": [
1377
// "location": "query",
1378
// "required": true,
1382
// "description": "The site's URL, including protocol, for example 'http://www.example.com/'",
1383
// "location": "path",
1384
// "required": true,
1388
// "description": "The relative path (without the site) of the sample URL; must be one of the URLs returned by list",
1389
// "location": "path",
1390
// "required": true,
1394
// "path": "sites/{siteUrl}/urlCrawlErrorsSamples/{url}",
1396
// "https://www.googleapis.com/auth/webmasters"