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 package analytics
43
44 import (
45 "bytes"
46 "context"
47 "encoding/json"
48 "errors"
49 "fmt"
50 "io"
51 "net/http"
52 "net/url"
53 "strconv"
54 "strings"
55
56 googleapi "google.golang.org/api/googleapi"
57 gensupport "google.golang.org/api/internal/gensupport"
58 option "google.golang.org/api/option"
59 htransport "google.golang.org/api/transport/http"
60 )
61
62
63
64 var _ = bytes.NewBuffer
65 var _ = strconv.Itoa
66 var _ = fmt.Sprintf
67 var _ = json.NewDecoder
68 var _ = io.Copy
69 var _ = url.Parse
70 var _ = gensupport.MarshalJSON
71 var _ = googleapi.Version
72 var _ = errors.New
73 var _ = strings.Replace
74 var _ = context.Canceled
75
76 const apiId = "analytics:v2.4"
77 const apiName = "analytics"
78 const apiVersion = "v2.4"
79 const basePath = "https://www.googleapis.com/analytics/v2.4/"
80
81
82 const (
83
84 AnalyticsScope = "https://www.googleapis.com/auth/analytics"
85
86
87 AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.readonly"
88 )
89
90
91 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
92 scopesOption := option.WithScopes(
93 "https://www.googleapis.com/auth/analytics",
94 "https://www.googleapis.com/auth/analytics.readonly",
95 )
96
97 opts = append([]option.ClientOption{scopesOption}, opts...)
98 client, endpoint, err := htransport.NewClient(ctx, opts...)
99 if err != nil {
100 return nil, err
101 }
102 s, err := New(client)
103 if err != nil {
104 return nil, err
105 }
106 if endpoint != "" {
107 s.BasePath = endpoint
108 }
109 return s, nil
110 }
111
112
113
114
115
116
117 func New(client *http.Client) (*Service, error) {
118 if client == nil {
119 return nil, errors.New("client is nil")
120 }
121 s := &Service{client: client, BasePath: basePath}
122 s.Data = NewDataService(s)
123 s.Management = NewManagementService(s)
124 return s, nil
125 }
126
127 type Service struct {
128 client *http.Client
129 BasePath string
130 UserAgent string
131
132 Data *DataService
133
134 Management *ManagementService
135 }
136
137 func (s *Service) userAgent() string {
138 if s.UserAgent == "" {
139 return googleapi.UserAgent
140 }
141 return googleapi.UserAgent + " " + s.UserAgent
142 }
143
144 func NewDataService(s *Service) *DataService {
145 rs := &DataService{s: s}
146 return rs
147 }
148
149 type DataService struct {
150 s *Service
151 }
152
153 func NewManagementService(s *Service) *ManagementService {
154 rs := &ManagementService{s: s}
155 rs.Accounts = NewManagementAccountsService(s)
156 rs.Goals = NewManagementGoalsService(s)
157 rs.Profiles = NewManagementProfilesService(s)
158 rs.Segments = NewManagementSegmentsService(s)
159 rs.Webproperties = NewManagementWebpropertiesService(s)
160 return rs
161 }
162
163 type ManagementService struct {
164 s *Service
165
166 Accounts *ManagementAccountsService
167
168 Goals *ManagementGoalsService
169
170 Profiles *ManagementProfilesService
171
172 Segments *ManagementSegmentsService
173
174 Webproperties *ManagementWebpropertiesService
175 }
176
177 func NewManagementAccountsService(s *Service) *ManagementAccountsService {
178 rs := &ManagementAccountsService{s: s}
179 return rs
180 }
181
182 type ManagementAccountsService struct {
183 s *Service
184 }
185
186 func NewManagementGoalsService(s *Service) *ManagementGoalsService {
187 rs := &ManagementGoalsService{s: s}
188 return rs
189 }
190
191 type ManagementGoalsService struct {
192 s *Service
193 }
194
195 func NewManagementProfilesService(s *Service) *ManagementProfilesService {
196 rs := &ManagementProfilesService{s: s}
197 return rs
198 }
199
200 type ManagementProfilesService struct {
201 s *Service
202 }
203
204 func NewManagementSegmentsService(s *Service) *ManagementSegmentsService {
205 rs := &ManagementSegmentsService{s: s}
206 return rs
207 }
208
209 type ManagementSegmentsService struct {
210 s *Service
211 }
212
213 func NewManagementWebpropertiesService(s *Service) *ManagementWebpropertiesService {
214 rs := &ManagementWebpropertiesService{s: s}
215 return rs
216 }
217
218 type ManagementWebpropertiesService struct {
219 s *Service
220 }
221
222
223
224 type DataGetCall struct {
225 s *Service
226 urlParams_ gensupport.URLParams
227 ifNoneMatch_ string
228 ctx_ context.Context
229 header_ http.Header
230 }
231
232
233 func (r *DataService) Get(ids string, startDate string, endDate string, metrics string) *DataGetCall {
234 c := &DataGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
235 c.urlParams_.Set("ids", ids)
236 c.urlParams_.Set("start-date", startDate)
237 c.urlParams_.Set("end-date", endDate)
238 c.urlParams_.Set("metrics", metrics)
239 return c
240 }
241
242
243
244
245 func (c *DataGetCall) Dimensions(dimensions string) *DataGetCall {
246 c.urlParams_.Set("dimensions", dimensions)
247 return c
248 }
249
250
251
252 func (c *DataGetCall) Filters(filters string) *DataGetCall {
253 c.urlParams_.Set("filters", filters)
254 return c
255 }
256
257
258
259 func (c *DataGetCall) MaxResults(maxResults int64) *DataGetCall {
260 c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
261 return c
262 }
263
264
265
266 func (c *DataGetCall) Segment(segment string) *DataGetCall {
267 c.urlParams_.Set("segment", segment)
268 return c
269 }
270
271
272
273
274 func (c *DataGetCall) Sort(sort string) *DataGetCall {
275 c.urlParams_.Set("sort", sort)
276 return c
277 }
278
279
280
281
282 func (c *DataGetCall) StartIndex(startIndex int64) *DataGetCall {
283 c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
284 return c
285 }
286
287
288
289
290 func (c *DataGetCall) Fields(s ...googleapi.Field) *DataGetCall {
291 c.urlParams_.Set("fields", googleapi.CombineFields(s))
292 return c
293 }
294
295
296
297
298
299
300 func (c *DataGetCall) IfNoneMatch(entityTag string) *DataGetCall {
301 c.ifNoneMatch_ = entityTag
302 return c
303 }
304
305
306
307
308 func (c *DataGetCall) Context(ctx context.Context) *DataGetCall {
309 c.ctx_ = ctx
310 return c
311 }
312
313
314
315 func (c *DataGetCall) Header() http.Header {
316 if c.header_ == nil {
317 c.header_ = make(http.Header)
318 }
319 return c.header_
320 }
321
322 func (c *DataGetCall) doRequest(alt string) (*http.Response, error) {
323 reqHeaders := make(http.Header)
324 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200206")
325 for k, v := range c.header_ {
326 reqHeaders[k] = v
327 }
328 reqHeaders.Set("User-Agent", c.s.userAgent())
329 if c.ifNoneMatch_ != "" {
330 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
331 }
332 var body io.Reader = nil
333 c.urlParams_.Set("alt", alt)
334 c.urlParams_.Set("prettyPrint", "false")
335 urls := googleapi.ResolveRelative(c.s.BasePath, "data")
336 urls += "?" + c.urlParams_.Encode()
337 req, err := http.NewRequest("GET", urls, body)
338 if err != nil {
339 return nil, err
340 }
341 req.Header = reqHeaders
342 return gensupport.SendRequest(c.ctx_, c.s.client, req)
343 }
344
345
346 func (c *DataGetCall) Do(opts ...googleapi.CallOption) error {
347 gensupport.SetOptions(c.urlParams_, opts...)
348 res, err := c.doRequest("json")
349 if err != nil {
350 return err
351 }
352 defer googleapi.CloseBody(res)
353 if err := googleapi.CheckResponse(res); err != nil {
354 return err
355 }
356 return nil
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440 }
441
442
443
444 type ManagementAccountsListCall struct {
445 s *Service
446 urlParams_ gensupport.URLParams
447 ifNoneMatch_ string
448 ctx_ context.Context
449 header_ http.Header
450 }
451
452
453 func (r *ManagementAccountsService) List() *ManagementAccountsListCall {
454 c := &ManagementAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
455 return c
456 }
457
458
459
460 func (c *ManagementAccountsListCall) MaxResults(maxResults int64) *ManagementAccountsListCall {
461 c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
462 return c
463 }
464
465
466
467
468 func (c *ManagementAccountsListCall) StartIndex(startIndex int64) *ManagementAccountsListCall {
469 c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
470 return c
471 }
472
473
474
475
476 func (c *ManagementAccountsListCall) Fields(s ...googleapi.Field) *ManagementAccountsListCall {
477 c.urlParams_.Set("fields", googleapi.CombineFields(s))
478 return c
479 }
480
481
482
483
484
485
486 func (c *ManagementAccountsListCall) IfNoneMatch(entityTag string) *ManagementAccountsListCall {
487 c.ifNoneMatch_ = entityTag
488 return c
489 }
490
491
492
493
494 func (c *ManagementAccountsListCall) Context(ctx context.Context) *ManagementAccountsListCall {
495 c.ctx_ = ctx
496 return c
497 }
498
499
500
501 func (c *ManagementAccountsListCall) Header() http.Header {
502 if c.header_ == nil {
503 c.header_ = make(http.Header)
504 }
505 return c.header_
506 }
507
508 func (c *ManagementAccountsListCall) doRequest(alt string) (*http.Response, error) {
509 reqHeaders := make(http.Header)
510 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200206")
511 for k, v := range c.header_ {
512 reqHeaders[k] = v
513 }
514 reqHeaders.Set("User-Agent", c.s.userAgent())
515 if c.ifNoneMatch_ != "" {
516 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
517 }
518 var body io.Reader = nil
519 c.urlParams_.Set("alt", alt)
520 c.urlParams_.Set("prettyPrint", "false")
521 urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts")
522 urls += "?" + c.urlParams_.Encode()
523 req, err := http.NewRequest("GET", urls, body)
524 if err != nil {
525 return nil, err
526 }
527 req.Header = reqHeaders
528 return gensupport.SendRequest(c.ctx_, c.s.client, req)
529 }
530
531
532 func (c *ManagementAccountsListCall) Do(opts ...googleapi.CallOption) error {
533 gensupport.SetOptions(c.urlParams_, opts...)
534 res, err := c.doRequest("json")
535 if err != nil {
536 return err
537 }
538 defer googleapi.CloseBody(res)
539 if err := googleapi.CheckResponse(res); err != nil {
540 return err
541 }
542 return nil
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569 }
570
571
572
573 type ManagementGoalsListCall struct {
574 s *Service
575 accountId string
576 webPropertyId string
577 profileId string
578 urlParams_ gensupport.URLParams
579 ifNoneMatch_ string
580 ctx_ context.Context
581 header_ http.Header
582 }
583
584
585 func (r *ManagementGoalsService) List(accountId string, webPropertyId string, profileId string) *ManagementGoalsListCall {
586 c := &ManagementGoalsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
587 c.accountId = accountId
588 c.webPropertyId = webPropertyId
589 c.profileId = profileId
590 return c
591 }
592
593
594
595 func (c *ManagementGoalsListCall) MaxResults(maxResults int64) *ManagementGoalsListCall {
596 c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
597 return c
598 }
599
600
601
602
603 func (c *ManagementGoalsListCall) StartIndex(startIndex int64) *ManagementGoalsListCall {
604 c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
605 return c
606 }
607
608
609
610
611 func (c *ManagementGoalsListCall) Fields(s ...googleapi.Field) *ManagementGoalsListCall {
612 c.urlParams_.Set("fields", googleapi.CombineFields(s))
613 return c
614 }
615
616
617
618
619
620
621 func (c *ManagementGoalsListCall) IfNoneMatch(entityTag string) *ManagementGoalsListCall {
622 c.ifNoneMatch_ = entityTag
623 return c
624 }
625
626
627
628
629 func (c *ManagementGoalsListCall) Context(ctx context.Context) *ManagementGoalsListCall {
630 c.ctx_ = ctx
631 return c
632 }
633
634
635
636 func (c *ManagementGoalsListCall) Header() http.Header {
637 if c.header_ == nil {
638 c.header_ = make(http.Header)
639 }
640 return c.header_
641 }
642
643 func (c *ManagementGoalsListCall) doRequest(alt string) (*http.Response, error) {
644 reqHeaders := make(http.Header)
645 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200206")
646 for k, v := range c.header_ {
647 reqHeaders[k] = v
648 }
649 reqHeaders.Set("User-Agent", c.s.userAgent())
650 if c.ifNoneMatch_ != "" {
651 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
652 }
653 var body io.Reader = nil
654 c.urlParams_.Set("alt", alt)
655 c.urlParams_.Set("prettyPrint", "false")
656 urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals")
657 urls += "?" + c.urlParams_.Encode()
658 req, err := http.NewRequest("GET", urls, body)
659 if err != nil {
660 return nil, err
661 }
662 req.Header = reqHeaders
663 googleapi.Expand(req.URL, map[string]string{
664 "accountId": c.accountId,
665 "webPropertyId": c.webPropertyId,
666 "profileId": c.profileId,
667 })
668 return gensupport.SendRequest(c.ctx_, c.s.client, req)
669 }
670
671
672 func (c *ManagementGoalsListCall) Do(opts ...googleapi.CallOption) error {
673 gensupport.SetOptions(c.urlParams_, opts...)
674 res, err := c.doRequest("json")
675 if err != nil {
676 return err
677 }
678 defer googleapi.CloseBody(res)
679 if err := googleapi.CheckResponse(res); err != nil {
680 return err
681 }
682 return nil
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732 }
733
734
735
736 type ManagementProfilesListCall struct {
737 s *Service
738 accountId string
739 webPropertyId string
740 urlParams_ gensupport.URLParams
741 ifNoneMatch_ string
742 ctx_ context.Context
743 header_ http.Header
744 }
745
746
747 func (r *ManagementProfilesService) List(accountId string, webPropertyId string) *ManagementProfilesListCall {
748 c := &ManagementProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
749 c.accountId = accountId
750 c.webPropertyId = webPropertyId
751 return c
752 }
753
754
755
756 func (c *ManagementProfilesListCall) MaxResults(maxResults int64) *ManagementProfilesListCall {
757 c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
758 return c
759 }
760
761
762
763
764 func (c *ManagementProfilesListCall) StartIndex(startIndex int64) *ManagementProfilesListCall {
765 c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
766 return c
767 }
768
769
770
771
772 func (c *ManagementProfilesListCall) Fields(s ...googleapi.Field) *ManagementProfilesListCall {
773 c.urlParams_.Set("fields", googleapi.CombineFields(s))
774 return c
775 }
776
777
778
779
780
781
782 func (c *ManagementProfilesListCall) IfNoneMatch(entityTag string) *ManagementProfilesListCall {
783 c.ifNoneMatch_ = entityTag
784 return c
785 }
786
787
788
789
790 func (c *ManagementProfilesListCall) Context(ctx context.Context) *ManagementProfilesListCall {
791 c.ctx_ = ctx
792 return c
793 }
794
795
796
797 func (c *ManagementProfilesListCall) Header() http.Header {
798 if c.header_ == nil {
799 c.header_ = make(http.Header)
800 }
801 return c.header_
802 }
803
804 func (c *ManagementProfilesListCall) doRequest(alt string) (*http.Response, error) {
805 reqHeaders := make(http.Header)
806 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200206")
807 for k, v := range c.header_ {
808 reqHeaders[k] = v
809 }
810 reqHeaders.Set("User-Agent", c.s.userAgent())
811 if c.ifNoneMatch_ != "" {
812 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
813 }
814 var body io.Reader = nil
815 c.urlParams_.Set("alt", alt)
816 c.urlParams_.Set("prettyPrint", "false")
817 urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles")
818 urls += "?" + c.urlParams_.Encode()
819 req, err := http.NewRequest("GET", urls, body)
820 if err != nil {
821 return nil, err
822 }
823 req.Header = reqHeaders
824 googleapi.Expand(req.URL, map[string]string{
825 "accountId": c.accountId,
826 "webPropertyId": c.webPropertyId,
827 })
828 return gensupport.SendRequest(c.ctx_, c.s.client, req)
829 }
830
831
832 func (c *ManagementProfilesListCall) Do(opts ...googleapi.CallOption) error {
833 gensupport.SetOptions(c.urlParams_, opts...)
834 res, err := c.doRequest("json")
835 if err != nil {
836 return err
837 }
838 defer googleapi.CloseBody(res)
839 if err := googleapi.CheckResponse(res); err != nil {
840 return err
841 }
842 return nil
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885 }
886
887
888
889 type ManagementSegmentsListCall struct {
890 s *Service
891 urlParams_ gensupport.URLParams
892 ifNoneMatch_ string
893 ctx_ context.Context
894 header_ http.Header
895 }
896
897
898 func (r *ManagementSegmentsService) List() *ManagementSegmentsListCall {
899 c := &ManagementSegmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
900 return c
901 }
902
903
904
905 func (c *ManagementSegmentsListCall) MaxResults(maxResults int64) *ManagementSegmentsListCall {
906 c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
907 return c
908 }
909
910
911
912
913 func (c *ManagementSegmentsListCall) StartIndex(startIndex int64) *ManagementSegmentsListCall {
914 c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
915 return c
916 }
917
918
919
920
921 func (c *ManagementSegmentsListCall) Fields(s ...googleapi.Field) *ManagementSegmentsListCall {
922 c.urlParams_.Set("fields", googleapi.CombineFields(s))
923 return c
924 }
925
926
927
928
929
930
931 func (c *ManagementSegmentsListCall) IfNoneMatch(entityTag string) *ManagementSegmentsListCall {
932 c.ifNoneMatch_ = entityTag
933 return c
934 }
935
936
937
938
939 func (c *ManagementSegmentsListCall) Context(ctx context.Context) *ManagementSegmentsListCall {
940 c.ctx_ = ctx
941 return c
942 }
943
944
945
946 func (c *ManagementSegmentsListCall) Header() http.Header {
947 if c.header_ == nil {
948 c.header_ = make(http.Header)
949 }
950 return c.header_
951 }
952
953 func (c *ManagementSegmentsListCall) doRequest(alt string) (*http.Response, error) {
954 reqHeaders := make(http.Header)
955 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200206")
956 for k, v := range c.header_ {
957 reqHeaders[k] = v
958 }
959 reqHeaders.Set("User-Agent", c.s.userAgent())
960 if c.ifNoneMatch_ != "" {
961 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
962 }
963 var body io.Reader = nil
964 c.urlParams_.Set("alt", alt)
965 c.urlParams_.Set("prettyPrint", "false")
966 urls := googleapi.ResolveRelative(c.s.BasePath, "management/segments")
967 urls += "?" + c.urlParams_.Encode()
968 req, err := http.NewRequest("GET", urls, body)
969 if err != nil {
970 return nil, err
971 }
972 req.Header = reqHeaders
973 return gensupport.SendRequest(c.ctx_, c.s.client, req)
974 }
975
976
977 func (c *ManagementSegmentsListCall) Do(opts ...googleapi.CallOption) error {
978 gensupport.SetOptions(c.urlParams_, opts...)
979 res, err := c.doRequest("json")
980 if err != nil {
981 return err
982 }
983 defer googleapi.CloseBody(res)
984 if err := googleapi.CheckResponse(res); err != nil {
985 return err
986 }
987 return nil
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014 }
1015
1016
1017
1018 type ManagementWebpropertiesListCall struct {
1019 s *Service
1020 accountId string
1021 urlParams_ gensupport.URLParams
1022 ifNoneMatch_ string
1023 ctx_ context.Context
1024 header_ http.Header
1025 }
1026
1027
1028 func (r *ManagementWebpropertiesService) List(accountId string) *ManagementWebpropertiesListCall {
1029 c := &ManagementWebpropertiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1030 c.accountId = accountId
1031 return c
1032 }
1033
1034
1035
1036 func (c *ManagementWebpropertiesListCall) MaxResults(maxResults int64) *ManagementWebpropertiesListCall {
1037 c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
1038 return c
1039 }
1040
1041
1042
1043
1044 func (c *ManagementWebpropertiesListCall) StartIndex(startIndex int64) *ManagementWebpropertiesListCall {
1045 c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
1046 return c
1047 }
1048
1049
1050
1051
1052 func (c *ManagementWebpropertiesListCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesListCall {
1053 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1054 return c
1055 }
1056
1057
1058
1059
1060
1061
1062 func (c *ManagementWebpropertiesListCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesListCall {
1063 c.ifNoneMatch_ = entityTag
1064 return c
1065 }
1066
1067
1068
1069
1070 func (c *ManagementWebpropertiesListCall) Context(ctx context.Context) *ManagementWebpropertiesListCall {
1071 c.ctx_ = ctx
1072 return c
1073 }
1074
1075
1076
1077 func (c *ManagementWebpropertiesListCall) Header() http.Header {
1078 if c.header_ == nil {
1079 c.header_ = make(http.Header)
1080 }
1081 return c.header_
1082 }
1083
1084 func (c *ManagementWebpropertiesListCall) doRequest(alt string) (*http.Response, error) {
1085 reqHeaders := make(http.Header)
1086 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200206")
1087 for k, v := range c.header_ {
1088 reqHeaders[k] = v
1089 }
1090 reqHeaders.Set("User-Agent", c.s.userAgent())
1091 if c.ifNoneMatch_ != "" {
1092 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1093 }
1094 var body io.Reader = nil
1095 c.urlParams_.Set("alt", alt)
1096 c.urlParams_.Set("prettyPrint", "false")
1097 urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties")
1098 urls += "?" + c.urlParams_.Encode()
1099 req, err := http.NewRequest("GET", urls, body)
1100 if err != nil {
1101 return nil, err
1102 }
1103 req.Header = reqHeaders
1104 googleapi.Expand(req.URL, map[string]string{
1105 "accountId": c.accountId,
1106 })
1107 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1108 }
1109
1110
1111 func (c *ManagementWebpropertiesListCall) Do(opts ...googleapi.CallOption) error {
1112 gensupport.SetOptions(c.urlParams_, opts...)
1113 res, err := c.doRequest("json")
1114 if err != nil {
1115 return err
1116 }
1117 defer googleapi.CloseBody(res)
1118 if err := googleapi.CheckResponse(res); err != nil {
1119 return err
1120 }
1121 return nil
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157 }
1158
View as plain text