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