1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 package searchconsole
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "net/http"
66 "net/url"
67 "strconv"
68 "strings"
69
70 googleapi "google.golang.org/api/googleapi"
71 internal "google.golang.org/api/internal"
72 gensupport "google.golang.org/api/internal/gensupport"
73 option "google.golang.org/api/option"
74 internaloption "google.golang.org/api/option/internaloption"
75 htransport "google.golang.org/api/transport/http"
76 )
77
78
79
80 var _ = bytes.NewBuffer
81 var _ = strconv.Itoa
82 var _ = fmt.Sprintf
83 var _ = json.NewDecoder
84 var _ = io.Copy
85 var _ = url.Parse
86 var _ = gensupport.MarshalJSON
87 var _ = googleapi.Version
88 var _ = errors.New
89 var _ = strings.Replace
90 var _ = context.Canceled
91 var _ = internaloption.WithDefaultEndpoint
92 var _ = internal.Version
93
94 const apiId = "searchconsole:v1"
95 const apiName = "searchconsole"
96 const apiVersion = "v1"
97 const basePath = "https://searchconsole.googleapis.com/"
98 const basePathTemplate = "https://searchconsole.UNIVERSE_DOMAIN/"
99 const mtlsBasePath = "https://searchconsole.mtls.googleapis.com/"
100
101
102 const (
103
104 WebmastersScope = "https://www.googleapis.com/auth/webmasters"
105
106
107 WebmastersReadonlyScope = "https://www.googleapis.com/auth/webmasters.readonly"
108 )
109
110
111 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
112 scopesOption := internaloption.WithDefaultScopes(
113 "https://www.googleapis.com/auth/webmasters",
114 "https://www.googleapis.com/auth/webmasters.readonly",
115 )
116
117 opts = append([]option.ClientOption{scopesOption}, opts...)
118 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
119 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
120 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
121 opts = append(opts, internaloption.EnableNewAuthLibrary())
122 client, endpoint, err := htransport.NewClient(ctx, opts...)
123 if err != nil {
124 return nil, err
125 }
126 s, err := New(client)
127 if err != nil {
128 return nil, err
129 }
130 if endpoint != "" {
131 s.BasePath = endpoint
132 }
133 return s, nil
134 }
135
136
137
138
139
140
141 func New(client *http.Client) (*Service, error) {
142 if client == nil {
143 return nil, errors.New("client is nil")
144 }
145 s := &Service{client: client, BasePath: basePath}
146 s.Searchanalytics = NewSearchanalyticsService(s)
147 s.Sitemaps = NewSitemapsService(s)
148 s.Sites = NewSitesService(s)
149 s.UrlInspection = NewUrlInspectionService(s)
150 s.UrlTestingTools = NewUrlTestingToolsService(s)
151 return s, nil
152 }
153
154 type Service struct {
155 client *http.Client
156 BasePath string
157 UserAgent string
158
159 Searchanalytics *SearchanalyticsService
160
161 Sitemaps *SitemapsService
162
163 Sites *SitesService
164
165 UrlInspection *UrlInspectionService
166
167 UrlTestingTools *UrlTestingToolsService
168 }
169
170 func (s *Service) userAgent() string {
171 if s.UserAgent == "" {
172 return googleapi.UserAgent
173 }
174 return googleapi.UserAgent + " " + s.UserAgent
175 }
176
177 func NewSearchanalyticsService(s *Service) *SearchanalyticsService {
178 rs := &SearchanalyticsService{s: s}
179 return rs
180 }
181
182 type SearchanalyticsService struct {
183 s *Service
184 }
185
186 func NewSitemapsService(s *Service) *SitemapsService {
187 rs := &SitemapsService{s: s}
188 return rs
189 }
190
191 type SitemapsService struct {
192 s *Service
193 }
194
195 func NewSitesService(s *Service) *SitesService {
196 rs := &SitesService{s: s}
197 return rs
198 }
199
200 type SitesService struct {
201 s *Service
202 }
203
204 func NewUrlInspectionService(s *Service) *UrlInspectionService {
205 rs := &UrlInspectionService{s: s}
206 rs.Index = NewUrlInspectionIndexService(s)
207 return rs
208 }
209
210 type UrlInspectionService struct {
211 s *Service
212
213 Index *UrlInspectionIndexService
214 }
215
216 func NewUrlInspectionIndexService(s *Service) *UrlInspectionIndexService {
217 rs := &UrlInspectionIndexService{s: s}
218 return rs
219 }
220
221 type UrlInspectionIndexService struct {
222 s *Service
223 }
224
225 func NewUrlTestingToolsService(s *Service) *UrlTestingToolsService {
226 rs := &UrlTestingToolsService{s: s}
227 rs.MobileFriendlyTest = NewUrlTestingToolsMobileFriendlyTestService(s)
228 return rs
229 }
230
231 type UrlTestingToolsService struct {
232 s *Service
233
234 MobileFriendlyTest *UrlTestingToolsMobileFriendlyTestService
235 }
236
237 func NewUrlTestingToolsMobileFriendlyTestService(s *Service) *UrlTestingToolsMobileFriendlyTestService {
238 rs := &UrlTestingToolsMobileFriendlyTestService{s: s}
239 return rs
240 }
241
242 type UrlTestingToolsMobileFriendlyTestService struct {
243 s *Service
244 }
245
246
247
248
249 type AmpInspectionResult struct {
250
251
252
253
254
255
256
257
258
259
260 AmpIndexStatusVerdict string `json:"ampIndexStatusVerdict,omitempty"`
261
262
263 AmpUrl string `json:"ampUrl,omitempty"`
264
265
266
267
268
269
270
271
272
273 IndexingState string `json:"indexingState,omitempty"`
274
275 Issues []*AmpIssue `json:"issues,omitempty"`
276
277
278 LastCrawlTime string `json:"lastCrawlTime,omitempty"`
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294 PageFetchState string `json:"pageFetchState,omitempty"`
295
296
297
298
299
300
301
302
303
304 RobotsTxtState string `json:"robotsTxtState,omitempty"`
305
306
307
308
309
310
311
312
313
314
315
316
317 Verdict string `json:"verdict,omitempty"`
318
319
320
321
322
323 ForceSendFields []string `json:"-"`
324
325
326
327
328 NullFields []string `json:"-"`
329 }
330
331 func (s *AmpInspectionResult) MarshalJSON() ([]byte, error) {
332 type NoMethod AmpInspectionResult
333 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
334 }
335
336
337 type AmpIssue struct {
338
339 IssueMessage string `json:"issueMessage,omitempty"`
340
341
342
343
344
345
346 Severity string `json:"severity,omitempty"`
347
348
349
350
351
352 ForceSendFields []string `json:"-"`
353
354
355
356
357 NullFields []string `json:"-"`
358 }
359
360 func (s *AmpIssue) MarshalJSON() ([]byte, error) {
361 type NoMethod AmpIssue
362 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
363 }
364
365 type ApiDataRow struct {
366 Clicks float64 `json:"clicks,omitempty"`
367 Ctr float64 `json:"ctr,omitempty"`
368 Impressions float64 `json:"impressions,omitempty"`
369 Keys []string `json:"keys,omitempty"`
370 Position float64 `json:"position,omitempty"`
371
372
373
374
375
376 ForceSendFields []string `json:"-"`
377
378
379
380
381 NullFields []string `json:"-"`
382 }
383
384 func (s *ApiDataRow) MarshalJSON() ([]byte, error) {
385 type NoMethod ApiDataRow
386 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
387 }
388
389 func (s *ApiDataRow) UnmarshalJSON(data []byte) error {
390 type NoMethod ApiDataRow
391 var s1 struct {
392 Clicks gensupport.JSONFloat64 `json:"clicks"`
393 Ctr gensupport.JSONFloat64 `json:"ctr"`
394 Impressions gensupport.JSONFloat64 `json:"impressions"`
395 Position gensupport.JSONFloat64 `json:"position"`
396 *NoMethod
397 }
398 s1.NoMethod = (*NoMethod)(s)
399 if err := json.Unmarshal(data, &s1); err != nil {
400 return err
401 }
402 s.Clicks = float64(s1.Clicks)
403 s.Ctr = float64(s1.Ctr)
404 s.Impressions = float64(s1.Impressions)
405 s.Position = float64(s1.Position)
406 return nil
407 }
408
409
410
411
412
413
414
415 type ApiDimensionFilter struct {
416
417
418
419
420
421
422 Dimension string `json:"dimension,omitempty"`
423 Expression string `json:"expression,omitempty"`
424
425
426
427
428
429
430
431 Operator string `json:"operator,omitempty"`
432
433
434
435
436
437 ForceSendFields []string `json:"-"`
438
439
440
441
442 NullFields []string `json:"-"`
443 }
444
445 func (s *ApiDimensionFilter) MarshalJSON() ([]byte, error) {
446 type NoMethod ApiDimensionFilter
447 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
448 }
449
450
451
452
453
454 type ApiDimensionFilterGroup struct {
455 Filters []*ApiDimensionFilter `json:"filters,omitempty"`
456
457
458 GroupType string `json:"groupType,omitempty"`
459
460
461
462
463
464 ForceSendFields []string `json:"-"`
465
466
467
468
469 NullFields []string `json:"-"`
470 }
471
472 func (s *ApiDimensionFilterGroup) MarshalJSON() ([]byte, error) {
473 type NoMethod ApiDimensionFilterGroup
474 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
475 }
476
477
478 type BlockedResource struct {
479
480 Url string `json:"url,omitempty"`
481
482
483
484
485
486 ForceSendFields []string `json:"-"`
487
488
489
490
491 NullFields []string `json:"-"`
492 }
493
494 func (s *BlockedResource) MarshalJSON() ([]byte, error) {
495 type NoMethod BlockedResource
496 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
497 }
498
499
500 type DetectedItems struct {
501
502 Items []*Item `json:"items,omitempty"`
503
504 RichResultType string `json:"richResultType,omitempty"`
505
506
507
508
509
510 ForceSendFields []string `json:"-"`
511
512
513
514
515 NullFields []string `json:"-"`
516 }
517
518 func (s *DetectedItems) MarshalJSON() ([]byte, error) {
519 type NoMethod DetectedItems
520 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
521 }
522
523
524 type Image struct {
525
526
527 Data string `json:"data,omitempty"`
528
529 MimeType string `json:"mimeType,omitempty"`
530
531
532
533
534
535 ForceSendFields []string `json:"-"`
536
537
538
539
540 NullFields []string `json:"-"`
541 }
542
543 func (s *Image) MarshalJSON() ([]byte, error) {
544 type NoMethod Image
545 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
546 }
547
548
549
550
551
552
553 type IndexStatusInspectionResult struct {
554
555
556 CoverageState string `json:"coverageState,omitempty"`
557
558
559
560
561
562
563 CrawledAs string `json:"crawledAs,omitempty"`
564
565
566 GoogleCanonical string `json:"googleCanonical,omitempty"`
567
568
569
570
571
572
573
574
575
576
577
578 IndexingState string `json:"indexingState,omitempty"`
579
580
581
582
583 LastCrawlTime string `json:"lastCrawlTime,omitempty"`
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602 PageFetchState string `json:"pageFetchState,omitempty"`
603
604 ReferringUrls []string `json:"referringUrls,omitempty"`
605
606
607
608
609
610
611
612
613
614 RobotsTxtState string `json:"robotsTxtState,omitempty"`
615
616
617
618 Sitemap []string `json:"sitemap,omitempty"`
619
620
621
622 UserCanonical string `json:"userCanonical,omitempty"`
623
624
625
626
627
628
629
630
631
632
633
634 Verdict string `json:"verdict,omitempty"`
635
636
637
638
639
640 ForceSendFields []string `json:"-"`
641
642
643
644
645 NullFields []string `json:"-"`
646 }
647
648 func (s *IndexStatusInspectionResult) MarshalJSON() ([]byte, error) {
649 type NoMethod IndexStatusInspectionResult
650 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
651 }
652
653
654 type InspectUrlIndexRequest struct {
655
656
657 InspectionUrl string `json:"inspectionUrl,omitempty"`
658
659
660
661
662 LanguageCode string `json:"languageCode,omitempty"`
663
664
665
666 SiteUrl string `json:"siteUrl,omitempty"`
667
668
669
670
671
672 ForceSendFields []string `json:"-"`
673
674
675
676
677 NullFields []string `json:"-"`
678 }
679
680 func (s *InspectUrlIndexRequest) MarshalJSON() ([]byte, error) {
681 type NoMethod InspectUrlIndexRequest
682 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
683 }
684
685
686 type InspectUrlIndexResponse struct {
687
688 InspectionResult *UrlInspectionResult `json:"inspectionResult,omitempty"`
689
690
691 googleapi.ServerResponse `json:"-"`
692
693
694
695
696
697 ForceSendFields []string `json:"-"`
698
699
700
701
702 NullFields []string `json:"-"`
703 }
704
705 func (s *InspectUrlIndexResponse) MarshalJSON() ([]byte, error) {
706 type NoMethod InspectUrlIndexResponse
707 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
708 }
709
710
711 type Item struct {
712
713 Issues []*RichResultsIssue `json:"issues,omitempty"`
714
715 Name string `json:"name,omitempty"`
716
717
718
719
720
721 ForceSendFields []string `json:"-"`
722
723
724
725
726 NullFields []string `json:"-"`
727 }
728
729 func (s *Item) MarshalJSON() ([]byte, error) {
730 type NoMethod Item
731 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
732 }
733
734
735 type MobileFriendlyIssue struct {
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757 Rule string `json:"rule,omitempty"`
758
759
760
761
762
763 ForceSendFields []string `json:"-"`
764
765
766
767
768 NullFields []string `json:"-"`
769 }
770
771 func (s *MobileFriendlyIssue) MarshalJSON() ([]byte, error) {
772 type NoMethod MobileFriendlyIssue
773 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
774 }
775
776
777 type MobileUsabilityInspectionResult struct {
778
779
780 Issues []*MobileUsabilityIssue `json:"issues,omitempty"`
781
782
783
784
785
786
787
788
789
790
791 Verdict string `json:"verdict,omitempty"`
792
793
794
795
796
797 ForceSendFields []string `json:"-"`
798
799
800
801
802 NullFields []string `json:"-"`
803 }
804
805 func (s *MobileUsabilityInspectionResult) MarshalJSON() ([]byte, error) {
806 type NoMethod MobileUsabilityInspectionResult
807 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
808 }
809
810
811 type MobileUsabilityIssue struct {
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833 IssueType string `json:"issueType,omitempty"`
834
835 Message string `json:"message,omitempty"`
836
837
838
839
840
841
842 Severity string `json:"severity,omitempty"`
843
844
845
846
847
848 ForceSendFields []string `json:"-"`
849
850
851
852
853 NullFields []string `json:"-"`
854 }
855
856 func (s *MobileUsabilityIssue) MarshalJSON() ([]byte, error) {
857 type NoMethod MobileUsabilityIssue
858 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
859 }
860
861
862 type ResourceIssue struct {
863
864 BlockedResource *BlockedResource `json:"blockedResource,omitempty"`
865
866
867
868
869
870 ForceSendFields []string `json:"-"`
871
872
873
874
875 NullFields []string `json:"-"`
876 }
877
878 func (s *ResourceIssue) MarshalJSON() ([]byte, error) {
879 type NoMethod ResourceIssue
880 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
881 }
882
883
884
885 type RichResultsInspectionResult struct {
886
887
888
889 DetectedItems []*DetectedItems `json:"detectedItems,omitempty"`
890
891
892
893
894
895
896
897
898
899
900 Verdict string `json:"verdict,omitempty"`
901
902
903
904
905
906 ForceSendFields []string `json:"-"`
907
908
909
910
911 NullFields []string `json:"-"`
912 }
913
914 func (s *RichResultsInspectionResult) MarshalJSON() ([]byte, error) {
915 type NoMethod RichResultsInspectionResult
916 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
917 }
918
919
920
921 type RichResultsIssue struct {
922
923 IssueMessage string `json:"issueMessage,omitempty"`
924
925
926
927
928
929
930
931
932 Severity string `json:"severity,omitempty"`
933
934
935
936
937
938 ForceSendFields []string `json:"-"`
939
940
941
942
943 NullFields []string `json:"-"`
944 }
945
946 func (s *RichResultsIssue) MarshalJSON() ([]byte, error) {
947 type NoMethod RichResultsIssue
948 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
949 }
950
951
952 type RunMobileFriendlyTestRequest struct {
953
954 RequestScreenshot bool `json:"requestScreenshot,omitempty"`
955
956 Url string `json:"url,omitempty"`
957
958
959
960
961
962 ForceSendFields []string `json:"-"`
963
964
965
966
967 NullFields []string `json:"-"`
968 }
969
970 func (s *RunMobileFriendlyTestRequest) MarshalJSON() ([]byte, error) {
971 type NoMethod RunMobileFriendlyTestRequest
972 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
973 }
974
975
976
977 type RunMobileFriendlyTestResponse struct {
978
979
980
981
982
983
984
985
986 MobileFriendliness string `json:"mobileFriendliness,omitempty"`
987
988 MobileFriendlyIssues []*MobileFriendlyIssue `json:"mobileFriendlyIssues,omitempty"`
989
990 ResourceIssues []*ResourceIssue `json:"resourceIssues,omitempty"`
991
992 Screenshot *Image `json:"screenshot,omitempty"`
993
994 TestStatus *TestStatus `json:"testStatus,omitempty"`
995
996
997 googleapi.ServerResponse `json:"-"`
998
999
1000
1001
1002
1003 ForceSendFields []string `json:"-"`
1004
1005
1006
1007
1008 NullFields []string `json:"-"`
1009 }
1010
1011 func (s *RunMobileFriendlyTestResponse) MarshalJSON() ([]byte, error) {
1012 type NoMethod RunMobileFriendlyTestResponse
1013 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1014 }
1015
1016 type SearchAnalyticsQueryRequest struct {
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034 AggregationType string `json:"aggregationType,omitempty"`
1035
1036
1037
1038
1039
1040
1041
1042 DataState string `json:"dataState,omitempty"`
1043
1044
1045
1046
1047 DimensionFilterGroups []*ApiDimensionFilterGroup `json:"dimensionFilterGroups,omitempty"`
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060 Dimensions []string `json:"dimensions,omitempty"`
1061
1062
1063
1064 EndDate string `json:"endDate,omitempty"`
1065
1066
1067 RowLimit int64 `json:"rowLimit,omitempty"`
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077 SearchType string `json:"searchType,omitempty"`
1078
1079
1080
1081 StartDate string `json:"startDate,omitempty"`
1082
1083
1084 StartRow int64 `json:"startRow,omitempty"`
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095 Type string `json:"type,omitempty"`
1096
1097
1098
1099
1100
1101 ForceSendFields []string `json:"-"`
1102
1103
1104
1105
1106 NullFields []string `json:"-"`
1107 }
1108
1109 func (s *SearchAnalyticsQueryRequest) MarshalJSON() ([]byte, error) {
1110 type NoMethod SearchAnalyticsQueryRequest
1111 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1112 }
1113
1114
1115
1116
1117 type SearchAnalyticsQueryResponse struct {
1118
1119
1120
1121
1122
1123
1124
1125 ResponseAggregationType string `json:"responseAggregationType,omitempty"`
1126
1127
1128 Rows []*ApiDataRow `json:"rows,omitempty"`
1129
1130
1131 googleapi.ServerResponse `json:"-"`
1132
1133
1134
1135
1136
1137 ForceSendFields []string `json:"-"`
1138
1139
1140
1141
1142 NullFields []string `json:"-"`
1143 }
1144
1145 func (s *SearchAnalyticsQueryResponse) MarshalJSON() ([]byte, error) {
1146 type NoMethod SearchAnalyticsQueryResponse
1147 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1148 }
1149
1150
1151 type SitemapsListResponse struct {
1152
1153
1154 Sitemap []*WmxSitemap `json:"sitemap,omitempty"`
1155
1156
1157 googleapi.ServerResponse `json:"-"`
1158
1159
1160
1161
1162
1163 ForceSendFields []string `json:"-"`
1164
1165
1166
1167
1168 NullFields []string `json:"-"`
1169 }
1170
1171 func (s *SitemapsListResponse) MarshalJSON() ([]byte, error) {
1172 type NoMethod SitemapsListResponse
1173 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1174 }
1175
1176
1177 type SitesListResponse struct {
1178
1179
1180
1181 SiteEntry []*WmxSite `json:"siteEntry,omitempty"`
1182
1183
1184 googleapi.ServerResponse `json:"-"`
1185
1186
1187
1188
1189
1190 ForceSendFields []string `json:"-"`
1191
1192
1193
1194
1195 NullFields []string `json:"-"`
1196 }
1197
1198 func (s *SitesListResponse) MarshalJSON() ([]byte, error) {
1199 type NoMethod SitesListResponse
1200 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1201 }
1202
1203
1204 type TestStatus struct {
1205
1206 Details string `json:"details,omitempty"`
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219 Status string `json:"status,omitempty"`
1220
1221
1222
1223
1224
1225 ForceSendFields []string `json:"-"`
1226
1227
1228
1229
1230 NullFields []string `json:"-"`
1231 }
1232
1233 func (s *TestStatus) MarshalJSON() ([]byte, error) {
1234 type NoMethod TestStatus
1235 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1236 }
1237
1238
1239
1240 type UrlInspectionResult struct {
1241
1242
1243 AmpResult *AmpInspectionResult `json:"ampResult,omitempty"`
1244
1245 IndexStatusResult *IndexStatusInspectionResult `json:"indexStatusResult,omitempty"`
1246
1247 InspectionResultLink string `json:"inspectionResultLink,omitempty"`
1248
1249 MobileUsabilityResult *MobileUsabilityInspectionResult `json:"mobileUsabilityResult,omitempty"`
1250
1251
1252 RichResultsResult *RichResultsInspectionResult `json:"richResultsResult,omitempty"`
1253
1254
1255
1256
1257
1258 ForceSendFields []string `json:"-"`
1259
1260
1261
1262
1263 NullFields []string `json:"-"`
1264 }
1265
1266 func (s *UrlInspectionResult) MarshalJSON() ([]byte, error) {
1267 type NoMethod UrlInspectionResult
1268 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1269 }
1270
1271
1272
1273
1274 type WmxSite struct {
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285 PermissionLevel string `json:"permissionLevel,omitempty"`
1286
1287 SiteUrl string `json:"siteUrl,omitempty"`
1288
1289
1290 googleapi.ServerResponse `json:"-"`
1291
1292
1293
1294
1295
1296 ForceSendFields []string `json:"-"`
1297
1298
1299
1300
1301 NullFields []string `json:"-"`
1302 }
1303
1304 func (s *WmxSite) MarshalJSON() ([]byte, error) {
1305 type NoMethod WmxSite
1306 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1307 }
1308
1309
1310
1311 type WmxSitemap struct {
1312
1313 Contents []*WmxSitemapContent `json:"contents,omitempty"`
1314
1315
1316 Errors int64 `json:"errors,omitempty,string"`
1317
1318 IsPending bool `json:"isPending,omitempty"`
1319
1320 IsSitemapsIndex bool `json:"isSitemapsIndex,omitempty"`
1321
1322
1323 LastDownloaded string `json:"lastDownloaded,omitempty"`
1324
1325
1326 LastSubmitted string `json:"lastSubmitted,omitempty"`
1327
1328 Path string `json:"path,omitempty"`
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339 Type string `json:"type,omitempty"`
1340
1341
1342 Warnings int64 `json:"warnings,omitempty,string"`
1343
1344
1345 googleapi.ServerResponse `json:"-"`
1346
1347
1348
1349
1350
1351 ForceSendFields []string `json:"-"`
1352
1353
1354
1355
1356 NullFields []string `json:"-"`
1357 }
1358
1359 func (s *WmxSitemap) MarshalJSON() ([]byte, error) {
1360 type NoMethod WmxSitemap
1361 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1362 }
1363
1364
1365
1366 type WmxSitemapContent struct {
1367
1368 Indexed int64 `json:"indexed,omitempty,string"`
1369
1370 Submitted int64 `json:"submitted,omitempty,string"`
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383 Type string `json:"type,omitempty"`
1384
1385
1386
1387
1388
1389 ForceSendFields []string `json:"-"`
1390
1391
1392
1393
1394 NullFields []string `json:"-"`
1395 }
1396
1397 func (s *WmxSitemapContent) MarshalJSON() ([]byte, error) {
1398 type NoMethod WmxSitemapContent
1399 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1400 }
1401
1402 type SearchanalyticsQueryCall struct {
1403 s *Service
1404 siteUrl string
1405 searchanalyticsqueryrequest *SearchAnalyticsQueryRequest
1406 urlParams_ gensupport.URLParams
1407 ctx_ context.Context
1408 header_ http.Header
1409 }
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420 func (r *SearchanalyticsService) Query(siteUrl string, searchanalyticsqueryrequest *SearchAnalyticsQueryRequest) *SearchanalyticsQueryCall {
1421 c := &SearchanalyticsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1422 c.siteUrl = siteUrl
1423 c.searchanalyticsqueryrequest = searchanalyticsqueryrequest
1424 return c
1425 }
1426
1427
1428
1429
1430 func (c *SearchanalyticsQueryCall) Fields(s ...googleapi.Field) *SearchanalyticsQueryCall {
1431 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1432 return c
1433 }
1434
1435
1436 func (c *SearchanalyticsQueryCall) Context(ctx context.Context) *SearchanalyticsQueryCall {
1437 c.ctx_ = ctx
1438 return c
1439 }
1440
1441
1442
1443 func (c *SearchanalyticsQueryCall) Header() http.Header {
1444 if c.header_ == nil {
1445 c.header_ = make(http.Header)
1446 }
1447 return c.header_
1448 }
1449
1450 func (c *SearchanalyticsQueryCall) doRequest(alt string) (*http.Response, error) {
1451 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1452 var body io.Reader = nil
1453 body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchanalyticsqueryrequest)
1454 if err != nil {
1455 return nil, err
1456 }
1457 c.urlParams_.Set("alt", alt)
1458 c.urlParams_.Set("prettyPrint", "false")
1459 urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}/searchAnalytics/query")
1460 urls += "?" + c.urlParams_.Encode()
1461 req, err := http.NewRequest("POST", urls, body)
1462 if err != nil {
1463 return nil, err
1464 }
1465 req.Header = reqHeaders
1466 googleapi.Expand(req.URL, map[string]string{
1467 "siteUrl": c.siteUrl,
1468 })
1469 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1470 }
1471
1472
1473
1474
1475
1476
1477
1478 func (c *SearchanalyticsQueryCall) Do(opts ...googleapi.CallOption) (*SearchAnalyticsQueryResponse, error) {
1479 gensupport.SetOptions(c.urlParams_, opts...)
1480 res, err := c.doRequest("json")
1481 if res != nil && res.StatusCode == http.StatusNotModified {
1482 if res.Body != nil {
1483 res.Body.Close()
1484 }
1485 return nil, gensupport.WrapError(&googleapi.Error{
1486 Code: res.StatusCode,
1487 Header: res.Header,
1488 })
1489 }
1490 if err != nil {
1491 return nil, err
1492 }
1493 defer googleapi.CloseBody(res)
1494 if err := googleapi.CheckResponse(res); err != nil {
1495 return nil, gensupport.WrapError(err)
1496 }
1497 ret := &SearchAnalyticsQueryResponse{
1498 ServerResponse: googleapi.ServerResponse{
1499 Header: res.Header,
1500 HTTPStatusCode: res.StatusCode,
1501 },
1502 }
1503 target := &ret
1504 if err := gensupport.DecodeResponse(target, res); err != nil {
1505 return nil, err
1506 }
1507 return ret, nil
1508 }
1509
1510 type SitemapsDeleteCall struct {
1511 s *Service
1512 siteUrl string
1513 feedpath string
1514 urlParams_ gensupport.URLParams
1515 ctx_ context.Context
1516 header_ http.Header
1517 }
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527 func (r *SitemapsService) Delete(siteUrl string, feedpath string) *SitemapsDeleteCall {
1528 c := &SitemapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1529 c.siteUrl = siteUrl
1530 c.feedpath = feedpath
1531 return c
1532 }
1533
1534
1535
1536
1537 func (c *SitemapsDeleteCall) Fields(s ...googleapi.Field) *SitemapsDeleteCall {
1538 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1539 return c
1540 }
1541
1542
1543 func (c *SitemapsDeleteCall) Context(ctx context.Context) *SitemapsDeleteCall {
1544 c.ctx_ = ctx
1545 return c
1546 }
1547
1548
1549
1550 func (c *SitemapsDeleteCall) Header() http.Header {
1551 if c.header_ == nil {
1552 c.header_ = make(http.Header)
1553 }
1554 return c.header_
1555 }
1556
1557 func (c *SitemapsDeleteCall) doRequest(alt string) (*http.Response, error) {
1558 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1559 var body io.Reader = nil
1560 c.urlParams_.Set("alt", alt)
1561 c.urlParams_.Set("prettyPrint", "false")
1562 urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}")
1563 urls += "?" + c.urlParams_.Encode()
1564 req, err := http.NewRequest("DELETE", urls, body)
1565 if err != nil {
1566 return nil, err
1567 }
1568 req.Header = reqHeaders
1569 googleapi.Expand(req.URL, map[string]string{
1570 "siteUrl": c.siteUrl,
1571 "feedpath": c.feedpath,
1572 })
1573 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1574 }
1575
1576
1577 func (c *SitemapsDeleteCall) Do(opts ...googleapi.CallOption) error {
1578 gensupport.SetOptions(c.urlParams_, opts...)
1579 res, err := c.doRequest("json")
1580 if err != nil {
1581 return err
1582 }
1583 defer googleapi.CloseBody(res)
1584 if err := googleapi.CheckResponse(res); err != nil {
1585 return gensupport.WrapError(err)
1586 }
1587 return nil
1588 }
1589
1590 type SitemapsGetCall struct {
1591 s *Service
1592 siteUrl string
1593 feedpath string
1594 urlParams_ gensupport.URLParams
1595 ifNoneMatch_ string
1596 ctx_ context.Context
1597 header_ http.Header
1598 }
1599
1600
1601
1602
1603
1604
1605
1606 func (r *SitemapsService) Get(siteUrl string, feedpath string) *SitemapsGetCall {
1607 c := &SitemapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1608 c.siteUrl = siteUrl
1609 c.feedpath = feedpath
1610 return c
1611 }
1612
1613
1614
1615
1616 func (c *SitemapsGetCall) Fields(s ...googleapi.Field) *SitemapsGetCall {
1617 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1618 return c
1619 }
1620
1621
1622
1623
1624 func (c *SitemapsGetCall) IfNoneMatch(entityTag string) *SitemapsGetCall {
1625 c.ifNoneMatch_ = entityTag
1626 return c
1627 }
1628
1629
1630 func (c *SitemapsGetCall) Context(ctx context.Context) *SitemapsGetCall {
1631 c.ctx_ = ctx
1632 return c
1633 }
1634
1635
1636
1637 func (c *SitemapsGetCall) Header() http.Header {
1638 if c.header_ == nil {
1639 c.header_ = make(http.Header)
1640 }
1641 return c.header_
1642 }
1643
1644 func (c *SitemapsGetCall) doRequest(alt string) (*http.Response, error) {
1645 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1646 if c.ifNoneMatch_ != "" {
1647 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1648 }
1649 var body io.Reader = nil
1650 c.urlParams_.Set("alt", alt)
1651 c.urlParams_.Set("prettyPrint", "false")
1652 urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}")
1653 urls += "?" + c.urlParams_.Encode()
1654 req, err := http.NewRequest("GET", urls, body)
1655 if err != nil {
1656 return nil, err
1657 }
1658 req.Header = reqHeaders
1659 googleapi.Expand(req.URL, map[string]string{
1660 "siteUrl": c.siteUrl,
1661 "feedpath": c.feedpath,
1662 })
1663 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1664 }
1665
1666
1667
1668
1669
1670
1671 func (c *SitemapsGetCall) Do(opts ...googleapi.CallOption) (*WmxSitemap, error) {
1672 gensupport.SetOptions(c.urlParams_, opts...)
1673 res, err := c.doRequest("json")
1674 if res != nil && res.StatusCode == http.StatusNotModified {
1675 if res.Body != nil {
1676 res.Body.Close()
1677 }
1678 return nil, gensupport.WrapError(&googleapi.Error{
1679 Code: res.StatusCode,
1680 Header: res.Header,
1681 })
1682 }
1683 if err != nil {
1684 return nil, err
1685 }
1686 defer googleapi.CloseBody(res)
1687 if err := googleapi.CheckResponse(res); err != nil {
1688 return nil, gensupport.WrapError(err)
1689 }
1690 ret := &WmxSitemap{
1691 ServerResponse: googleapi.ServerResponse{
1692 Header: res.Header,
1693 HTTPStatusCode: res.StatusCode,
1694 },
1695 }
1696 target := &ret
1697 if err := gensupport.DecodeResponse(target, res); err != nil {
1698 return nil, err
1699 }
1700 return ret, nil
1701 }
1702
1703 type SitemapsListCall struct {
1704 s *Service
1705 siteUrl string
1706 urlParams_ gensupport.URLParams
1707 ifNoneMatch_ string
1708 ctx_ context.Context
1709 header_ http.Header
1710 }
1711
1712
1713
1714
1715
1716
1717
1718 func (r *SitemapsService) List(siteUrl string) *SitemapsListCall {
1719 c := &SitemapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1720 c.siteUrl = siteUrl
1721 return c
1722 }
1723
1724
1725
1726 func (c *SitemapsListCall) SitemapIndex(sitemapIndex string) *SitemapsListCall {
1727 c.urlParams_.Set("sitemapIndex", sitemapIndex)
1728 return c
1729 }
1730
1731
1732
1733
1734 func (c *SitemapsListCall) Fields(s ...googleapi.Field) *SitemapsListCall {
1735 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1736 return c
1737 }
1738
1739
1740
1741
1742 func (c *SitemapsListCall) IfNoneMatch(entityTag string) *SitemapsListCall {
1743 c.ifNoneMatch_ = entityTag
1744 return c
1745 }
1746
1747
1748 func (c *SitemapsListCall) Context(ctx context.Context) *SitemapsListCall {
1749 c.ctx_ = ctx
1750 return c
1751 }
1752
1753
1754
1755 func (c *SitemapsListCall) Header() http.Header {
1756 if c.header_ == nil {
1757 c.header_ = make(http.Header)
1758 }
1759 return c.header_
1760 }
1761
1762 func (c *SitemapsListCall) doRequest(alt string) (*http.Response, error) {
1763 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1764 if c.ifNoneMatch_ != "" {
1765 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1766 }
1767 var body io.Reader = nil
1768 c.urlParams_.Set("alt", alt)
1769 c.urlParams_.Set("prettyPrint", "false")
1770 urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}/sitemaps")
1771 urls += "?" + c.urlParams_.Encode()
1772 req, err := http.NewRequest("GET", urls, body)
1773 if err != nil {
1774 return nil, err
1775 }
1776 req.Header = reqHeaders
1777 googleapi.Expand(req.URL, map[string]string{
1778 "siteUrl": c.siteUrl,
1779 })
1780 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1781 }
1782
1783
1784
1785
1786
1787
1788
1789 func (c *SitemapsListCall) Do(opts ...googleapi.CallOption) (*SitemapsListResponse, error) {
1790 gensupport.SetOptions(c.urlParams_, opts...)
1791 res, err := c.doRequest("json")
1792 if res != nil && res.StatusCode == http.StatusNotModified {
1793 if res.Body != nil {
1794 res.Body.Close()
1795 }
1796 return nil, gensupport.WrapError(&googleapi.Error{
1797 Code: res.StatusCode,
1798 Header: res.Header,
1799 })
1800 }
1801 if err != nil {
1802 return nil, err
1803 }
1804 defer googleapi.CloseBody(res)
1805 if err := googleapi.CheckResponse(res); err != nil {
1806 return nil, gensupport.WrapError(err)
1807 }
1808 ret := &SitemapsListResponse{
1809 ServerResponse: googleapi.ServerResponse{
1810 Header: res.Header,
1811 HTTPStatusCode: res.StatusCode,
1812 },
1813 }
1814 target := &ret
1815 if err := gensupport.DecodeResponse(target, res); err != nil {
1816 return nil, err
1817 }
1818 return ret, nil
1819 }
1820
1821 type SitemapsSubmitCall struct {
1822 s *Service
1823 siteUrl string
1824 feedpath string
1825 urlParams_ gensupport.URLParams
1826 ctx_ context.Context
1827 header_ http.Header
1828 }
1829
1830
1831
1832
1833
1834
1835
1836 func (r *SitemapsService) Submit(siteUrl string, feedpath string) *SitemapsSubmitCall {
1837 c := &SitemapsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1838 c.siteUrl = siteUrl
1839 c.feedpath = feedpath
1840 return c
1841 }
1842
1843
1844
1845
1846 func (c *SitemapsSubmitCall) Fields(s ...googleapi.Field) *SitemapsSubmitCall {
1847 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1848 return c
1849 }
1850
1851
1852 func (c *SitemapsSubmitCall) Context(ctx context.Context) *SitemapsSubmitCall {
1853 c.ctx_ = ctx
1854 return c
1855 }
1856
1857
1858
1859 func (c *SitemapsSubmitCall) Header() http.Header {
1860 if c.header_ == nil {
1861 c.header_ = make(http.Header)
1862 }
1863 return c.header_
1864 }
1865
1866 func (c *SitemapsSubmitCall) doRequest(alt string) (*http.Response, error) {
1867 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1868 var body io.Reader = nil
1869 c.urlParams_.Set("alt", alt)
1870 c.urlParams_.Set("prettyPrint", "false")
1871 urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}")
1872 urls += "?" + c.urlParams_.Encode()
1873 req, err := http.NewRequest("PUT", urls, body)
1874 if err != nil {
1875 return nil, err
1876 }
1877 req.Header = reqHeaders
1878 googleapi.Expand(req.URL, map[string]string{
1879 "siteUrl": c.siteUrl,
1880 "feedpath": c.feedpath,
1881 })
1882 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1883 }
1884
1885
1886 func (c *SitemapsSubmitCall) Do(opts ...googleapi.CallOption) error {
1887 gensupport.SetOptions(c.urlParams_, opts...)
1888 res, err := c.doRequest("json")
1889 if err != nil {
1890 return err
1891 }
1892 defer googleapi.CloseBody(res)
1893 if err := googleapi.CheckResponse(res); err != nil {
1894 return gensupport.WrapError(err)
1895 }
1896 return nil
1897 }
1898
1899 type SitesAddCall struct {
1900 s *Service
1901 siteUrl string
1902 urlParams_ gensupport.URLParams
1903 ctx_ context.Context
1904 header_ http.Header
1905 }
1906
1907
1908
1909
1910 func (r *SitesService) Add(siteUrl string) *SitesAddCall {
1911 c := &SitesAddCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1912 c.siteUrl = siteUrl
1913 return c
1914 }
1915
1916
1917
1918
1919 func (c *SitesAddCall) Fields(s ...googleapi.Field) *SitesAddCall {
1920 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1921 return c
1922 }
1923
1924
1925 func (c *SitesAddCall) Context(ctx context.Context) *SitesAddCall {
1926 c.ctx_ = ctx
1927 return c
1928 }
1929
1930
1931
1932 func (c *SitesAddCall) Header() http.Header {
1933 if c.header_ == nil {
1934 c.header_ = make(http.Header)
1935 }
1936 return c.header_
1937 }
1938
1939 func (c *SitesAddCall) doRequest(alt string) (*http.Response, error) {
1940 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1941 var body io.Reader = nil
1942 c.urlParams_.Set("alt", alt)
1943 c.urlParams_.Set("prettyPrint", "false")
1944 urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}")
1945 urls += "?" + c.urlParams_.Encode()
1946 req, err := http.NewRequest("PUT", urls, body)
1947 if err != nil {
1948 return nil, err
1949 }
1950 req.Header = reqHeaders
1951 googleapi.Expand(req.URL, map[string]string{
1952 "siteUrl": c.siteUrl,
1953 })
1954 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1955 }
1956
1957
1958 func (c *SitesAddCall) Do(opts ...googleapi.CallOption) error {
1959 gensupport.SetOptions(c.urlParams_, opts...)
1960 res, err := c.doRequest("json")
1961 if err != nil {
1962 return err
1963 }
1964 defer googleapi.CloseBody(res)
1965 if err := googleapi.CheckResponse(res); err != nil {
1966 return gensupport.WrapError(err)
1967 }
1968 return nil
1969 }
1970
1971 type SitesDeleteCall struct {
1972 s *Service
1973 siteUrl string
1974 urlParams_ gensupport.URLParams
1975 ctx_ context.Context
1976 header_ http.Header
1977 }
1978
1979
1980
1981
1982
1983 func (r *SitesService) Delete(siteUrl string) *SitesDeleteCall {
1984 c := &SitesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1985 c.siteUrl = siteUrl
1986 return c
1987 }
1988
1989
1990
1991
1992 func (c *SitesDeleteCall) Fields(s ...googleapi.Field) *SitesDeleteCall {
1993 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1994 return c
1995 }
1996
1997
1998 func (c *SitesDeleteCall) Context(ctx context.Context) *SitesDeleteCall {
1999 c.ctx_ = ctx
2000 return c
2001 }
2002
2003
2004
2005 func (c *SitesDeleteCall) Header() http.Header {
2006 if c.header_ == nil {
2007 c.header_ = make(http.Header)
2008 }
2009 return c.header_
2010 }
2011
2012 func (c *SitesDeleteCall) doRequest(alt string) (*http.Response, error) {
2013 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2014 var body io.Reader = nil
2015 c.urlParams_.Set("alt", alt)
2016 c.urlParams_.Set("prettyPrint", "false")
2017 urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}")
2018 urls += "?" + c.urlParams_.Encode()
2019 req, err := http.NewRequest("DELETE", urls, body)
2020 if err != nil {
2021 return nil, err
2022 }
2023 req.Header = reqHeaders
2024 googleapi.Expand(req.URL, map[string]string{
2025 "siteUrl": c.siteUrl,
2026 })
2027 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2028 }
2029
2030
2031 func (c *SitesDeleteCall) Do(opts ...googleapi.CallOption) error {
2032 gensupport.SetOptions(c.urlParams_, opts...)
2033 res, err := c.doRequest("json")
2034 if err != nil {
2035 return err
2036 }
2037 defer googleapi.CloseBody(res)
2038 if err := googleapi.CheckResponse(res); err != nil {
2039 return gensupport.WrapError(err)
2040 }
2041 return nil
2042 }
2043
2044 type SitesGetCall struct {
2045 s *Service
2046 siteUrl string
2047 urlParams_ gensupport.URLParams
2048 ifNoneMatch_ string
2049 ctx_ context.Context
2050 header_ http.Header
2051 }
2052
2053
2054
2055
2056
2057 func (r *SitesService) Get(siteUrl string) *SitesGetCall {
2058 c := &SitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2059 c.siteUrl = siteUrl
2060 return c
2061 }
2062
2063
2064
2065
2066 func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
2067 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2068 return c
2069 }
2070
2071
2072
2073
2074 func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall {
2075 c.ifNoneMatch_ = entityTag
2076 return c
2077 }
2078
2079
2080 func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall {
2081 c.ctx_ = ctx
2082 return c
2083 }
2084
2085
2086
2087 func (c *SitesGetCall) Header() http.Header {
2088 if c.header_ == nil {
2089 c.header_ = make(http.Header)
2090 }
2091 return c.header_
2092 }
2093
2094 func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) {
2095 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2096 if c.ifNoneMatch_ != "" {
2097 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2098 }
2099 var body io.Reader = nil
2100 c.urlParams_.Set("alt", alt)
2101 c.urlParams_.Set("prettyPrint", "false")
2102 urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites/{siteUrl}")
2103 urls += "?" + c.urlParams_.Encode()
2104 req, err := http.NewRequest("GET", urls, body)
2105 if err != nil {
2106 return nil, err
2107 }
2108 req.Header = reqHeaders
2109 googleapi.Expand(req.URL, map[string]string{
2110 "siteUrl": c.siteUrl,
2111 })
2112 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2113 }
2114
2115
2116
2117
2118
2119
2120 func (c *SitesGetCall) Do(opts ...googleapi.CallOption) (*WmxSite, error) {
2121 gensupport.SetOptions(c.urlParams_, opts...)
2122 res, err := c.doRequest("json")
2123 if res != nil && res.StatusCode == http.StatusNotModified {
2124 if res.Body != nil {
2125 res.Body.Close()
2126 }
2127 return nil, gensupport.WrapError(&googleapi.Error{
2128 Code: res.StatusCode,
2129 Header: res.Header,
2130 })
2131 }
2132 if err != nil {
2133 return nil, err
2134 }
2135 defer googleapi.CloseBody(res)
2136 if err := googleapi.CheckResponse(res); err != nil {
2137 return nil, gensupport.WrapError(err)
2138 }
2139 ret := &WmxSite{
2140 ServerResponse: googleapi.ServerResponse{
2141 Header: res.Header,
2142 HTTPStatusCode: res.StatusCode,
2143 },
2144 }
2145 target := &ret
2146 if err := gensupport.DecodeResponse(target, res); err != nil {
2147 return nil, err
2148 }
2149 return ret, nil
2150 }
2151
2152 type SitesListCall struct {
2153 s *Service
2154 urlParams_ gensupport.URLParams
2155 ifNoneMatch_ string
2156 ctx_ context.Context
2157 header_ http.Header
2158 }
2159
2160
2161 func (r *SitesService) List() *SitesListCall {
2162 c := &SitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2163 return c
2164 }
2165
2166
2167
2168
2169 func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
2170 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2171 return c
2172 }
2173
2174
2175
2176
2177 func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall {
2178 c.ifNoneMatch_ = entityTag
2179 return c
2180 }
2181
2182
2183 func (c *SitesListCall) Context(ctx context.Context) *SitesListCall {
2184 c.ctx_ = ctx
2185 return c
2186 }
2187
2188
2189
2190 func (c *SitesListCall) Header() http.Header {
2191 if c.header_ == nil {
2192 c.header_ = make(http.Header)
2193 }
2194 return c.header_
2195 }
2196
2197 func (c *SitesListCall) doRequest(alt string) (*http.Response, error) {
2198 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2199 if c.ifNoneMatch_ != "" {
2200 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2201 }
2202 var body io.Reader = nil
2203 c.urlParams_.Set("alt", alt)
2204 c.urlParams_.Set("prettyPrint", "false")
2205 urls := googleapi.ResolveRelative(c.s.BasePath, "webmasters/v3/sites")
2206 urls += "?" + c.urlParams_.Encode()
2207 req, err := http.NewRequest("GET", urls, body)
2208 if err != nil {
2209 return nil, err
2210 }
2211 req.Header = reqHeaders
2212 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2213 }
2214
2215
2216
2217
2218
2219
2220
2221 func (c *SitesListCall) Do(opts ...googleapi.CallOption) (*SitesListResponse, error) {
2222 gensupport.SetOptions(c.urlParams_, opts...)
2223 res, err := c.doRequest("json")
2224 if res != nil && res.StatusCode == http.StatusNotModified {
2225 if res.Body != nil {
2226 res.Body.Close()
2227 }
2228 return nil, gensupport.WrapError(&googleapi.Error{
2229 Code: res.StatusCode,
2230 Header: res.Header,
2231 })
2232 }
2233 if err != nil {
2234 return nil, err
2235 }
2236 defer googleapi.CloseBody(res)
2237 if err := googleapi.CheckResponse(res); err != nil {
2238 return nil, gensupport.WrapError(err)
2239 }
2240 ret := &SitesListResponse{
2241 ServerResponse: googleapi.ServerResponse{
2242 Header: res.Header,
2243 HTTPStatusCode: res.StatusCode,
2244 },
2245 }
2246 target := &ret
2247 if err := gensupport.DecodeResponse(target, res); err != nil {
2248 return nil, err
2249 }
2250 return ret, nil
2251 }
2252
2253 type UrlInspectionIndexInspectCall struct {
2254 s *Service
2255 inspecturlindexrequest *InspectUrlIndexRequest
2256 urlParams_ gensupport.URLParams
2257 ctx_ context.Context
2258 header_ http.Header
2259 }
2260
2261
2262 func (r *UrlInspectionIndexService) Inspect(inspecturlindexrequest *InspectUrlIndexRequest) *UrlInspectionIndexInspectCall {
2263 c := &UrlInspectionIndexInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2264 c.inspecturlindexrequest = inspecturlindexrequest
2265 return c
2266 }
2267
2268
2269
2270
2271 func (c *UrlInspectionIndexInspectCall) Fields(s ...googleapi.Field) *UrlInspectionIndexInspectCall {
2272 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2273 return c
2274 }
2275
2276
2277 func (c *UrlInspectionIndexInspectCall) Context(ctx context.Context) *UrlInspectionIndexInspectCall {
2278 c.ctx_ = ctx
2279 return c
2280 }
2281
2282
2283
2284 func (c *UrlInspectionIndexInspectCall) Header() http.Header {
2285 if c.header_ == nil {
2286 c.header_ = make(http.Header)
2287 }
2288 return c.header_
2289 }
2290
2291 func (c *UrlInspectionIndexInspectCall) doRequest(alt string) (*http.Response, error) {
2292 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2293 var body io.Reader = nil
2294 body, err := googleapi.WithoutDataWrapper.JSONReader(c.inspecturlindexrequest)
2295 if err != nil {
2296 return nil, err
2297 }
2298 c.urlParams_.Set("alt", alt)
2299 c.urlParams_.Set("prettyPrint", "false")
2300 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/urlInspection/index:inspect")
2301 urls += "?" + c.urlParams_.Encode()
2302 req, err := http.NewRequest("POST", urls, body)
2303 if err != nil {
2304 return nil, err
2305 }
2306 req.Header = reqHeaders
2307 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2308 }
2309
2310
2311
2312
2313
2314
2315
2316 func (c *UrlInspectionIndexInspectCall) Do(opts ...googleapi.CallOption) (*InspectUrlIndexResponse, error) {
2317 gensupport.SetOptions(c.urlParams_, opts...)
2318 res, err := c.doRequest("json")
2319 if res != nil && res.StatusCode == http.StatusNotModified {
2320 if res.Body != nil {
2321 res.Body.Close()
2322 }
2323 return nil, gensupport.WrapError(&googleapi.Error{
2324 Code: res.StatusCode,
2325 Header: res.Header,
2326 })
2327 }
2328 if err != nil {
2329 return nil, err
2330 }
2331 defer googleapi.CloseBody(res)
2332 if err := googleapi.CheckResponse(res); err != nil {
2333 return nil, gensupport.WrapError(err)
2334 }
2335 ret := &InspectUrlIndexResponse{
2336 ServerResponse: googleapi.ServerResponse{
2337 Header: res.Header,
2338 HTTPStatusCode: res.StatusCode,
2339 },
2340 }
2341 target := &ret
2342 if err := gensupport.DecodeResponse(target, res); err != nil {
2343 return nil, err
2344 }
2345 return ret, nil
2346 }
2347
2348 type UrlTestingToolsMobileFriendlyTestRunCall struct {
2349 s *Service
2350 runmobilefriendlytestrequest *RunMobileFriendlyTestRequest
2351 urlParams_ gensupport.URLParams
2352 ctx_ context.Context
2353 header_ http.Header
2354 }
2355
2356
2357 func (r *UrlTestingToolsMobileFriendlyTestService) Run(runmobilefriendlytestrequest *RunMobileFriendlyTestRequest) *UrlTestingToolsMobileFriendlyTestRunCall {
2358 c := &UrlTestingToolsMobileFriendlyTestRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2359 c.runmobilefriendlytestrequest = runmobilefriendlytestrequest
2360 return c
2361 }
2362
2363
2364
2365
2366 func (c *UrlTestingToolsMobileFriendlyTestRunCall) Fields(s ...googleapi.Field) *UrlTestingToolsMobileFriendlyTestRunCall {
2367 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2368 return c
2369 }
2370
2371
2372 func (c *UrlTestingToolsMobileFriendlyTestRunCall) Context(ctx context.Context) *UrlTestingToolsMobileFriendlyTestRunCall {
2373 c.ctx_ = ctx
2374 return c
2375 }
2376
2377
2378
2379 func (c *UrlTestingToolsMobileFriendlyTestRunCall) Header() http.Header {
2380 if c.header_ == nil {
2381 c.header_ = make(http.Header)
2382 }
2383 return c.header_
2384 }
2385
2386 func (c *UrlTestingToolsMobileFriendlyTestRunCall) doRequest(alt string) (*http.Response, error) {
2387 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2388 var body io.Reader = nil
2389 body, err := googleapi.WithoutDataWrapper.JSONReader(c.runmobilefriendlytestrequest)
2390 if err != nil {
2391 return nil, err
2392 }
2393 c.urlParams_.Set("alt", alt)
2394 c.urlParams_.Set("prettyPrint", "false")
2395 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/urlTestingTools/mobileFriendlyTest:run")
2396 urls += "?" + c.urlParams_.Encode()
2397 req, err := http.NewRequest("POST", urls, body)
2398 if err != nil {
2399 return nil, err
2400 }
2401 req.Header = reqHeaders
2402 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2403 }
2404
2405
2406
2407
2408
2409
2410
2411 func (c *UrlTestingToolsMobileFriendlyTestRunCall) Do(opts ...googleapi.CallOption) (*RunMobileFriendlyTestResponse, error) {
2412 gensupport.SetOptions(c.urlParams_, opts...)
2413 res, err := c.doRequest("json")
2414 if res != nil && res.StatusCode == http.StatusNotModified {
2415 if res.Body != nil {
2416 res.Body.Close()
2417 }
2418 return nil, gensupport.WrapError(&googleapi.Error{
2419 Code: res.StatusCode,
2420 Header: res.Header,
2421 })
2422 }
2423 if err != nil {
2424 return nil, err
2425 }
2426 defer googleapi.CloseBody(res)
2427 if err := googleapi.CheckResponse(res); err != nil {
2428 return nil, gensupport.WrapError(err)
2429 }
2430 ret := &RunMobileFriendlyTestResponse{
2431 ServerResponse: googleapi.ServerResponse{
2432 Header: res.Header,
2433 HTTPStatusCode: res.StatusCode,
2434 },
2435 }
2436 target := &ret
2437 if err := gensupport.DecodeResponse(target, res); err != nil {
2438 return nil, err
2439 }
2440 return ret, nil
2441 }
2442
View as plain text