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 adexchangeseller
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 = "adexchangeseller:v2.0"
77 const apiName = "adexchangeseller"
78 const apiVersion = "v2.0"
79 const basePath = "https://www.googleapis.com/adexchangeseller/v2.0/"
80
81
82 const (
83
84 AdexchangeSellerScope = "https://www.googleapis.com/auth/adexchange.seller"
85
86
87 AdexchangeSellerReadonlyScope = "https://www.googleapis.com/auth/adexchange.seller.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/adexchange.seller",
94 "https://www.googleapis.com/auth/adexchange.seller.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.Accounts = NewAccountsService(s)
123 return s, nil
124 }
125
126 type Service struct {
127 client *http.Client
128 BasePath string
129 UserAgent string
130
131 Accounts *AccountsService
132 }
133
134 func (s *Service) userAgent() string {
135 if s.UserAgent == "" {
136 return googleapi.UserAgent
137 }
138 return googleapi.UserAgent + " " + s.UserAgent
139 }
140
141 func NewAccountsService(s *Service) *AccountsService {
142 rs := &AccountsService{s: s}
143 rs.Adclients = NewAccountsAdclientsService(s)
144 rs.Alerts = NewAccountsAlertsService(s)
145 rs.Customchannels = NewAccountsCustomchannelsService(s)
146 rs.Metadata = NewAccountsMetadataService(s)
147 rs.Preferreddeals = NewAccountsPreferreddealsService(s)
148 rs.Reports = NewAccountsReportsService(s)
149 rs.Urlchannels = NewAccountsUrlchannelsService(s)
150 return rs
151 }
152
153 type AccountsService struct {
154 s *Service
155
156 Adclients *AccountsAdclientsService
157
158 Alerts *AccountsAlertsService
159
160 Customchannels *AccountsCustomchannelsService
161
162 Metadata *AccountsMetadataService
163
164 Preferreddeals *AccountsPreferreddealsService
165
166 Reports *AccountsReportsService
167
168 Urlchannels *AccountsUrlchannelsService
169 }
170
171 func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService {
172 rs := &AccountsAdclientsService{s: s}
173 return rs
174 }
175
176 type AccountsAdclientsService struct {
177 s *Service
178 }
179
180 func NewAccountsAlertsService(s *Service) *AccountsAlertsService {
181 rs := &AccountsAlertsService{s: s}
182 return rs
183 }
184
185 type AccountsAlertsService struct {
186 s *Service
187 }
188
189 func NewAccountsCustomchannelsService(s *Service) *AccountsCustomchannelsService {
190 rs := &AccountsCustomchannelsService{s: s}
191 return rs
192 }
193
194 type AccountsCustomchannelsService struct {
195 s *Service
196 }
197
198 func NewAccountsMetadataService(s *Service) *AccountsMetadataService {
199 rs := &AccountsMetadataService{s: s}
200 rs.Dimensions = NewAccountsMetadataDimensionsService(s)
201 rs.Metrics = NewAccountsMetadataMetricsService(s)
202 return rs
203 }
204
205 type AccountsMetadataService struct {
206 s *Service
207
208 Dimensions *AccountsMetadataDimensionsService
209
210 Metrics *AccountsMetadataMetricsService
211 }
212
213 func NewAccountsMetadataDimensionsService(s *Service) *AccountsMetadataDimensionsService {
214 rs := &AccountsMetadataDimensionsService{s: s}
215 return rs
216 }
217
218 type AccountsMetadataDimensionsService struct {
219 s *Service
220 }
221
222 func NewAccountsMetadataMetricsService(s *Service) *AccountsMetadataMetricsService {
223 rs := &AccountsMetadataMetricsService{s: s}
224 return rs
225 }
226
227 type AccountsMetadataMetricsService struct {
228 s *Service
229 }
230
231 func NewAccountsPreferreddealsService(s *Service) *AccountsPreferreddealsService {
232 rs := &AccountsPreferreddealsService{s: s}
233 return rs
234 }
235
236 type AccountsPreferreddealsService struct {
237 s *Service
238 }
239
240 func NewAccountsReportsService(s *Service) *AccountsReportsService {
241 rs := &AccountsReportsService{s: s}
242 rs.Saved = NewAccountsReportsSavedService(s)
243 return rs
244 }
245
246 type AccountsReportsService struct {
247 s *Service
248
249 Saved *AccountsReportsSavedService
250 }
251
252 func NewAccountsReportsSavedService(s *Service) *AccountsReportsSavedService {
253 rs := &AccountsReportsSavedService{s: s}
254 return rs
255 }
256
257 type AccountsReportsSavedService struct {
258 s *Service
259 }
260
261 func NewAccountsUrlchannelsService(s *Service) *AccountsUrlchannelsService {
262 rs := &AccountsUrlchannelsService{s: s}
263 return rs
264 }
265
266 type AccountsUrlchannelsService struct {
267 s *Service
268 }
269
270 type Account struct {
271
272 Id string `json:"id,omitempty"`
273
274
275
276 Kind string `json:"kind,omitempty"`
277
278
279 Name string `json:"name,omitempty"`
280
281
282
283 googleapi.ServerResponse `json:"-"`
284
285
286
287
288
289
290
291 ForceSendFields []string `json:"-"`
292
293
294
295
296
297
298
299 NullFields []string `json:"-"`
300 }
301
302 func (s *Account) MarshalJSON() ([]byte, error) {
303 type NoMethod Account
304 raw := NoMethod(*s)
305 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
306 }
307
308 type Accounts struct {
309
310 Etag string `json:"etag,omitempty"`
311
312
313 Items []*Account `json:"items,omitempty"`
314
315
316 Kind string `json:"kind,omitempty"`
317
318
319
320
321 NextPageToken string `json:"nextPageToken,omitempty"`
322
323
324
325 googleapi.ServerResponse `json:"-"`
326
327
328
329
330
331
332
333 ForceSendFields []string `json:"-"`
334
335
336
337
338
339
340
341 NullFields []string `json:"-"`
342 }
343
344 func (s *Accounts) MarshalJSON() ([]byte, error) {
345 type NoMethod Accounts
346 raw := NoMethod(*s)
347 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
348 }
349
350 type AdClient struct {
351
352 ArcOptIn bool `json:"arcOptIn,omitempty"`
353
354
355 Id string `json:"id,omitempty"`
356
357
358
359 Kind string `json:"kind,omitempty"`
360
361
362
363 ProductCode string `json:"productCode,omitempty"`
364
365
366 SupportsReporting bool `json:"supportsReporting,omitempty"`
367
368
369
370
371
372
373
374 ForceSendFields []string `json:"-"`
375
376
377
378
379
380
381
382 NullFields []string `json:"-"`
383 }
384
385 func (s *AdClient) MarshalJSON() ([]byte, error) {
386 type NoMethod AdClient
387 raw := NoMethod(*s)
388 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
389 }
390
391 type AdClients struct {
392
393 Etag string `json:"etag,omitempty"`
394
395
396 Items []*AdClient `json:"items,omitempty"`
397
398
399 Kind string `json:"kind,omitempty"`
400
401
402
403
404 NextPageToken string `json:"nextPageToken,omitempty"`
405
406
407
408 googleapi.ServerResponse `json:"-"`
409
410
411
412
413
414
415
416 ForceSendFields []string `json:"-"`
417
418
419
420
421
422
423
424 NullFields []string `json:"-"`
425 }
426
427 func (s *AdClients) MarshalJSON() ([]byte, error) {
428 type NoMethod AdClients
429 raw := NoMethod(*s)
430 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
431 }
432
433 type Alert struct {
434
435
436
437 Id string `json:"id,omitempty"`
438
439
440 Kind string `json:"kind,omitempty"`
441
442
443 Message string `json:"message,omitempty"`
444
445
446
447 Severity string `json:"severity,omitempty"`
448
449
450
451
452
453 Type string `json:"type,omitempty"`
454
455
456
457
458
459
460
461 ForceSendFields []string `json:"-"`
462
463
464
465
466
467
468
469 NullFields []string `json:"-"`
470 }
471
472 func (s *Alert) MarshalJSON() ([]byte, error) {
473 type NoMethod Alert
474 raw := NoMethod(*s)
475 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
476 }
477
478 type Alerts struct {
479
480 Items []*Alert `json:"items,omitempty"`
481
482
483 Kind string `json:"kind,omitempty"`
484
485
486
487 googleapi.ServerResponse `json:"-"`
488
489
490
491
492
493
494
495 ForceSendFields []string `json:"-"`
496
497
498
499
500
501
502
503 NullFields []string `json:"-"`
504 }
505
506 func (s *Alerts) MarshalJSON() ([]byte, error) {
507 type NoMethod Alerts
508 raw := NoMethod(*s)
509 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
510 }
511
512 type CustomChannel struct {
513
514
515 Code string `json:"code,omitempty"`
516
517
518
519
520 Id string `json:"id,omitempty"`
521
522
523
524 Kind string `json:"kind,omitempty"`
525
526
527 Name string `json:"name,omitempty"`
528
529
530
531 TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"`
532
533
534
535 googleapi.ServerResponse `json:"-"`
536
537
538
539
540
541
542
543 ForceSendFields []string `json:"-"`
544
545
546
547
548
549
550
551 NullFields []string `json:"-"`
552 }
553
554 func (s *CustomChannel) MarshalJSON() ([]byte, error) {
555 type NoMethod CustomChannel
556 raw := NoMethod(*s)
557 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
558 }
559
560
561
562 type CustomChannelTargetingInfo struct {
563
564 AdsAppearOn string `json:"adsAppearOn,omitempty"`
565
566
567 Description string `json:"description,omitempty"`
568
569
570
571
572
573
574
575 Location string `json:"location,omitempty"`
576
577
578 SiteLanguage string `json:"siteLanguage,omitempty"`
579
580
581
582
583
584
585
586 ForceSendFields []string `json:"-"`
587
588
589
590
591
592
593
594 NullFields []string `json:"-"`
595 }
596
597 func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) {
598 type NoMethod CustomChannelTargetingInfo
599 raw := NoMethod(*s)
600 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
601 }
602
603 type CustomChannels struct {
604
605 Etag string `json:"etag,omitempty"`
606
607
608 Items []*CustomChannel `json:"items,omitempty"`
609
610
611
612 Kind string `json:"kind,omitempty"`
613
614
615
616
617 NextPageToken string `json:"nextPageToken,omitempty"`
618
619
620
621 googleapi.ServerResponse `json:"-"`
622
623
624
625
626
627
628
629 ForceSendFields []string `json:"-"`
630
631
632
633
634
635
636
637 NullFields []string `json:"-"`
638 }
639
640 func (s *CustomChannels) MarshalJSON() ([]byte, error) {
641 type NoMethod CustomChannels
642 raw := NoMethod(*s)
643 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
644 }
645
646 type Metadata struct {
647 Items []*ReportingMetadataEntry `json:"items,omitempty"`
648
649
650 Kind string `json:"kind,omitempty"`
651
652
653
654 googleapi.ServerResponse `json:"-"`
655
656
657
658
659
660
661
662 ForceSendFields []string `json:"-"`
663
664
665
666
667
668
669
670 NullFields []string `json:"-"`
671 }
672
673 func (s *Metadata) MarshalJSON() ([]byte, error) {
674 type NoMethod Metadata
675 raw := NoMethod(*s)
676 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
677 }
678
679 type PreferredDeal struct {
680
681 AdvertiserName string `json:"advertiserName,omitempty"`
682
683
684 BuyerNetworkName string `json:"buyerNetworkName,omitempty"`
685
686
687
688 CurrencyCode string `json:"currencyCode,omitempty"`
689
690
691
692
693 EndTime uint64 `json:"endTime,omitempty,string"`
694
695
696
697
698
699 FixedCpm int64 `json:"fixedCpm,omitempty,string"`
700
701
702 Id int64 `json:"id,omitempty,string"`
703
704
705
706 Kind string `json:"kind,omitempty"`
707
708
709
710
711 StartTime uint64 `json:"startTime,omitempty,string"`
712
713
714
715 googleapi.ServerResponse `json:"-"`
716
717
718
719
720
721
722
723 ForceSendFields []string `json:"-"`
724
725
726
727
728
729
730
731
732 NullFields []string `json:"-"`
733 }
734
735 func (s *PreferredDeal) MarshalJSON() ([]byte, error) {
736 type NoMethod PreferredDeal
737 raw := NoMethod(*s)
738 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
739 }
740
741 type PreferredDeals struct {
742
743 Items []*PreferredDeal `json:"items,omitempty"`
744
745
746
747 Kind string `json:"kind,omitempty"`
748
749
750
751 googleapi.ServerResponse `json:"-"`
752
753
754
755
756
757
758
759 ForceSendFields []string `json:"-"`
760
761
762
763
764
765
766
767 NullFields []string `json:"-"`
768 }
769
770 func (s *PreferredDeals) MarshalJSON() ([]byte, error) {
771 type NoMethod PreferredDeals
772 raw := NoMethod(*s)
773 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
774 }
775
776 type Report struct {
777
778
779
780 Averages []string `json:"averages,omitempty"`
781
782
783
784
785 Headers []*ReportHeaders `json:"headers,omitempty"`
786
787
788 Kind string `json:"kind,omitempty"`
789
790
791
792
793
794 Rows [][]string `json:"rows,omitempty"`
795
796
797
798
799 TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"`
800
801
802
803
804 Totals []string `json:"totals,omitempty"`
805
806
807 Warnings []string `json:"warnings,omitempty"`
808
809
810
811 googleapi.ServerResponse `json:"-"`
812
813
814
815
816
817
818
819 ForceSendFields []string `json:"-"`
820
821
822
823
824
825
826
827 NullFields []string `json:"-"`
828 }
829
830 func (s *Report) MarshalJSON() ([]byte, error) {
831 type NoMethod Report
832 raw := NoMethod(*s)
833 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
834 }
835
836 type ReportHeaders struct {
837
838
839 Currency string `json:"currency,omitempty"`
840
841
842 Name string `json:"name,omitempty"`
843
844
845
846 Type string `json:"type,omitempty"`
847
848
849
850
851
852
853
854 ForceSendFields []string `json:"-"`
855
856
857
858
859
860
861
862 NullFields []string `json:"-"`
863 }
864
865 func (s *ReportHeaders) MarshalJSON() ([]byte, error) {
866 type NoMethod ReportHeaders
867 raw := NoMethod(*s)
868 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
869 }
870
871 type ReportingMetadataEntry struct {
872
873
874
875 CompatibleDimensions []string `json:"compatibleDimensions,omitempty"`
876
877
878
879 CompatibleMetrics []string `json:"compatibleMetrics,omitempty"`
880
881
882
883 Id string `json:"id,omitempty"`
884
885
886
887 Kind string `json:"kind,omitempty"`
888
889
890
891
892
893
894 RequiredDimensions []string `json:"requiredDimensions,omitempty"`
895
896
897
898
899
900
901 RequiredMetrics []string `json:"requiredMetrics,omitempty"`
902
903
904
905 SupportedProducts []string `json:"supportedProducts,omitempty"`
906
907
908
909
910
911
912
913
914 ForceSendFields []string `json:"-"`
915
916
917
918
919
920
921
922
923 NullFields []string `json:"-"`
924 }
925
926 func (s *ReportingMetadataEntry) MarshalJSON() ([]byte, error) {
927 type NoMethod ReportingMetadataEntry
928 raw := NoMethod(*s)
929 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
930 }
931
932 type SavedReport struct {
933
934 Id string `json:"id,omitempty"`
935
936
937
938 Kind string `json:"kind,omitempty"`
939
940
941 Name string `json:"name,omitempty"`
942
943
944
945
946
947
948
949 ForceSendFields []string `json:"-"`
950
951
952
953
954
955
956
957 NullFields []string `json:"-"`
958 }
959
960 func (s *SavedReport) MarshalJSON() ([]byte, error) {
961 type NoMethod SavedReport
962 raw := NoMethod(*s)
963 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
964 }
965
966 type SavedReports struct {
967
968 Etag string `json:"etag,omitempty"`
969
970
971 Items []*SavedReport `json:"items,omitempty"`
972
973
974
975 Kind string `json:"kind,omitempty"`
976
977
978
979
980 NextPageToken string `json:"nextPageToken,omitempty"`
981
982
983
984 googleapi.ServerResponse `json:"-"`
985
986
987
988
989
990
991
992 ForceSendFields []string `json:"-"`
993
994
995
996
997
998
999
1000 NullFields []string `json:"-"`
1001 }
1002
1003 func (s *SavedReports) MarshalJSON() ([]byte, error) {
1004 type NoMethod SavedReports
1005 raw := NoMethod(*s)
1006 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1007 }
1008
1009 type UrlChannel struct {
1010
1011
1012
1013 Id string `json:"id,omitempty"`
1014
1015
1016
1017 Kind string `json:"kind,omitempty"`
1018
1019
1020
1021 UrlPattern string `json:"urlPattern,omitempty"`
1022
1023
1024
1025
1026
1027
1028
1029 ForceSendFields []string `json:"-"`
1030
1031
1032
1033
1034
1035
1036
1037 NullFields []string `json:"-"`
1038 }
1039
1040 func (s *UrlChannel) MarshalJSON() ([]byte, error) {
1041 type NoMethod UrlChannel
1042 raw := NoMethod(*s)
1043 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1044 }
1045
1046 type UrlChannels struct {
1047
1048 Etag string `json:"etag,omitempty"`
1049
1050
1051 Items []*UrlChannel `json:"items,omitempty"`
1052
1053
1054
1055 Kind string `json:"kind,omitempty"`
1056
1057
1058
1059
1060 NextPageToken string `json:"nextPageToken,omitempty"`
1061
1062
1063
1064 googleapi.ServerResponse `json:"-"`
1065
1066
1067
1068
1069
1070
1071
1072 ForceSendFields []string `json:"-"`
1073
1074
1075
1076
1077
1078
1079
1080 NullFields []string `json:"-"`
1081 }
1082
1083 func (s *UrlChannels) MarshalJSON() ([]byte, error) {
1084 type NoMethod UrlChannels
1085 raw := NoMethod(*s)
1086 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1087 }
1088
1089
1090
1091 type AccountsGetCall struct {
1092 s *Service
1093 accountId string
1094 urlParams_ gensupport.URLParams
1095 ifNoneMatch_ string
1096 ctx_ context.Context
1097 header_ http.Header
1098 }
1099
1100
1101 func (r *AccountsService) Get(accountId string) *AccountsGetCall {
1102 c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1103 c.accountId = accountId
1104 return c
1105 }
1106
1107
1108
1109
1110 func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
1111 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1112 return c
1113 }
1114
1115
1116
1117
1118
1119
1120 func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
1121 c.ifNoneMatch_ = entityTag
1122 return c
1123 }
1124
1125
1126
1127
1128 func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
1129 c.ctx_ = ctx
1130 return c
1131 }
1132
1133
1134
1135 func (c *AccountsGetCall) Header() http.Header {
1136 if c.header_ == nil {
1137 c.header_ = make(http.Header)
1138 }
1139 return c.header_
1140 }
1141
1142 func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
1143 reqHeaders := make(http.Header)
1144 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1145 for k, v := range c.header_ {
1146 reqHeaders[k] = v
1147 }
1148 reqHeaders.Set("User-Agent", c.s.userAgent())
1149 if c.ifNoneMatch_ != "" {
1150 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1151 }
1152 var body io.Reader = nil
1153 c.urlParams_.Set("alt", alt)
1154 c.urlParams_.Set("prettyPrint", "false")
1155 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}")
1156 urls += "?" + c.urlParams_.Encode()
1157 req, err := http.NewRequest("GET", urls, body)
1158 if err != nil {
1159 return nil, err
1160 }
1161 req.Header = reqHeaders
1162 googleapi.Expand(req.URL, map[string]string{
1163 "accountId": c.accountId,
1164 })
1165 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1166 }
1167
1168
1169
1170
1171
1172
1173
1174
1175 func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
1176 gensupport.SetOptions(c.urlParams_, opts...)
1177 res, err := c.doRequest("json")
1178 if res != nil && res.StatusCode == http.StatusNotModified {
1179 if res.Body != nil {
1180 res.Body.Close()
1181 }
1182 return nil, &googleapi.Error{
1183 Code: res.StatusCode,
1184 Header: res.Header,
1185 }
1186 }
1187 if err != nil {
1188 return nil, err
1189 }
1190 defer googleapi.CloseBody(res)
1191 if err := googleapi.CheckResponse(res); err != nil {
1192 return nil, err
1193 }
1194 ret := &Account{
1195 ServerResponse: googleapi.ServerResponse{
1196 Header: res.Header,
1197 HTTPStatusCode: res.StatusCode,
1198 },
1199 }
1200 target := &ret
1201 if err := gensupport.DecodeResponse(target, res); err != nil {
1202 return nil, err
1203 }
1204 return ret, nil
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230 }
1231
1232
1233
1234 type AccountsListCall struct {
1235 s *Service
1236 urlParams_ gensupport.URLParams
1237 ifNoneMatch_ string
1238 ctx_ context.Context
1239 header_ http.Header
1240 }
1241
1242
1243 func (r *AccountsService) List() *AccountsListCall {
1244 c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1245 return c
1246 }
1247
1248
1249
1250 func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
1251 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1252 return c
1253 }
1254
1255
1256
1257
1258
1259 func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
1260 c.urlParams_.Set("pageToken", pageToken)
1261 return c
1262 }
1263
1264
1265
1266
1267 func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
1268 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1269 return c
1270 }
1271
1272
1273
1274
1275
1276
1277 func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
1278 c.ifNoneMatch_ = entityTag
1279 return c
1280 }
1281
1282
1283
1284
1285 func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
1286 c.ctx_ = ctx
1287 return c
1288 }
1289
1290
1291
1292 func (c *AccountsListCall) Header() http.Header {
1293 if c.header_ == nil {
1294 c.header_ = make(http.Header)
1295 }
1296 return c.header_
1297 }
1298
1299 func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
1300 reqHeaders := make(http.Header)
1301 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1302 for k, v := range c.header_ {
1303 reqHeaders[k] = v
1304 }
1305 reqHeaders.Set("User-Agent", c.s.userAgent())
1306 if c.ifNoneMatch_ != "" {
1307 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1308 }
1309 var body io.Reader = nil
1310 c.urlParams_.Set("alt", alt)
1311 c.urlParams_.Set("prettyPrint", "false")
1312 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
1313 urls += "?" + c.urlParams_.Encode()
1314 req, err := http.NewRequest("GET", urls, body)
1315 if err != nil {
1316 return nil, err
1317 }
1318 req.Header = reqHeaders
1319 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1320 }
1321
1322
1323
1324
1325
1326
1327
1328
1329 func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*Accounts, error) {
1330 gensupport.SetOptions(c.urlParams_, opts...)
1331 res, err := c.doRequest("json")
1332 if res != nil && res.StatusCode == http.StatusNotModified {
1333 if res.Body != nil {
1334 res.Body.Close()
1335 }
1336 return nil, &googleapi.Error{
1337 Code: res.StatusCode,
1338 Header: res.Header,
1339 }
1340 }
1341 if err != nil {
1342 return nil, err
1343 }
1344 defer googleapi.CloseBody(res)
1345 if err := googleapi.CheckResponse(res); err != nil {
1346 return nil, err
1347 }
1348 ret := &Accounts{
1349 ServerResponse: googleapi.ServerResponse{
1350 Header: res.Header,
1351 HTTPStatusCode: res.StatusCode,
1352 },
1353 }
1354 target := &ret
1355 if err := gensupport.DecodeResponse(target, res); err != nil {
1356 return nil, err
1357 }
1358 return ret, nil
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388 }
1389
1390
1391
1392
1393 func (c *AccountsListCall) Pages(ctx context.Context, f func(*Accounts) error) error {
1394 c.ctx_ = ctx
1395 defer c.PageToken(c.urlParams_.Get("pageToken"))
1396 for {
1397 x, err := c.Do()
1398 if err != nil {
1399 return err
1400 }
1401 if err := f(x); err != nil {
1402 return err
1403 }
1404 if x.NextPageToken == "" {
1405 return nil
1406 }
1407 c.PageToken(x.NextPageToken)
1408 }
1409 }
1410
1411
1412
1413 type AccountsAdclientsListCall struct {
1414 s *Service
1415 accountId string
1416 urlParams_ gensupport.URLParams
1417 ifNoneMatch_ string
1418 ctx_ context.Context
1419 header_ http.Header
1420 }
1421
1422
1423 func (r *AccountsAdclientsService) List(accountId string) *AccountsAdclientsListCall {
1424 c := &AccountsAdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1425 c.accountId = accountId
1426 return c
1427 }
1428
1429
1430
1431 func (c *AccountsAdclientsListCall) MaxResults(maxResults int64) *AccountsAdclientsListCall {
1432 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1433 return c
1434 }
1435
1436
1437
1438
1439
1440 func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall {
1441 c.urlParams_.Set("pageToken", pageToken)
1442 return c
1443 }
1444
1445
1446
1447
1448 func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall {
1449 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1450 return c
1451 }
1452
1453
1454
1455
1456
1457
1458 func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall {
1459 c.ifNoneMatch_ = entityTag
1460 return c
1461 }
1462
1463
1464
1465
1466 func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall {
1467 c.ctx_ = ctx
1468 return c
1469 }
1470
1471
1472
1473 func (c *AccountsAdclientsListCall) Header() http.Header {
1474 if c.header_ == nil {
1475 c.header_ = make(http.Header)
1476 }
1477 return c.header_
1478 }
1479
1480 func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) {
1481 reqHeaders := make(http.Header)
1482 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1483 for k, v := range c.header_ {
1484 reqHeaders[k] = v
1485 }
1486 reqHeaders.Set("User-Agent", c.s.userAgent())
1487 if c.ifNoneMatch_ != "" {
1488 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1489 }
1490 var body io.Reader = nil
1491 c.urlParams_.Set("alt", alt)
1492 c.urlParams_.Set("prettyPrint", "false")
1493 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients")
1494 urls += "?" + c.urlParams_.Encode()
1495 req, err := http.NewRequest("GET", urls, body)
1496 if err != nil {
1497 return nil, err
1498 }
1499 req.Header = reqHeaders
1500 googleapi.Expand(req.URL, map[string]string{
1501 "accountId": c.accountId,
1502 })
1503 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1504 }
1505
1506
1507
1508
1509
1510
1511
1512
1513 func (c *AccountsAdclientsListCall) Do(opts ...googleapi.CallOption) (*AdClients, error) {
1514 gensupport.SetOptions(c.urlParams_, opts...)
1515 res, err := c.doRequest("json")
1516 if res != nil && res.StatusCode == http.StatusNotModified {
1517 if res.Body != nil {
1518 res.Body.Close()
1519 }
1520 return nil, &googleapi.Error{
1521 Code: res.StatusCode,
1522 Header: res.Header,
1523 }
1524 }
1525 if err != nil {
1526 return nil, err
1527 }
1528 defer googleapi.CloseBody(res)
1529 if err := googleapi.CheckResponse(res); err != nil {
1530 return nil, err
1531 }
1532 ret := &AdClients{
1533 ServerResponse: googleapi.ServerResponse{
1534 Header: res.Header,
1535 HTTPStatusCode: res.StatusCode,
1536 },
1537 }
1538 target := &ret
1539 if err := gensupport.DecodeResponse(target, res); err != nil {
1540 return nil, err
1541 }
1542 return ret, nil
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581 }
1582
1583
1584
1585
1586 func (c *AccountsAdclientsListCall) Pages(ctx context.Context, f func(*AdClients) error) error {
1587 c.ctx_ = ctx
1588 defer c.PageToken(c.urlParams_.Get("pageToken"))
1589 for {
1590 x, err := c.Do()
1591 if err != nil {
1592 return err
1593 }
1594 if err := f(x); err != nil {
1595 return err
1596 }
1597 if x.NextPageToken == "" {
1598 return nil
1599 }
1600 c.PageToken(x.NextPageToken)
1601 }
1602 }
1603
1604
1605
1606 type AccountsAlertsListCall struct {
1607 s *Service
1608 accountId string
1609 urlParams_ gensupport.URLParams
1610 ifNoneMatch_ string
1611 ctx_ context.Context
1612 header_ http.Header
1613 }
1614
1615
1616 func (r *AccountsAlertsService) List(accountId string) *AccountsAlertsListCall {
1617 c := &AccountsAlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1618 c.accountId = accountId
1619 return c
1620 }
1621
1622
1623
1624
1625
1626 func (c *AccountsAlertsListCall) Locale(locale string) *AccountsAlertsListCall {
1627 c.urlParams_.Set("locale", locale)
1628 return c
1629 }
1630
1631
1632
1633
1634 func (c *AccountsAlertsListCall) Fields(s ...googleapi.Field) *AccountsAlertsListCall {
1635 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1636 return c
1637 }
1638
1639
1640
1641
1642
1643
1644 func (c *AccountsAlertsListCall) IfNoneMatch(entityTag string) *AccountsAlertsListCall {
1645 c.ifNoneMatch_ = entityTag
1646 return c
1647 }
1648
1649
1650
1651
1652 func (c *AccountsAlertsListCall) Context(ctx context.Context) *AccountsAlertsListCall {
1653 c.ctx_ = ctx
1654 return c
1655 }
1656
1657
1658
1659 func (c *AccountsAlertsListCall) Header() http.Header {
1660 if c.header_ == nil {
1661 c.header_ = make(http.Header)
1662 }
1663 return c.header_
1664 }
1665
1666 func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) {
1667 reqHeaders := make(http.Header)
1668 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1669 for k, v := range c.header_ {
1670 reqHeaders[k] = v
1671 }
1672 reqHeaders.Set("User-Agent", c.s.userAgent())
1673 if c.ifNoneMatch_ != "" {
1674 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1675 }
1676 var body io.Reader = nil
1677 c.urlParams_.Set("alt", alt)
1678 c.urlParams_.Set("prettyPrint", "false")
1679 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts")
1680 urls += "?" + c.urlParams_.Encode()
1681 req, err := http.NewRequest("GET", urls, body)
1682 if err != nil {
1683 return nil, err
1684 }
1685 req.Header = reqHeaders
1686 googleapi.Expand(req.URL, map[string]string{
1687 "accountId": c.accountId,
1688 })
1689 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1690 }
1691
1692
1693
1694
1695
1696
1697
1698
1699 func (c *AccountsAlertsListCall) Do(opts ...googleapi.CallOption) (*Alerts, error) {
1700 gensupport.SetOptions(c.urlParams_, opts...)
1701 res, err := c.doRequest("json")
1702 if res != nil && res.StatusCode == http.StatusNotModified {
1703 if res.Body != nil {
1704 res.Body.Close()
1705 }
1706 return nil, &googleapi.Error{
1707 Code: res.StatusCode,
1708 Header: res.Header,
1709 }
1710 }
1711 if err != nil {
1712 return nil, err
1713 }
1714 defer googleapi.CloseBody(res)
1715 if err := googleapi.CheckResponse(res); err != nil {
1716 return nil, err
1717 }
1718 ret := &Alerts{
1719 ServerResponse: googleapi.ServerResponse{
1720 Header: res.Header,
1721 HTTPStatusCode: res.StatusCode,
1722 },
1723 }
1724 target := &ret
1725 if err := gensupport.DecodeResponse(target, res); err != nil {
1726 return nil, err
1727 }
1728 return ret, nil
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759 }
1760
1761
1762
1763 type AccountsCustomchannelsGetCall struct {
1764 s *Service
1765 accountId string
1766 adClientId string
1767 customChannelId string
1768 urlParams_ gensupport.URLParams
1769 ifNoneMatch_ string
1770 ctx_ context.Context
1771 header_ http.Header
1772 }
1773
1774
1775 func (r *AccountsCustomchannelsService) Get(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsGetCall {
1776 c := &AccountsCustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1777 c.accountId = accountId
1778 c.adClientId = adClientId
1779 c.customChannelId = customChannelId
1780 return c
1781 }
1782
1783
1784
1785
1786 func (c *AccountsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsGetCall {
1787 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1788 return c
1789 }
1790
1791
1792
1793
1794
1795
1796 func (c *AccountsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsGetCall {
1797 c.ifNoneMatch_ = entityTag
1798 return c
1799 }
1800
1801
1802
1803
1804 func (c *AccountsCustomchannelsGetCall) Context(ctx context.Context) *AccountsCustomchannelsGetCall {
1805 c.ctx_ = ctx
1806 return c
1807 }
1808
1809
1810
1811 func (c *AccountsCustomchannelsGetCall) Header() http.Header {
1812 if c.header_ == nil {
1813 c.header_ = make(http.Header)
1814 }
1815 return c.header_
1816 }
1817
1818 func (c *AccountsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
1819 reqHeaders := make(http.Header)
1820 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1821 for k, v := range c.header_ {
1822 reqHeaders[k] = v
1823 }
1824 reqHeaders.Set("User-Agent", c.s.userAgent())
1825 if c.ifNoneMatch_ != "" {
1826 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1827 }
1828 var body io.Reader = nil
1829 c.urlParams_.Set("alt", alt)
1830 c.urlParams_.Set("prettyPrint", "false")
1831 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}")
1832 urls += "?" + c.urlParams_.Encode()
1833 req, err := http.NewRequest("GET", urls, body)
1834 if err != nil {
1835 return nil, err
1836 }
1837 req.Header = reqHeaders
1838 googleapi.Expand(req.URL, map[string]string{
1839 "accountId": c.accountId,
1840 "adClientId": c.adClientId,
1841 "customChannelId": c.customChannelId,
1842 })
1843 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1844 }
1845
1846
1847
1848
1849
1850
1851
1852
1853 func (c *AccountsCustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
1854 gensupport.SetOptions(c.urlParams_, opts...)
1855 res, err := c.doRequest("json")
1856 if res != nil && res.StatusCode == http.StatusNotModified {
1857 if res.Body != nil {
1858 res.Body.Close()
1859 }
1860 return nil, &googleapi.Error{
1861 Code: res.StatusCode,
1862 Header: res.Header,
1863 }
1864 }
1865 if err != nil {
1866 return nil, err
1867 }
1868 defer googleapi.CloseBody(res)
1869 if err := googleapi.CheckResponse(res); err != nil {
1870 return nil, err
1871 }
1872 ret := &CustomChannel{
1873 ServerResponse: googleapi.ServerResponse{
1874 Header: res.Header,
1875 HTTPStatusCode: res.StatusCode,
1876 },
1877 }
1878 target := &ret
1879 if err := gensupport.DecodeResponse(target, res); err != nil {
1880 return nil, err
1881 }
1882 return ret, nil
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922 }
1923
1924
1925
1926 type AccountsCustomchannelsListCall struct {
1927 s *Service
1928 accountId string
1929 adClientId string
1930 urlParams_ gensupport.URLParams
1931 ifNoneMatch_ string
1932 ctx_ context.Context
1933 header_ http.Header
1934 }
1935
1936
1937
1938 func (r *AccountsCustomchannelsService) List(accountId string, adClientId string) *AccountsCustomchannelsListCall {
1939 c := &AccountsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1940 c.accountId = accountId
1941 c.adClientId = adClientId
1942 return c
1943 }
1944
1945
1946
1947
1948 func (c *AccountsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsListCall {
1949 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1950 return c
1951 }
1952
1953
1954
1955
1956
1957 func (c *AccountsCustomchannelsListCall) PageToken(pageToken string) *AccountsCustomchannelsListCall {
1958 c.urlParams_.Set("pageToken", pageToken)
1959 return c
1960 }
1961
1962
1963
1964
1965 func (c *AccountsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsListCall {
1966 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1967 return c
1968 }
1969
1970
1971
1972
1973
1974
1975 func (c *AccountsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsListCall {
1976 c.ifNoneMatch_ = entityTag
1977 return c
1978 }
1979
1980
1981
1982
1983 func (c *AccountsCustomchannelsListCall) Context(ctx context.Context) *AccountsCustomchannelsListCall {
1984 c.ctx_ = ctx
1985 return c
1986 }
1987
1988
1989
1990 func (c *AccountsCustomchannelsListCall) Header() http.Header {
1991 if c.header_ == nil {
1992 c.header_ = make(http.Header)
1993 }
1994 return c.header_
1995 }
1996
1997 func (c *AccountsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
1998 reqHeaders := make(http.Header)
1999 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2000 for k, v := range c.header_ {
2001 reqHeaders[k] = v
2002 }
2003 reqHeaders.Set("User-Agent", c.s.userAgent())
2004 if c.ifNoneMatch_ != "" {
2005 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2006 }
2007 var body io.Reader = nil
2008 c.urlParams_.Set("alt", alt)
2009 c.urlParams_.Set("prettyPrint", "false")
2010 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels")
2011 urls += "?" + c.urlParams_.Encode()
2012 req, err := http.NewRequest("GET", urls, body)
2013 if err != nil {
2014 return nil, err
2015 }
2016 req.Header = reqHeaders
2017 googleapi.Expand(req.URL, map[string]string{
2018 "accountId": c.accountId,
2019 "adClientId": c.adClientId,
2020 })
2021 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2022 }
2023
2024
2025
2026
2027
2028
2029
2030
2031 func (c *AccountsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
2032 gensupport.SetOptions(c.urlParams_, opts...)
2033 res, err := c.doRequest("json")
2034 if res != nil && res.StatusCode == http.StatusNotModified {
2035 if res.Body != nil {
2036 res.Body.Close()
2037 }
2038 return nil, &googleapi.Error{
2039 Code: res.StatusCode,
2040 Header: res.Header,
2041 }
2042 }
2043 if err != nil {
2044 return nil, err
2045 }
2046 defer googleapi.CloseBody(res)
2047 if err := googleapi.CheckResponse(res); err != nil {
2048 return nil, err
2049 }
2050 ret := &CustomChannels{
2051 ServerResponse: googleapi.ServerResponse{
2052 Header: res.Header,
2053 HTTPStatusCode: res.StatusCode,
2054 },
2055 }
2056 target := &ret
2057 if err := gensupport.DecodeResponse(target, res); err != nil {
2058 return nil, err
2059 }
2060 return ret, nil
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106 }
2107
2108
2109
2110
2111 func (c *AccountsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
2112 c.ctx_ = ctx
2113 defer c.PageToken(c.urlParams_.Get("pageToken"))
2114 for {
2115 x, err := c.Do()
2116 if err != nil {
2117 return err
2118 }
2119 if err := f(x); err != nil {
2120 return err
2121 }
2122 if x.NextPageToken == "" {
2123 return nil
2124 }
2125 c.PageToken(x.NextPageToken)
2126 }
2127 }
2128
2129
2130
2131 type AccountsMetadataDimensionsListCall struct {
2132 s *Service
2133 accountId string
2134 urlParams_ gensupport.URLParams
2135 ifNoneMatch_ string
2136 ctx_ context.Context
2137 header_ http.Header
2138 }
2139
2140
2141
2142 func (r *AccountsMetadataDimensionsService) List(accountId string) *AccountsMetadataDimensionsListCall {
2143 c := &AccountsMetadataDimensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2144 c.accountId = accountId
2145 return c
2146 }
2147
2148
2149
2150
2151 func (c *AccountsMetadataDimensionsListCall) Fields(s ...googleapi.Field) *AccountsMetadataDimensionsListCall {
2152 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2153 return c
2154 }
2155
2156
2157
2158
2159
2160
2161 func (c *AccountsMetadataDimensionsListCall) IfNoneMatch(entityTag string) *AccountsMetadataDimensionsListCall {
2162 c.ifNoneMatch_ = entityTag
2163 return c
2164 }
2165
2166
2167
2168
2169 func (c *AccountsMetadataDimensionsListCall) Context(ctx context.Context) *AccountsMetadataDimensionsListCall {
2170 c.ctx_ = ctx
2171 return c
2172 }
2173
2174
2175
2176 func (c *AccountsMetadataDimensionsListCall) Header() http.Header {
2177 if c.header_ == nil {
2178 c.header_ = make(http.Header)
2179 }
2180 return c.header_
2181 }
2182
2183 func (c *AccountsMetadataDimensionsListCall) doRequest(alt string) (*http.Response, error) {
2184 reqHeaders := make(http.Header)
2185 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2186 for k, v := range c.header_ {
2187 reqHeaders[k] = v
2188 }
2189 reqHeaders.Set("User-Agent", c.s.userAgent())
2190 if c.ifNoneMatch_ != "" {
2191 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2192 }
2193 var body io.Reader = nil
2194 c.urlParams_.Set("alt", alt)
2195 c.urlParams_.Set("prettyPrint", "false")
2196 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/metadata/dimensions")
2197 urls += "?" + c.urlParams_.Encode()
2198 req, err := http.NewRequest("GET", urls, body)
2199 if err != nil {
2200 return nil, err
2201 }
2202 req.Header = reqHeaders
2203 googleapi.Expand(req.URL, map[string]string{
2204 "accountId": c.accountId,
2205 })
2206 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2207 }
2208
2209
2210
2211
2212
2213
2214
2215
2216 func (c *AccountsMetadataDimensionsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
2217 gensupport.SetOptions(c.urlParams_, opts...)
2218 res, err := c.doRequest("json")
2219 if res != nil && res.StatusCode == http.StatusNotModified {
2220 if res.Body != nil {
2221 res.Body.Close()
2222 }
2223 return nil, &googleapi.Error{
2224 Code: res.StatusCode,
2225 Header: res.Header,
2226 }
2227 }
2228 if err != nil {
2229 return nil, err
2230 }
2231 defer googleapi.CloseBody(res)
2232 if err := googleapi.CheckResponse(res); err != nil {
2233 return nil, err
2234 }
2235 ret := &Metadata{
2236 ServerResponse: googleapi.ServerResponse{
2237 Header: res.Header,
2238 HTTPStatusCode: res.StatusCode,
2239 },
2240 }
2241 target := &ret
2242 if err := gensupport.DecodeResponse(target, res); err != nil {
2243 return nil, err
2244 }
2245 return ret, nil
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271 }
2272
2273
2274
2275 type AccountsMetadataMetricsListCall struct {
2276 s *Service
2277 accountId string
2278 urlParams_ gensupport.URLParams
2279 ifNoneMatch_ string
2280 ctx_ context.Context
2281 header_ http.Header
2282 }
2283
2284
2285
2286 func (r *AccountsMetadataMetricsService) List(accountId string) *AccountsMetadataMetricsListCall {
2287 c := &AccountsMetadataMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2288 c.accountId = accountId
2289 return c
2290 }
2291
2292
2293
2294
2295 func (c *AccountsMetadataMetricsListCall) Fields(s ...googleapi.Field) *AccountsMetadataMetricsListCall {
2296 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2297 return c
2298 }
2299
2300
2301
2302
2303
2304
2305 func (c *AccountsMetadataMetricsListCall) IfNoneMatch(entityTag string) *AccountsMetadataMetricsListCall {
2306 c.ifNoneMatch_ = entityTag
2307 return c
2308 }
2309
2310
2311
2312
2313 func (c *AccountsMetadataMetricsListCall) Context(ctx context.Context) *AccountsMetadataMetricsListCall {
2314 c.ctx_ = ctx
2315 return c
2316 }
2317
2318
2319
2320 func (c *AccountsMetadataMetricsListCall) Header() http.Header {
2321 if c.header_ == nil {
2322 c.header_ = make(http.Header)
2323 }
2324 return c.header_
2325 }
2326
2327 func (c *AccountsMetadataMetricsListCall) doRequest(alt string) (*http.Response, error) {
2328 reqHeaders := make(http.Header)
2329 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2330 for k, v := range c.header_ {
2331 reqHeaders[k] = v
2332 }
2333 reqHeaders.Set("User-Agent", c.s.userAgent())
2334 if c.ifNoneMatch_ != "" {
2335 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2336 }
2337 var body io.Reader = nil
2338 c.urlParams_.Set("alt", alt)
2339 c.urlParams_.Set("prettyPrint", "false")
2340 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/metadata/metrics")
2341 urls += "?" + c.urlParams_.Encode()
2342 req, err := http.NewRequest("GET", urls, body)
2343 if err != nil {
2344 return nil, err
2345 }
2346 req.Header = reqHeaders
2347 googleapi.Expand(req.URL, map[string]string{
2348 "accountId": c.accountId,
2349 })
2350 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2351 }
2352
2353
2354
2355
2356
2357
2358
2359
2360 func (c *AccountsMetadataMetricsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
2361 gensupport.SetOptions(c.urlParams_, opts...)
2362 res, err := c.doRequest("json")
2363 if res != nil && res.StatusCode == http.StatusNotModified {
2364 if res.Body != nil {
2365 res.Body.Close()
2366 }
2367 return nil, &googleapi.Error{
2368 Code: res.StatusCode,
2369 Header: res.Header,
2370 }
2371 }
2372 if err != nil {
2373 return nil, err
2374 }
2375 defer googleapi.CloseBody(res)
2376 if err := googleapi.CheckResponse(res); err != nil {
2377 return nil, err
2378 }
2379 ret := &Metadata{
2380 ServerResponse: googleapi.ServerResponse{
2381 Header: res.Header,
2382 HTTPStatusCode: res.StatusCode,
2383 },
2384 }
2385 target := &ret
2386 if err := gensupport.DecodeResponse(target, res); err != nil {
2387 return nil, err
2388 }
2389 return ret, nil
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415 }
2416
2417
2418
2419 type AccountsPreferreddealsGetCall struct {
2420 s *Service
2421 accountId string
2422 dealId string
2423 urlParams_ gensupport.URLParams
2424 ifNoneMatch_ string
2425 ctx_ context.Context
2426 header_ http.Header
2427 }
2428
2429
2430 func (r *AccountsPreferreddealsService) Get(accountId string, dealId string) *AccountsPreferreddealsGetCall {
2431 c := &AccountsPreferreddealsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2432 c.accountId = accountId
2433 c.dealId = dealId
2434 return c
2435 }
2436
2437
2438
2439
2440 func (c *AccountsPreferreddealsGetCall) Fields(s ...googleapi.Field) *AccountsPreferreddealsGetCall {
2441 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2442 return c
2443 }
2444
2445
2446
2447
2448
2449
2450 func (c *AccountsPreferreddealsGetCall) IfNoneMatch(entityTag string) *AccountsPreferreddealsGetCall {
2451 c.ifNoneMatch_ = entityTag
2452 return c
2453 }
2454
2455
2456
2457
2458 func (c *AccountsPreferreddealsGetCall) Context(ctx context.Context) *AccountsPreferreddealsGetCall {
2459 c.ctx_ = ctx
2460 return c
2461 }
2462
2463
2464
2465 func (c *AccountsPreferreddealsGetCall) Header() http.Header {
2466 if c.header_ == nil {
2467 c.header_ = make(http.Header)
2468 }
2469 return c.header_
2470 }
2471
2472 func (c *AccountsPreferreddealsGetCall) doRequest(alt string) (*http.Response, error) {
2473 reqHeaders := make(http.Header)
2474 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2475 for k, v := range c.header_ {
2476 reqHeaders[k] = v
2477 }
2478 reqHeaders.Set("User-Agent", c.s.userAgent())
2479 if c.ifNoneMatch_ != "" {
2480 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2481 }
2482 var body io.Reader = nil
2483 c.urlParams_.Set("alt", alt)
2484 c.urlParams_.Set("prettyPrint", "false")
2485 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/preferreddeals/{dealId}")
2486 urls += "?" + c.urlParams_.Encode()
2487 req, err := http.NewRequest("GET", urls, body)
2488 if err != nil {
2489 return nil, err
2490 }
2491 req.Header = reqHeaders
2492 googleapi.Expand(req.URL, map[string]string{
2493 "accountId": c.accountId,
2494 "dealId": c.dealId,
2495 })
2496 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2497 }
2498
2499
2500
2501
2502
2503
2504
2505
2506 func (c *AccountsPreferreddealsGetCall) Do(opts ...googleapi.CallOption) (*PreferredDeal, error) {
2507 gensupport.SetOptions(c.urlParams_, opts...)
2508 res, err := c.doRequest("json")
2509 if res != nil && res.StatusCode == http.StatusNotModified {
2510 if res.Body != nil {
2511 res.Body.Close()
2512 }
2513 return nil, &googleapi.Error{
2514 Code: res.StatusCode,
2515 Header: res.Header,
2516 }
2517 }
2518 if err != nil {
2519 return nil, err
2520 }
2521 defer googleapi.CloseBody(res)
2522 if err := googleapi.CheckResponse(res); err != nil {
2523 return nil, err
2524 }
2525 ret := &PreferredDeal{
2526 ServerResponse: googleapi.ServerResponse{
2527 Header: res.Header,
2528 HTTPStatusCode: res.StatusCode,
2529 },
2530 }
2531 target := &ret
2532 if err := gensupport.DecodeResponse(target, res); err != nil {
2533 return nil, err
2534 }
2535 return ret, nil
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568 }
2569
2570
2571
2572 type AccountsPreferreddealsListCall struct {
2573 s *Service
2574 accountId string
2575 urlParams_ gensupport.URLParams
2576 ifNoneMatch_ string
2577 ctx_ context.Context
2578 header_ http.Header
2579 }
2580
2581
2582 func (r *AccountsPreferreddealsService) List(accountId string) *AccountsPreferreddealsListCall {
2583 c := &AccountsPreferreddealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2584 c.accountId = accountId
2585 return c
2586 }
2587
2588
2589
2590
2591 func (c *AccountsPreferreddealsListCall) Fields(s ...googleapi.Field) *AccountsPreferreddealsListCall {
2592 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2593 return c
2594 }
2595
2596
2597
2598
2599
2600
2601 func (c *AccountsPreferreddealsListCall) IfNoneMatch(entityTag string) *AccountsPreferreddealsListCall {
2602 c.ifNoneMatch_ = entityTag
2603 return c
2604 }
2605
2606
2607
2608
2609 func (c *AccountsPreferreddealsListCall) Context(ctx context.Context) *AccountsPreferreddealsListCall {
2610 c.ctx_ = ctx
2611 return c
2612 }
2613
2614
2615
2616 func (c *AccountsPreferreddealsListCall) Header() http.Header {
2617 if c.header_ == nil {
2618 c.header_ = make(http.Header)
2619 }
2620 return c.header_
2621 }
2622
2623 func (c *AccountsPreferreddealsListCall) doRequest(alt string) (*http.Response, error) {
2624 reqHeaders := make(http.Header)
2625 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2626 for k, v := range c.header_ {
2627 reqHeaders[k] = v
2628 }
2629 reqHeaders.Set("User-Agent", c.s.userAgent())
2630 if c.ifNoneMatch_ != "" {
2631 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2632 }
2633 var body io.Reader = nil
2634 c.urlParams_.Set("alt", alt)
2635 c.urlParams_.Set("prettyPrint", "false")
2636 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/preferreddeals")
2637 urls += "?" + c.urlParams_.Encode()
2638 req, err := http.NewRequest("GET", urls, body)
2639 if err != nil {
2640 return nil, err
2641 }
2642 req.Header = reqHeaders
2643 googleapi.Expand(req.URL, map[string]string{
2644 "accountId": c.accountId,
2645 })
2646 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2647 }
2648
2649
2650
2651
2652
2653
2654
2655
2656 func (c *AccountsPreferreddealsListCall) Do(opts ...googleapi.CallOption) (*PreferredDeals, error) {
2657 gensupport.SetOptions(c.urlParams_, opts...)
2658 res, err := c.doRequest("json")
2659 if res != nil && res.StatusCode == http.StatusNotModified {
2660 if res.Body != nil {
2661 res.Body.Close()
2662 }
2663 return nil, &googleapi.Error{
2664 Code: res.StatusCode,
2665 Header: res.Header,
2666 }
2667 }
2668 if err != nil {
2669 return nil, err
2670 }
2671 defer googleapi.CloseBody(res)
2672 if err := googleapi.CheckResponse(res); err != nil {
2673 return nil, err
2674 }
2675 ret := &PreferredDeals{
2676 ServerResponse: googleapi.ServerResponse{
2677 Header: res.Header,
2678 HTTPStatusCode: res.StatusCode,
2679 },
2680 }
2681 target := &ret
2682 if err := gensupport.DecodeResponse(target, res); err != nil {
2683 return nil, err
2684 }
2685 return ret, nil
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711 }
2712
2713
2714
2715 type AccountsReportsGenerateCall struct {
2716 s *Service
2717 accountId string
2718 urlParams_ gensupport.URLParams
2719 ifNoneMatch_ string
2720 ctx_ context.Context
2721 header_ http.Header
2722 }
2723
2724
2725
2726
2727 func (r *AccountsReportsService) Generate(accountId string, startDate string, endDate string) *AccountsReportsGenerateCall {
2728 c := &AccountsReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2729 c.accountId = accountId
2730 c.urlParams_.Set("startDate", startDate)
2731 c.urlParams_.Set("endDate", endDate)
2732 return c
2733 }
2734
2735
2736
2737 func (c *AccountsReportsGenerateCall) Dimension(dimension ...string) *AccountsReportsGenerateCall {
2738 c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
2739 return c
2740 }
2741
2742
2743
2744 func (c *AccountsReportsGenerateCall) Filter(filter ...string) *AccountsReportsGenerateCall {
2745 c.urlParams_.SetMulti("filter", append([]string{}, filter...))
2746 return c
2747 }
2748
2749
2750
2751
2752 func (c *AccountsReportsGenerateCall) Locale(locale string) *AccountsReportsGenerateCall {
2753 c.urlParams_.Set("locale", locale)
2754 return c
2755 }
2756
2757
2758
2759 func (c *AccountsReportsGenerateCall) MaxResults(maxResults int64) *AccountsReportsGenerateCall {
2760 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2761 return c
2762 }
2763
2764
2765
2766 func (c *AccountsReportsGenerateCall) Metric(metric ...string) *AccountsReportsGenerateCall {
2767 c.urlParams_.SetMulti("metric", append([]string{}, metric...))
2768 return c
2769 }
2770
2771
2772
2773
2774
2775 func (c *AccountsReportsGenerateCall) Sort(sort ...string) *AccountsReportsGenerateCall {
2776 c.urlParams_.SetMulti("sort", append([]string{}, sort...))
2777 return c
2778 }
2779
2780
2781
2782 func (c *AccountsReportsGenerateCall) StartIndex(startIndex int64) *AccountsReportsGenerateCall {
2783 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
2784 return c
2785 }
2786
2787
2788
2789
2790 func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall {
2791 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2792 return c
2793 }
2794
2795
2796
2797
2798
2799
2800 func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall {
2801 c.ifNoneMatch_ = entityTag
2802 return c
2803 }
2804
2805
2806
2807
2808 func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall {
2809 c.ctx_ = ctx
2810 return c
2811 }
2812
2813
2814
2815 func (c *AccountsReportsGenerateCall) Header() http.Header {
2816 if c.header_ == nil {
2817 c.header_ = make(http.Header)
2818 }
2819 return c.header_
2820 }
2821
2822 func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
2823 reqHeaders := make(http.Header)
2824 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2825 for k, v := range c.header_ {
2826 reqHeaders[k] = v
2827 }
2828 reqHeaders.Set("User-Agent", c.s.userAgent())
2829 if c.ifNoneMatch_ != "" {
2830 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2831 }
2832 var body io.Reader = nil
2833 c.urlParams_.Set("alt", alt)
2834 c.urlParams_.Set("prettyPrint", "false")
2835 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports")
2836 urls += "?" + c.urlParams_.Encode()
2837 req, err := http.NewRequest("GET", urls, body)
2838 if err != nil {
2839 return nil, err
2840 }
2841 req.Header = reqHeaders
2842 googleapi.Expand(req.URL, map[string]string{
2843 "accountId": c.accountId,
2844 })
2845 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2846 }
2847
2848
2849
2850
2851 func (c *AccountsReportsGenerateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
2852 gensupport.SetOptions(c.urlParams_, opts...)
2853 res, err := c.doRequest("media")
2854 if err != nil {
2855 return nil, err
2856 }
2857 if err := googleapi.CheckMediaResponse(res); err != nil {
2858 res.Body.Close()
2859 return nil, err
2860 }
2861 return res, nil
2862 }
2863
2864
2865
2866
2867
2868
2869
2870
2871 func (c *AccountsReportsGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
2872 gensupport.SetOptions(c.urlParams_, opts...)
2873 res, err := c.doRequest("json")
2874 if res != nil && res.StatusCode == http.StatusNotModified {
2875 if res.Body != nil {
2876 res.Body.Close()
2877 }
2878 return nil, &googleapi.Error{
2879 Code: res.StatusCode,
2880 Header: res.Header,
2881 }
2882 }
2883 if err != nil {
2884 return nil, err
2885 }
2886 defer googleapi.CloseBody(res)
2887 if err := googleapi.CheckResponse(res); err != nil {
2888 return nil, err
2889 }
2890 ret := &Report{
2891 ServerResponse: googleapi.ServerResponse{
2892 Header: res.Header,
2893 HTTPStatusCode: res.StatusCode,
2894 },
2895 }
2896 target := &ret
2897 if err := gensupport.DecodeResponse(target, res); err != nil {
2898 return nil, err
2899 }
2900 return ret, nil
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993 }
2994
2995
2996
2997 type AccountsReportsSavedGenerateCall struct {
2998 s *Service
2999 accountId string
3000 savedReportId string
3001 urlParams_ gensupport.URLParams
3002 ifNoneMatch_ string
3003 ctx_ context.Context
3004 header_ http.Header
3005 }
3006
3007
3008
3009 func (r *AccountsReportsSavedService) Generate(accountId string, savedReportId string) *AccountsReportsSavedGenerateCall {
3010 c := &AccountsReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3011 c.accountId = accountId
3012 c.savedReportId = savedReportId
3013 return c
3014 }
3015
3016
3017
3018
3019 func (c *AccountsReportsSavedGenerateCall) Locale(locale string) *AccountsReportsSavedGenerateCall {
3020 c.urlParams_.Set("locale", locale)
3021 return c
3022 }
3023
3024
3025
3026 func (c *AccountsReportsSavedGenerateCall) MaxResults(maxResults int64) *AccountsReportsSavedGenerateCall {
3027 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3028 return c
3029 }
3030
3031
3032
3033 func (c *AccountsReportsSavedGenerateCall) StartIndex(startIndex int64) *AccountsReportsSavedGenerateCall {
3034 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
3035 return c
3036 }
3037
3038
3039
3040
3041 func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall {
3042 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3043 return c
3044 }
3045
3046
3047
3048
3049
3050
3051 func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall {
3052 c.ifNoneMatch_ = entityTag
3053 return c
3054 }
3055
3056
3057
3058
3059 func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall {
3060 c.ctx_ = ctx
3061 return c
3062 }
3063
3064
3065
3066 func (c *AccountsReportsSavedGenerateCall) Header() http.Header {
3067 if c.header_ == nil {
3068 c.header_ = make(http.Header)
3069 }
3070 return c.header_
3071 }
3072
3073 func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
3074 reqHeaders := make(http.Header)
3075 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3076 for k, v := range c.header_ {
3077 reqHeaders[k] = v
3078 }
3079 reqHeaders.Set("User-Agent", c.s.userAgent())
3080 if c.ifNoneMatch_ != "" {
3081 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3082 }
3083 var body io.Reader = nil
3084 c.urlParams_.Set("alt", alt)
3085 c.urlParams_.Set("prettyPrint", "false")
3086 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}")
3087 urls += "?" + c.urlParams_.Encode()
3088 req, err := http.NewRequest("GET", urls, body)
3089 if err != nil {
3090 return nil, err
3091 }
3092 req.Header = reqHeaders
3093 googleapi.Expand(req.URL, map[string]string{
3094 "accountId": c.accountId,
3095 "savedReportId": c.savedReportId,
3096 })
3097 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3098 }
3099
3100
3101
3102
3103
3104
3105
3106
3107 func (c *AccountsReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
3108 gensupport.SetOptions(c.urlParams_, opts...)
3109 res, err := c.doRequest("json")
3110 if res != nil && res.StatusCode == http.StatusNotModified {
3111 if res.Body != nil {
3112 res.Body.Close()
3113 }
3114 return nil, &googleapi.Error{
3115 Code: res.StatusCode,
3116 Header: res.Header,
3117 }
3118 }
3119 if err != nil {
3120 return nil, err
3121 }
3122 defer googleapi.CloseBody(res)
3123 if err := googleapi.CheckResponse(res); err != nil {
3124 return nil, err
3125 }
3126 ret := &Report{
3127 ServerResponse: googleapi.ServerResponse{
3128 Header: res.Header,
3129 HTTPStatusCode: res.StatusCode,
3130 },
3131 }
3132 target := &ret
3133 if err := gensupport.DecodeResponse(target, res); err != nil {
3134 return nil, err
3135 }
3136 return ret, nil
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191 }
3192
3193
3194
3195 type AccountsReportsSavedListCall struct {
3196 s *Service
3197 accountId string
3198 urlParams_ gensupport.URLParams
3199 ifNoneMatch_ string
3200 ctx_ context.Context
3201 header_ http.Header
3202 }
3203
3204
3205 func (r *AccountsReportsSavedService) List(accountId string) *AccountsReportsSavedListCall {
3206 c := &AccountsReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3207 c.accountId = accountId
3208 return c
3209 }
3210
3211
3212
3213 func (c *AccountsReportsSavedListCall) MaxResults(maxResults int64) *AccountsReportsSavedListCall {
3214 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3215 return c
3216 }
3217
3218
3219
3220
3221
3222 func (c *AccountsReportsSavedListCall) PageToken(pageToken string) *AccountsReportsSavedListCall {
3223 c.urlParams_.Set("pageToken", pageToken)
3224 return c
3225 }
3226
3227
3228
3229
3230 func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall {
3231 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3232 return c
3233 }
3234
3235
3236
3237
3238
3239
3240 func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall {
3241 c.ifNoneMatch_ = entityTag
3242 return c
3243 }
3244
3245
3246
3247
3248 func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall {
3249 c.ctx_ = ctx
3250 return c
3251 }
3252
3253
3254
3255 func (c *AccountsReportsSavedListCall) Header() http.Header {
3256 if c.header_ == nil {
3257 c.header_ = make(http.Header)
3258 }
3259 return c.header_
3260 }
3261
3262 func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
3263 reqHeaders := make(http.Header)
3264 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3265 for k, v := range c.header_ {
3266 reqHeaders[k] = v
3267 }
3268 reqHeaders.Set("User-Agent", c.s.userAgent())
3269 if c.ifNoneMatch_ != "" {
3270 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3271 }
3272 var body io.Reader = nil
3273 c.urlParams_.Set("alt", alt)
3274 c.urlParams_.Set("prettyPrint", "false")
3275 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved")
3276 urls += "?" + c.urlParams_.Encode()
3277 req, err := http.NewRequest("GET", urls, body)
3278 if err != nil {
3279 return nil, err
3280 }
3281 req.Header = reqHeaders
3282 googleapi.Expand(req.URL, map[string]string{
3283 "accountId": c.accountId,
3284 })
3285 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3286 }
3287
3288
3289
3290
3291
3292
3293
3294
3295 func (c *AccountsReportsSavedListCall) Do(opts ...googleapi.CallOption) (*SavedReports, error) {
3296 gensupport.SetOptions(c.urlParams_, opts...)
3297 res, err := c.doRequest("json")
3298 if res != nil && res.StatusCode == http.StatusNotModified {
3299 if res.Body != nil {
3300 res.Body.Close()
3301 }
3302 return nil, &googleapi.Error{
3303 Code: res.StatusCode,
3304 Header: res.Header,
3305 }
3306 }
3307 if err != nil {
3308 return nil, err
3309 }
3310 defer googleapi.CloseBody(res)
3311 if err := googleapi.CheckResponse(res); err != nil {
3312 return nil, err
3313 }
3314 ret := &SavedReports{
3315 ServerResponse: googleapi.ServerResponse{
3316 Header: res.Header,
3317 HTTPStatusCode: res.StatusCode,
3318 },
3319 }
3320 target := &ret
3321 if err := gensupport.DecodeResponse(target, res); err != nil {
3322 return nil, err
3323 }
3324 return ret, nil
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363 }
3364
3365
3366
3367
3368 func (c *AccountsReportsSavedListCall) Pages(ctx context.Context, f func(*SavedReports) error) error {
3369 c.ctx_ = ctx
3370 defer c.PageToken(c.urlParams_.Get("pageToken"))
3371 for {
3372 x, err := c.Do()
3373 if err != nil {
3374 return err
3375 }
3376 if err := f(x); err != nil {
3377 return err
3378 }
3379 if x.NextPageToken == "" {
3380 return nil
3381 }
3382 c.PageToken(x.NextPageToken)
3383 }
3384 }
3385
3386
3387
3388 type AccountsUrlchannelsListCall struct {
3389 s *Service
3390 accountId string
3391 adClientId string
3392 urlParams_ gensupport.URLParams
3393 ifNoneMatch_ string
3394 ctx_ context.Context
3395 header_ http.Header
3396 }
3397
3398
3399
3400 func (r *AccountsUrlchannelsService) List(accountId string, adClientId string) *AccountsUrlchannelsListCall {
3401 c := &AccountsUrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3402 c.accountId = accountId
3403 c.adClientId = adClientId
3404 return c
3405 }
3406
3407
3408
3409 func (c *AccountsUrlchannelsListCall) MaxResults(maxResults int64) *AccountsUrlchannelsListCall {
3410 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3411 return c
3412 }
3413
3414
3415
3416
3417
3418 func (c *AccountsUrlchannelsListCall) PageToken(pageToken string) *AccountsUrlchannelsListCall {
3419 c.urlParams_.Set("pageToken", pageToken)
3420 return c
3421 }
3422
3423
3424
3425
3426 func (c *AccountsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsUrlchannelsListCall {
3427 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3428 return c
3429 }
3430
3431
3432
3433
3434
3435
3436 func (c *AccountsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsUrlchannelsListCall {
3437 c.ifNoneMatch_ = entityTag
3438 return c
3439 }
3440
3441
3442
3443
3444 func (c *AccountsUrlchannelsListCall) Context(ctx context.Context) *AccountsUrlchannelsListCall {
3445 c.ctx_ = ctx
3446 return c
3447 }
3448
3449
3450
3451 func (c *AccountsUrlchannelsListCall) Header() http.Header {
3452 if c.header_ == nil {
3453 c.header_ = make(http.Header)
3454 }
3455 return c.header_
3456 }
3457
3458 func (c *AccountsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
3459 reqHeaders := make(http.Header)
3460 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3461 for k, v := range c.header_ {
3462 reqHeaders[k] = v
3463 }
3464 reqHeaders.Set("User-Agent", c.s.userAgent())
3465 if c.ifNoneMatch_ != "" {
3466 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3467 }
3468 var body io.Reader = nil
3469 c.urlParams_.Set("alt", alt)
3470 c.urlParams_.Set("prettyPrint", "false")
3471 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels")
3472 urls += "?" + c.urlParams_.Encode()
3473 req, err := http.NewRequest("GET", urls, body)
3474 if err != nil {
3475 return nil, err
3476 }
3477 req.Header = reqHeaders
3478 googleapi.Expand(req.URL, map[string]string{
3479 "accountId": c.accountId,
3480 "adClientId": c.adClientId,
3481 })
3482 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3483 }
3484
3485
3486
3487
3488
3489
3490
3491
3492 func (c *AccountsUrlchannelsListCall) Do(opts ...googleapi.CallOption) (*UrlChannels, error) {
3493 gensupport.SetOptions(c.urlParams_, opts...)
3494 res, err := c.doRequest("json")
3495 if res != nil && res.StatusCode == http.StatusNotModified {
3496 if res.Body != nil {
3497 res.Body.Close()
3498 }
3499 return nil, &googleapi.Error{
3500 Code: res.StatusCode,
3501 Header: res.Header,
3502 }
3503 }
3504 if err != nil {
3505 return nil, err
3506 }
3507 defer googleapi.CloseBody(res)
3508 if err := googleapi.CheckResponse(res); err != nil {
3509 return nil, err
3510 }
3511 ret := &UrlChannels{
3512 ServerResponse: googleapi.ServerResponse{
3513 Header: res.Header,
3514 HTTPStatusCode: res.StatusCode,
3515 },
3516 }
3517 target := &ret
3518 if err := gensupport.DecodeResponse(target, res); err != nil {
3519 return nil, err
3520 }
3521 return ret, nil
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567 }
3568
3569
3570
3571
3572 func (c *AccountsUrlchannelsListCall) Pages(ctx context.Context, f func(*UrlChannels) error) error {
3573 c.ctx_ = ctx
3574 defer c.PageToken(c.urlParams_.Get("pageToken"))
3575 for {
3576 x, err := c.Do()
3577 if err != nil {
3578 return err
3579 }
3580 if err := f(x); err != nil {
3581 return err
3582 }
3583 if x.NextPageToken == "" {
3584 return nil
3585 }
3586 c.PageToken(x.NextPageToken)
3587 }
3588 }
3589
View as plain text