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 adsense
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 = "adsense:v1.3"
77 const apiName = "adsense"
78 const apiVersion = "v1.3"
79 const basePath = "https://www.googleapis.com/adsense/v1.3/"
80
81
82 const (
83
84 AdsenseScope = "https://www.googleapis.com/auth/adsense"
85
86
87 AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.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/adsense",
94 "https://www.googleapis.com/auth/adsense.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.Reports = NewReportsService(s)
129 s.Savedadstyles = NewSavedadstylesService(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 Reports *ReportsService
152
153 Savedadstyles *SavedadstylesService
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 rs.Adclients = NewAccountsAdclientsService(s)
168 rs.Adunits = NewAccountsAdunitsService(s)
169 rs.Alerts = NewAccountsAlertsService(s)
170 rs.Customchannels = NewAccountsCustomchannelsService(s)
171 rs.Reports = NewAccountsReportsService(s)
172 rs.Savedadstyles = NewAccountsSavedadstylesService(s)
173 rs.Urlchannels = NewAccountsUrlchannelsService(s)
174 return rs
175 }
176
177 type AccountsService struct {
178 s *Service
179
180 Adclients *AccountsAdclientsService
181
182 Adunits *AccountsAdunitsService
183
184 Alerts *AccountsAlertsService
185
186 Customchannels *AccountsCustomchannelsService
187
188 Reports *AccountsReportsService
189
190 Savedadstyles *AccountsSavedadstylesService
191
192 Urlchannels *AccountsUrlchannelsService
193 }
194
195 func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService {
196 rs := &AccountsAdclientsService{s: s}
197 return rs
198 }
199
200 type AccountsAdclientsService struct {
201 s *Service
202 }
203
204 func NewAccountsAdunitsService(s *Service) *AccountsAdunitsService {
205 rs := &AccountsAdunitsService{s: s}
206 rs.Customchannels = NewAccountsAdunitsCustomchannelsService(s)
207 return rs
208 }
209
210 type AccountsAdunitsService struct {
211 s *Service
212
213 Customchannels *AccountsAdunitsCustomchannelsService
214 }
215
216 func NewAccountsAdunitsCustomchannelsService(s *Service) *AccountsAdunitsCustomchannelsService {
217 rs := &AccountsAdunitsCustomchannelsService{s: s}
218 return rs
219 }
220
221 type AccountsAdunitsCustomchannelsService struct {
222 s *Service
223 }
224
225 func NewAccountsAlertsService(s *Service) *AccountsAlertsService {
226 rs := &AccountsAlertsService{s: s}
227 return rs
228 }
229
230 type AccountsAlertsService struct {
231 s *Service
232 }
233
234 func NewAccountsCustomchannelsService(s *Service) *AccountsCustomchannelsService {
235 rs := &AccountsCustomchannelsService{s: s}
236 rs.Adunits = NewAccountsCustomchannelsAdunitsService(s)
237 return rs
238 }
239
240 type AccountsCustomchannelsService struct {
241 s *Service
242
243 Adunits *AccountsCustomchannelsAdunitsService
244 }
245
246 func NewAccountsCustomchannelsAdunitsService(s *Service) *AccountsCustomchannelsAdunitsService {
247 rs := &AccountsCustomchannelsAdunitsService{s: s}
248 return rs
249 }
250
251 type AccountsCustomchannelsAdunitsService struct {
252 s *Service
253 }
254
255 func NewAccountsReportsService(s *Service) *AccountsReportsService {
256 rs := &AccountsReportsService{s: s}
257 rs.Saved = NewAccountsReportsSavedService(s)
258 return rs
259 }
260
261 type AccountsReportsService struct {
262 s *Service
263
264 Saved *AccountsReportsSavedService
265 }
266
267 func NewAccountsReportsSavedService(s *Service) *AccountsReportsSavedService {
268 rs := &AccountsReportsSavedService{s: s}
269 return rs
270 }
271
272 type AccountsReportsSavedService struct {
273 s *Service
274 }
275
276 func NewAccountsSavedadstylesService(s *Service) *AccountsSavedadstylesService {
277 rs := &AccountsSavedadstylesService{s: s}
278 return rs
279 }
280
281 type AccountsSavedadstylesService struct {
282 s *Service
283 }
284
285 func NewAccountsUrlchannelsService(s *Service) *AccountsUrlchannelsService {
286 rs := &AccountsUrlchannelsService{s: s}
287 return rs
288 }
289
290 type AccountsUrlchannelsService struct {
291 s *Service
292 }
293
294 func NewAdclientsService(s *Service) *AdclientsService {
295 rs := &AdclientsService{s: s}
296 return rs
297 }
298
299 type AdclientsService struct {
300 s *Service
301 }
302
303 func NewAdunitsService(s *Service) *AdunitsService {
304 rs := &AdunitsService{s: s}
305 rs.Customchannels = NewAdunitsCustomchannelsService(s)
306 return rs
307 }
308
309 type AdunitsService struct {
310 s *Service
311
312 Customchannels *AdunitsCustomchannelsService
313 }
314
315 func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService {
316 rs := &AdunitsCustomchannelsService{s: s}
317 return rs
318 }
319
320 type AdunitsCustomchannelsService struct {
321 s *Service
322 }
323
324 func NewAlertsService(s *Service) *AlertsService {
325 rs := &AlertsService{s: s}
326 return rs
327 }
328
329 type AlertsService struct {
330 s *Service
331 }
332
333 func NewCustomchannelsService(s *Service) *CustomchannelsService {
334 rs := &CustomchannelsService{s: s}
335 rs.Adunits = NewCustomchannelsAdunitsService(s)
336 return rs
337 }
338
339 type CustomchannelsService struct {
340 s *Service
341
342 Adunits *CustomchannelsAdunitsService
343 }
344
345 func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService {
346 rs := &CustomchannelsAdunitsService{s: s}
347 return rs
348 }
349
350 type CustomchannelsAdunitsService struct {
351 s *Service
352 }
353
354 func NewMetadataService(s *Service) *MetadataService {
355 rs := &MetadataService{s: s}
356 rs.Dimensions = NewMetadataDimensionsService(s)
357 rs.Metrics = NewMetadataMetricsService(s)
358 return rs
359 }
360
361 type MetadataService struct {
362 s *Service
363
364 Dimensions *MetadataDimensionsService
365
366 Metrics *MetadataMetricsService
367 }
368
369 func NewMetadataDimensionsService(s *Service) *MetadataDimensionsService {
370 rs := &MetadataDimensionsService{s: s}
371 return rs
372 }
373
374 type MetadataDimensionsService struct {
375 s *Service
376 }
377
378 func NewMetadataMetricsService(s *Service) *MetadataMetricsService {
379 rs := &MetadataMetricsService{s: s}
380 return rs
381 }
382
383 type MetadataMetricsService struct {
384 s *Service
385 }
386
387 func NewReportsService(s *Service) *ReportsService {
388 rs := &ReportsService{s: s}
389 rs.Saved = NewReportsSavedService(s)
390 return rs
391 }
392
393 type ReportsService struct {
394 s *Service
395
396 Saved *ReportsSavedService
397 }
398
399 func NewReportsSavedService(s *Service) *ReportsSavedService {
400 rs := &ReportsSavedService{s: s}
401 return rs
402 }
403
404 type ReportsSavedService struct {
405 s *Service
406 }
407
408 func NewSavedadstylesService(s *Service) *SavedadstylesService {
409 rs := &SavedadstylesService{s: s}
410 return rs
411 }
412
413 type SavedadstylesService struct {
414 s *Service
415 }
416
417 func NewUrlchannelsService(s *Service) *UrlchannelsService {
418 rs := &UrlchannelsService{s: s}
419 return rs
420 }
421
422 type UrlchannelsService struct {
423 s *Service
424 }
425
426 type Account struct {
427
428 Id string `json:"id,omitempty"`
429
430
431 Kind string `json:"kind,omitempty"`
432
433
434 Name string `json:"name,omitempty"`
435
436
437 Premium bool `json:"premium,omitempty"`
438
439
440 SubAccounts []*Account `json:"subAccounts,omitempty"`
441
442
443
444 googleapi.ServerResponse `json:"-"`
445
446
447
448
449
450
451
452 ForceSendFields []string `json:"-"`
453
454
455
456
457
458
459
460 NullFields []string `json:"-"`
461 }
462
463 func (s *Account) MarshalJSON() ([]byte, error) {
464 type NoMethod Account
465 raw := NoMethod(*s)
466 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
467 }
468
469 type Accounts struct {
470
471 Etag string `json:"etag,omitempty"`
472
473
474 Items []*Account `json:"items,omitempty"`
475
476
477 Kind string `json:"kind,omitempty"`
478
479
480
481
482 NextPageToken string `json:"nextPageToken,omitempty"`
483
484
485
486 googleapi.ServerResponse `json:"-"`
487
488
489
490
491
492
493
494 ForceSendFields []string `json:"-"`
495
496
497
498
499
500
501
502 NullFields []string `json:"-"`
503 }
504
505 func (s *Accounts) MarshalJSON() ([]byte, error) {
506 type NoMethod Accounts
507 raw := NoMethod(*s)
508 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
509 }
510
511 type AdClient struct {
512
513 ArcOptIn bool `json:"arcOptIn,omitempty"`
514
515
516 Id string `json:"id,omitempty"`
517
518
519 Kind string `json:"kind,omitempty"`
520
521
522
523 ProductCode string `json:"productCode,omitempty"`
524
525
526 SupportsReporting bool `json:"supportsReporting,omitempty"`
527
528
529
530
531
532
533
534 ForceSendFields []string `json:"-"`
535
536
537
538
539
540
541
542 NullFields []string `json:"-"`
543 }
544
545 func (s *AdClient) MarshalJSON() ([]byte, error) {
546 type NoMethod AdClient
547 raw := NoMethod(*s)
548 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
549 }
550
551 type AdClients struct {
552
553 Etag string `json:"etag,omitempty"`
554
555
556 Items []*AdClient `json:"items,omitempty"`
557
558
559 Kind string `json:"kind,omitempty"`
560
561
562
563
564 NextPageToken string `json:"nextPageToken,omitempty"`
565
566
567
568 googleapi.ServerResponse `json:"-"`
569
570
571
572
573
574
575
576 ForceSendFields []string `json:"-"`
577
578
579
580
581
582
583
584 NullFields []string `json:"-"`
585 }
586
587 func (s *AdClients) MarshalJSON() ([]byte, error) {
588 type NoMethod AdClients
589 raw := NoMethod(*s)
590 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
591 }
592
593 type AdCode struct {
594
595 AdCode string `json:"adCode,omitempty"`
596
597
598 Kind string `json:"kind,omitempty"`
599
600
601
602 googleapi.ServerResponse `json:"-"`
603
604
605
606
607
608
609
610 ForceSendFields []string `json:"-"`
611
612
613
614
615
616
617
618 NullFields []string `json:"-"`
619 }
620
621 func (s *AdCode) MarshalJSON() ([]byte, error) {
622 type NoMethod AdCode
623 raw := NoMethod(*s)
624 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
625 }
626
627 type AdStyle struct {
628
629
630
631 Colors *AdStyleColors `json:"colors,omitempty"`
632
633
634
635 Corners string `json:"corners,omitempty"`
636
637
638 Font *AdStyleFont `json:"font,omitempty"`
639
640
641 Kind string `json:"kind,omitempty"`
642
643
644
645
646
647
648
649 ForceSendFields []string `json:"-"`
650
651
652
653
654
655
656
657 NullFields []string `json:"-"`
658 }
659
660 func (s *AdStyle) MarshalJSON() ([]byte, error) {
661 type NoMethod AdStyle
662 raw := NoMethod(*s)
663 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
664 }
665
666
667
668
669 type AdStyleColors struct {
670
671 Background string `json:"background,omitempty"`
672
673
674 Border string `json:"border,omitempty"`
675
676
677 Text string `json:"text,omitempty"`
678
679
680 Title string `json:"title,omitempty"`
681
682
683 Url string `json:"url,omitempty"`
684
685
686
687
688
689
690
691 ForceSendFields []string `json:"-"`
692
693
694
695
696
697
698
699 NullFields []string `json:"-"`
700 }
701
702 func (s *AdStyleColors) MarshalJSON() ([]byte, error) {
703 type NoMethod AdStyleColors
704 raw := NoMethod(*s)
705 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
706 }
707
708
709 type AdStyleFont struct {
710
711 Family string `json:"family,omitempty"`
712
713
714 Size string `json:"size,omitempty"`
715
716
717
718
719
720
721
722 ForceSendFields []string `json:"-"`
723
724
725
726
727
728
729
730 NullFields []string `json:"-"`
731 }
732
733 func (s *AdStyleFont) MarshalJSON() ([]byte, error) {
734 type NoMethod AdStyleFont
735 raw := NoMethod(*s)
736 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
737 }
738
739 type AdUnit struct {
740
741
742 Code string `json:"code,omitempty"`
743
744
745
746 ContentAdsSettings *AdUnitContentAdsSettings `json:"contentAdsSettings,omitempty"`
747
748
749 CustomStyle *AdStyle `json:"customStyle,omitempty"`
750
751
752 FeedAdsSettings *AdUnitFeedAdsSettings `json:"feedAdsSettings,omitempty"`
753
754
755
756
757 Id string `json:"id,omitempty"`
758
759
760 Kind string `json:"kind,omitempty"`
761
762
763
764 MobileContentAdsSettings *AdUnitMobileContentAdsSettings `json:"mobileContentAdsSettings,omitempty"`
765
766
767 Name string `json:"name,omitempty"`
768
769
770
771 SavedStyleId string `json:"savedStyleId,omitempty"`
772
773
774
775
776
777
778
779
780
781
782 Status string `json:"status,omitempty"`
783
784
785
786 googleapi.ServerResponse `json:"-"`
787
788
789
790
791
792
793
794 ForceSendFields []string `json:"-"`
795
796
797
798
799
800
801
802 NullFields []string `json:"-"`
803 }
804
805 func (s *AdUnit) MarshalJSON() ([]byte, error) {
806 type NoMethod AdUnit
807 raw := NoMethod(*s)
808 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
809 }
810
811
812
813 type AdUnitContentAdsSettings struct {
814
815
816 BackupOption *AdUnitContentAdsSettingsBackupOption `json:"backupOption,omitempty"`
817
818
819 Size string `json:"size,omitempty"`
820
821
822 Type string `json:"type,omitempty"`
823
824
825
826
827
828
829
830 ForceSendFields []string `json:"-"`
831
832
833
834
835
836
837
838 NullFields []string `json:"-"`
839 }
840
841 func (s *AdUnitContentAdsSettings) MarshalJSON() ([]byte, error) {
842 type NoMethod AdUnitContentAdsSettings
843 raw := NoMethod(*s)
844 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
845 }
846
847
848
849 type AdUnitContentAdsSettingsBackupOption struct {
850
851 Color string `json:"color,omitempty"`
852
853
854
855 Type string `json:"type,omitempty"`
856
857
858 Url string `json:"url,omitempty"`
859
860
861
862
863
864
865
866 ForceSendFields []string `json:"-"`
867
868
869
870
871
872
873
874 NullFields []string `json:"-"`
875 }
876
877 func (s *AdUnitContentAdsSettingsBackupOption) MarshalJSON() ([]byte, error) {
878 type NoMethod AdUnitContentAdsSettingsBackupOption
879 raw := NoMethod(*s)
880 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
881 }
882
883
884
885 type AdUnitFeedAdsSettings struct {
886
887 AdPosition string `json:"adPosition,omitempty"`
888
889
890
891 Frequency int64 `json:"frequency,omitempty"`
892
893
894
895 MinimumWordCount int64 `json:"minimumWordCount,omitempty"`
896
897
898 Type string `json:"type,omitempty"`
899
900
901
902
903
904
905
906 ForceSendFields []string `json:"-"`
907
908
909
910
911
912
913
914 NullFields []string `json:"-"`
915 }
916
917 func (s *AdUnitFeedAdsSettings) MarshalJSON() ([]byte, error) {
918 type NoMethod AdUnitFeedAdsSettings
919 raw := NoMethod(*s)
920 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
921 }
922
923
924
925 type AdUnitMobileContentAdsSettings struct {
926
927 MarkupLanguage string `json:"markupLanguage,omitempty"`
928
929
930 ScriptingLanguage string `json:"scriptingLanguage,omitempty"`
931
932
933 Size string `json:"size,omitempty"`
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
953 NullFields []string `json:"-"`
954 }
955
956 func (s *AdUnitMobileContentAdsSettings) MarshalJSON() ([]byte, error) {
957 type NoMethod AdUnitMobileContentAdsSettings
958 raw := NoMethod(*s)
959 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
960 }
961
962 type AdUnits struct {
963
964 Etag string `json:"etag,omitempty"`
965
966
967 Items []*AdUnit `json:"items,omitempty"`
968
969
970 Kind string `json:"kind,omitempty"`
971
972
973
974
975 NextPageToken string `json:"nextPageToken,omitempty"`
976
977
978
979 googleapi.ServerResponse `json:"-"`
980
981
982
983
984
985
986
987 ForceSendFields []string `json:"-"`
988
989
990
991
992
993
994
995 NullFields []string `json:"-"`
996 }
997
998 func (s *AdUnits) MarshalJSON() ([]byte, error) {
999 type NoMethod AdUnits
1000 raw := NoMethod(*s)
1001 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1002 }
1003
1004 type AdsenseReportsGenerateResponse struct {
1005
1006
1007
1008 Averages []string `json:"averages,omitempty"`
1009
1010
1011
1012
1013 Headers []*AdsenseReportsGenerateResponseHeaders `json:"headers,omitempty"`
1014
1015
1016 Kind string `json:"kind,omitempty"`
1017
1018
1019
1020
1021
1022 Rows [][]string `json:"rows,omitempty"`
1023
1024
1025
1026
1027 TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"`
1028
1029
1030
1031
1032 Totals []string `json:"totals,omitempty"`
1033
1034
1035 Warnings []string `json:"warnings,omitempty"`
1036
1037
1038
1039 googleapi.ServerResponse `json:"-"`
1040
1041
1042
1043
1044
1045
1046
1047 ForceSendFields []string `json:"-"`
1048
1049
1050
1051
1052
1053
1054
1055 NullFields []string `json:"-"`
1056 }
1057
1058 func (s *AdsenseReportsGenerateResponse) MarshalJSON() ([]byte, error) {
1059 type NoMethod AdsenseReportsGenerateResponse
1060 raw := NoMethod(*s)
1061 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1062 }
1063
1064 type AdsenseReportsGenerateResponseHeaders struct {
1065
1066
1067 Currency string `json:"currency,omitempty"`
1068
1069
1070 Name string `json:"name,omitempty"`
1071
1072
1073
1074 Type string `json:"type,omitempty"`
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 *AdsenseReportsGenerateResponseHeaders) MarshalJSON() ([]byte, error) {
1094 type NoMethod AdsenseReportsGenerateResponseHeaders
1095 raw := NoMethod(*s)
1096 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1097 }
1098
1099 type Alert struct {
1100
1101
1102
1103 Id string `json:"id,omitempty"`
1104
1105
1106 Kind string `json:"kind,omitempty"`
1107
1108
1109 Message string `json:"message,omitempty"`
1110
1111
1112
1113 Severity string `json:"severity,omitempty"`
1114
1115
1116
1117
1118
1119 Type string `json:"type,omitempty"`
1120
1121
1122
1123
1124
1125
1126
1127 ForceSendFields []string `json:"-"`
1128
1129
1130
1131
1132
1133
1134
1135 NullFields []string `json:"-"`
1136 }
1137
1138 func (s *Alert) MarshalJSON() ([]byte, error) {
1139 type NoMethod Alert
1140 raw := NoMethod(*s)
1141 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1142 }
1143
1144 type Alerts struct {
1145
1146 Items []*Alert `json:"items,omitempty"`
1147
1148
1149 Kind string `json:"kind,omitempty"`
1150
1151
1152
1153 googleapi.ServerResponse `json:"-"`
1154
1155
1156
1157
1158
1159
1160
1161 ForceSendFields []string `json:"-"`
1162
1163
1164
1165
1166
1167
1168
1169 NullFields []string `json:"-"`
1170 }
1171
1172 func (s *Alerts) MarshalJSON() ([]byte, error) {
1173 type NoMethod Alerts
1174 raw := NoMethod(*s)
1175 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1176 }
1177
1178 type CustomChannel struct {
1179
1180
1181 Code string `json:"code,omitempty"`
1182
1183
1184
1185
1186 Id string `json:"id,omitempty"`
1187
1188
1189 Kind string `json:"kind,omitempty"`
1190
1191
1192 Name string `json:"name,omitempty"`
1193
1194
1195
1196 TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"`
1197
1198
1199
1200 googleapi.ServerResponse `json:"-"`
1201
1202
1203
1204
1205
1206
1207
1208 ForceSendFields []string `json:"-"`
1209
1210
1211
1212
1213
1214
1215
1216 NullFields []string `json:"-"`
1217 }
1218
1219 func (s *CustomChannel) MarshalJSON() ([]byte, error) {
1220 type NoMethod CustomChannel
1221 raw := NoMethod(*s)
1222 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1223 }
1224
1225
1226
1227 type CustomChannelTargetingInfo struct {
1228
1229 AdsAppearOn string `json:"adsAppearOn,omitempty"`
1230
1231
1232 Description string `json:"description,omitempty"`
1233
1234
1235
1236
1237
1238
1239
1240 Location string `json:"location,omitempty"`
1241
1242
1243 SiteLanguage string `json:"siteLanguage,omitempty"`
1244
1245
1246
1247
1248
1249
1250
1251 ForceSendFields []string `json:"-"`
1252
1253
1254
1255
1256
1257
1258
1259 NullFields []string `json:"-"`
1260 }
1261
1262 func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) {
1263 type NoMethod CustomChannelTargetingInfo
1264 raw := NoMethod(*s)
1265 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1266 }
1267
1268 type CustomChannels struct {
1269
1270 Etag string `json:"etag,omitempty"`
1271
1272
1273 Items []*CustomChannel `json:"items,omitempty"`
1274
1275
1276 Kind string `json:"kind,omitempty"`
1277
1278
1279
1280
1281 NextPageToken string `json:"nextPageToken,omitempty"`
1282
1283
1284
1285 googleapi.ServerResponse `json:"-"`
1286
1287
1288
1289
1290
1291
1292
1293 ForceSendFields []string `json:"-"`
1294
1295
1296
1297
1298
1299
1300
1301 NullFields []string `json:"-"`
1302 }
1303
1304 func (s *CustomChannels) MarshalJSON() ([]byte, error) {
1305 type NoMethod CustomChannels
1306 raw := NoMethod(*s)
1307 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1308 }
1309
1310 type Metadata struct {
1311 Items []*ReportingMetadataEntry `json:"items,omitempty"`
1312
1313
1314 Kind string `json:"kind,omitempty"`
1315
1316
1317
1318 googleapi.ServerResponse `json:"-"`
1319
1320
1321
1322
1323
1324
1325
1326 ForceSendFields []string `json:"-"`
1327
1328
1329
1330
1331
1332
1333
1334 NullFields []string `json:"-"`
1335 }
1336
1337 func (s *Metadata) MarshalJSON() ([]byte, error) {
1338 type NoMethod Metadata
1339 raw := NoMethod(*s)
1340 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1341 }
1342
1343 type ReportingMetadataEntry struct {
1344
1345
1346
1347 CompatibleDimensions []string `json:"compatibleDimensions,omitempty"`
1348
1349
1350
1351 CompatibleMetrics []string `json:"compatibleMetrics,omitempty"`
1352
1353
1354
1355 Id string `json:"id,omitempty"`
1356
1357
1358
1359 Kind string `json:"kind,omitempty"`
1360
1361
1362
1363
1364
1365
1366 RequiredDimensions []string `json:"requiredDimensions,omitempty"`
1367
1368
1369
1370
1371
1372
1373 RequiredMetrics []string `json:"requiredMetrics,omitempty"`
1374
1375
1376
1377 SupportedProducts []string `json:"supportedProducts,omitempty"`
1378
1379
1380
1381
1382
1383
1384
1385
1386 ForceSendFields []string `json:"-"`
1387
1388
1389
1390
1391
1392
1393
1394
1395 NullFields []string `json:"-"`
1396 }
1397
1398 func (s *ReportingMetadataEntry) MarshalJSON() ([]byte, error) {
1399 type NoMethod ReportingMetadataEntry
1400 raw := NoMethod(*s)
1401 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1402 }
1403
1404 type SavedAdStyle struct {
1405
1406 AdStyle *AdStyle `json:"adStyle,omitempty"`
1407
1408
1409
1410
1411 Id string `json:"id,omitempty"`
1412
1413
1414 Kind string `json:"kind,omitempty"`
1415
1416
1417 Name string `json:"name,omitempty"`
1418
1419
1420
1421 googleapi.ServerResponse `json:"-"`
1422
1423
1424
1425
1426
1427
1428
1429 ForceSendFields []string `json:"-"`
1430
1431
1432
1433
1434
1435
1436
1437 NullFields []string `json:"-"`
1438 }
1439
1440 func (s *SavedAdStyle) MarshalJSON() ([]byte, error) {
1441 type NoMethod SavedAdStyle
1442 raw := NoMethod(*s)
1443 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1444 }
1445
1446 type SavedAdStyles struct {
1447
1448 Etag string `json:"etag,omitempty"`
1449
1450
1451 Items []*SavedAdStyle `json:"items,omitempty"`
1452
1453
1454 Kind string `json:"kind,omitempty"`
1455
1456
1457
1458
1459 NextPageToken string `json:"nextPageToken,omitempty"`
1460
1461
1462
1463 googleapi.ServerResponse `json:"-"`
1464
1465
1466
1467
1468
1469
1470
1471 ForceSendFields []string `json:"-"`
1472
1473
1474
1475
1476
1477
1478
1479 NullFields []string `json:"-"`
1480 }
1481
1482 func (s *SavedAdStyles) MarshalJSON() ([]byte, error) {
1483 type NoMethod SavedAdStyles
1484 raw := NoMethod(*s)
1485 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1486 }
1487
1488 type SavedReport struct {
1489
1490 Id string `json:"id,omitempty"`
1491
1492
1493 Kind string `json:"kind,omitempty"`
1494
1495
1496 Name string `json:"name,omitempty"`
1497
1498
1499
1500
1501
1502
1503
1504 ForceSendFields []string `json:"-"`
1505
1506
1507
1508
1509
1510
1511
1512 NullFields []string `json:"-"`
1513 }
1514
1515 func (s *SavedReport) MarshalJSON() ([]byte, error) {
1516 type NoMethod SavedReport
1517 raw := NoMethod(*s)
1518 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1519 }
1520
1521 type SavedReports struct {
1522
1523 Etag string `json:"etag,omitempty"`
1524
1525
1526 Items []*SavedReport `json:"items,omitempty"`
1527
1528
1529 Kind string `json:"kind,omitempty"`
1530
1531
1532
1533
1534 NextPageToken string `json:"nextPageToken,omitempty"`
1535
1536
1537
1538 googleapi.ServerResponse `json:"-"`
1539
1540
1541
1542
1543
1544
1545
1546 ForceSendFields []string `json:"-"`
1547
1548
1549
1550
1551
1552
1553
1554 NullFields []string `json:"-"`
1555 }
1556
1557 func (s *SavedReports) MarshalJSON() ([]byte, error) {
1558 type NoMethod SavedReports
1559 raw := NoMethod(*s)
1560 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1561 }
1562
1563 type UrlChannel struct {
1564
1565
1566
1567 Id string `json:"id,omitempty"`
1568
1569
1570 Kind string `json:"kind,omitempty"`
1571
1572
1573
1574 UrlPattern string `json:"urlPattern,omitempty"`
1575
1576
1577
1578
1579
1580
1581
1582 ForceSendFields []string `json:"-"`
1583
1584
1585
1586
1587
1588
1589
1590 NullFields []string `json:"-"`
1591 }
1592
1593 func (s *UrlChannel) MarshalJSON() ([]byte, error) {
1594 type NoMethod UrlChannel
1595 raw := NoMethod(*s)
1596 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1597 }
1598
1599 type UrlChannels struct {
1600
1601 Etag string `json:"etag,omitempty"`
1602
1603
1604 Items []*UrlChannel `json:"items,omitempty"`
1605
1606
1607 Kind string `json:"kind,omitempty"`
1608
1609
1610
1611
1612 NextPageToken string `json:"nextPageToken,omitempty"`
1613
1614
1615
1616 googleapi.ServerResponse `json:"-"`
1617
1618
1619
1620
1621
1622
1623
1624 ForceSendFields []string `json:"-"`
1625
1626
1627
1628
1629
1630
1631
1632 NullFields []string `json:"-"`
1633 }
1634
1635 func (s *UrlChannels) MarshalJSON() ([]byte, error) {
1636 type NoMethod UrlChannels
1637 raw := NoMethod(*s)
1638 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1639 }
1640
1641
1642
1643 type AccountsGetCall struct {
1644 s *Service
1645 accountId string
1646 urlParams_ gensupport.URLParams
1647 ifNoneMatch_ string
1648 ctx_ context.Context
1649 header_ http.Header
1650 }
1651
1652
1653 func (r *AccountsService) Get(accountId string) *AccountsGetCall {
1654 c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1655 c.accountId = accountId
1656 return c
1657 }
1658
1659
1660
1661 func (c *AccountsGetCall) Tree(tree bool) *AccountsGetCall {
1662 c.urlParams_.Set("tree", fmt.Sprint(tree))
1663 return c
1664 }
1665
1666
1667
1668
1669 func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
1670 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1671 return c
1672 }
1673
1674
1675
1676
1677
1678
1679 func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
1680 c.ifNoneMatch_ = entityTag
1681 return c
1682 }
1683
1684
1685
1686
1687 func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
1688 c.ctx_ = ctx
1689 return c
1690 }
1691
1692
1693
1694 func (c *AccountsGetCall) Header() http.Header {
1695 if c.header_ == nil {
1696 c.header_ = make(http.Header)
1697 }
1698 return c.header_
1699 }
1700
1701 func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
1702 reqHeaders := make(http.Header)
1703 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1704 for k, v := range c.header_ {
1705 reqHeaders[k] = v
1706 }
1707 reqHeaders.Set("User-Agent", c.s.userAgent())
1708 if c.ifNoneMatch_ != "" {
1709 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1710 }
1711 var body io.Reader = nil
1712 c.urlParams_.Set("alt", alt)
1713 c.urlParams_.Set("prettyPrint", "false")
1714 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}")
1715 urls += "?" + c.urlParams_.Encode()
1716 req, err := http.NewRequest("GET", urls, body)
1717 if err != nil {
1718 return nil, err
1719 }
1720 req.Header = reqHeaders
1721 googleapi.Expand(req.URL, map[string]string{
1722 "accountId": c.accountId,
1723 })
1724 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1725 }
1726
1727
1728
1729
1730
1731
1732
1733
1734 func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
1735 gensupport.SetOptions(c.urlParams_, opts...)
1736 res, err := c.doRequest("json")
1737 if res != nil && res.StatusCode == http.StatusNotModified {
1738 if res.Body != nil {
1739 res.Body.Close()
1740 }
1741 return nil, &googleapi.Error{
1742 Code: res.StatusCode,
1743 Header: res.Header,
1744 }
1745 }
1746 if err != nil {
1747 return nil, err
1748 }
1749 defer googleapi.CloseBody(res)
1750 if err := googleapi.CheckResponse(res); err != nil {
1751 return nil, err
1752 }
1753 ret := &Account{
1754 ServerResponse: googleapi.ServerResponse{
1755 Header: res.Header,
1756 HTTPStatusCode: res.StatusCode,
1757 },
1758 }
1759 target := &ret
1760 if err := gensupport.DecodeResponse(target, res); err != nil {
1761 return nil, err
1762 }
1763 return ret, nil
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794 }
1795
1796
1797
1798 type AccountsListCall struct {
1799 s *Service
1800 urlParams_ gensupport.URLParams
1801 ifNoneMatch_ string
1802 ctx_ context.Context
1803 header_ http.Header
1804 }
1805
1806
1807 func (r *AccountsService) List() *AccountsListCall {
1808 c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1809 return c
1810 }
1811
1812
1813
1814 func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
1815 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1816 return c
1817 }
1818
1819
1820
1821
1822
1823 func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
1824 c.urlParams_.Set("pageToken", pageToken)
1825 return c
1826 }
1827
1828
1829
1830
1831 func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
1832 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1833 return c
1834 }
1835
1836
1837
1838
1839
1840
1841 func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
1842 c.ifNoneMatch_ = entityTag
1843 return c
1844 }
1845
1846
1847
1848
1849 func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
1850 c.ctx_ = ctx
1851 return c
1852 }
1853
1854
1855
1856 func (c *AccountsListCall) Header() http.Header {
1857 if c.header_ == nil {
1858 c.header_ = make(http.Header)
1859 }
1860 return c.header_
1861 }
1862
1863 func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
1864 reqHeaders := make(http.Header)
1865 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1866 for k, v := range c.header_ {
1867 reqHeaders[k] = v
1868 }
1869 reqHeaders.Set("User-Agent", c.s.userAgent())
1870 if c.ifNoneMatch_ != "" {
1871 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1872 }
1873 var body io.Reader = nil
1874 c.urlParams_.Set("alt", alt)
1875 c.urlParams_.Set("prettyPrint", "false")
1876 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
1877 urls += "?" + c.urlParams_.Encode()
1878 req, err := http.NewRequest("GET", urls, body)
1879 if err != nil {
1880 return nil, err
1881 }
1882 req.Header = reqHeaders
1883 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1884 }
1885
1886
1887
1888
1889
1890
1891
1892
1893 func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*Accounts, error) {
1894 gensupport.SetOptions(c.urlParams_, opts...)
1895 res, err := c.doRequest("json")
1896 if res != nil && res.StatusCode == http.StatusNotModified {
1897 if res.Body != nil {
1898 res.Body.Close()
1899 }
1900 return nil, &googleapi.Error{
1901 Code: res.StatusCode,
1902 Header: res.Header,
1903 }
1904 }
1905 if err != nil {
1906 return nil, err
1907 }
1908 defer googleapi.CloseBody(res)
1909 if err := googleapi.CheckResponse(res); err != nil {
1910 return nil, err
1911 }
1912 ret := &Accounts{
1913 ServerResponse: googleapi.ServerResponse{
1914 Header: res.Header,
1915 HTTPStatusCode: res.StatusCode,
1916 },
1917 }
1918 target := &ret
1919 if err := gensupport.DecodeResponse(target, res); err != nil {
1920 return nil, err
1921 }
1922 return ret, nil
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952 }
1953
1954
1955
1956
1957 func (c *AccountsListCall) Pages(ctx context.Context, f func(*Accounts) error) error {
1958 c.ctx_ = ctx
1959 defer c.PageToken(c.urlParams_.Get("pageToken"))
1960 for {
1961 x, err := c.Do()
1962 if err != nil {
1963 return err
1964 }
1965 if err := f(x); err != nil {
1966 return err
1967 }
1968 if x.NextPageToken == "" {
1969 return nil
1970 }
1971 c.PageToken(x.NextPageToken)
1972 }
1973 }
1974
1975
1976
1977 type AccountsAdclientsListCall struct {
1978 s *Service
1979 accountId string
1980 urlParams_ gensupport.URLParams
1981 ifNoneMatch_ string
1982 ctx_ context.Context
1983 header_ http.Header
1984 }
1985
1986
1987 func (r *AccountsAdclientsService) List(accountId string) *AccountsAdclientsListCall {
1988 c := &AccountsAdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1989 c.accountId = accountId
1990 return c
1991 }
1992
1993
1994
1995 func (c *AccountsAdclientsListCall) MaxResults(maxResults int64) *AccountsAdclientsListCall {
1996 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1997 return c
1998 }
1999
2000
2001
2002
2003
2004 func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall {
2005 c.urlParams_.Set("pageToken", pageToken)
2006 return c
2007 }
2008
2009
2010
2011
2012 func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall {
2013 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2014 return c
2015 }
2016
2017
2018
2019
2020
2021
2022 func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall {
2023 c.ifNoneMatch_ = entityTag
2024 return c
2025 }
2026
2027
2028
2029
2030 func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall {
2031 c.ctx_ = ctx
2032 return c
2033 }
2034
2035
2036
2037 func (c *AccountsAdclientsListCall) Header() http.Header {
2038 if c.header_ == nil {
2039 c.header_ = make(http.Header)
2040 }
2041 return c.header_
2042 }
2043
2044 func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) {
2045 reqHeaders := make(http.Header)
2046 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2047 for k, v := range c.header_ {
2048 reqHeaders[k] = v
2049 }
2050 reqHeaders.Set("User-Agent", c.s.userAgent())
2051 if c.ifNoneMatch_ != "" {
2052 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2053 }
2054 var body io.Reader = nil
2055 c.urlParams_.Set("alt", alt)
2056 c.urlParams_.Set("prettyPrint", "false")
2057 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients")
2058 urls += "?" + c.urlParams_.Encode()
2059 req, err := http.NewRequest("GET", urls, body)
2060 if err != nil {
2061 return nil, err
2062 }
2063 req.Header = reqHeaders
2064 googleapi.Expand(req.URL, map[string]string{
2065 "accountId": c.accountId,
2066 })
2067 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2068 }
2069
2070
2071
2072
2073
2074
2075
2076
2077 func (c *AccountsAdclientsListCall) Do(opts ...googleapi.CallOption) (*AdClients, error) {
2078 gensupport.SetOptions(c.urlParams_, opts...)
2079 res, err := c.doRequest("json")
2080 if res != nil && res.StatusCode == http.StatusNotModified {
2081 if res.Body != nil {
2082 res.Body.Close()
2083 }
2084 return nil, &googleapi.Error{
2085 Code: res.StatusCode,
2086 Header: res.Header,
2087 }
2088 }
2089 if err != nil {
2090 return nil, err
2091 }
2092 defer googleapi.CloseBody(res)
2093 if err := googleapi.CheckResponse(res); err != nil {
2094 return nil, err
2095 }
2096 ret := &AdClients{
2097 ServerResponse: googleapi.ServerResponse{
2098 Header: res.Header,
2099 HTTPStatusCode: res.StatusCode,
2100 },
2101 }
2102 target := &ret
2103 if err := gensupport.DecodeResponse(target, res); err != nil {
2104 return nil, err
2105 }
2106 return ret, nil
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145 }
2146
2147
2148
2149
2150 func (c *AccountsAdclientsListCall) Pages(ctx context.Context, f func(*AdClients) error) error {
2151 c.ctx_ = ctx
2152 defer c.PageToken(c.urlParams_.Get("pageToken"))
2153 for {
2154 x, err := c.Do()
2155 if err != nil {
2156 return err
2157 }
2158 if err := f(x); err != nil {
2159 return err
2160 }
2161 if x.NextPageToken == "" {
2162 return nil
2163 }
2164 c.PageToken(x.NextPageToken)
2165 }
2166 }
2167
2168
2169
2170 type AccountsAdunitsGetCall struct {
2171 s *Service
2172 accountId string
2173 adClientId string
2174 adUnitId string
2175 urlParams_ gensupport.URLParams
2176 ifNoneMatch_ string
2177 ctx_ context.Context
2178 header_ http.Header
2179 }
2180
2181
2182
2183 func (r *AccountsAdunitsService) Get(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetCall {
2184 c := &AccountsAdunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2185 c.accountId = accountId
2186 c.adClientId = adClientId
2187 c.adUnitId = adUnitId
2188 return c
2189 }
2190
2191
2192
2193
2194 func (c *AccountsAdunitsGetCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetCall {
2195 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2196 return c
2197 }
2198
2199
2200
2201
2202
2203
2204 func (c *AccountsAdunitsGetCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetCall {
2205 c.ifNoneMatch_ = entityTag
2206 return c
2207 }
2208
2209
2210
2211
2212 func (c *AccountsAdunitsGetCall) Context(ctx context.Context) *AccountsAdunitsGetCall {
2213 c.ctx_ = ctx
2214 return c
2215 }
2216
2217
2218
2219 func (c *AccountsAdunitsGetCall) Header() http.Header {
2220 if c.header_ == nil {
2221 c.header_ = make(http.Header)
2222 }
2223 return c.header_
2224 }
2225
2226 func (c *AccountsAdunitsGetCall) doRequest(alt string) (*http.Response, error) {
2227 reqHeaders := make(http.Header)
2228 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2229 for k, v := range c.header_ {
2230 reqHeaders[k] = v
2231 }
2232 reqHeaders.Set("User-Agent", c.s.userAgent())
2233 if c.ifNoneMatch_ != "" {
2234 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2235 }
2236 var body io.Reader = nil
2237 c.urlParams_.Set("alt", alt)
2238 c.urlParams_.Set("prettyPrint", "false")
2239 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}")
2240 urls += "?" + c.urlParams_.Encode()
2241 req, err := http.NewRequest("GET", urls, body)
2242 if err != nil {
2243 return nil, err
2244 }
2245 req.Header = reqHeaders
2246 googleapi.Expand(req.URL, map[string]string{
2247 "accountId": c.accountId,
2248 "adClientId": c.adClientId,
2249 "adUnitId": c.adUnitId,
2250 })
2251 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2252 }
2253
2254
2255
2256
2257
2258
2259
2260
2261 func (c *AccountsAdunitsGetCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
2262 gensupport.SetOptions(c.urlParams_, opts...)
2263 res, err := c.doRequest("json")
2264 if res != nil && res.StatusCode == http.StatusNotModified {
2265 if res.Body != nil {
2266 res.Body.Close()
2267 }
2268 return nil, &googleapi.Error{
2269 Code: res.StatusCode,
2270 Header: res.Header,
2271 }
2272 }
2273 if err != nil {
2274 return nil, err
2275 }
2276 defer googleapi.CloseBody(res)
2277 if err := googleapi.CheckResponse(res); err != nil {
2278 return nil, err
2279 }
2280 ret := &AdUnit{
2281 ServerResponse: googleapi.ServerResponse{
2282 Header: res.Header,
2283 HTTPStatusCode: res.StatusCode,
2284 },
2285 }
2286 target := &ret
2287 if err := gensupport.DecodeResponse(target, res); err != nil {
2288 return nil, err
2289 }
2290 return ret, nil
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330 }
2331
2332
2333
2334 type AccountsAdunitsGetAdCodeCall struct {
2335 s *Service
2336 accountId string
2337 adClientId string
2338 adUnitId string
2339 urlParams_ gensupport.URLParams
2340 ifNoneMatch_ string
2341 ctx_ context.Context
2342 header_ http.Header
2343 }
2344
2345
2346 func (r *AccountsAdunitsService) GetAdCode(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetAdCodeCall {
2347 c := &AccountsAdunitsGetAdCodeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2348 c.accountId = accountId
2349 c.adClientId = adClientId
2350 c.adUnitId = adUnitId
2351 return c
2352 }
2353
2354
2355
2356
2357 func (c *AccountsAdunitsGetAdCodeCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetAdCodeCall {
2358 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2359 return c
2360 }
2361
2362
2363
2364
2365
2366
2367 func (c *AccountsAdunitsGetAdCodeCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetAdCodeCall {
2368 c.ifNoneMatch_ = entityTag
2369 return c
2370 }
2371
2372
2373
2374
2375 func (c *AccountsAdunitsGetAdCodeCall) Context(ctx context.Context) *AccountsAdunitsGetAdCodeCall {
2376 c.ctx_ = ctx
2377 return c
2378 }
2379
2380
2381
2382 func (c *AccountsAdunitsGetAdCodeCall) Header() http.Header {
2383 if c.header_ == nil {
2384 c.header_ = make(http.Header)
2385 }
2386 return c.header_
2387 }
2388
2389 func (c *AccountsAdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, error) {
2390 reqHeaders := make(http.Header)
2391 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2392 for k, v := range c.header_ {
2393 reqHeaders[k] = v
2394 }
2395 reqHeaders.Set("User-Agent", c.s.userAgent())
2396 if c.ifNoneMatch_ != "" {
2397 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2398 }
2399 var body io.Reader = nil
2400 c.urlParams_.Set("alt", alt)
2401 c.urlParams_.Set("prettyPrint", "false")
2402 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode")
2403 urls += "?" + c.urlParams_.Encode()
2404 req, err := http.NewRequest("GET", urls, body)
2405 if err != nil {
2406 return nil, err
2407 }
2408 req.Header = reqHeaders
2409 googleapi.Expand(req.URL, map[string]string{
2410 "accountId": c.accountId,
2411 "adClientId": c.adClientId,
2412 "adUnitId": c.adUnitId,
2413 })
2414 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2415 }
2416
2417
2418
2419
2420
2421
2422
2423
2424 func (c *AccountsAdunitsGetAdCodeCall) Do(opts ...googleapi.CallOption) (*AdCode, error) {
2425 gensupport.SetOptions(c.urlParams_, opts...)
2426 res, err := c.doRequest("json")
2427 if res != nil && res.StatusCode == http.StatusNotModified {
2428 if res.Body != nil {
2429 res.Body.Close()
2430 }
2431 return nil, &googleapi.Error{
2432 Code: res.StatusCode,
2433 Header: res.Header,
2434 }
2435 }
2436 if err != nil {
2437 return nil, err
2438 }
2439 defer googleapi.CloseBody(res)
2440 if err := googleapi.CheckResponse(res); err != nil {
2441 return nil, err
2442 }
2443 ret := &AdCode{
2444 ServerResponse: googleapi.ServerResponse{
2445 Header: res.Header,
2446 HTTPStatusCode: res.StatusCode,
2447 },
2448 }
2449 target := &ret
2450 if err := gensupport.DecodeResponse(target, res); err != nil {
2451 return nil, err
2452 }
2453 return ret, nil
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493 }
2494
2495
2496
2497 type AccountsAdunitsListCall struct {
2498 s *Service
2499 accountId string
2500 adClientId string
2501 urlParams_ gensupport.URLParams
2502 ifNoneMatch_ string
2503 ctx_ context.Context
2504 header_ http.Header
2505 }
2506
2507
2508
2509 func (r *AccountsAdunitsService) List(accountId string, adClientId string) *AccountsAdunitsListCall {
2510 c := &AccountsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2511 c.accountId = accountId
2512 c.adClientId = adClientId
2513 return c
2514 }
2515
2516
2517
2518 func (c *AccountsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsAdunitsListCall {
2519 c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
2520 return c
2521 }
2522
2523
2524
2525 func (c *AccountsAdunitsListCall) MaxResults(maxResults int64) *AccountsAdunitsListCall {
2526 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2527 return c
2528 }
2529
2530
2531
2532
2533
2534 func (c *AccountsAdunitsListCall) PageToken(pageToken string) *AccountsAdunitsListCall {
2535 c.urlParams_.Set("pageToken", pageToken)
2536 return c
2537 }
2538
2539
2540
2541
2542 func (c *AccountsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsListCall {
2543 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2544 return c
2545 }
2546
2547
2548
2549
2550
2551
2552 func (c *AccountsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsListCall {
2553 c.ifNoneMatch_ = entityTag
2554 return c
2555 }
2556
2557
2558
2559
2560 func (c *AccountsAdunitsListCall) Context(ctx context.Context) *AccountsAdunitsListCall {
2561 c.ctx_ = ctx
2562 return c
2563 }
2564
2565
2566
2567 func (c *AccountsAdunitsListCall) Header() http.Header {
2568 if c.header_ == nil {
2569 c.header_ = make(http.Header)
2570 }
2571 return c.header_
2572 }
2573
2574 func (c *AccountsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
2575 reqHeaders := make(http.Header)
2576 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2577 for k, v := range c.header_ {
2578 reqHeaders[k] = v
2579 }
2580 reqHeaders.Set("User-Agent", c.s.userAgent())
2581 if c.ifNoneMatch_ != "" {
2582 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2583 }
2584 var body io.Reader = nil
2585 c.urlParams_.Set("alt", alt)
2586 c.urlParams_.Set("prettyPrint", "false")
2587 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits")
2588 urls += "?" + c.urlParams_.Encode()
2589 req, err := http.NewRequest("GET", urls, body)
2590 if err != nil {
2591 return nil, err
2592 }
2593 req.Header = reqHeaders
2594 googleapi.Expand(req.URL, map[string]string{
2595 "accountId": c.accountId,
2596 "adClientId": c.adClientId,
2597 })
2598 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2599 }
2600
2601
2602
2603
2604
2605
2606
2607
2608 func (c *AccountsAdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
2609 gensupport.SetOptions(c.urlParams_, opts...)
2610 res, err := c.doRequest("json")
2611 if res != nil && res.StatusCode == http.StatusNotModified {
2612 if res.Body != nil {
2613 res.Body.Close()
2614 }
2615 return nil, &googleapi.Error{
2616 Code: res.StatusCode,
2617 Header: res.Header,
2618 }
2619 }
2620 if err != nil {
2621 return nil, err
2622 }
2623 defer googleapi.CloseBody(res)
2624 if err := googleapi.CheckResponse(res); err != nil {
2625 return nil, err
2626 }
2627 ret := &AdUnits{
2628 ServerResponse: googleapi.ServerResponse{
2629 Header: res.Header,
2630 HTTPStatusCode: res.StatusCode,
2631 },
2632 }
2633 target := &ret
2634 if err := gensupport.DecodeResponse(target, res); err != nil {
2635 return nil, err
2636 }
2637 return ret, nil
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688 }
2689
2690
2691
2692
2693 func (c *AccountsAdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
2694 c.ctx_ = ctx
2695 defer c.PageToken(c.urlParams_.Get("pageToken"))
2696 for {
2697 x, err := c.Do()
2698 if err != nil {
2699 return err
2700 }
2701 if err := f(x); err != nil {
2702 return err
2703 }
2704 if x.NextPageToken == "" {
2705 return nil
2706 }
2707 c.PageToken(x.NextPageToken)
2708 }
2709 }
2710
2711
2712
2713 type AccountsAdunitsCustomchannelsListCall struct {
2714 s *Service
2715 accountId string
2716 adClientId string
2717 adUnitId string
2718 urlParams_ gensupport.URLParams
2719 ifNoneMatch_ string
2720 ctx_ context.Context
2721 header_ http.Header
2722 }
2723
2724
2725
2726 func (r *AccountsAdunitsCustomchannelsService) List(accountId string, adClientId string, adUnitId string) *AccountsAdunitsCustomchannelsListCall {
2727 c := &AccountsAdunitsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2728 c.accountId = accountId
2729 c.adClientId = adClientId
2730 c.adUnitId = adUnitId
2731 return c
2732 }
2733
2734
2735
2736
2737 func (c *AccountsAdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsAdunitsCustomchannelsListCall {
2738 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2739 return c
2740 }
2741
2742
2743
2744
2745
2746 func (c *AccountsAdunitsCustomchannelsListCall) PageToken(pageToken string) *AccountsAdunitsCustomchannelsListCall {
2747 c.urlParams_.Set("pageToken", pageToken)
2748 return c
2749 }
2750
2751
2752
2753
2754 func (c *AccountsAdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsCustomchannelsListCall {
2755 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2756 return c
2757 }
2758
2759
2760
2761
2762
2763
2764 func (c *AccountsAdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsCustomchannelsListCall {
2765 c.ifNoneMatch_ = entityTag
2766 return c
2767 }
2768
2769
2770
2771
2772 func (c *AccountsAdunitsCustomchannelsListCall) Context(ctx context.Context) *AccountsAdunitsCustomchannelsListCall {
2773 c.ctx_ = ctx
2774 return c
2775 }
2776
2777
2778
2779 func (c *AccountsAdunitsCustomchannelsListCall) Header() http.Header {
2780 if c.header_ == nil {
2781 c.header_ = make(http.Header)
2782 }
2783 return c.header_
2784 }
2785
2786 func (c *AccountsAdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
2787 reqHeaders := make(http.Header)
2788 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2789 for k, v := range c.header_ {
2790 reqHeaders[k] = v
2791 }
2792 reqHeaders.Set("User-Agent", c.s.userAgent())
2793 if c.ifNoneMatch_ != "" {
2794 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2795 }
2796 var body io.Reader = nil
2797 c.urlParams_.Set("alt", alt)
2798 c.urlParams_.Set("prettyPrint", "false")
2799 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels")
2800 urls += "?" + c.urlParams_.Encode()
2801 req, err := http.NewRequest("GET", urls, body)
2802 if err != nil {
2803 return nil, err
2804 }
2805 req.Header = reqHeaders
2806 googleapi.Expand(req.URL, map[string]string{
2807 "accountId": c.accountId,
2808 "adClientId": c.adClientId,
2809 "adUnitId": c.adUnitId,
2810 })
2811 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2812 }
2813
2814
2815
2816
2817
2818
2819
2820
2821 func (c *AccountsAdunitsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
2822 gensupport.SetOptions(c.urlParams_, opts...)
2823 res, err := c.doRequest("json")
2824 if res != nil && res.StatusCode == http.StatusNotModified {
2825 if res.Body != nil {
2826 res.Body.Close()
2827 }
2828 return nil, &googleapi.Error{
2829 Code: res.StatusCode,
2830 Header: res.Header,
2831 }
2832 }
2833 if err != nil {
2834 return nil, err
2835 }
2836 defer googleapi.CloseBody(res)
2837 if err := googleapi.CheckResponse(res); err != nil {
2838 return nil, err
2839 }
2840 ret := &CustomChannels{
2841 ServerResponse: googleapi.ServerResponse{
2842 Header: res.Header,
2843 HTTPStatusCode: res.StatusCode,
2844 },
2845 }
2846 target := &ret
2847 if err := gensupport.DecodeResponse(target, res); err != nil {
2848 return nil, err
2849 }
2850 return ret, nil
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903 }
2904
2905
2906
2907
2908 func (c *AccountsAdunitsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
2909 c.ctx_ = ctx
2910 defer c.PageToken(c.urlParams_.Get("pageToken"))
2911 for {
2912 x, err := c.Do()
2913 if err != nil {
2914 return err
2915 }
2916 if err := f(x); err != nil {
2917 return err
2918 }
2919 if x.NextPageToken == "" {
2920 return nil
2921 }
2922 c.PageToken(x.NextPageToken)
2923 }
2924 }
2925
2926
2927
2928 type AccountsAlertsListCall struct {
2929 s *Service
2930 accountId string
2931 urlParams_ gensupport.URLParams
2932 ifNoneMatch_ string
2933 ctx_ context.Context
2934 header_ http.Header
2935 }
2936
2937
2938 func (r *AccountsAlertsService) List(accountId string) *AccountsAlertsListCall {
2939 c := &AccountsAlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2940 c.accountId = accountId
2941 return c
2942 }
2943
2944
2945
2946
2947
2948 func (c *AccountsAlertsListCall) Locale(locale string) *AccountsAlertsListCall {
2949 c.urlParams_.Set("locale", locale)
2950 return c
2951 }
2952
2953
2954
2955
2956 func (c *AccountsAlertsListCall) Fields(s ...googleapi.Field) *AccountsAlertsListCall {
2957 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2958 return c
2959 }
2960
2961
2962
2963
2964
2965
2966 func (c *AccountsAlertsListCall) IfNoneMatch(entityTag string) *AccountsAlertsListCall {
2967 c.ifNoneMatch_ = entityTag
2968 return c
2969 }
2970
2971
2972
2973
2974 func (c *AccountsAlertsListCall) Context(ctx context.Context) *AccountsAlertsListCall {
2975 c.ctx_ = ctx
2976 return c
2977 }
2978
2979
2980
2981 func (c *AccountsAlertsListCall) Header() http.Header {
2982 if c.header_ == nil {
2983 c.header_ = make(http.Header)
2984 }
2985 return c.header_
2986 }
2987
2988 func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) {
2989 reqHeaders := make(http.Header)
2990 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2991 for k, v := range c.header_ {
2992 reqHeaders[k] = v
2993 }
2994 reqHeaders.Set("User-Agent", c.s.userAgent())
2995 if c.ifNoneMatch_ != "" {
2996 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2997 }
2998 var body io.Reader = nil
2999 c.urlParams_.Set("alt", alt)
3000 c.urlParams_.Set("prettyPrint", "false")
3001 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts")
3002 urls += "?" + c.urlParams_.Encode()
3003 req, err := http.NewRequest("GET", urls, body)
3004 if err != nil {
3005 return nil, err
3006 }
3007 req.Header = reqHeaders
3008 googleapi.Expand(req.URL, map[string]string{
3009 "accountId": c.accountId,
3010 })
3011 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3012 }
3013
3014
3015
3016
3017
3018
3019
3020
3021 func (c *AccountsAlertsListCall) Do(opts ...googleapi.CallOption) (*Alerts, error) {
3022 gensupport.SetOptions(c.urlParams_, opts...)
3023 res, err := c.doRequest("json")
3024 if res != nil && res.StatusCode == http.StatusNotModified {
3025 if res.Body != nil {
3026 res.Body.Close()
3027 }
3028 return nil, &googleapi.Error{
3029 Code: res.StatusCode,
3030 Header: res.Header,
3031 }
3032 }
3033 if err != nil {
3034 return nil, err
3035 }
3036 defer googleapi.CloseBody(res)
3037 if err := googleapi.CheckResponse(res); err != nil {
3038 return nil, err
3039 }
3040 ret := &Alerts{
3041 ServerResponse: googleapi.ServerResponse{
3042 Header: res.Header,
3043 HTTPStatusCode: res.StatusCode,
3044 },
3045 }
3046 target := &ret
3047 if err := gensupport.DecodeResponse(target, res); err != nil {
3048 return nil, err
3049 }
3050 return ret, nil
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081 }
3082
3083
3084
3085 type AccountsCustomchannelsGetCall struct {
3086 s *Service
3087 accountId string
3088 adClientId string
3089 customChannelId string
3090 urlParams_ gensupport.URLParams
3091 ifNoneMatch_ string
3092 ctx_ context.Context
3093 header_ http.Header
3094 }
3095
3096
3097
3098 func (r *AccountsCustomchannelsService) Get(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsGetCall {
3099 c := &AccountsCustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3100 c.accountId = accountId
3101 c.adClientId = adClientId
3102 c.customChannelId = customChannelId
3103 return c
3104 }
3105
3106
3107
3108
3109 func (c *AccountsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsGetCall {
3110 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3111 return c
3112 }
3113
3114
3115
3116
3117
3118
3119 func (c *AccountsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsGetCall {
3120 c.ifNoneMatch_ = entityTag
3121 return c
3122 }
3123
3124
3125
3126
3127 func (c *AccountsCustomchannelsGetCall) Context(ctx context.Context) *AccountsCustomchannelsGetCall {
3128 c.ctx_ = ctx
3129 return c
3130 }
3131
3132
3133
3134 func (c *AccountsCustomchannelsGetCall) Header() http.Header {
3135 if c.header_ == nil {
3136 c.header_ = make(http.Header)
3137 }
3138 return c.header_
3139 }
3140
3141 func (c *AccountsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
3142 reqHeaders := make(http.Header)
3143 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3144 for k, v := range c.header_ {
3145 reqHeaders[k] = v
3146 }
3147 reqHeaders.Set("User-Agent", c.s.userAgent())
3148 if c.ifNoneMatch_ != "" {
3149 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3150 }
3151 var body io.Reader = nil
3152 c.urlParams_.Set("alt", alt)
3153 c.urlParams_.Set("prettyPrint", "false")
3154 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}")
3155 urls += "?" + c.urlParams_.Encode()
3156 req, err := http.NewRequest("GET", urls, body)
3157 if err != nil {
3158 return nil, err
3159 }
3160 req.Header = reqHeaders
3161 googleapi.Expand(req.URL, map[string]string{
3162 "accountId": c.accountId,
3163 "adClientId": c.adClientId,
3164 "customChannelId": c.customChannelId,
3165 })
3166 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3167 }
3168
3169
3170
3171
3172
3173
3174
3175
3176 func (c *AccountsCustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
3177 gensupport.SetOptions(c.urlParams_, opts...)
3178 res, err := c.doRequest("json")
3179 if res != nil && res.StatusCode == http.StatusNotModified {
3180 if res.Body != nil {
3181 res.Body.Close()
3182 }
3183 return nil, &googleapi.Error{
3184 Code: res.StatusCode,
3185 Header: res.Header,
3186 }
3187 }
3188 if err != nil {
3189 return nil, err
3190 }
3191 defer googleapi.CloseBody(res)
3192 if err := googleapi.CheckResponse(res); err != nil {
3193 return nil, err
3194 }
3195 ret := &CustomChannel{
3196 ServerResponse: googleapi.ServerResponse{
3197 Header: res.Header,
3198 HTTPStatusCode: res.StatusCode,
3199 },
3200 }
3201 target := &ret
3202 if err := gensupport.DecodeResponse(target, res); err != nil {
3203 return nil, err
3204 }
3205 return ret, nil
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245 }
3246
3247
3248
3249 type AccountsCustomchannelsListCall struct {
3250 s *Service
3251 accountId string
3252 adClientId string
3253 urlParams_ gensupport.URLParams
3254 ifNoneMatch_ string
3255 ctx_ context.Context
3256 header_ http.Header
3257 }
3258
3259
3260
3261 func (r *AccountsCustomchannelsService) List(accountId string, adClientId string) *AccountsCustomchannelsListCall {
3262 c := &AccountsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3263 c.accountId = accountId
3264 c.adClientId = adClientId
3265 return c
3266 }
3267
3268
3269
3270
3271 func (c *AccountsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsListCall {
3272 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3273 return c
3274 }
3275
3276
3277
3278
3279
3280 func (c *AccountsCustomchannelsListCall) PageToken(pageToken string) *AccountsCustomchannelsListCall {
3281 c.urlParams_.Set("pageToken", pageToken)
3282 return c
3283 }
3284
3285
3286
3287
3288 func (c *AccountsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsListCall {
3289 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3290 return c
3291 }
3292
3293
3294
3295
3296
3297
3298 func (c *AccountsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsListCall {
3299 c.ifNoneMatch_ = entityTag
3300 return c
3301 }
3302
3303
3304
3305
3306 func (c *AccountsCustomchannelsListCall) Context(ctx context.Context) *AccountsCustomchannelsListCall {
3307 c.ctx_ = ctx
3308 return c
3309 }
3310
3311
3312
3313 func (c *AccountsCustomchannelsListCall) Header() http.Header {
3314 if c.header_ == nil {
3315 c.header_ = make(http.Header)
3316 }
3317 return c.header_
3318 }
3319
3320 func (c *AccountsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
3321 reqHeaders := make(http.Header)
3322 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3323 for k, v := range c.header_ {
3324 reqHeaders[k] = v
3325 }
3326 reqHeaders.Set("User-Agent", c.s.userAgent())
3327 if c.ifNoneMatch_ != "" {
3328 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3329 }
3330 var body io.Reader = nil
3331 c.urlParams_.Set("alt", alt)
3332 c.urlParams_.Set("prettyPrint", "false")
3333 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels")
3334 urls += "?" + c.urlParams_.Encode()
3335 req, err := http.NewRequest("GET", urls, body)
3336 if err != nil {
3337 return nil, err
3338 }
3339 req.Header = reqHeaders
3340 googleapi.Expand(req.URL, map[string]string{
3341 "accountId": c.accountId,
3342 "adClientId": c.adClientId,
3343 })
3344 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3345 }
3346
3347
3348
3349
3350
3351
3352
3353
3354 func (c *AccountsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
3355 gensupport.SetOptions(c.urlParams_, opts...)
3356 res, err := c.doRequest("json")
3357 if res != nil && res.StatusCode == http.StatusNotModified {
3358 if res.Body != nil {
3359 res.Body.Close()
3360 }
3361 return nil, &googleapi.Error{
3362 Code: res.StatusCode,
3363 Header: res.Header,
3364 }
3365 }
3366 if err != nil {
3367 return nil, err
3368 }
3369 defer googleapi.CloseBody(res)
3370 if err := googleapi.CheckResponse(res); err != nil {
3371 return nil, err
3372 }
3373 ret := &CustomChannels{
3374 ServerResponse: googleapi.ServerResponse{
3375 Header: res.Header,
3376 HTTPStatusCode: res.StatusCode,
3377 },
3378 }
3379 target := &ret
3380 if err := gensupport.DecodeResponse(target, res); err != nil {
3381 return nil, err
3382 }
3383 return ret, nil
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429 }
3430
3431
3432
3433
3434 func (c *AccountsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
3435 c.ctx_ = ctx
3436 defer c.PageToken(c.urlParams_.Get("pageToken"))
3437 for {
3438 x, err := c.Do()
3439 if err != nil {
3440 return err
3441 }
3442 if err := f(x); err != nil {
3443 return err
3444 }
3445 if x.NextPageToken == "" {
3446 return nil
3447 }
3448 c.PageToken(x.NextPageToken)
3449 }
3450 }
3451
3452
3453
3454 type AccountsCustomchannelsAdunitsListCall struct {
3455 s *Service
3456 accountId string
3457 adClientId string
3458 customChannelId string
3459 urlParams_ gensupport.URLParams
3460 ifNoneMatch_ string
3461 ctx_ context.Context
3462 header_ http.Header
3463 }
3464
3465
3466 func (r *AccountsCustomchannelsAdunitsService) List(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsAdunitsListCall {
3467 c := &AccountsCustomchannelsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3468 c.accountId = accountId
3469 c.adClientId = adClientId
3470 c.customChannelId = customChannelId
3471 return c
3472 }
3473
3474
3475
3476 func (c *AccountsCustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsCustomchannelsAdunitsListCall {
3477 c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
3478 return c
3479 }
3480
3481
3482
3483 func (c *AccountsCustomchannelsAdunitsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsAdunitsListCall {
3484 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3485 return c
3486 }
3487
3488
3489
3490
3491
3492 func (c *AccountsCustomchannelsAdunitsListCall) PageToken(pageToken string) *AccountsCustomchannelsAdunitsListCall {
3493 c.urlParams_.Set("pageToken", pageToken)
3494 return c
3495 }
3496
3497
3498
3499
3500 func (c *AccountsCustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsAdunitsListCall {
3501 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3502 return c
3503 }
3504
3505
3506
3507
3508
3509
3510 func (c *AccountsCustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsAdunitsListCall {
3511 c.ifNoneMatch_ = entityTag
3512 return c
3513 }
3514
3515
3516
3517
3518 func (c *AccountsCustomchannelsAdunitsListCall) Context(ctx context.Context) *AccountsCustomchannelsAdunitsListCall {
3519 c.ctx_ = ctx
3520 return c
3521 }
3522
3523
3524
3525 func (c *AccountsCustomchannelsAdunitsListCall) Header() http.Header {
3526 if c.header_ == nil {
3527 c.header_ = make(http.Header)
3528 }
3529 return c.header_
3530 }
3531
3532 func (c *AccountsCustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
3533 reqHeaders := make(http.Header)
3534 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3535 for k, v := range c.header_ {
3536 reqHeaders[k] = v
3537 }
3538 reqHeaders.Set("User-Agent", c.s.userAgent())
3539 if c.ifNoneMatch_ != "" {
3540 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3541 }
3542 var body io.Reader = nil
3543 c.urlParams_.Set("alt", alt)
3544 c.urlParams_.Set("prettyPrint", "false")
3545 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits")
3546 urls += "?" + c.urlParams_.Encode()
3547 req, err := http.NewRequest("GET", urls, body)
3548 if err != nil {
3549 return nil, err
3550 }
3551 req.Header = reqHeaders
3552 googleapi.Expand(req.URL, map[string]string{
3553 "accountId": c.accountId,
3554 "adClientId": c.adClientId,
3555 "customChannelId": c.customChannelId,
3556 })
3557 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3558 }
3559
3560
3561
3562
3563
3564
3565
3566
3567 func (c *AccountsCustomchannelsAdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
3568 gensupport.SetOptions(c.urlParams_, opts...)
3569 res, err := c.doRequest("json")
3570 if res != nil && res.StatusCode == http.StatusNotModified {
3571 if res.Body != nil {
3572 res.Body.Close()
3573 }
3574 return nil, &googleapi.Error{
3575 Code: res.StatusCode,
3576 Header: res.Header,
3577 }
3578 }
3579 if err != nil {
3580 return nil, err
3581 }
3582 defer googleapi.CloseBody(res)
3583 if err := googleapi.CheckResponse(res); err != nil {
3584 return nil, err
3585 }
3586 ret := &AdUnits{
3587 ServerResponse: googleapi.ServerResponse{
3588 Header: res.Header,
3589 HTTPStatusCode: res.StatusCode,
3590 },
3591 }
3592 target := &ret
3593 if err := gensupport.DecodeResponse(target, res); err != nil {
3594 return nil, err
3595 }
3596 return ret, nil
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654 }
3655
3656
3657
3658
3659 func (c *AccountsCustomchannelsAdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
3660 c.ctx_ = ctx
3661 defer c.PageToken(c.urlParams_.Get("pageToken"))
3662 for {
3663 x, err := c.Do()
3664 if err != nil {
3665 return err
3666 }
3667 if err := f(x); err != nil {
3668 return err
3669 }
3670 if x.NextPageToken == "" {
3671 return nil
3672 }
3673 c.PageToken(x.NextPageToken)
3674 }
3675 }
3676
3677
3678
3679 type AccountsReportsGenerateCall struct {
3680 s *Service
3681 accountId string
3682 urlParams_ gensupport.URLParams
3683 ifNoneMatch_ string
3684 ctx_ context.Context
3685 header_ http.Header
3686 }
3687
3688
3689
3690
3691 func (r *AccountsReportsService) Generate(accountId string, startDate string, endDate string) *AccountsReportsGenerateCall {
3692 c := &AccountsReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3693 c.accountId = accountId
3694 c.urlParams_.Set("startDate", startDate)
3695 c.urlParams_.Set("endDate", endDate)
3696 return c
3697 }
3698
3699
3700
3701
3702 func (c *AccountsReportsGenerateCall) Currency(currency string) *AccountsReportsGenerateCall {
3703 c.urlParams_.Set("currency", currency)
3704 return c
3705 }
3706
3707
3708
3709 func (c *AccountsReportsGenerateCall) Dimension(dimension ...string) *AccountsReportsGenerateCall {
3710 c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
3711 return c
3712 }
3713
3714
3715
3716 func (c *AccountsReportsGenerateCall) Filter(filter ...string) *AccountsReportsGenerateCall {
3717 c.urlParams_.SetMulti("filter", append([]string{}, filter...))
3718 return c
3719 }
3720
3721
3722
3723
3724 func (c *AccountsReportsGenerateCall) Locale(locale string) *AccountsReportsGenerateCall {
3725 c.urlParams_.Set("locale", locale)
3726 return c
3727 }
3728
3729
3730
3731 func (c *AccountsReportsGenerateCall) MaxResults(maxResults int64) *AccountsReportsGenerateCall {
3732 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3733 return c
3734 }
3735
3736
3737
3738 func (c *AccountsReportsGenerateCall) Metric(metric ...string) *AccountsReportsGenerateCall {
3739 c.urlParams_.SetMulti("metric", append([]string{}, metric...))
3740 return c
3741 }
3742
3743
3744
3745
3746
3747 func (c *AccountsReportsGenerateCall) Sort(sort ...string) *AccountsReportsGenerateCall {
3748 c.urlParams_.SetMulti("sort", append([]string{}, sort...))
3749 return c
3750 }
3751
3752
3753
3754 func (c *AccountsReportsGenerateCall) StartIndex(startIndex int64) *AccountsReportsGenerateCall {
3755 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
3756 return c
3757 }
3758
3759
3760
3761
3762
3763 func (c *AccountsReportsGenerateCall) UseTimezoneReporting(useTimezoneReporting bool) *AccountsReportsGenerateCall {
3764 c.urlParams_.Set("useTimezoneReporting", fmt.Sprint(useTimezoneReporting))
3765 return c
3766 }
3767
3768
3769
3770
3771 func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall {
3772 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3773 return c
3774 }
3775
3776
3777
3778
3779
3780
3781 func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall {
3782 c.ifNoneMatch_ = entityTag
3783 return c
3784 }
3785
3786
3787
3788
3789 func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall {
3790 c.ctx_ = ctx
3791 return c
3792 }
3793
3794
3795
3796 func (c *AccountsReportsGenerateCall) Header() http.Header {
3797 if c.header_ == nil {
3798 c.header_ = make(http.Header)
3799 }
3800 return c.header_
3801 }
3802
3803 func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
3804 reqHeaders := make(http.Header)
3805 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
3806 for k, v := range c.header_ {
3807 reqHeaders[k] = v
3808 }
3809 reqHeaders.Set("User-Agent", c.s.userAgent())
3810 if c.ifNoneMatch_ != "" {
3811 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3812 }
3813 var body io.Reader = nil
3814 c.urlParams_.Set("alt", alt)
3815 c.urlParams_.Set("prettyPrint", "false")
3816 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports")
3817 urls += "?" + c.urlParams_.Encode()
3818 req, err := http.NewRequest("GET", urls, body)
3819 if err != nil {
3820 return nil, err
3821 }
3822 req.Header = reqHeaders
3823 googleapi.Expand(req.URL, map[string]string{
3824 "accountId": c.accountId,
3825 })
3826 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3827 }
3828
3829
3830
3831
3832 func (c *AccountsReportsGenerateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
3833 gensupport.SetOptions(c.urlParams_, opts...)
3834 res, err := c.doRequest("media")
3835 if err != nil {
3836 return nil, err
3837 }
3838 if err := googleapi.CheckMediaResponse(res); err != nil {
3839 res.Body.Close()
3840 return nil, err
3841 }
3842 return res, nil
3843 }
3844
3845
3846
3847
3848
3849
3850
3851
3852 func (c *AccountsReportsGenerateCall) Do(opts ...googleapi.CallOption) (*AdsenseReportsGenerateResponse, 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 := &AdsenseReportsGenerateResponse{
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
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985 }
3986
3987
3988
3989 type AccountsReportsSavedGenerateCall struct {
3990 s *Service
3991 accountId string
3992 savedReportId string
3993 urlParams_ gensupport.URLParams
3994 ifNoneMatch_ string
3995 ctx_ context.Context
3996 header_ http.Header
3997 }
3998
3999
4000
4001 func (r *AccountsReportsSavedService) Generate(accountId string, savedReportId string) *AccountsReportsSavedGenerateCall {
4002 c := &AccountsReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4003 c.accountId = accountId
4004 c.savedReportId = savedReportId
4005 return c
4006 }
4007
4008
4009
4010
4011 func (c *AccountsReportsSavedGenerateCall) Locale(locale string) *AccountsReportsSavedGenerateCall {
4012 c.urlParams_.Set("locale", locale)
4013 return c
4014 }
4015
4016
4017
4018 func (c *AccountsReportsSavedGenerateCall) MaxResults(maxResults int64) *AccountsReportsSavedGenerateCall {
4019 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4020 return c
4021 }
4022
4023
4024
4025 func (c *AccountsReportsSavedGenerateCall) StartIndex(startIndex int64) *AccountsReportsSavedGenerateCall {
4026 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
4027 return c
4028 }
4029
4030
4031
4032
4033 func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall {
4034 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4035 return c
4036 }
4037
4038
4039
4040
4041
4042
4043 func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall {
4044 c.ifNoneMatch_ = entityTag
4045 return c
4046 }
4047
4048
4049
4050
4051 func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall {
4052 c.ctx_ = ctx
4053 return c
4054 }
4055
4056
4057
4058 func (c *AccountsReportsSavedGenerateCall) Header() http.Header {
4059 if c.header_ == nil {
4060 c.header_ = make(http.Header)
4061 }
4062 return c.header_
4063 }
4064
4065 func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
4066 reqHeaders := make(http.Header)
4067 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4068 for k, v := range c.header_ {
4069 reqHeaders[k] = v
4070 }
4071 reqHeaders.Set("User-Agent", c.s.userAgent())
4072 if c.ifNoneMatch_ != "" {
4073 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4074 }
4075 var body io.Reader = nil
4076 c.urlParams_.Set("alt", alt)
4077 c.urlParams_.Set("prettyPrint", "false")
4078 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}")
4079 urls += "?" + c.urlParams_.Encode()
4080 req, err := http.NewRequest("GET", urls, body)
4081 if err != nil {
4082 return nil, err
4083 }
4084 req.Header = reqHeaders
4085 googleapi.Expand(req.URL, map[string]string{
4086 "accountId": c.accountId,
4087 "savedReportId": c.savedReportId,
4088 })
4089 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4090 }
4091
4092
4093
4094
4095
4096
4097
4098
4099 func (c *AccountsReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*AdsenseReportsGenerateResponse, error) {
4100 gensupport.SetOptions(c.urlParams_, opts...)
4101 res, err := c.doRequest("json")
4102 if res != nil && res.StatusCode == http.StatusNotModified {
4103 if res.Body != nil {
4104 res.Body.Close()
4105 }
4106 return nil, &googleapi.Error{
4107 Code: res.StatusCode,
4108 Header: res.Header,
4109 }
4110 }
4111 if err != nil {
4112 return nil, err
4113 }
4114 defer googleapi.CloseBody(res)
4115 if err := googleapi.CheckResponse(res); err != nil {
4116 return nil, err
4117 }
4118 ret := &AdsenseReportsGenerateResponse{
4119 ServerResponse: googleapi.ServerResponse{
4120 Header: res.Header,
4121 HTTPStatusCode: res.StatusCode,
4122 },
4123 }
4124 target := &ret
4125 if err := gensupport.DecodeResponse(target, res); err != nil {
4126 return nil, err
4127 }
4128 return ret, nil
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183 }
4184
4185
4186
4187 type AccountsReportsSavedListCall struct {
4188 s *Service
4189 accountId string
4190 urlParams_ gensupport.URLParams
4191 ifNoneMatch_ string
4192 ctx_ context.Context
4193 header_ http.Header
4194 }
4195
4196
4197 func (r *AccountsReportsSavedService) List(accountId string) *AccountsReportsSavedListCall {
4198 c := &AccountsReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4199 c.accountId = accountId
4200 return c
4201 }
4202
4203
4204
4205 func (c *AccountsReportsSavedListCall) MaxResults(maxResults int64) *AccountsReportsSavedListCall {
4206 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4207 return c
4208 }
4209
4210
4211
4212
4213
4214 func (c *AccountsReportsSavedListCall) PageToken(pageToken string) *AccountsReportsSavedListCall {
4215 c.urlParams_.Set("pageToken", pageToken)
4216 return c
4217 }
4218
4219
4220
4221
4222 func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall {
4223 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4224 return c
4225 }
4226
4227
4228
4229
4230
4231
4232 func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall {
4233 c.ifNoneMatch_ = entityTag
4234 return c
4235 }
4236
4237
4238
4239
4240 func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall {
4241 c.ctx_ = ctx
4242 return c
4243 }
4244
4245
4246
4247 func (c *AccountsReportsSavedListCall) Header() http.Header {
4248 if c.header_ == nil {
4249 c.header_ = make(http.Header)
4250 }
4251 return c.header_
4252 }
4253
4254 func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
4255 reqHeaders := make(http.Header)
4256 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4257 for k, v := range c.header_ {
4258 reqHeaders[k] = v
4259 }
4260 reqHeaders.Set("User-Agent", c.s.userAgent())
4261 if c.ifNoneMatch_ != "" {
4262 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4263 }
4264 var body io.Reader = nil
4265 c.urlParams_.Set("alt", alt)
4266 c.urlParams_.Set("prettyPrint", "false")
4267 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved")
4268 urls += "?" + c.urlParams_.Encode()
4269 req, err := http.NewRequest("GET", urls, body)
4270 if err != nil {
4271 return nil, err
4272 }
4273 req.Header = reqHeaders
4274 googleapi.Expand(req.URL, map[string]string{
4275 "accountId": c.accountId,
4276 })
4277 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4278 }
4279
4280
4281
4282
4283
4284
4285
4286
4287 func (c *AccountsReportsSavedListCall) Do(opts ...googleapi.CallOption) (*SavedReports, error) {
4288 gensupport.SetOptions(c.urlParams_, opts...)
4289 res, err := c.doRequest("json")
4290 if res != nil && res.StatusCode == http.StatusNotModified {
4291 if res.Body != nil {
4292 res.Body.Close()
4293 }
4294 return nil, &googleapi.Error{
4295 Code: res.StatusCode,
4296 Header: res.Header,
4297 }
4298 }
4299 if err != nil {
4300 return nil, err
4301 }
4302 defer googleapi.CloseBody(res)
4303 if err := googleapi.CheckResponse(res); err != nil {
4304 return nil, err
4305 }
4306 ret := &SavedReports{
4307 ServerResponse: googleapi.ServerResponse{
4308 Header: res.Header,
4309 HTTPStatusCode: res.StatusCode,
4310 },
4311 }
4312 target := &ret
4313 if err := gensupport.DecodeResponse(target, res); err != nil {
4314 return nil, err
4315 }
4316 return ret, nil
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355 }
4356
4357
4358
4359
4360 func (c *AccountsReportsSavedListCall) Pages(ctx context.Context, f func(*SavedReports) error) error {
4361 c.ctx_ = ctx
4362 defer c.PageToken(c.urlParams_.Get("pageToken"))
4363 for {
4364 x, err := c.Do()
4365 if err != nil {
4366 return err
4367 }
4368 if err := f(x); err != nil {
4369 return err
4370 }
4371 if x.NextPageToken == "" {
4372 return nil
4373 }
4374 c.PageToken(x.NextPageToken)
4375 }
4376 }
4377
4378
4379
4380 type AccountsSavedadstylesGetCall struct {
4381 s *Service
4382 accountId string
4383 savedAdStyleId string
4384 urlParams_ gensupport.URLParams
4385 ifNoneMatch_ string
4386 ctx_ context.Context
4387 header_ http.Header
4388 }
4389
4390
4391 func (r *AccountsSavedadstylesService) Get(accountId string, savedAdStyleId string) *AccountsSavedadstylesGetCall {
4392 c := &AccountsSavedadstylesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4393 c.accountId = accountId
4394 c.savedAdStyleId = savedAdStyleId
4395 return c
4396 }
4397
4398
4399
4400
4401 func (c *AccountsSavedadstylesGetCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesGetCall {
4402 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4403 return c
4404 }
4405
4406
4407
4408
4409
4410
4411 func (c *AccountsSavedadstylesGetCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesGetCall {
4412 c.ifNoneMatch_ = entityTag
4413 return c
4414 }
4415
4416
4417
4418
4419 func (c *AccountsSavedadstylesGetCall) Context(ctx context.Context) *AccountsSavedadstylesGetCall {
4420 c.ctx_ = ctx
4421 return c
4422 }
4423
4424
4425
4426 func (c *AccountsSavedadstylesGetCall) Header() http.Header {
4427 if c.header_ == nil {
4428 c.header_ = make(http.Header)
4429 }
4430 return c.header_
4431 }
4432
4433 func (c *AccountsSavedadstylesGetCall) doRequest(alt string) (*http.Response, error) {
4434 reqHeaders := make(http.Header)
4435 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4436 for k, v := range c.header_ {
4437 reqHeaders[k] = v
4438 }
4439 reqHeaders.Set("User-Agent", c.s.userAgent())
4440 if c.ifNoneMatch_ != "" {
4441 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4442 }
4443 var body io.Reader = nil
4444 c.urlParams_.Set("alt", alt)
4445 c.urlParams_.Set("prettyPrint", "false")
4446 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles/{savedAdStyleId}")
4447 urls += "?" + c.urlParams_.Encode()
4448 req, err := http.NewRequest("GET", urls, body)
4449 if err != nil {
4450 return nil, err
4451 }
4452 req.Header = reqHeaders
4453 googleapi.Expand(req.URL, map[string]string{
4454 "accountId": c.accountId,
4455 "savedAdStyleId": c.savedAdStyleId,
4456 })
4457 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4458 }
4459
4460
4461
4462
4463
4464
4465
4466
4467 func (c *AccountsSavedadstylesGetCall) Do(opts ...googleapi.CallOption) (*SavedAdStyle, error) {
4468 gensupport.SetOptions(c.urlParams_, opts...)
4469 res, err := c.doRequest("json")
4470 if res != nil && res.StatusCode == http.StatusNotModified {
4471 if res.Body != nil {
4472 res.Body.Close()
4473 }
4474 return nil, &googleapi.Error{
4475 Code: res.StatusCode,
4476 Header: res.Header,
4477 }
4478 }
4479 if err != nil {
4480 return nil, err
4481 }
4482 defer googleapi.CloseBody(res)
4483 if err := googleapi.CheckResponse(res); err != nil {
4484 return nil, err
4485 }
4486 ret := &SavedAdStyle{
4487 ServerResponse: googleapi.ServerResponse{
4488 Header: res.Header,
4489 HTTPStatusCode: res.StatusCode,
4490 },
4491 }
4492 target := &ret
4493 if err := gensupport.DecodeResponse(target, res); err != nil {
4494 return nil, err
4495 }
4496 return ret, nil
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529 }
4530
4531
4532
4533 type AccountsSavedadstylesListCall struct {
4534 s *Service
4535 accountId string
4536 urlParams_ gensupport.URLParams
4537 ifNoneMatch_ string
4538 ctx_ context.Context
4539 header_ http.Header
4540 }
4541
4542
4543 func (r *AccountsSavedadstylesService) List(accountId string) *AccountsSavedadstylesListCall {
4544 c := &AccountsSavedadstylesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4545 c.accountId = accountId
4546 return c
4547 }
4548
4549
4550
4551
4552 func (c *AccountsSavedadstylesListCall) MaxResults(maxResults int64) *AccountsSavedadstylesListCall {
4553 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4554 return c
4555 }
4556
4557
4558
4559
4560
4561 func (c *AccountsSavedadstylesListCall) PageToken(pageToken string) *AccountsSavedadstylesListCall {
4562 c.urlParams_.Set("pageToken", pageToken)
4563 return c
4564 }
4565
4566
4567
4568
4569 func (c *AccountsSavedadstylesListCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesListCall {
4570 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4571 return c
4572 }
4573
4574
4575
4576
4577
4578
4579 func (c *AccountsSavedadstylesListCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesListCall {
4580 c.ifNoneMatch_ = entityTag
4581 return c
4582 }
4583
4584
4585
4586
4587 func (c *AccountsSavedadstylesListCall) Context(ctx context.Context) *AccountsSavedadstylesListCall {
4588 c.ctx_ = ctx
4589 return c
4590 }
4591
4592
4593
4594 func (c *AccountsSavedadstylesListCall) Header() http.Header {
4595 if c.header_ == nil {
4596 c.header_ = make(http.Header)
4597 }
4598 return c.header_
4599 }
4600
4601 func (c *AccountsSavedadstylesListCall) doRequest(alt string) (*http.Response, error) {
4602 reqHeaders := make(http.Header)
4603 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4604 for k, v := range c.header_ {
4605 reqHeaders[k] = v
4606 }
4607 reqHeaders.Set("User-Agent", c.s.userAgent())
4608 if c.ifNoneMatch_ != "" {
4609 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4610 }
4611 var body io.Reader = nil
4612 c.urlParams_.Set("alt", alt)
4613 c.urlParams_.Set("prettyPrint", "false")
4614 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles")
4615 urls += "?" + c.urlParams_.Encode()
4616 req, err := http.NewRequest("GET", urls, body)
4617 if err != nil {
4618 return nil, err
4619 }
4620 req.Header = reqHeaders
4621 googleapi.Expand(req.URL, map[string]string{
4622 "accountId": c.accountId,
4623 })
4624 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4625 }
4626
4627
4628
4629
4630
4631
4632
4633
4634 func (c *AccountsSavedadstylesListCall) Do(opts ...googleapi.CallOption) (*SavedAdStyles, error) {
4635 gensupport.SetOptions(c.urlParams_, opts...)
4636 res, err := c.doRequest("json")
4637 if res != nil && res.StatusCode == http.StatusNotModified {
4638 if res.Body != nil {
4639 res.Body.Close()
4640 }
4641 return nil, &googleapi.Error{
4642 Code: res.StatusCode,
4643 Header: res.Header,
4644 }
4645 }
4646 if err != nil {
4647 return nil, err
4648 }
4649 defer googleapi.CloseBody(res)
4650 if err := googleapi.CheckResponse(res); err != nil {
4651 return nil, err
4652 }
4653 ret := &SavedAdStyles{
4654 ServerResponse: googleapi.ServerResponse{
4655 Header: res.Header,
4656 HTTPStatusCode: res.StatusCode,
4657 },
4658 }
4659 target := &ret
4660 if err := gensupport.DecodeResponse(target, res); err != nil {
4661 return nil, err
4662 }
4663 return ret, nil
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702 }
4703
4704
4705
4706
4707 func (c *AccountsSavedadstylesListCall) Pages(ctx context.Context, f func(*SavedAdStyles) error) error {
4708 c.ctx_ = ctx
4709 defer c.PageToken(c.urlParams_.Get("pageToken"))
4710 for {
4711 x, err := c.Do()
4712 if err != nil {
4713 return err
4714 }
4715 if err := f(x); err != nil {
4716 return err
4717 }
4718 if x.NextPageToken == "" {
4719 return nil
4720 }
4721 c.PageToken(x.NextPageToken)
4722 }
4723 }
4724
4725
4726
4727 type AccountsUrlchannelsListCall struct {
4728 s *Service
4729 accountId string
4730 adClientId string
4731 urlParams_ gensupport.URLParams
4732 ifNoneMatch_ string
4733 ctx_ context.Context
4734 header_ http.Header
4735 }
4736
4737
4738
4739 func (r *AccountsUrlchannelsService) List(accountId string, adClientId string) *AccountsUrlchannelsListCall {
4740 c := &AccountsUrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4741 c.accountId = accountId
4742 c.adClientId = adClientId
4743 return c
4744 }
4745
4746
4747
4748 func (c *AccountsUrlchannelsListCall) MaxResults(maxResults int64) *AccountsUrlchannelsListCall {
4749 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4750 return c
4751 }
4752
4753
4754
4755
4756
4757 func (c *AccountsUrlchannelsListCall) PageToken(pageToken string) *AccountsUrlchannelsListCall {
4758 c.urlParams_.Set("pageToken", pageToken)
4759 return c
4760 }
4761
4762
4763
4764
4765 func (c *AccountsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsUrlchannelsListCall {
4766 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4767 return c
4768 }
4769
4770
4771
4772
4773
4774
4775 func (c *AccountsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsUrlchannelsListCall {
4776 c.ifNoneMatch_ = entityTag
4777 return c
4778 }
4779
4780
4781
4782
4783 func (c *AccountsUrlchannelsListCall) Context(ctx context.Context) *AccountsUrlchannelsListCall {
4784 c.ctx_ = ctx
4785 return c
4786 }
4787
4788
4789
4790 func (c *AccountsUrlchannelsListCall) Header() http.Header {
4791 if c.header_ == nil {
4792 c.header_ = make(http.Header)
4793 }
4794 return c.header_
4795 }
4796
4797 func (c *AccountsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
4798 reqHeaders := make(http.Header)
4799 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4800 for k, v := range c.header_ {
4801 reqHeaders[k] = v
4802 }
4803 reqHeaders.Set("User-Agent", c.s.userAgent())
4804 if c.ifNoneMatch_ != "" {
4805 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4806 }
4807 var body io.Reader = nil
4808 c.urlParams_.Set("alt", alt)
4809 c.urlParams_.Set("prettyPrint", "false")
4810 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels")
4811 urls += "?" + c.urlParams_.Encode()
4812 req, err := http.NewRequest("GET", urls, body)
4813 if err != nil {
4814 return nil, err
4815 }
4816 req.Header = reqHeaders
4817 googleapi.Expand(req.URL, map[string]string{
4818 "accountId": c.accountId,
4819 "adClientId": c.adClientId,
4820 })
4821 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4822 }
4823
4824
4825
4826
4827
4828
4829
4830
4831 func (c *AccountsUrlchannelsListCall) Do(opts ...googleapi.CallOption) (*UrlChannels, error) {
4832 gensupport.SetOptions(c.urlParams_, opts...)
4833 res, err := c.doRequest("json")
4834 if res != nil && res.StatusCode == http.StatusNotModified {
4835 if res.Body != nil {
4836 res.Body.Close()
4837 }
4838 return nil, &googleapi.Error{
4839 Code: res.StatusCode,
4840 Header: res.Header,
4841 }
4842 }
4843 if err != nil {
4844 return nil, err
4845 }
4846 defer googleapi.CloseBody(res)
4847 if err := googleapi.CheckResponse(res); err != nil {
4848 return nil, err
4849 }
4850 ret := &UrlChannels{
4851 ServerResponse: googleapi.ServerResponse{
4852 Header: res.Header,
4853 HTTPStatusCode: res.StatusCode,
4854 },
4855 }
4856 target := &ret
4857 if err := gensupport.DecodeResponse(target, res); err != nil {
4858 return nil, err
4859 }
4860 return ret, nil
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906 }
4907
4908
4909
4910
4911 func (c *AccountsUrlchannelsListCall) Pages(ctx context.Context, f func(*UrlChannels) error) error {
4912 c.ctx_ = ctx
4913 defer c.PageToken(c.urlParams_.Get("pageToken"))
4914 for {
4915 x, err := c.Do()
4916 if err != nil {
4917 return err
4918 }
4919 if err := f(x); err != nil {
4920 return err
4921 }
4922 if x.NextPageToken == "" {
4923 return nil
4924 }
4925 c.PageToken(x.NextPageToken)
4926 }
4927 }
4928
4929
4930
4931 type AdclientsListCall struct {
4932 s *Service
4933 urlParams_ gensupport.URLParams
4934 ifNoneMatch_ string
4935 ctx_ context.Context
4936 header_ http.Header
4937 }
4938
4939
4940 func (r *AdclientsService) List() *AdclientsListCall {
4941 c := &AdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4942 return c
4943 }
4944
4945
4946
4947 func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall {
4948 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4949 return c
4950 }
4951
4952
4953
4954
4955
4956 func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall {
4957 c.urlParams_.Set("pageToken", pageToken)
4958 return c
4959 }
4960
4961
4962
4963
4964 func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall {
4965 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4966 return c
4967 }
4968
4969
4970
4971
4972
4973
4974 func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall {
4975 c.ifNoneMatch_ = entityTag
4976 return c
4977 }
4978
4979
4980
4981
4982 func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall {
4983 c.ctx_ = ctx
4984 return c
4985 }
4986
4987
4988
4989 func (c *AdclientsListCall) Header() http.Header {
4990 if c.header_ == nil {
4991 c.header_ = make(http.Header)
4992 }
4993 return c.header_
4994 }
4995
4996 func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) {
4997 reqHeaders := make(http.Header)
4998 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
4999 for k, v := range c.header_ {
5000 reqHeaders[k] = v
5001 }
5002 reqHeaders.Set("User-Agent", c.s.userAgent())
5003 if c.ifNoneMatch_ != "" {
5004 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5005 }
5006 var body io.Reader = nil
5007 c.urlParams_.Set("alt", alt)
5008 c.urlParams_.Set("prettyPrint", "false")
5009 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients")
5010 urls += "?" + c.urlParams_.Encode()
5011 req, err := http.NewRequest("GET", urls, body)
5012 if err != nil {
5013 return nil, err
5014 }
5015 req.Header = reqHeaders
5016 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5017 }
5018
5019
5020
5021
5022
5023
5024
5025
5026 func (c *AdclientsListCall) Do(opts ...googleapi.CallOption) (*AdClients, error) {
5027 gensupport.SetOptions(c.urlParams_, opts...)
5028 res, err := c.doRequest("json")
5029 if res != nil && res.StatusCode == http.StatusNotModified {
5030 if res.Body != nil {
5031 res.Body.Close()
5032 }
5033 return nil, &googleapi.Error{
5034 Code: res.StatusCode,
5035 Header: res.Header,
5036 }
5037 }
5038 if err != nil {
5039 return nil, err
5040 }
5041 defer googleapi.CloseBody(res)
5042 if err := googleapi.CheckResponse(res); err != nil {
5043 return nil, err
5044 }
5045 ret := &AdClients{
5046 ServerResponse: googleapi.ServerResponse{
5047 Header: res.Header,
5048 HTTPStatusCode: res.StatusCode,
5049 },
5050 }
5051 target := &ret
5052 if err := gensupport.DecodeResponse(target, res); err != nil {
5053 return nil, err
5054 }
5055 return ret, nil
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085 }
5086
5087
5088
5089
5090 func (c *AdclientsListCall) Pages(ctx context.Context, f func(*AdClients) error) error {
5091 c.ctx_ = ctx
5092 defer c.PageToken(c.urlParams_.Get("pageToken"))
5093 for {
5094 x, err := c.Do()
5095 if err != nil {
5096 return err
5097 }
5098 if err := f(x); err != nil {
5099 return err
5100 }
5101 if x.NextPageToken == "" {
5102 return nil
5103 }
5104 c.PageToken(x.NextPageToken)
5105 }
5106 }
5107
5108
5109
5110 type AdunitsGetCall struct {
5111 s *Service
5112 adClientId string
5113 adUnitId string
5114 urlParams_ gensupport.URLParams
5115 ifNoneMatch_ string
5116 ctx_ context.Context
5117 header_ http.Header
5118 }
5119
5120
5121 func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall {
5122 c := &AdunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5123 c.adClientId = adClientId
5124 c.adUnitId = adUnitId
5125 return c
5126 }
5127
5128
5129
5130
5131 func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall {
5132 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5133 return c
5134 }
5135
5136
5137
5138
5139
5140
5141 func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall {
5142 c.ifNoneMatch_ = entityTag
5143 return c
5144 }
5145
5146
5147
5148
5149 func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall {
5150 c.ctx_ = ctx
5151 return c
5152 }
5153
5154
5155
5156 func (c *AdunitsGetCall) Header() http.Header {
5157 if c.header_ == nil {
5158 c.header_ = make(http.Header)
5159 }
5160 return c.header_
5161 }
5162
5163 func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) {
5164 reqHeaders := make(http.Header)
5165 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5166 for k, v := range c.header_ {
5167 reqHeaders[k] = v
5168 }
5169 reqHeaders.Set("User-Agent", c.s.userAgent())
5170 if c.ifNoneMatch_ != "" {
5171 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5172 }
5173 var body io.Reader = nil
5174 c.urlParams_.Set("alt", alt)
5175 c.urlParams_.Set("prettyPrint", "false")
5176 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}")
5177 urls += "?" + c.urlParams_.Encode()
5178 req, err := http.NewRequest("GET", urls, body)
5179 if err != nil {
5180 return nil, err
5181 }
5182 req.Header = reqHeaders
5183 googleapi.Expand(req.URL, map[string]string{
5184 "adClientId": c.adClientId,
5185 "adUnitId": c.adUnitId,
5186 })
5187 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5188 }
5189
5190
5191
5192
5193
5194
5195
5196
5197 func (c *AdunitsGetCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
5198 gensupport.SetOptions(c.urlParams_, opts...)
5199 res, err := c.doRequest("json")
5200 if res != nil && res.StatusCode == http.StatusNotModified {
5201 if res.Body != nil {
5202 res.Body.Close()
5203 }
5204 return nil, &googleapi.Error{
5205 Code: res.StatusCode,
5206 Header: res.Header,
5207 }
5208 }
5209 if err != nil {
5210 return nil, err
5211 }
5212 defer googleapi.CloseBody(res)
5213 if err := googleapi.CheckResponse(res); err != nil {
5214 return nil, err
5215 }
5216 ret := &AdUnit{
5217 ServerResponse: googleapi.ServerResponse{
5218 Header: res.Header,
5219 HTTPStatusCode: res.StatusCode,
5220 },
5221 }
5222 target := &ret
5223 if err := gensupport.DecodeResponse(target, res); err != nil {
5224 return nil, err
5225 }
5226 return ret, nil
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259 }
5260
5261
5262
5263 type AdunitsGetAdCodeCall struct {
5264 s *Service
5265 adClientId string
5266 adUnitId string
5267 urlParams_ gensupport.URLParams
5268 ifNoneMatch_ string
5269 ctx_ context.Context
5270 header_ http.Header
5271 }
5272
5273
5274 func (r *AdunitsService) GetAdCode(adClientId string, adUnitId string) *AdunitsGetAdCodeCall {
5275 c := &AdunitsGetAdCodeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5276 c.adClientId = adClientId
5277 c.adUnitId = adUnitId
5278 return c
5279 }
5280
5281
5282
5283
5284 func (c *AdunitsGetAdCodeCall) Fields(s ...googleapi.Field) *AdunitsGetAdCodeCall {
5285 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5286 return c
5287 }
5288
5289
5290
5291
5292
5293
5294 func (c *AdunitsGetAdCodeCall) IfNoneMatch(entityTag string) *AdunitsGetAdCodeCall {
5295 c.ifNoneMatch_ = entityTag
5296 return c
5297 }
5298
5299
5300
5301
5302 func (c *AdunitsGetAdCodeCall) Context(ctx context.Context) *AdunitsGetAdCodeCall {
5303 c.ctx_ = ctx
5304 return c
5305 }
5306
5307
5308
5309 func (c *AdunitsGetAdCodeCall) Header() http.Header {
5310 if c.header_ == nil {
5311 c.header_ = make(http.Header)
5312 }
5313 return c.header_
5314 }
5315
5316 func (c *AdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, error) {
5317 reqHeaders := make(http.Header)
5318 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5319 for k, v := range c.header_ {
5320 reqHeaders[k] = v
5321 }
5322 reqHeaders.Set("User-Agent", c.s.userAgent())
5323 if c.ifNoneMatch_ != "" {
5324 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5325 }
5326 var body io.Reader = nil
5327 c.urlParams_.Set("alt", alt)
5328 c.urlParams_.Set("prettyPrint", "false")
5329 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/adcode")
5330 urls += "?" + c.urlParams_.Encode()
5331 req, err := http.NewRequest("GET", urls, body)
5332 if err != nil {
5333 return nil, err
5334 }
5335 req.Header = reqHeaders
5336 googleapi.Expand(req.URL, map[string]string{
5337 "adClientId": c.adClientId,
5338 "adUnitId": c.adUnitId,
5339 })
5340 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5341 }
5342
5343
5344
5345
5346
5347
5348
5349
5350 func (c *AdunitsGetAdCodeCall) Do(opts ...googleapi.CallOption) (*AdCode, error) {
5351 gensupport.SetOptions(c.urlParams_, opts...)
5352 res, err := c.doRequest("json")
5353 if res != nil && res.StatusCode == http.StatusNotModified {
5354 if res.Body != nil {
5355 res.Body.Close()
5356 }
5357 return nil, &googleapi.Error{
5358 Code: res.StatusCode,
5359 Header: res.Header,
5360 }
5361 }
5362 if err != nil {
5363 return nil, err
5364 }
5365 defer googleapi.CloseBody(res)
5366 if err := googleapi.CheckResponse(res); err != nil {
5367 return nil, err
5368 }
5369 ret := &AdCode{
5370 ServerResponse: googleapi.ServerResponse{
5371 Header: res.Header,
5372 HTTPStatusCode: res.StatusCode,
5373 },
5374 }
5375 target := &ret
5376 if err := gensupport.DecodeResponse(target, res); err != nil {
5377 return nil, err
5378 }
5379 return ret, nil
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412 }
5413
5414
5415
5416 type AdunitsListCall struct {
5417 s *Service
5418 adClientId string
5419 urlParams_ gensupport.URLParams
5420 ifNoneMatch_ string
5421 ctx_ context.Context
5422 header_ http.Header
5423 }
5424
5425
5426
5427 func (r *AdunitsService) List(adClientId string) *AdunitsListCall {
5428 c := &AdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5429 c.adClientId = adClientId
5430 return c
5431 }
5432
5433
5434
5435 func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall {
5436 c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
5437 return c
5438 }
5439
5440
5441
5442 func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall {
5443 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
5444 return c
5445 }
5446
5447
5448
5449
5450
5451 func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall {
5452 c.urlParams_.Set("pageToken", pageToken)
5453 return c
5454 }
5455
5456
5457
5458
5459 func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall {
5460 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5461 return c
5462 }
5463
5464
5465
5466
5467
5468
5469 func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall {
5470 c.ifNoneMatch_ = entityTag
5471 return c
5472 }
5473
5474
5475
5476
5477 func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall {
5478 c.ctx_ = ctx
5479 return c
5480 }
5481
5482
5483
5484 func (c *AdunitsListCall) Header() http.Header {
5485 if c.header_ == nil {
5486 c.header_ = make(http.Header)
5487 }
5488 return c.header_
5489 }
5490
5491 func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) {
5492 reqHeaders := make(http.Header)
5493 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5494 for k, v := range c.header_ {
5495 reqHeaders[k] = v
5496 }
5497 reqHeaders.Set("User-Agent", c.s.userAgent())
5498 if c.ifNoneMatch_ != "" {
5499 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5500 }
5501 var body io.Reader = nil
5502 c.urlParams_.Set("alt", alt)
5503 c.urlParams_.Set("prettyPrint", "false")
5504 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits")
5505 urls += "?" + c.urlParams_.Encode()
5506 req, err := http.NewRequest("GET", urls, body)
5507 if err != nil {
5508 return nil, err
5509 }
5510 req.Header = reqHeaders
5511 googleapi.Expand(req.URL, map[string]string{
5512 "adClientId": c.adClientId,
5513 })
5514 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5515 }
5516
5517
5518
5519
5520
5521
5522
5523
5524 func (c *AdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
5525 gensupport.SetOptions(c.urlParams_, opts...)
5526 res, err := c.doRequest("json")
5527 if res != nil && res.StatusCode == http.StatusNotModified {
5528 if res.Body != nil {
5529 res.Body.Close()
5530 }
5531 return nil, &googleapi.Error{
5532 Code: res.StatusCode,
5533 Header: res.Header,
5534 }
5535 }
5536 if err != nil {
5537 return nil, err
5538 }
5539 defer googleapi.CloseBody(res)
5540 if err := googleapi.CheckResponse(res); err != nil {
5541 return nil, err
5542 }
5543 ret := &AdUnits{
5544 ServerResponse: googleapi.ServerResponse{
5545 Header: res.Header,
5546 HTTPStatusCode: res.StatusCode,
5547 },
5548 }
5549 target := &ret
5550 if err := gensupport.DecodeResponse(target, res); err != nil {
5551 return nil, err
5552 }
5553 return ret, nil
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597 }
5598
5599
5600
5601
5602 func (c *AdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
5603 c.ctx_ = ctx
5604 defer c.PageToken(c.urlParams_.Get("pageToken"))
5605 for {
5606 x, err := c.Do()
5607 if err != nil {
5608 return err
5609 }
5610 if err := f(x); err != nil {
5611 return err
5612 }
5613 if x.NextPageToken == "" {
5614 return nil
5615 }
5616 c.PageToken(x.NextPageToken)
5617 }
5618 }
5619
5620
5621
5622 type AdunitsCustomchannelsListCall struct {
5623 s *Service
5624 adClientId string
5625 adUnitId string
5626 urlParams_ gensupport.URLParams
5627 ifNoneMatch_ string
5628 ctx_ context.Context
5629 header_ http.Header
5630 }
5631
5632
5633
5634 func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall {
5635 c := &AdunitsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5636 c.adClientId = adClientId
5637 c.adUnitId = adUnitId
5638 return c
5639 }
5640
5641
5642
5643
5644 func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall {
5645 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
5646 return c
5647 }
5648
5649
5650
5651
5652
5653 func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall {
5654 c.urlParams_.Set("pageToken", pageToken)
5655 return c
5656 }
5657
5658
5659
5660
5661 func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall {
5662 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5663 return c
5664 }
5665
5666
5667
5668
5669
5670
5671 func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall {
5672 c.ifNoneMatch_ = entityTag
5673 return c
5674 }
5675
5676
5677
5678
5679 func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall {
5680 c.ctx_ = ctx
5681 return c
5682 }
5683
5684
5685
5686 func (c *AdunitsCustomchannelsListCall) Header() http.Header {
5687 if c.header_ == nil {
5688 c.header_ = make(http.Header)
5689 }
5690 return c.header_
5691 }
5692
5693 func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
5694 reqHeaders := make(http.Header)
5695 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5696 for k, v := range c.header_ {
5697 reqHeaders[k] = v
5698 }
5699 reqHeaders.Set("User-Agent", c.s.userAgent())
5700 if c.ifNoneMatch_ != "" {
5701 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5702 }
5703 var body io.Reader = nil
5704 c.urlParams_.Set("alt", alt)
5705 c.urlParams_.Set("prettyPrint", "false")
5706 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels")
5707 urls += "?" + c.urlParams_.Encode()
5708 req, err := http.NewRequest("GET", urls, body)
5709 if err != nil {
5710 return nil, err
5711 }
5712 req.Header = reqHeaders
5713 googleapi.Expand(req.URL, map[string]string{
5714 "adClientId": c.adClientId,
5715 "adUnitId": c.adUnitId,
5716 })
5717 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5718 }
5719
5720
5721
5722
5723
5724
5725
5726
5727 func (c *AdunitsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
5728 gensupport.SetOptions(c.urlParams_, opts...)
5729 res, err := c.doRequest("json")
5730 if res != nil && res.StatusCode == http.StatusNotModified {
5731 if res.Body != nil {
5732 res.Body.Close()
5733 }
5734 return nil, &googleapi.Error{
5735 Code: res.StatusCode,
5736 Header: res.Header,
5737 }
5738 }
5739 if err != nil {
5740 return nil, err
5741 }
5742 defer googleapi.CloseBody(res)
5743 if err := googleapi.CheckResponse(res); err != nil {
5744 return nil, err
5745 }
5746 ret := &CustomChannels{
5747 ServerResponse: googleapi.ServerResponse{
5748 Header: res.Header,
5749 HTTPStatusCode: res.StatusCode,
5750 },
5751 }
5752 target := &ret
5753 if err := gensupport.DecodeResponse(target, res); err != nil {
5754 return nil, err
5755 }
5756 return ret, nil
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802 }
5803
5804
5805
5806
5807 func (c *AdunitsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
5808 c.ctx_ = ctx
5809 defer c.PageToken(c.urlParams_.Get("pageToken"))
5810 for {
5811 x, err := c.Do()
5812 if err != nil {
5813 return err
5814 }
5815 if err := f(x); err != nil {
5816 return err
5817 }
5818 if x.NextPageToken == "" {
5819 return nil
5820 }
5821 c.PageToken(x.NextPageToken)
5822 }
5823 }
5824
5825
5826
5827 type AlertsListCall struct {
5828 s *Service
5829 urlParams_ gensupport.URLParams
5830 ifNoneMatch_ string
5831 ctx_ context.Context
5832 header_ http.Header
5833 }
5834
5835
5836 func (r *AlertsService) List() *AlertsListCall {
5837 c := &AlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5838 return c
5839 }
5840
5841
5842
5843
5844
5845 func (c *AlertsListCall) Locale(locale string) *AlertsListCall {
5846 c.urlParams_.Set("locale", locale)
5847 return c
5848 }
5849
5850
5851
5852
5853 func (c *AlertsListCall) Fields(s ...googleapi.Field) *AlertsListCall {
5854 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5855 return c
5856 }
5857
5858
5859
5860
5861
5862
5863 func (c *AlertsListCall) IfNoneMatch(entityTag string) *AlertsListCall {
5864 c.ifNoneMatch_ = entityTag
5865 return c
5866 }
5867
5868
5869
5870
5871 func (c *AlertsListCall) Context(ctx context.Context) *AlertsListCall {
5872 c.ctx_ = ctx
5873 return c
5874 }
5875
5876
5877
5878 func (c *AlertsListCall) Header() http.Header {
5879 if c.header_ == nil {
5880 c.header_ = make(http.Header)
5881 }
5882 return c.header_
5883 }
5884
5885 func (c *AlertsListCall) doRequest(alt string) (*http.Response, error) {
5886 reqHeaders := make(http.Header)
5887 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
5888 for k, v := range c.header_ {
5889 reqHeaders[k] = v
5890 }
5891 reqHeaders.Set("User-Agent", c.s.userAgent())
5892 if c.ifNoneMatch_ != "" {
5893 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5894 }
5895 var body io.Reader = nil
5896 c.urlParams_.Set("alt", alt)
5897 c.urlParams_.Set("prettyPrint", "false")
5898 urls := googleapi.ResolveRelative(c.s.BasePath, "alerts")
5899 urls += "?" + c.urlParams_.Encode()
5900 req, err := http.NewRequest("GET", urls, body)
5901 if err != nil {
5902 return nil, err
5903 }
5904 req.Header = reqHeaders
5905 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5906 }
5907
5908
5909
5910
5911
5912
5913
5914
5915 func (c *AlertsListCall) Do(opts ...googleapi.CallOption) (*Alerts, error) {
5916 gensupport.SetOptions(c.urlParams_, opts...)
5917 res, err := c.doRequest("json")
5918 if res != nil && res.StatusCode == http.StatusNotModified {
5919 if res.Body != nil {
5920 res.Body.Close()
5921 }
5922 return nil, &googleapi.Error{
5923 Code: res.StatusCode,
5924 Header: res.Header,
5925 }
5926 }
5927 if err != nil {
5928 return nil, err
5929 }
5930 defer googleapi.CloseBody(res)
5931 if err := googleapi.CheckResponse(res); err != nil {
5932 return nil, err
5933 }
5934 ret := &Alerts{
5935 ServerResponse: googleapi.ServerResponse{
5936 Header: res.Header,
5937 HTTPStatusCode: res.StatusCode,
5938 },
5939 }
5940 target := &ret
5941 if err := gensupport.DecodeResponse(target, res); err != nil {
5942 return nil, err
5943 }
5944 return ret, nil
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966 }
5967
5968
5969
5970 type CustomchannelsGetCall struct {
5971 s *Service
5972 adClientId string
5973 customChannelId string
5974 urlParams_ gensupport.URLParams
5975 ifNoneMatch_ string
5976 ctx_ context.Context
5977 header_ http.Header
5978 }
5979
5980
5981 func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall {
5982 c := &CustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5983 c.adClientId = adClientId
5984 c.customChannelId = customChannelId
5985 return c
5986 }
5987
5988
5989
5990
5991 func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall {
5992 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5993 return c
5994 }
5995
5996
5997
5998
5999
6000
6001 func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall {
6002 c.ifNoneMatch_ = entityTag
6003 return c
6004 }
6005
6006
6007
6008
6009 func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall {
6010 c.ctx_ = ctx
6011 return c
6012 }
6013
6014
6015
6016 func (c *CustomchannelsGetCall) Header() http.Header {
6017 if c.header_ == nil {
6018 c.header_ = make(http.Header)
6019 }
6020 return c.header_
6021 }
6022
6023 func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
6024 reqHeaders := make(http.Header)
6025 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
6026 for k, v := range c.header_ {
6027 reqHeaders[k] = v
6028 }
6029 reqHeaders.Set("User-Agent", c.s.userAgent())
6030 if c.ifNoneMatch_ != "" {
6031 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6032 }
6033 var body io.Reader = nil
6034 c.urlParams_.Set("alt", alt)
6035 c.urlParams_.Set("prettyPrint", "false")
6036 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}")
6037 urls += "?" + c.urlParams_.Encode()
6038 req, err := http.NewRequest("GET", urls, body)
6039 if err != nil {
6040 return nil, err
6041 }
6042 req.Header = reqHeaders
6043 googleapi.Expand(req.URL, map[string]string{
6044 "adClientId": c.adClientId,
6045 "customChannelId": c.customChannelId,
6046 })
6047 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6048 }
6049
6050
6051
6052
6053
6054
6055
6056
6057 func (c *CustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
6058 gensupport.SetOptions(c.urlParams_, opts...)
6059 res, err := c.doRequest("json")
6060 if res != nil && res.StatusCode == http.StatusNotModified {
6061 if res.Body != nil {
6062 res.Body.Close()
6063 }
6064 return nil, &googleapi.Error{
6065 Code: res.StatusCode,
6066 Header: res.Header,
6067 }
6068 }
6069 if err != nil {
6070 return nil, err
6071 }
6072 defer googleapi.CloseBody(res)
6073 if err := googleapi.CheckResponse(res); err != nil {
6074 return nil, err
6075 }
6076 ret := &CustomChannel{
6077 ServerResponse: googleapi.ServerResponse{
6078 Header: res.Header,
6079 HTTPStatusCode: res.StatusCode,
6080 },
6081 }
6082 target := &ret
6083 if err := gensupport.DecodeResponse(target, res); err != nil {
6084 return nil, err
6085 }
6086 return ret, nil
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119 }
6120
6121
6122
6123 type CustomchannelsListCall struct {
6124 s *Service
6125 adClientId string
6126 urlParams_ gensupport.URLParams
6127 ifNoneMatch_ string
6128 ctx_ context.Context
6129 header_ http.Header
6130 }
6131
6132
6133
6134 func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall {
6135 c := &CustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6136 c.adClientId = adClientId
6137 return c
6138 }
6139
6140
6141
6142
6143 func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall {
6144 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
6145 return c
6146 }
6147
6148
6149
6150
6151
6152 func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall {
6153 c.urlParams_.Set("pageToken", pageToken)
6154 return c
6155 }
6156
6157
6158
6159
6160 func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall {
6161 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6162 return c
6163 }
6164
6165
6166
6167
6168
6169
6170 func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall {
6171 c.ifNoneMatch_ = entityTag
6172 return c
6173 }
6174
6175
6176
6177
6178 func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall {
6179 c.ctx_ = ctx
6180 return c
6181 }
6182
6183
6184
6185 func (c *CustomchannelsListCall) Header() http.Header {
6186 if c.header_ == nil {
6187 c.header_ = make(http.Header)
6188 }
6189 return c.header_
6190 }
6191
6192 func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
6193 reqHeaders := make(http.Header)
6194 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
6195 for k, v := range c.header_ {
6196 reqHeaders[k] = v
6197 }
6198 reqHeaders.Set("User-Agent", c.s.userAgent())
6199 if c.ifNoneMatch_ != "" {
6200 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6201 }
6202 var body io.Reader = nil
6203 c.urlParams_.Set("alt", alt)
6204 c.urlParams_.Set("prettyPrint", "false")
6205 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels")
6206 urls += "?" + c.urlParams_.Encode()
6207 req, err := http.NewRequest("GET", urls, body)
6208 if err != nil {
6209 return nil, err
6210 }
6211 req.Header = reqHeaders
6212 googleapi.Expand(req.URL, map[string]string{
6213 "adClientId": c.adClientId,
6214 })
6215 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6216 }
6217
6218
6219
6220
6221
6222
6223
6224
6225 func (c *CustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
6226 gensupport.SetOptions(c.urlParams_, opts...)
6227 res, err := c.doRequest("json")
6228 if res != nil && res.StatusCode == http.StatusNotModified {
6229 if res.Body != nil {
6230 res.Body.Close()
6231 }
6232 return nil, &googleapi.Error{
6233 Code: res.StatusCode,
6234 Header: res.Header,
6235 }
6236 }
6237 if err != nil {
6238 return nil, err
6239 }
6240 defer googleapi.CloseBody(res)
6241 if err := googleapi.CheckResponse(res); err != nil {
6242 return nil, err
6243 }
6244 ret := &CustomChannels{
6245 ServerResponse: googleapi.ServerResponse{
6246 Header: res.Header,
6247 HTTPStatusCode: res.StatusCode,
6248 },
6249 }
6250 target := &ret
6251 if err := gensupport.DecodeResponse(target, res); err != nil {
6252 return nil, err
6253 }
6254 return ret, nil
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293 }
6294
6295
6296
6297
6298 func (c *CustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
6299 c.ctx_ = ctx
6300 defer c.PageToken(c.urlParams_.Get("pageToken"))
6301 for {
6302 x, err := c.Do()
6303 if err != nil {
6304 return err
6305 }
6306 if err := f(x); err != nil {
6307 return err
6308 }
6309 if x.NextPageToken == "" {
6310 return nil
6311 }
6312 c.PageToken(x.NextPageToken)
6313 }
6314 }
6315
6316
6317
6318 type CustomchannelsAdunitsListCall struct {
6319 s *Service
6320 adClientId string
6321 customChannelId string
6322 urlParams_ gensupport.URLParams
6323 ifNoneMatch_ string
6324 ctx_ context.Context
6325 header_ http.Header
6326 }
6327
6328
6329 func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall {
6330 c := &CustomchannelsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6331 c.adClientId = adClientId
6332 c.customChannelId = customChannelId
6333 return c
6334 }
6335
6336
6337
6338 func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall {
6339 c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
6340 return c
6341 }
6342
6343
6344
6345 func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall {
6346 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
6347 return c
6348 }
6349
6350
6351
6352
6353
6354 func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall {
6355 c.urlParams_.Set("pageToken", pageToken)
6356 return c
6357 }
6358
6359
6360
6361
6362 func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall {
6363 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6364 return c
6365 }
6366
6367
6368
6369
6370
6371
6372 func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall {
6373 c.ifNoneMatch_ = entityTag
6374 return c
6375 }
6376
6377
6378
6379
6380 func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall {
6381 c.ctx_ = ctx
6382 return c
6383 }
6384
6385
6386
6387 func (c *CustomchannelsAdunitsListCall) Header() http.Header {
6388 if c.header_ == nil {
6389 c.header_ = make(http.Header)
6390 }
6391 return c.header_
6392 }
6393
6394 func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
6395 reqHeaders := make(http.Header)
6396 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
6397 for k, v := range c.header_ {
6398 reqHeaders[k] = v
6399 }
6400 reqHeaders.Set("User-Agent", c.s.userAgent())
6401 if c.ifNoneMatch_ != "" {
6402 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6403 }
6404 var body io.Reader = nil
6405 c.urlParams_.Set("alt", alt)
6406 c.urlParams_.Set("prettyPrint", "false")
6407 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits")
6408 urls += "?" + c.urlParams_.Encode()
6409 req, err := http.NewRequest("GET", urls, body)
6410 if err != nil {
6411 return nil, err
6412 }
6413 req.Header = reqHeaders
6414 googleapi.Expand(req.URL, map[string]string{
6415 "adClientId": c.adClientId,
6416 "customChannelId": c.customChannelId,
6417 })
6418 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6419 }
6420
6421
6422
6423
6424
6425
6426
6427
6428 func (c *CustomchannelsAdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
6429 gensupport.SetOptions(c.urlParams_, opts...)
6430 res, err := c.doRequest("json")
6431 if res != nil && res.StatusCode == http.StatusNotModified {
6432 if res.Body != nil {
6433 res.Body.Close()
6434 }
6435 return nil, &googleapi.Error{
6436 Code: res.StatusCode,
6437 Header: res.Header,
6438 }
6439 }
6440 if err != nil {
6441 return nil, err
6442 }
6443 defer googleapi.CloseBody(res)
6444 if err := googleapi.CheckResponse(res); err != nil {
6445 return nil, err
6446 }
6447 ret := &AdUnits{
6448 ServerResponse: googleapi.ServerResponse{
6449 Header: res.Header,
6450 HTTPStatusCode: res.StatusCode,
6451 },
6452 }
6453 target := &ret
6454 if err := gensupport.DecodeResponse(target, res); err != nil {
6455 return nil, err
6456 }
6457 return ret, nil
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508 }
6509
6510
6511
6512
6513 func (c *CustomchannelsAdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
6514 c.ctx_ = ctx
6515 defer c.PageToken(c.urlParams_.Get("pageToken"))
6516 for {
6517 x, err := c.Do()
6518 if err != nil {
6519 return err
6520 }
6521 if err := f(x); err != nil {
6522 return err
6523 }
6524 if x.NextPageToken == "" {
6525 return nil
6526 }
6527 c.PageToken(x.NextPageToken)
6528 }
6529 }
6530
6531
6532
6533 type MetadataDimensionsListCall struct {
6534 s *Service
6535 urlParams_ gensupport.URLParams
6536 ifNoneMatch_ string
6537 ctx_ context.Context
6538 header_ http.Header
6539 }
6540
6541
6542
6543 func (r *MetadataDimensionsService) List() *MetadataDimensionsListCall {
6544 c := &MetadataDimensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6545 return c
6546 }
6547
6548
6549
6550
6551 func (c *MetadataDimensionsListCall) Fields(s ...googleapi.Field) *MetadataDimensionsListCall {
6552 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6553 return c
6554 }
6555
6556
6557
6558
6559
6560
6561 func (c *MetadataDimensionsListCall) IfNoneMatch(entityTag string) *MetadataDimensionsListCall {
6562 c.ifNoneMatch_ = entityTag
6563 return c
6564 }
6565
6566
6567
6568
6569 func (c *MetadataDimensionsListCall) Context(ctx context.Context) *MetadataDimensionsListCall {
6570 c.ctx_ = ctx
6571 return c
6572 }
6573
6574
6575
6576 func (c *MetadataDimensionsListCall) Header() http.Header {
6577 if c.header_ == nil {
6578 c.header_ = make(http.Header)
6579 }
6580 return c.header_
6581 }
6582
6583 func (c *MetadataDimensionsListCall) doRequest(alt string) (*http.Response, error) {
6584 reqHeaders := make(http.Header)
6585 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
6586 for k, v := range c.header_ {
6587 reqHeaders[k] = v
6588 }
6589 reqHeaders.Set("User-Agent", c.s.userAgent())
6590 if c.ifNoneMatch_ != "" {
6591 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6592 }
6593 var body io.Reader = nil
6594 c.urlParams_.Set("alt", alt)
6595 c.urlParams_.Set("prettyPrint", "false")
6596 urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/dimensions")
6597 urls += "?" + c.urlParams_.Encode()
6598 req, err := http.NewRequest("GET", urls, body)
6599 if err != nil {
6600 return nil, err
6601 }
6602 req.Header = reqHeaders
6603 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6604 }
6605
6606
6607
6608
6609
6610
6611
6612
6613 func (c *MetadataDimensionsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
6614 gensupport.SetOptions(c.urlParams_, opts...)
6615 res, err := c.doRequest("json")
6616 if res != nil && res.StatusCode == http.StatusNotModified {
6617 if res.Body != nil {
6618 res.Body.Close()
6619 }
6620 return nil, &googleapi.Error{
6621 Code: res.StatusCode,
6622 Header: res.Header,
6623 }
6624 }
6625 if err != nil {
6626 return nil, err
6627 }
6628 defer googleapi.CloseBody(res)
6629 if err := googleapi.CheckResponse(res); err != nil {
6630 return nil, err
6631 }
6632 ret := &Metadata{
6633 ServerResponse: googleapi.ServerResponse{
6634 Header: res.Header,
6635 HTTPStatusCode: res.StatusCode,
6636 },
6637 }
6638 target := &ret
6639 if err := gensupport.DecodeResponse(target, res); err != nil {
6640 return nil, err
6641 }
6642 return ret, nil
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657 }
6658
6659
6660
6661 type MetadataMetricsListCall struct {
6662 s *Service
6663 urlParams_ gensupport.URLParams
6664 ifNoneMatch_ string
6665 ctx_ context.Context
6666 header_ http.Header
6667 }
6668
6669
6670
6671 func (r *MetadataMetricsService) List() *MetadataMetricsListCall {
6672 c := &MetadataMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6673 return c
6674 }
6675
6676
6677
6678
6679 func (c *MetadataMetricsListCall) Fields(s ...googleapi.Field) *MetadataMetricsListCall {
6680 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6681 return c
6682 }
6683
6684
6685
6686
6687
6688
6689 func (c *MetadataMetricsListCall) IfNoneMatch(entityTag string) *MetadataMetricsListCall {
6690 c.ifNoneMatch_ = entityTag
6691 return c
6692 }
6693
6694
6695
6696
6697 func (c *MetadataMetricsListCall) Context(ctx context.Context) *MetadataMetricsListCall {
6698 c.ctx_ = ctx
6699 return c
6700 }
6701
6702
6703
6704 func (c *MetadataMetricsListCall) Header() http.Header {
6705 if c.header_ == nil {
6706 c.header_ = make(http.Header)
6707 }
6708 return c.header_
6709 }
6710
6711 func (c *MetadataMetricsListCall) doRequest(alt string) (*http.Response, error) {
6712 reqHeaders := make(http.Header)
6713 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
6714 for k, v := range c.header_ {
6715 reqHeaders[k] = v
6716 }
6717 reqHeaders.Set("User-Agent", c.s.userAgent())
6718 if c.ifNoneMatch_ != "" {
6719 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6720 }
6721 var body io.Reader = nil
6722 c.urlParams_.Set("alt", alt)
6723 c.urlParams_.Set("prettyPrint", "false")
6724 urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/metrics")
6725 urls += "?" + c.urlParams_.Encode()
6726 req, err := http.NewRequest("GET", urls, body)
6727 if err != nil {
6728 return nil, err
6729 }
6730 req.Header = reqHeaders
6731 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6732 }
6733
6734
6735
6736
6737
6738
6739
6740
6741 func (c *MetadataMetricsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
6742 gensupport.SetOptions(c.urlParams_, opts...)
6743 res, err := c.doRequest("json")
6744 if res != nil && res.StatusCode == http.StatusNotModified {
6745 if res.Body != nil {
6746 res.Body.Close()
6747 }
6748 return nil, &googleapi.Error{
6749 Code: res.StatusCode,
6750 Header: res.Header,
6751 }
6752 }
6753 if err != nil {
6754 return nil, err
6755 }
6756 defer googleapi.CloseBody(res)
6757 if err := googleapi.CheckResponse(res); err != nil {
6758 return nil, err
6759 }
6760 ret := &Metadata{
6761 ServerResponse: googleapi.ServerResponse{
6762 Header: res.Header,
6763 HTTPStatusCode: res.StatusCode,
6764 },
6765 }
6766 target := &ret
6767 if err := gensupport.DecodeResponse(target, res); err != nil {
6768 return nil, err
6769 }
6770 return ret, nil
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785 }
6786
6787
6788
6789 type ReportsGenerateCall struct {
6790 s *Service
6791 urlParams_ gensupport.URLParams
6792 ifNoneMatch_ string
6793 ctx_ context.Context
6794 header_ http.Header
6795 }
6796
6797
6798
6799
6800 func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall {
6801 c := &ReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6802 c.urlParams_.Set("startDate", startDate)
6803 c.urlParams_.Set("endDate", endDate)
6804 return c
6805 }
6806
6807
6808
6809 func (c *ReportsGenerateCall) AccountId(accountId ...string) *ReportsGenerateCall {
6810 c.urlParams_.SetMulti("accountId", append([]string{}, accountId...))
6811 return c
6812 }
6813
6814
6815
6816
6817 func (c *ReportsGenerateCall) Currency(currency string) *ReportsGenerateCall {
6818 c.urlParams_.Set("currency", currency)
6819 return c
6820 }
6821
6822
6823
6824 func (c *ReportsGenerateCall) Dimension(dimension ...string) *ReportsGenerateCall {
6825 c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
6826 return c
6827 }
6828
6829
6830
6831 func (c *ReportsGenerateCall) Filter(filter ...string) *ReportsGenerateCall {
6832 c.urlParams_.SetMulti("filter", append([]string{}, filter...))
6833 return c
6834 }
6835
6836
6837
6838
6839 func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall {
6840 c.urlParams_.Set("locale", locale)
6841 return c
6842 }
6843
6844
6845
6846 func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall {
6847 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
6848 return c
6849 }
6850
6851
6852
6853 func (c *ReportsGenerateCall) Metric(metric ...string) *ReportsGenerateCall {
6854 c.urlParams_.SetMulti("metric", append([]string{}, metric...))
6855 return c
6856 }
6857
6858
6859
6860
6861
6862 func (c *ReportsGenerateCall) Sort(sort ...string) *ReportsGenerateCall {
6863 c.urlParams_.SetMulti("sort", append([]string{}, sort...))
6864 return c
6865 }
6866
6867
6868
6869 func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall {
6870 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
6871 return c
6872 }
6873
6874
6875
6876
6877
6878 func (c *ReportsGenerateCall) UseTimezoneReporting(useTimezoneReporting bool) *ReportsGenerateCall {
6879 c.urlParams_.Set("useTimezoneReporting", fmt.Sprint(useTimezoneReporting))
6880 return c
6881 }
6882
6883
6884
6885
6886 func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall {
6887 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6888 return c
6889 }
6890
6891
6892
6893
6894
6895
6896 func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall {
6897 c.ifNoneMatch_ = entityTag
6898 return c
6899 }
6900
6901
6902
6903
6904 func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall {
6905 c.ctx_ = ctx
6906 return c
6907 }
6908
6909
6910
6911 func (c *ReportsGenerateCall) Header() http.Header {
6912 if c.header_ == nil {
6913 c.header_ = make(http.Header)
6914 }
6915 return c.header_
6916 }
6917
6918 func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
6919 reqHeaders := make(http.Header)
6920 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
6921 for k, v := range c.header_ {
6922 reqHeaders[k] = v
6923 }
6924 reqHeaders.Set("User-Agent", c.s.userAgent())
6925 if c.ifNoneMatch_ != "" {
6926 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6927 }
6928 var body io.Reader = nil
6929 c.urlParams_.Set("alt", alt)
6930 c.urlParams_.Set("prettyPrint", "false")
6931 urls := googleapi.ResolveRelative(c.s.BasePath, "reports")
6932 urls += "?" + c.urlParams_.Encode()
6933 req, err := http.NewRequest("GET", urls, body)
6934 if err != nil {
6935 return nil, err
6936 }
6937 req.Header = reqHeaders
6938 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6939 }
6940
6941
6942
6943
6944 func (c *ReportsGenerateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
6945 gensupport.SetOptions(c.urlParams_, opts...)
6946 res, err := c.doRequest("media")
6947 if err != nil {
6948 return nil, err
6949 }
6950 if err := googleapi.CheckMediaResponse(res); err != nil {
6951 res.Body.Close()
6952 return nil, err
6953 }
6954 return res, nil
6955 }
6956
6957
6958
6959
6960
6961
6962
6963
6964 func (c *ReportsGenerateCall) Do(opts ...googleapi.CallOption) (*AdsenseReportsGenerateResponse, error) {
6965 gensupport.SetOptions(c.urlParams_, opts...)
6966 res, err := c.doRequest("json")
6967 if res != nil && res.StatusCode == http.StatusNotModified {
6968 if res.Body != nil {
6969 res.Body.Close()
6970 }
6971 return nil, &googleapi.Error{
6972 Code: res.StatusCode,
6973 Header: res.Header,
6974 }
6975 }
6976 if err != nil {
6977 return nil, err
6978 }
6979 defer googleapi.CloseBody(res)
6980 if err := googleapi.CheckResponse(res); err != nil {
6981 return nil, err
6982 }
6983 ret := &AdsenseReportsGenerateResponse{
6984 ServerResponse: googleapi.ServerResponse{
6985 Header: res.Header,
6986 HTTPStatusCode: res.StatusCode,
6987 },
6988 }
6989 target := &ret
6990 if err := gensupport.DecodeResponse(target, res); err != nil {
6991 return nil, err
6992 }
6993 return ret, nil
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096 }
7097
7098
7099
7100 type ReportsSavedGenerateCall struct {
7101 s *Service
7102 savedReportId string
7103 urlParams_ gensupport.URLParams
7104 ifNoneMatch_ string
7105 ctx_ context.Context
7106 header_ http.Header
7107 }
7108
7109
7110
7111 func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall {
7112 c := &ReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7113 c.savedReportId = savedReportId
7114 return c
7115 }
7116
7117
7118
7119
7120 func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall {
7121 c.urlParams_.Set("locale", locale)
7122 return c
7123 }
7124
7125
7126
7127 func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall {
7128 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7129 return c
7130 }
7131
7132
7133
7134 func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall {
7135 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
7136 return c
7137 }
7138
7139
7140
7141
7142 func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall {
7143 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7144 return c
7145 }
7146
7147
7148
7149
7150
7151
7152 func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall {
7153 c.ifNoneMatch_ = entityTag
7154 return c
7155 }
7156
7157
7158
7159
7160 func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall {
7161 c.ctx_ = ctx
7162 return c
7163 }
7164
7165
7166
7167 func (c *ReportsSavedGenerateCall) Header() http.Header {
7168 if c.header_ == nil {
7169 c.header_ = make(http.Header)
7170 }
7171 return c.header_
7172 }
7173
7174 func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
7175 reqHeaders := make(http.Header)
7176 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
7177 for k, v := range c.header_ {
7178 reqHeaders[k] = v
7179 }
7180 reqHeaders.Set("User-Agent", c.s.userAgent())
7181 if c.ifNoneMatch_ != "" {
7182 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7183 }
7184 var body io.Reader = nil
7185 c.urlParams_.Set("alt", alt)
7186 c.urlParams_.Set("prettyPrint", "false")
7187 urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}")
7188 urls += "?" + c.urlParams_.Encode()
7189 req, err := http.NewRequest("GET", urls, body)
7190 if err != nil {
7191 return nil, err
7192 }
7193 req.Header = reqHeaders
7194 googleapi.Expand(req.URL, map[string]string{
7195 "savedReportId": c.savedReportId,
7196 })
7197 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7198 }
7199
7200
7201
7202
7203
7204
7205
7206
7207 func (c *ReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*AdsenseReportsGenerateResponse, error) {
7208 gensupport.SetOptions(c.urlParams_, opts...)
7209 res, err := c.doRequest("json")
7210 if res != nil && res.StatusCode == http.StatusNotModified {
7211 if res.Body != nil {
7212 res.Body.Close()
7213 }
7214 return nil, &googleapi.Error{
7215 Code: res.StatusCode,
7216 Header: res.Header,
7217 }
7218 }
7219 if err != nil {
7220 return nil, err
7221 }
7222 defer googleapi.CloseBody(res)
7223 if err := googleapi.CheckResponse(res); err != nil {
7224 return nil, err
7225 }
7226 ret := &AdsenseReportsGenerateResponse{
7227 ServerResponse: googleapi.ServerResponse{
7228 Header: res.Header,
7229 HTTPStatusCode: res.StatusCode,
7230 },
7231 }
7232 target := &ret
7233 if err := gensupport.DecodeResponse(target, res); err != nil {
7234 return nil, err
7235 }
7236 return ret, nil
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284 }
7285
7286
7287
7288 type ReportsSavedListCall struct {
7289 s *Service
7290 urlParams_ gensupport.URLParams
7291 ifNoneMatch_ string
7292 ctx_ context.Context
7293 header_ http.Header
7294 }
7295
7296
7297 func (r *ReportsSavedService) List() *ReportsSavedListCall {
7298 c := &ReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7299 return c
7300 }
7301
7302
7303
7304 func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall {
7305 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7306 return c
7307 }
7308
7309
7310
7311
7312
7313 func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall {
7314 c.urlParams_.Set("pageToken", pageToken)
7315 return c
7316 }
7317
7318
7319
7320
7321 func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall {
7322 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7323 return c
7324 }
7325
7326
7327
7328
7329
7330
7331 func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall {
7332 c.ifNoneMatch_ = entityTag
7333 return c
7334 }
7335
7336
7337
7338
7339 func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall {
7340 c.ctx_ = ctx
7341 return c
7342 }
7343
7344
7345
7346 func (c *ReportsSavedListCall) Header() http.Header {
7347 if c.header_ == nil {
7348 c.header_ = make(http.Header)
7349 }
7350 return c.header_
7351 }
7352
7353 func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
7354 reqHeaders := make(http.Header)
7355 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
7356 for k, v := range c.header_ {
7357 reqHeaders[k] = v
7358 }
7359 reqHeaders.Set("User-Agent", c.s.userAgent())
7360 if c.ifNoneMatch_ != "" {
7361 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7362 }
7363 var body io.Reader = nil
7364 c.urlParams_.Set("alt", alt)
7365 c.urlParams_.Set("prettyPrint", "false")
7366 urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved")
7367 urls += "?" + c.urlParams_.Encode()
7368 req, err := http.NewRequest("GET", urls, body)
7369 if err != nil {
7370 return nil, err
7371 }
7372 req.Header = reqHeaders
7373 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7374 }
7375
7376
7377
7378
7379
7380
7381
7382
7383 func (c *ReportsSavedListCall) Do(opts ...googleapi.CallOption) (*SavedReports, error) {
7384 gensupport.SetOptions(c.urlParams_, opts...)
7385 res, err := c.doRequest("json")
7386 if res != nil && res.StatusCode == http.StatusNotModified {
7387 if res.Body != nil {
7388 res.Body.Close()
7389 }
7390 return nil, &googleapi.Error{
7391 Code: res.StatusCode,
7392 Header: res.Header,
7393 }
7394 }
7395 if err != nil {
7396 return nil, err
7397 }
7398 defer googleapi.CloseBody(res)
7399 if err := googleapi.CheckResponse(res); err != nil {
7400 return nil, err
7401 }
7402 ret := &SavedReports{
7403 ServerResponse: googleapi.ServerResponse{
7404 Header: res.Header,
7405 HTTPStatusCode: res.StatusCode,
7406 },
7407 }
7408 target := &ret
7409 if err := gensupport.DecodeResponse(target, res); err != nil {
7410 return nil, err
7411 }
7412 return ret, nil
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442 }
7443
7444
7445
7446
7447 func (c *ReportsSavedListCall) Pages(ctx context.Context, f func(*SavedReports) error) error {
7448 c.ctx_ = ctx
7449 defer c.PageToken(c.urlParams_.Get("pageToken"))
7450 for {
7451 x, err := c.Do()
7452 if err != nil {
7453 return err
7454 }
7455 if err := f(x); err != nil {
7456 return err
7457 }
7458 if x.NextPageToken == "" {
7459 return nil
7460 }
7461 c.PageToken(x.NextPageToken)
7462 }
7463 }
7464
7465
7466
7467 type SavedadstylesGetCall struct {
7468 s *Service
7469 savedAdStyleId string
7470 urlParams_ gensupport.URLParams
7471 ifNoneMatch_ string
7472 ctx_ context.Context
7473 header_ http.Header
7474 }
7475
7476
7477 func (r *SavedadstylesService) Get(savedAdStyleId string) *SavedadstylesGetCall {
7478 c := &SavedadstylesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7479 c.savedAdStyleId = savedAdStyleId
7480 return c
7481 }
7482
7483
7484
7485
7486 func (c *SavedadstylesGetCall) Fields(s ...googleapi.Field) *SavedadstylesGetCall {
7487 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7488 return c
7489 }
7490
7491
7492
7493
7494
7495
7496 func (c *SavedadstylesGetCall) IfNoneMatch(entityTag string) *SavedadstylesGetCall {
7497 c.ifNoneMatch_ = entityTag
7498 return c
7499 }
7500
7501
7502
7503
7504 func (c *SavedadstylesGetCall) Context(ctx context.Context) *SavedadstylesGetCall {
7505 c.ctx_ = ctx
7506 return c
7507 }
7508
7509
7510
7511 func (c *SavedadstylesGetCall) Header() http.Header {
7512 if c.header_ == nil {
7513 c.header_ = make(http.Header)
7514 }
7515 return c.header_
7516 }
7517
7518 func (c *SavedadstylesGetCall) doRequest(alt string) (*http.Response, error) {
7519 reqHeaders := make(http.Header)
7520 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
7521 for k, v := range c.header_ {
7522 reqHeaders[k] = v
7523 }
7524 reqHeaders.Set("User-Agent", c.s.userAgent())
7525 if c.ifNoneMatch_ != "" {
7526 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7527 }
7528 var body io.Reader = nil
7529 c.urlParams_.Set("alt", alt)
7530 c.urlParams_.Set("prettyPrint", "false")
7531 urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles/{savedAdStyleId}")
7532 urls += "?" + c.urlParams_.Encode()
7533 req, err := http.NewRequest("GET", urls, body)
7534 if err != nil {
7535 return nil, err
7536 }
7537 req.Header = reqHeaders
7538 googleapi.Expand(req.URL, map[string]string{
7539 "savedAdStyleId": c.savedAdStyleId,
7540 })
7541 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7542 }
7543
7544
7545
7546
7547
7548
7549
7550
7551 func (c *SavedadstylesGetCall) Do(opts ...googleapi.CallOption) (*SavedAdStyle, error) {
7552 gensupport.SetOptions(c.urlParams_, opts...)
7553 res, err := c.doRequest("json")
7554 if res != nil && res.StatusCode == http.StatusNotModified {
7555 if res.Body != nil {
7556 res.Body.Close()
7557 }
7558 return nil, &googleapi.Error{
7559 Code: res.StatusCode,
7560 Header: res.Header,
7561 }
7562 }
7563 if err != nil {
7564 return nil, err
7565 }
7566 defer googleapi.CloseBody(res)
7567 if err := googleapi.CheckResponse(res); err != nil {
7568 return nil, err
7569 }
7570 ret := &SavedAdStyle{
7571 ServerResponse: googleapi.ServerResponse{
7572 Header: res.Header,
7573 HTTPStatusCode: res.StatusCode,
7574 },
7575 }
7576 target := &ret
7577 if err := gensupport.DecodeResponse(target, res); err != nil {
7578 return nil, err
7579 }
7580 return ret, nil
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606 }
7607
7608
7609
7610 type SavedadstylesListCall struct {
7611 s *Service
7612 urlParams_ gensupport.URLParams
7613 ifNoneMatch_ string
7614 ctx_ context.Context
7615 header_ http.Header
7616 }
7617
7618
7619 func (r *SavedadstylesService) List() *SavedadstylesListCall {
7620 c := &SavedadstylesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7621 return c
7622 }
7623
7624
7625
7626
7627 func (c *SavedadstylesListCall) MaxResults(maxResults int64) *SavedadstylesListCall {
7628 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7629 return c
7630 }
7631
7632
7633
7634
7635
7636 func (c *SavedadstylesListCall) PageToken(pageToken string) *SavedadstylesListCall {
7637 c.urlParams_.Set("pageToken", pageToken)
7638 return c
7639 }
7640
7641
7642
7643
7644 func (c *SavedadstylesListCall) Fields(s ...googleapi.Field) *SavedadstylesListCall {
7645 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7646 return c
7647 }
7648
7649
7650
7651
7652
7653
7654 func (c *SavedadstylesListCall) IfNoneMatch(entityTag string) *SavedadstylesListCall {
7655 c.ifNoneMatch_ = entityTag
7656 return c
7657 }
7658
7659
7660
7661
7662 func (c *SavedadstylesListCall) Context(ctx context.Context) *SavedadstylesListCall {
7663 c.ctx_ = ctx
7664 return c
7665 }
7666
7667
7668
7669 func (c *SavedadstylesListCall) Header() http.Header {
7670 if c.header_ == nil {
7671 c.header_ = make(http.Header)
7672 }
7673 return c.header_
7674 }
7675
7676 func (c *SavedadstylesListCall) doRequest(alt string) (*http.Response, error) {
7677 reqHeaders := make(http.Header)
7678 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
7679 for k, v := range c.header_ {
7680 reqHeaders[k] = v
7681 }
7682 reqHeaders.Set("User-Agent", c.s.userAgent())
7683 if c.ifNoneMatch_ != "" {
7684 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7685 }
7686 var body io.Reader = nil
7687 c.urlParams_.Set("alt", alt)
7688 c.urlParams_.Set("prettyPrint", "false")
7689 urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles")
7690 urls += "?" + c.urlParams_.Encode()
7691 req, err := http.NewRequest("GET", urls, body)
7692 if err != nil {
7693 return nil, err
7694 }
7695 req.Header = reqHeaders
7696 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7697 }
7698
7699
7700
7701
7702
7703
7704
7705
7706 func (c *SavedadstylesListCall) Do(opts ...googleapi.CallOption) (*SavedAdStyles, error) {
7707 gensupport.SetOptions(c.urlParams_, opts...)
7708 res, err := c.doRequest("json")
7709 if res != nil && res.StatusCode == http.StatusNotModified {
7710 if res.Body != nil {
7711 res.Body.Close()
7712 }
7713 return nil, &googleapi.Error{
7714 Code: res.StatusCode,
7715 Header: res.Header,
7716 }
7717 }
7718 if err != nil {
7719 return nil, err
7720 }
7721 defer googleapi.CloseBody(res)
7722 if err := googleapi.CheckResponse(res); err != nil {
7723 return nil, err
7724 }
7725 ret := &SavedAdStyles{
7726 ServerResponse: googleapi.ServerResponse{
7727 Header: res.Header,
7728 HTTPStatusCode: res.StatusCode,
7729 },
7730 }
7731 target := &ret
7732 if err := gensupport.DecodeResponse(target, res); err != nil {
7733 return nil, err
7734 }
7735 return ret, nil
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765 }
7766
7767
7768
7769
7770 func (c *SavedadstylesListCall) Pages(ctx context.Context, f func(*SavedAdStyles) error) error {
7771 c.ctx_ = ctx
7772 defer c.PageToken(c.urlParams_.Get("pageToken"))
7773 for {
7774 x, err := c.Do()
7775 if err != nil {
7776 return err
7777 }
7778 if err := f(x); err != nil {
7779 return err
7780 }
7781 if x.NextPageToken == "" {
7782 return nil
7783 }
7784 c.PageToken(x.NextPageToken)
7785 }
7786 }
7787
7788
7789
7790 type UrlchannelsListCall struct {
7791 s *Service
7792 adClientId string
7793 urlParams_ gensupport.URLParams
7794 ifNoneMatch_ string
7795 ctx_ context.Context
7796 header_ http.Header
7797 }
7798
7799
7800
7801 func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall {
7802 c := &UrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7803 c.adClientId = adClientId
7804 return c
7805 }
7806
7807
7808
7809 func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall {
7810 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7811 return c
7812 }
7813
7814
7815
7816
7817
7818 func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall {
7819 c.urlParams_.Set("pageToken", pageToken)
7820 return c
7821 }
7822
7823
7824
7825
7826 func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall {
7827 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7828 return c
7829 }
7830
7831
7832
7833
7834
7835
7836 func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall {
7837 c.ifNoneMatch_ = entityTag
7838 return c
7839 }
7840
7841
7842
7843
7844 func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall {
7845 c.ctx_ = ctx
7846 return c
7847 }
7848
7849
7850
7851 func (c *UrlchannelsListCall) Header() http.Header {
7852 if c.header_ == nil {
7853 c.header_ = make(http.Header)
7854 }
7855 return c.header_
7856 }
7857
7858 func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
7859 reqHeaders := make(http.Header)
7860 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
7861 for k, v := range c.header_ {
7862 reqHeaders[k] = v
7863 }
7864 reqHeaders.Set("User-Agent", c.s.userAgent())
7865 if c.ifNoneMatch_ != "" {
7866 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7867 }
7868 var body io.Reader = nil
7869 c.urlParams_.Set("alt", alt)
7870 c.urlParams_.Set("prettyPrint", "false")
7871 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels")
7872 urls += "?" + c.urlParams_.Encode()
7873 req, err := http.NewRequest("GET", urls, body)
7874 if err != nil {
7875 return nil, err
7876 }
7877 req.Header = reqHeaders
7878 googleapi.Expand(req.URL, map[string]string{
7879 "adClientId": c.adClientId,
7880 })
7881 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7882 }
7883
7884
7885
7886
7887
7888
7889
7890
7891 func (c *UrlchannelsListCall) Do(opts ...googleapi.CallOption) (*UrlChannels, error) {
7892 gensupport.SetOptions(c.urlParams_, opts...)
7893 res, err := c.doRequest("json")
7894 if res != nil && res.StatusCode == http.StatusNotModified {
7895 if res.Body != nil {
7896 res.Body.Close()
7897 }
7898 return nil, &googleapi.Error{
7899 Code: res.StatusCode,
7900 Header: res.Header,
7901 }
7902 }
7903 if err != nil {
7904 return nil, err
7905 }
7906 defer googleapi.CloseBody(res)
7907 if err := googleapi.CheckResponse(res); err != nil {
7908 return nil, err
7909 }
7910 ret := &UrlChannels{
7911 ServerResponse: googleapi.ServerResponse{
7912 Header: res.Header,
7913 HTTPStatusCode: res.StatusCode,
7914 },
7915 }
7916 target := &ret
7917 if err := gensupport.DecodeResponse(target, res); err != nil {
7918 return nil, err
7919 }
7920 return ret, nil
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959 }
7960
7961
7962
7963
7964 func (c *UrlchannelsListCall) Pages(ctx context.Context, f func(*UrlChannels) error) error {
7965 c.ctx_ = ctx
7966 defer c.PageToken(c.urlParams_.Get("pageToken"))
7967 for {
7968 x, err := c.Do()
7969 if err != nil {
7970 return err
7971 }
7972 if err := f(x); err != nil {
7973 return err
7974 }
7975 if x.NextPageToken == "" {
7976 return nil
7977 }
7978 c.PageToken(x.NextPageToken)
7979 }
7980 }
7981
View as plain text