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