1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 package adexchangeseller
43
44 import (
45 "bytes"
46 "context"
47 "encoding/json"
48 "errors"
49 "fmt"
50 "io"
51 "net/http"
52 "net/url"
53 "strconv"
54 "strings"
55
56 googleapi "google.golang.org/api/googleapi"
57 gensupport "google.golang.org/api/internal/gensupport"
58 option "google.golang.org/api/option"
59 htransport "google.golang.org/api/transport/http"
60 )
61
62
63
64 var _ = bytes.NewBuffer
65 var _ = strconv.Itoa
66 var _ = fmt.Sprintf
67 var _ = json.NewDecoder
68 var _ = io.Copy
69 var _ = url.Parse
70 var _ = gensupport.MarshalJSON
71 var _ = googleapi.Version
72 var _ = errors.New
73 var _ = strings.Replace
74 var _ = context.Canceled
75
76 const apiId = "adexchangeseller:v1"
77 const apiName = "adexchangeseller"
78 const apiVersion = "v1"
79 const basePath = "https://www.googleapis.com/adexchangeseller/v1/"
80
81
82 const (
83
84 AdexchangeSellerScope = "https://www.googleapis.com/auth/adexchange.seller"
85
86
87 AdexchangeSellerReadonlyScope = "https://www.googleapis.com/auth/adexchange.seller.readonly"
88 )
89
90
91 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
92 scopesOption := option.WithScopes(
93 "https://www.googleapis.com/auth/adexchange.seller",
94 "https://www.googleapis.com/auth/adexchange.seller.readonly",
95 )
96
97 opts = append([]option.ClientOption{scopesOption}, opts...)
98 client, endpoint, err := htransport.NewClient(ctx, opts...)
99 if err != nil {
100 return nil, err
101 }
102 s, err := New(client)
103 if err != nil {
104 return nil, err
105 }
106 if endpoint != "" {
107 s.BasePath = endpoint
108 }
109 return s, nil
110 }
111
112
113
114
115
116
117 func New(client *http.Client) (*Service, error) {
118 if client == nil {
119 return nil, errors.New("client is nil")
120 }
121 s := &Service{client: client, BasePath: basePath}
122 s.Adclients = NewAdclientsService(s)
123 s.Adunits = NewAdunitsService(s)
124 s.Customchannels = NewCustomchannelsService(s)
125 s.Reports = NewReportsService(s)
126 s.Urlchannels = NewUrlchannelsService(s)
127 return s, nil
128 }
129
130 type Service struct {
131 client *http.Client
132 BasePath string
133 UserAgent string
134
135 Adclients *AdclientsService
136
137 Adunits *AdunitsService
138
139 Customchannels *CustomchannelsService
140
141 Reports *ReportsService
142
143 Urlchannels *UrlchannelsService
144 }
145
146 func (s *Service) userAgent() string {
147 if s.UserAgent == "" {
148 return googleapi.UserAgent
149 }
150 return googleapi.UserAgent + " " + s.UserAgent
151 }
152
153 func NewAdclientsService(s *Service) *AdclientsService {
154 rs := &AdclientsService{s: s}
155 return rs
156 }
157
158 type AdclientsService struct {
159 s *Service
160 }
161
162 func NewAdunitsService(s *Service) *AdunitsService {
163 rs := &AdunitsService{s: s}
164 rs.Customchannels = NewAdunitsCustomchannelsService(s)
165 return rs
166 }
167
168 type AdunitsService struct {
169 s *Service
170
171 Customchannels *AdunitsCustomchannelsService
172 }
173
174 func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService {
175 rs := &AdunitsCustomchannelsService{s: s}
176 return rs
177 }
178
179 type AdunitsCustomchannelsService struct {
180 s *Service
181 }
182
183 func NewCustomchannelsService(s *Service) *CustomchannelsService {
184 rs := &CustomchannelsService{s: s}
185 rs.Adunits = NewCustomchannelsAdunitsService(s)
186 return rs
187 }
188
189 type CustomchannelsService struct {
190 s *Service
191
192 Adunits *CustomchannelsAdunitsService
193 }
194
195 func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService {
196 rs := &CustomchannelsAdunitsService{s: s}
197 return rs
198 }
199
200 type CustomchannelsAdunitsService struct {
201 s *Service
202 }
203
204 func NewReportsService(s *Service) *ReportsService {
205 rs := &ReportsService{s: s}
206 rs.Saved = NewReportsSavedService(s)
207 return rs
208 }
209
210 type ReportsService struct {
211 s *Service
212
213 Saved *ReportsSavedService
214 }
215
216 func NewReportsSavedService(s *Service) *ReportsSavedService {
217 rs := &ReportsSavedService{s: s}
218 return rs
219 }
220
221 type ReportsSavedService struct {
222 s *Service
223 }
224
225 func NewUrlchannelsService(s *Service) *UrlchannelsService {
226 rs := &UrlchannelsService{s: s}
227 return rs
228 }
229
230 type UrlchannelsService struct {
231 s *Service
232 }
233
234 type AdClient struct {
235
236 ArcOptIn bool `json:"arcOptIn,omitempty"`
237
238
239 Id string `json:"id,omitempty"`
240
241
242
243 Kind string `json:"kind,omitempty"`
244
245
246
247 ProductCode string `json:"productCode,omitempty"`
248
249
250 SupportsReporting bool `json:"supportsReporting,omitempty"`
251
252
253
254
255
256
257
258 ForceSendFields []string `json:"-"`
259
260
261
262
263
264
265
266 NullFields []string `json:"-"`
267 }
268
269 func (s *AdClient) MarshalJSON() ([]byte, error) {
270 type NoMethod AdClient
271 raw := NoMethod(*s)
272 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
273 }
274
275 type AdClients struct {
276
277 Etag string `json:"etag,omitempty"`
278
279
280 Items []*AdClient `json:"items,omitempty"`
281
282
283 Kind string `json:"kind,omitempty"`
284
285
286
287
288 NextPageToken string `json:"nextPageToken,omitempty"`
289
290
291
292 googleapi.ServerResponse `json:"-"`
293
294
295
296
297
298
299
300 ForceSendFields []string `json:"-"`
301
302
303
304
305
306
307
308 NullFields []string `json:"-"`
309 }
310
311 func (s *AdClients) MarshalJSON() ([]byte, error) {
312 type NoMethod AdClients
313 raw := NoMethod(*s)
314 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
315 }
316
317 type AdUnit struct {
318
319
320 Code string `json:"code,omitempty"`
321
322
323
324
325 Id string `json:"id,omitempty"`
326
327
328 Kind string `json:"kind,omitempty"`
329
330
331 Name string `json:"name,omitempty"`
332
333
334
335
336
337
338
339
340
341
342 Status string `json:"status,omitempty"`
343
344
345
346 googleapi.ServerResponse `json:"-"`
347
348
349
350
351
352
353
354 ForceSendFields []string `json:"-"`
355
356
357
358
359
360
361
362 NullFields []string `json:"-"`
363 }
364
365 func (s *AdUnit) MarshalJSON() ([]byte, error) {
366 type NoMethod AdUnit
367 raw := NoMethod(*s)
368 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
369 }
370
371 type AdUnits struct {
372
373 Etag string `json:"etag,omitempty"`
374
375
376 Items []*AdUnit `json:"items,omitempty"`
377
378
379 Kind string `json:"kind,omitempty"`
380
381
382
383
384 NextPageToken string `json:"nextPageToken,omitempty"`
385
386
387
388 googleapi.ServerResponse `json:"-"`
389
390
391
392
393
394
395
396 ForceSendFields []string `json:"-"`
397
398
399
400
401
402
403
404 NullFields []string `json:"-"`
405 }
406
407 func (s *AdUnits) MarshalJSON() ([]byte, error) {
408 type NoMethod AdUnits
409 raw := NoMethod(*s)
410 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
411 }
412
413 type CustomChannel struct {
414
415
416 Code string `json:"code,omitempty"`
417
418
419
420
421 Id string `json:"id,omitempty"`
422
423
424
425 Kind string `json:"kind,omitempty"`
426
427
428 Name string `json:"name,omitempty"`
429
430
431
432 TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"`
433
434
435
436 googleapi.ServerResponse `json:"-"`
437
438
439
440
441
442
443
444 ForceSendFields []string `json:"-"`
445
446
447
448
449
450
451
452 NullFields []string `json:"-"`
453 }
454
455 func (s *CustomChannel) MarshalJSON() ([]byte, error) {
456 type NoMethod CustomChannel
457 raw := NoMethod(*s)
458 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
459 }
460
461
462
463 type CustomChannelTargetingInfo struct {
464
465 AdsAppearOn string `json:"adsAppearOn,omitempty"`
466
467
468 Description string `json:"description,omitempty"`
469
470
471
472
473
474
475
476 Location string `json:"location,omitempty"`
477
478
479 SiteLanguage string `json:"siteLanguage,omitempty"`
480
481
482
483
484
485
486
487 ForceSendFields []string `json:"-"`
488
489
490
491
492
493
494
495 NullFields []string `json:"-"`
496 }
497
498 func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) {
499 type NoMethod CustomChannelTargetingInfo
500 raw := NoMethod(*s)
501 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
502 }
503
504 type CustomChannels struct {
505
506 Etag string `json:"etag,omitempty"`
507
508
509 Items []*CustomChannel `json:"items,omitempty"`
510
511
512
513 Kind string `json:"kind,omitempty"`
514
515
516
517
518 NextPageToken string `json:"nextPageToken,omitempty"`
519
520
521
522 googleapi.ServerResponse `json:"-"`
523
524
525
526
527
528
529
530 ForceSendFields []string `json:"-"`
531
532
533
534
535
536
537
538 NullFields []string `json:"-"`
539 }
540
541 func (s *CustomChannels) MarshalJSON() ([]byte, error) {
542 type NoMethod CustomChannels
543 raw := NoMethod(*s)
544 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
545 }
546
547 type Report struct {
548
549
550
551 Averages []string `json:"averages,omitempty"`
552
553
554
555
556 Headers []*ReportHeaders `json:"headers,omitempty"`
557
558
559 Kind string `json:"kind,omitempty"`
560
561
562
563
564
565 Rows [][]string `json:"rows,omitempty"`
566
567
568
569
570 TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"`
571
572
573
574
575 Totals []string `json:"totals,omitempty"`
576
577
578 Warnings []string `json:"warnings,omitempty"`
579
580
581
582 googleapi.ServerResponse `json:"-"`
583
584
585
586
587
588
589
590 ForceSendFields []string `json:"-"`
591
592
593
594
595
596
597
598 NullFields []string `json:"-"`
599 }
600
601 func (s *Report) MarshalJSON() ([]byte, error) {
602 type NoMethod Report
603 raw := NoMethod(*s)
604 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
605 }
606
607 type ReportHeaders struct {
608
609
610 Currency string `json:"currency,omitempty"`
611
612
613 Name string `json:"name,omitempty"`
614
615
616
617 Type string `json:"type,omitempty"`
618
619
620
621
622
623
624
625 ForceSendFields []string `json:"-"`
626
627
628
629
630
631
632
633 NullFields []string `json:"-"`
634 }
635
636 func (s *ReportHeaders) MarshalJSON() ([]byte, error) {
637 type NoMethod ReportHeaders
638 raw := NoMethod(*s)
639 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
640 }
641
642 type SavedReport struct {
643
644 Id string `json:"id,omitempty"`
645
646
647
648 Kind string `json:"kind,omitempty"`
649
650
651 Name string `json:"name,omitempty"`
652
653
654
655
656
657
658
659 ForceSendFields []string `json:"-"`
660
661
662
663
664
665
666
667 NullFields []string `json:"-"`
668 }
669
670 func (s *SavedReport) MarshalJSON() ([]byte, error) {
671 type NoMethod SavedReport
672 raw := NoMethod(*s)
673 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
674 }
675
676 type SavedReports struct {
677
678 Etag string `json:"etag,omitempty"`
679
680
681 Items []*SavedReport `json:"items,omitempty"`
682
683
684
685 Kind string `json:"kind,omitempty"`
686
687
688
689
690 NextPageToken string `json:"nextPageToken,omitempty"`
691
692
693
694 googleapi.ServerResponse `json:"-"`
695
696
697
698
699
700
701
702 ForceSendFields []string `json:"-"`
703
704
705
706
707
708
709
710 NullFields []string `json:"-"`
711 }
712
713 func (s *SavedReports) MarshalJSON() ([]byte, error) {
714 type NoMethod SavedReports
715 raw := NoMethod(*s)
716 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
717 }
718
719 type UrlChannel struct {
720
721
722
723 Id string `json:"id,omitempty"`
724
725
726
727 Kind string `json:"kind,omitempty"`
728
729
730
731 UrlPattern string `json:"urlPattern,omitempty"`
732
733
734
735
736
737
738
739 ForceSendFields []string `json:"-"`
740
741
742
743
744
745
746
747 NullFields []string `json:"-"`
748 }
749
750 func (s *UrlChannel) MarshalJSON() ([]byte, error) {
751 type NoMethod UrlChannel
752 raw := NoMethod(*s)
753 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
754 }
755
756 type UrlChannels struct {
757
758 Etag string `json:"etag,omitempty"`
759
760
761 Items []*UrlChannel `json:"items,omitempty"`
762
763
764
765 Kind string `json:"kind,omitempty"`
766
767
768
769
770 NextPageToken string `json:"nextPageToken,omitempty"`
771
772
773
774 googleapi.ServerResponse `json:"-"`
775
776
777
778
779
780
781
782 ForceSendFields []string `json:"-"`
783
784
785
786
787
788
789
790 NullFields []string `json:"-"`
791 }
792
793 func (s *UrlChannels) MarshalJSON() ([]byte, error) {
794 type NoMethod UrlChannels
795 raw := NoMethod(*s)
796 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
797 }
798
799
800
801 type AdclientsListCall struct {
802 s *Service
803 urlParams_ gensupport.URLParams
804 ifNoneMatch_ string
805 ctx_ context.Context
806 header_ http.Header
807 }
808
809
810 func (r *AdclientsService) List() *AdclientsListCall {
811 c := &AdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
812 return c
813 }
814
815
816
817 func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall {
818 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
819 return c
820 }
821
822
823
824
825
826 func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall {
827 c.urlParams_.Set("pageToken", pageToken)
828 return c
829 }
830
831
832
833
834 func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall {
835 c.urlParams_.Set("fields", googleapi.CombineFields(s))
836 return c
837 }
838
839
840
841
842
843
844 func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall {
845 c.ifNoneMatch_ = entityTag
846 return c
847 }
848
849
850
851
852 func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall {
853 c.ctx_ = ctx
854 return c
855 }
856
857
858
859 func (c *AdclientsListCall) Header() http.Header {
860 if c.header_ == nil {
861 c.header_ = make(http.Header)
862 }
863 return c.header_
864 }
865
866 func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) {
867 reqHeaders := make(http.Header)
868 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
869 for k, v := range c.header_ {
870 reqHeaders[k] = v
871 }
872 reqHeaders.Set("User-Agent", c.s.userAgent())
873 if c.ifNoneMatch_ != "" {
874 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
875 }
876 var body io.Reader = nil
877 c.urlParams_.Set("alt", alt)
878 c.urlParams_.Set("prettyPrint", "false")
879 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients")
880 urls += "?" + c.urlParams_.Encode()
881 req, err := http.NewRequest("GET", urls, body)
882 if err != nil {
883 return nil, err
884 }
885 req.Header = reqHeaders
886 return gensupport.SendRequest(c.ctx_, c.s.client, req)
887 }
888
889
890
891
892
893
894
895
896 func (c *AdclientsListCall) Do(opts ...googleapi.CallOption) (*AdClients, error) {
897 gensupport.SetOptions(c.urlParams_, opts...)
898 res, err := c.doRequest("json")
899 if res != nil && res.StatusCode == http.StatusNotModified {
900 if res.Body != nil {
901 res.Body.Close()
902 }
903 return nil, &googleapi.Error{
904 Code: res.StatusCode,
905 Header: res.Header,
906 }
907 }
908 if err != nil {
909 return nil, err
910 }
911 defer googleapi.CloseBody(res)
912 if err := googleapi.CheckResponse(res); err != nil {
913 return nil, err
914 }
915 ret := &AdClients{
916 ServerResponse: googleapi.ServerResponse{
917 Header: res.Header,
918 HTTPStatusCode: res.StatusCode,
919 },
920 }
921 target := &ret
922 if err := gensupport.DecodeResponse(target, res); err != nil {
923 return nil, err
924 }
925 return ret, nil
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955 }
956
957
958
959
960 func (c *AdclientsListCall) Pages(ctx context.Context, f func(*AdClients) error) error {
961 c.ctx_ = ctx
962 defer c.PageToken(c.urlParams_.Get("pageToken"))
963 for {
964 x, err := c.Do()
965 if err != nil {
966 return err
967 }
968 if err := f(x); err != nil {
969 return err
970 }
971 if x.NextPageToken == "" {
972 return nil
973 }
974 c.PageToken(x.NextPageToken)
975 }
976 }
977
978
979
980 type AdunitsGetCall struct {
981 s *Service
982 adClientId string
983 adUnitId string
984 urlParams_ gensupport.URLParams
985 ifNoneMatch_ string
986 ctx_ context.Context
987 header_ http.Header
988 }
989
990
991 func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall {
992 c := &AdunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
993 c.adClientId = adClientId
994 c.adUnitId = adUnitId
995 return c
996 }
997
998
999
1000
1001 func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall {
1002 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1003 return c
1004 }
1005
1006
1007
1008
1009
1010
1011 func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall {
1012 c.ifNoneMatch_ = entityTag
1013 return c
1014 }
1015
1016
1017
1018
1019 func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall {
1020 c.ctx_ = ctx
1021 return c
1022 }
1023
1024
1025
1026 func (c *AdunitsGetCall) Header() http.Header {
1027 if c.header_ == nil {
1028 c.header_ = make(http.Header)
1029 }
1030 return c.header_
1031 }
1032
1033 func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) {
1034 reqHeaders := make(http.Header)
1035 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1036 for k, v := range c.header_ {
1037 reqHeaders[k] = v
1038 }
1039 reqHeaders.Set("User-Agent", c.s.userAgent())
1040 if c.ifNoneMatch_ != "" {
1041 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1042 }
1043 var body io.Reader = nil
1044 c.urlParams_.Set("alt", alt)
1045 c.urlParams_.Set("prettyPrint", "false")
1046 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}")
1047 urls += "?" + c.urlParams_.Encode()
1048 req, err := http.NewRequest("GET", urls, body)
1049 if err != nil {
1050 return nil, err
1051 }
1052 req.Header = reqHeaders
1053 googleapi.Expand(req.URL, map[string]string{
1054 "adClientId": c.adClientId,
1055 "adUnitId": c.adUnitId,
1056 })
1057 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1058 }
1059
1060
1061
1062
1063
1064
1065
1066
1067 func (c *AdunitsGetCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
1068 gensupport.SetOptions(c.urlParams_, opts...)
1069 res, err := c.doRequest("json")
1070 if res != nil && res.StatusCode == http.StatusNotModified {
1071 if res.Body != nil {
1072 res.Body.Close()
1073 }
1074 return nil, &googleapi.Error{
1075 Code: res.StatusCode,
1076 Header: res.Header,
1077 }
1078 }
1079 if err != nil {
1080 return nil, err
1081 }
1082 defer googleapi.CloseBody(res)
1083 if err := googleapi.CheckResponse(res); err != nil {
1084 return nil, err
1085 }
1086 ret := &AdUnit{
1087 ServerResponse: googleapi.ServerResponse{
1088 Header: res.Header,
1089 HTTPStatusCode: res.StatusCode,
1090 },
1091 }
1092 target := &ret
1093 if err := gensupport.DecodeResponse(target, res); err != nil {
1094 return nil, err
1095 }
1096 return ret, nil
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129 }
1130
1131
1132
1133 type AdunitsListCall struct {
1134 s *Service
1135 adClientId string
1136 urlParams_ gensupport.URLParams
1137 ifNoneMatch_ string
1138 ctx_ context.Context
1139 header_ http.Header
1140 }
1141
1142
1143
1144 func (r *AdunitsService) List(adClientId string) *AdunitsListCall {
1145 c := &AdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1146 c.adClientId = adClientId
1147 return c
1148 }
1149
1150
1151
1152 func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall {
1153 c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
1154 return c
1155 }
1156
1157
1158
1159 func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall {
1160 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1161 return c
1162 }
1163
1164
1165
1166
1167
1168 func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall {
1169 c.urlParams_.Set("pageToken", pageToken)
1170 return c
1171 }
1172
1173
1174
1175
1176 func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall {
1177 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1178 return c
1179 }
1180
1181
1182
1183
1184
1185
1186 func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall {
1187 c.ifNoneMatch_ = entityTag
1188 return c
1189 }
1190
1191
1192
1193
1194 func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall {
1195 c.ctx_ = ctx
1196 return c
1197 }
1198
1199
1200
1201 func (c *AdunitsListCall) Header() http.Header {
1202 if c.header_ == nil {
1203 c.header_ = make(http.Header)
1204 }
1205 return c.header_
1206 }
1207
1208 func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) {
1209 reqHeaders := make(http.Header)
1210 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1211 for k, v := range c.header_ {
1212 reqHeaders[k] = v
1213 }
1214 reqHeaders.Set("User-Agent", c.s.userAgent())
1215 if c.ifNoneMatch_ != "" {
1216 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1217 }
1218 var body io.Reader = nil
1219 c.urlParams_.Set("alt", alt)
1220 c.urlParams_.Set("prettyPrint", "false")
1221 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits")
1222 urls += "?" + c.urlParams_.Encode()
1223 req, err := http.NewRequest("GET", urls, body)
1224 if err != nil {
1225 return nil, err
1226 }
1227 req.Header = reqHeaders
1228 googleapi.Expand(req.URL, map[string]string{
1229 "adClientId": c.adClientId,
1230 })
1231 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1232 }
1233
1234
1235
1236
1237
1238
1239
1240
1241 func (c *AdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
1242 gensupport.SetOptions(c.urlParams_, opts...)
1243 res, err := c.doRequest("json")
1244 if res != nil && res.StatusCode == http.StatusNotModified {
1245 if res.Body != nil {
1246 res.Body.Close()
1247 }
1248 return nil, &googleapi.Error{
1249 Code: res.StatusCode,
1250 Header: res.Header,
1251 }
1252 }
1253 if err != nil {
1254 return nil, err
1255 }
1256 defer googleapi.CloseBody(res)
1257 if err := googleapi.CheckResponse(res); err != nil {
1258 return nil, err
1259 }
1260 ret := &AdUnits{
1261 ServerResponse: googleapi.ServerResponse{
1262 Header: res.Header,
1263 HTTPStatusCode: res.StatusCode,
1264 },
1265 }
1266 target := &ret
1267 if err := gensupport.DecodeResponse(target, res); err != nil {
1268 return nil, err
1269 }
1270 return ret, nil
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314 }
1315
1316
1317
1318
1319 func (c *AdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
1320 c.ctx_ = ctx
1321 defer c.PageToken(c.urlParams_.Get("pageToken"))
1322 for {
1323 x, err := c.Do()
1324 if err != nil {
1325 return err
1326 }
1327 if err := f(x); err != nil {
1328 return err
1329 }
1330 if x.NextPageToken == "" {
1331 return nil
1332 }
1333 c.PageToken(x.NextPageToken)
1334 }
1335 }
1336
1337
1338
1339 type AdunitsCustomchannelsListCall struct {
1340 s *Service
1341 adClientId string
1342 adUnitId string
1343 urlParams_ gensupport.URLParams
1344 ifNoneMatch_ string
1345 ctx_ context.Context
1346 header_ http.Header
1347 }
1348
1349
1350
1351 func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall {
1352 c := &AdunitsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1353 c.adClientId = adClientId
1354 c.adUnitId = adUnitId
1355 return c
1356 }
1357
1358
1359
1360
1361 func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall {
1362 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1363 return c
1364 }
1365
1366
1367
1368
1369
1370 func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall {
1371 c.urlParams_.Set("pageToken", pageToken)
1372 return c
1373 }
1374
1375
1376
1377
1378 func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall {
1379 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1380 return c
1381 }
1382
1383
1384
1385
1386
1387
1388 func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall {
1389 c.ifNoneMatch_ = entityTag
1390 return c
1391 }
1392
1393
1394
1395
1396 func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall {
1397 c.ctx_ = ctx
1398 return c
1399 }
1400
1401
1402
1403 func (c *AdunitsCustomchannelsListCall) Header() http.Header {
1404 if c.header_ == nil {
1405 c.header_ = make(http.Header)
1406 }
1407 return c.header_
1408 }
1409
1410 func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
1411 reqHeaders := make(http.Header)
1412 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1413 for k, v := range c.header_ {
1414 reqHeaders[k] = v
1415 }
1416 reqHeaders.Set("User-Agent", c.s.userAgent())
1417 if c.ifNoneMatch_ != "" {
1418 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1419 }
1420 var body io.Reader = nil
1421 c.urlParams_.Set("alt", alt)
1422 c.urlParams_.Set("prettyPrint", "false")
1423 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels")
1424 urls += "?" + c.urlParams_.Encode()
1425 req, err := http.NewRequest("GET", urls, body)
1426 if err != nil {
1427 return nil, err
1428 }
1429 req.Header = reqHeaders
1430 googleapi.Expand(req.URL, map[string]string{
1431 "adClientId": c.adClientId,
1432 "adUnitId": c.adUnitId,
1433 })
1434 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1435 }
1436
1437
1438
1439
1440
1441
1442
1443
1444 func (c *AdunitsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
1445 gensupport.SetOptions(c.urlParams_, opts...)
1446 res, err := c.doRequest("json")
1447 if res != nil && res.StatusCode == http.StatusNotModified {
1448 if res.Body != nil {
1449 res.Body.Close()
1450 }
1451 return nil, &googleapi.Error{
1452 Code: res.StatusCode,
1453 Header: res.Header,
1454 }
1455 }
1456 if err != nil {
1457 return nil, err
1458 }
1459 defer googleapi.CloseBody(res)
1460 if err := googleapi.CheckResponse(res); err != nil {
1461 return nil, err
1462 }
1463 ret := &CustomChannels{
1464 ServerResponse: googleapi.ServerResponse{
1465 Header: res.Header,
1466 HTTPStatusCode: res.StatusCode,
1467 },
1468 }
1469 target := &ret
1470 if err := gensupport.DecodeResponse(target, res); err != nil {
1471 return nil, err
1472 }
1473 return ret, nil
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519 }
1520
1521
1522
1523
1524 func (c *AdunitsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
1525 c.ctx_ = ctx
1526 defer c.PageToken(c.urlParams_.Get("pageToken"))
1527 for {
1528 x, err := c.Do()
1529 if err != nil {
1530 return err
1531 }
1532 if err := f(x); err != nil {
1533 return err
1534 }
1535 if x.NextPageToken == "" {
1536 return nil
1537 }
1538 c.PageToken(x.NextPageToken)
1539 }
1540 }
1541
1542
1543
1544 type CustomchannelsGetCall struct {
1545 s *Service
1546 adClientId string
1547 customChannelId string
1548 urlParams_ gensupport.URLParams
1549 ifNoneMatch_ string
1550 ctx_ context.Context
1551 header_ http.Header
1552 }
1553
1554
1555 func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall {
1556 c := &CustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1557 c.adClientId = adClientId
1558 c.customChannelId = customChannelId
1559 return c
1560 }
1561
1562
1563
1564
1565 func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall {
1566 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1567 return c
1568 }
1569
1570
1571
1572
1573
1574
1575 func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall {
1576 c.ifNoneMatch_ = entityTag
1577 return c
1578 }
1579
1580
1581
1582
1583 func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall {
1584 c.ctx_ = ctx
1585 return c
1586 }
1587
1588
1589
1590 func (c *CustomchannelsGetCall) Header() http.Header {
1591 if c.header_ == nil {
1592 c.header_ = make(http.Header)
1593 }
1594 return c.header_
1595 }
1596
1597 func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
1598 reqHeaders := make(http.Header)
1599 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1600 for k, v := range c.header_ {
1601 reqHeaders[k] = v
1602 }
1603 reqHeaders.Set("User-Agent", c.s.userAgent())
1604 if c.ifNoneMatch_ != "" {
1605 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1606 }
1607 var body io.Reader = nil
1608 c.urlParams_.Set("alt", alt)
1609 c.urlParams_.Set("prettyPrint", "false")
1610 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}")
1611 urls += "?" + c.urlParams_.Encode()
1612 req, err := http.NewRequest("GET", urls, body)
1613 if err != nil {
1614 return nil, err
1615 }
1616 req.Header = reqHeaders
1617 googleapi.Expand(req.URL, map[string]string{
1618 "adClientId": c.adClientId,
1619 "customChannelId": c.customChannelId,
1620 })
1621 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1622 }
1623
1624
1625
1626
1627
1628
1629
1630
1631 func (c *CustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
1632 gensupport.SetOptions(c.urlParams_, opts...)
1633 res, err := c.doRequest("json")
1634 if res != nil && res.StatusCode == http.StatusNotModified {
1635 if res.Body != nil {
1636 res.Body.Close()
1637 }
1638 return nil, &googleapi.Error{
1639 Code: res.StatusCode,
1640 Header: res.Header,
1641 }
1642 }
1643 if err != nil {
1644 return nil, err
1645 }
1646 defer googleapi.CloseBody(res)
1647 if err := googleapi.CheckResponse(res); err != nil {
1648 return nil, err
1649 }
1650 ret := &CustomChannel{
1651 ServerResponse: googleapi.ServerResponse{
1652 Header: res.Header,
1653 HTTPStatusCode: res.StatusCode,
1654 },
1655 }
1656 target := &ret
1657 if err := gensupport.DecodeResponse(target, res); err != nil {
1658 return nil, err
1659 }
1660 return ret, nil
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693 }
1694
1695
1696
1697 type CustomchannelsListCall struct {
1698 s *Service
1699 adClientId string
1700 urlParams_ gensupport.URLParams
1701 ifNoneMatch_ string
1702 ctx_ context.Context
1703 header_ http.Header
1704 }
1705
1706
1707
1708 func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall {
1709 c := &CustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1710 c.adClientId = adClientId
1711 return c
1712 }
1713
1714
1715
1716
1717 func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall {
1718 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1719 return c
1720 }
1721
1722
1723
1724
1725
1726 func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall {
1727 c.urlParams_.Set("pageToken", pageToken)
1728 return c
1729 }
1730
1731
1732
1733
1734 func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall {
1735 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1736 return c
1737 }
1738
1739
1740
1741
1742
1743
1744 func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall {
1745 c.ifNoneMatch_ = entityTag
1746 return c
1747 }
1748
1749
1750
1751
1752 func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall {
1753 c.ctx_ = ctx
1754 return c
1755 }
1756
1757
1758
1759 func (c *CustomchannelsListCall) Header() http.Header {
1760 if c.header_ == nil {
1761 c.header_ = make(http.Header)
1762 }
1763 return c.header_
1764 }
1765
1766 func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
1767 reqHeaders := make(http.Header)
1768 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1769 for k, v := range c.header_ {
1770 reqHeaders[k] = v
1771 }
1772 reqHeaders.Set("User-Agent", c.s.userAgent())
1773 if c.ifNoneMatch_ != "" {
1774 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1775 }
1776 var body io.Reader = nil
1777 c.urlParams_.Set("alt", alt)
1778 c.urlParams_.Set("prettyPrint", "false")
1779 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels")
1780 urls += "?" + c.urlParams_.Encode()
1781 req, err := http.NewRequest("GET", urls, body)
1782 if err != nil {
1783 return nil, err
1784 }
1785 req.Header = reqHeaders
1786 googleapi.Expand(req.URL, map[string]string{
1787 "adClientId": c.adClientId,
1788 })
1789 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1790 }
1791
1792
1793
1794
1795
1796
1797
1798
1799 func (c *CustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
1800 gensupport.SetOptions(c.urlParams_, opts...)
1801 res, err := c.doRequest("json")
1802 if res != nil && res.StatusCode == http.StatusNotModified {
1803 if res.Body != nil {
1804 res.Body.Close()
1805 }
1806 return nil, &googleapi.Error{
1807 Code: res.StatusCode,
1808 Header: res.Header,
1809 }
1810 }
1811 if err != nil {
1812 return nil, err
1813 }
1814 defer googleapi.CloseBody(res)
1815 if err := googleapi.CheckResponse(res); err != nil {
1816 return nil, err
1817 }
1818 ret := &CustomChannels{
1819 ServerResponse: googleapi.ServerResponse{
1820 Header: res.Header,
1821 HTTPStatusCode: res.StatusCode,
1822 },
1823 }
1824 target := &ret
1825 if err := gensupport.DecodeResponse(target, res); err != nil {
1826 return nil, err
1827 }
1828 return ret, nil
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867 }
1868
1869
1870
1871
1872 func (c *CustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
1873 c.ctx_ = ctx
1874 defer c.PageToken(c.urlParams_.Get("pageToken"))
1875 for {
1876 x, err := c.Do()
1877 if err != nil {
1878 return err
1879 }
1880 if err := f(x); err != nil {
1881 return err
1882 }
1883 if x.NextPageToken == "" {
1884 return nil
1885 }
1886 c.PageToken(x.NextPageToken)
1887 }
1888 }
1889
1890
1891
1892 type CustomchannelsAdunitsListCall struct {
1893 s *Service
1894 adClientId string
1895 customChannelId string
1896 urlParams_ gensupport.URLParams
1897 ifNoneMatch_ string
1898 ctx_ context.Context
1899 header_ http.Header
1900 }
1901
1902
1903 func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall {
1904 c := &CustomchannelsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1905 c.adClientId = adClientId
1906 c.customChannelId = customChannelId
1907 return c
1908 }
1909
1910
1911
1912 func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall {
1913 c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
1914 return c
1915 }
1916
1917
1918
1919 func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall {
1920 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1921 return c
1922 }
1923
1924
1925
1926
1927
1928 func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall {
1929 c.urlParams_.Set("pageToken", pageToken)
1930 return c
1931 }
1932
1933
1934
1935
1936 func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall {
1937 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1938 return c
1939 }
1940
1941
1942
1943
1944
1945
1946 func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall {
1947 c.ifNoneMatch_ = entityTag
1948 return c
1949 }
1950
1951
1952
1953
1954 func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall {
1955 c.ctx_ = ctx
1956 return c
1957 }
1958
1959
1960
1961 func (c *CustomchannelsAdunitsListCall) Header() http.Header {
1962 if c.header_ == nil {
1963 c.header_ = make(http.Header)
1964 }
1965 return c.header_
1966 }
1967
1968 func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
1969 reqHeaders := make(http.Header)
1970 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1971 for k, v := range c.header_ {
1972 reqHeaders[k] = v
1973 }
1974 reqHeaders.Set("User-Agent", c.s.userAgent())
1975 if c.ifNoneMatch_ != "" {
1976 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1977 }
1978 var body io.Reader = nil
1979 c.urlParams_.Set("alt", alt)
1980 c.urlParams_.Set("prettyPrint", "false")
1981 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits")
1982 urls += "?" + c.urlParams_.Encode()
1983 req, err := http.NewRequest("GET", urls, body)
1984 if err != nil {
1985 return nil, err
1986 }
1987 req.Header = reqHeaders
1988 googleapi.Expand(req.URL, map[string]string{
1989 "adClientId": c.adClientId,
1990 "customChannelId": c.customChannelId,
1991 })
1992 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1993 }
1994
1995
1996
1997
1998
1999
2000
2001
2002 func (c *CustomchannelsAdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
2003 gensupport.SetOptions(c.urlParams_, opts...)
2004 res, err := c.doRequest("json")
2005 if res != nil && res.StatusCode == http.StatusNotModified {
2006 if res.Body != nil {
2007 res.Body.Close()
2008 }
2009 return nil, &googleapi.Error{
2010 Code: res.StatusCode,
2011 Header: res.Header,
2012 }
2013 }
2014 if err != nil {
2015 return nil, err
2016 }
2017 defer googleapi.CloseBody(res)
2018 if err := googleapi.CheckResponse(res); err != nil {
2019 return nil, err
2020 }
2021 ret := &AdUnits{
2022 ServerResponse: googleapi.ServerResponse{
2023 Header: res.Header,
2024 HTTPStatusCode: res.StatusCode,
2025 },
2026 }
2027 target := &ret
2028 if err := gensupport.DecodeResponse(target, res); err != nil {
2029 return nil, err
2030 }
2031 return ret, nil
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
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
2085
2086
2087 func (c *CustomchannelsAdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
2088 c.ctx_ = ctx
2089 defer c.PageToken(c.urlParams_.Get("pageToken"))
2090 for {
2091 x, err := c.Do()
2092 if err != nil {
2093 return err
2094 }
2095 if err := f(x); err != nil {
2096 return err
2097 }
2098 if x.NextPageToken == "" {
2099 return nil
2100 }
2101 c.PageToken(x.NextPageToken)
2102 }
2103 }
2104
2105
2106
2107 type ReportsGenerateCall struct {
2108 s *Service
2109 urlParams_ gensupport.URLParams
2110 ifNoneMatch_ string
2111 ctx_ context.Context
2112 header_ http.Header
2113 }
2114
2115
2116
2117
2118 func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall {
2119 c := &ReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2120 c.urlParams_.Set("startDate", startDate)
2121 c.urlParams_.Set("endDate", endDate)
2122 return c
2123 }
2124
2125
2126
2127 func (c *ReportsGenerateCall) Dimension(dimension ...string) *ReportsGenerateCall {
2128 c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
2129 return c
2130 }
2131
2132
2133
2134 func (c *ReportsGenerateCall) Filter(filter ...string) *ReportsGenerateCall {
2135 c.urlParams_.SetMulti("filter", append([]string{}, filter...))
2136 return c
2137 }
2138
2139
2140
2141
2142 func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall {
2143 c.urlParams_.Set("locale", locale)
2144 return c
2145 }
2146
2147
2148
2149 func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall {
2150 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2151 return c
2152 }
2153
2154
2155
2156 func (c *ReportsGenerateCall) Metric(metric ...string) *ReportsGenerateCall {
2157 c.urlParams_.SetMulti("metric", append([]string{}, metric...))
2158 return c
2159 }
2160
2161
2162
2163
2164
2165 func (c *ReportsGenerateCall) Sort(sort ...string) *ReportsGenerateCall {
2166 c.urlParams_.SetMulti("sort", append([]string{}, sort...))
2167 return c
2168 }
2169
2170
2171
2172 func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall {
2173 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
2174 return c
2175 }
2176
2177
2178
2179
2180 func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall {
2181 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2182 return c
2183 }
2184
2185
2186
2187
2188
2189
2190 func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall {
2191 c.ifNoneMatch_ = entityTag
2192 return c
2193 }
2194
2195
2196
2197
2198 func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall {
2199 c.ctx_ = ctx
2200 return c
2201 }
2202
2203
2204
2205 func (c *ReportsGenerateCall) Header() http.Header {
2206 if c.header_ == nil {
2207 c.header_ = make(http.Header)
2208 }
2209 return c.header_
2210 }
2211
2212 func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
2213 reqHeaders := make(http.Header)
2214 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2215 for k, v := range c.header_ {
2216 reqHeaders[k] = v
2217 }
2218 reqHeaders.Set("User-Agent", c.s.userAgent())
2219 if c.ifNoneMatch_ != "" {
2220 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2221 }
2222 var body io.Reader = nil
2223 c.urlParams_.Set("alt", alt)
2224 c.urlParams_.Set("prettyPrint", "false")
2225 urls := googleapi.ResolveRelative(c.s.BasePath, "reports")
2226 urls += "?" + c.urlParams_.Encode()
2227 req, err := http.NewRequest("GET", urls, body)
2228 if err != nil {
2229 return nil, err
2230 }
2231 req.Header = reqHeaders
2232 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2233 }
2234
2235
2236
2237
2238 func (c *ReportsGenerateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
2239 gensupport.SetOptions(c.urlParams_, opts...)
2240 res, err := c.doRequest("media")
2241 if err != nil {
2242 return nil, err
2243 }
2244 if err := googleapi.CheckMediaResponse(res); err != nil {
2245 res.Body.Close()
2246 return nil, err
2247 }
2248 return res, nil
2249 }
2250
2251
2252
2253
2254
2255
2256
2257
2258 func (c *ReportsGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
2259 gensupport.SetOptions(c.urlParams_, opts...)
2260 res, err := c.doRequest("json")
2261 if res != nil && res.StatusCode == http.StatusNotModified {
2262 if res.Body != nil {
2263 res.Body.Close()
2264 }
2265 return nil, &googleapi.Error{
2266 Code: res.StatusCode,
2267 Header: res.Header,
2268 }
2269 }
2270 if err != nil {
2271 return nil, err
2272 }
2273 defer googleapi.CloseBody(res)
2274 if err := googleapi.CheckResponse(res); err != nil {
2275 return nil, err
2276 }
2277 ret := &Report{
2278 ServerResponse: googleapi.ServerResponse{
2279 Header: res.Header,
2280 HTTPStatusCode: res.StatusCode,
2281 },
2282 }
2283 target := &ret
2284 if err := gensupport.DecodeResponse(target, res); err != nil {
2285 return nil, err
2286 }
2287 return ret, nil
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373 }
2374
2375
2376
2377 type ReportsSavedGenerateCall struct {
2378 s *Service
2379 savedReportId string
2380 urlParams_ gensupport.URLParams
2381 ifNoneMatch_ string
2382 ctx_ context.Context
2383 header_ http.Header
2384 }
2385
2386
2387
2388 func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall {
2389 c := &ReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2390 c.savedReportId = savedReportId
2391 return c
2392 }
2393
2394
2395
2396
2397 func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall {
2398 c.urlParams_.Set("locale", locale)
2399 return c
2400 }
2401
2402
2403
2404 func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall {
2405 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2406 return c
2407 }
2408
2409
2410
2411 func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall {
2412 c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
2413 return c
2414 }
2415
2416
2417
2418
2419 func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall {
2420 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2421 return c
2422 }
2423
2424
2425
2426
2427
2428
2429 func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall {
2430 c.ifNoneMatch_ = entityTag
2431 return c
2432 }
2433
2434
2435
2436
2437 func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall {
2438 c.ctx_ = ctx
2439 return c
2440 }
2441
2442
2443
2444 func (c *ReportsSavedGenerateCall) Header() http.Header {
2445 if c.header_ == nil {
2446 c.header_ = make(http.Header)
2447 }
2448 return c.header_
2449 }
2450
2451 func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
2452 reqHeaders := make(http.Header)
2453 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2454 for k, v := range c.header_ {
2455 reqHeaders[k] = v
2456 }
2457 reqHeaders.Set("User-Agent", c.s.userAgent())
2458 if c.ifNoneMatch_ != "" {
2459 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2460 }
2461 var body io.Reader = nil
2462 c.urlParams_.Set("alt", alt)
2463 c.urlParams_.Set("prettyPrint", "false")
2464 urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}")
2465 urls += "?" + c.urlParams_.Encode()
2466 req, err := http.NewRequest("GET", urls, body)
2467 if err != nil {
2468 return nil, err
2469 }
2470 req.Header = reqHeaders
2471 googleapi.Expand(req.URL, map[string]string{
2472 "savedReportId": c.savedReportId,
2473 })
2474 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2475 }
2476
2477
2478
2479
2480
2481
2482
2483
2484 func (c *ReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
2485 gensupport.SetOptions(c.urlParams_, opts...)
2486 res, err := c.doRequest("json")
2487 if res != nil && res.StatusCode == http.StatusNotModified {
2488 if res.Body != nil {
2489 res.Body.Close()
2490 }
2491 return nil, &googleapi.Error{
2492 Code: res.StatusCode,
2493 Header: res.Header,
2494 }
2495 }
2496 if err != nil {
2497 return nil, err
2498 }
2499 defer googleapi.CloseBody(res)
2500 if err := googleapi.CheckResponse(res); err != nil {
2501 return nil, err
2502 }
2503 ret := &Report{
2504 ServerResponse: googleapi.ServerResponse{
2505 Header: res.Header,
2506 HTTPStatusCode: res.StatusCode,
2507 },
2508 }
2509 target := &ret
2510 if err := gensupport.DecodeResponse(target, res); err != nil {
2511 return nil, err
2512 }
2513 return ret, nil
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561 }
2562
2563
2564
2565 type ReportsSavedListCall struct {
2566 s *Service
2567 urlParams_ gensupport.URLParams
2568 ifNoneMatch_ string
2569 ctx_ context.Context
2570 header_ http.Header
2571 }
2572
2573
2574 func (r *ReportsSavedService) List() *ReportsSavedListCall {
2575 c := &ReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2576 return c
2577 }
2578
2579
2580
2581 func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall {
2582 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2583 return c
2584 }
2585
2586
2587
2588
2589
2590 func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall {
2591 c.urlParams_.Set("pageToken", pageToken)
2592 return c
2593 }
2594
2595
2596
2597
2598 func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall {
2599 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2600 return c
2601 }
2602
2603
2604
2605
2606
2607
2608 func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall {
2609 c.ifNoneMatch_ = entityTag
2610 return c
2611 }
2612
2613
2614
2615
2616 func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall {
2617 c.ctx_ = ctx
2618 return c
2619 }
2620
2621
2622
2623 func (c *ReportsSavedListCall) Header() http.Header {
2624 if c.header_ == nil {
2625 c.header_ = make(http.Header)
2626 }
2627 return c.header_
2628 }
2629
2630 func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
2631 reqHeaders := make(http.Header)
2632 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2633 for k, v := range c.header_ {
2634 reqHeaders[k] = v
2635 }
2636 reqHeaders.Set("User-Agent", c.s.userAgent())
2637 if c.ifNoneMatch_ != "" {
2638 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2639 }
2640 var body io.Reader = nil
2641 c.urlParams_.Set("alt", alt)
2642 c.urlParams_.Set("prettyPrint", "false")
2643 urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved")
2644 urls += "?" + c.urlParams_.Encode()
2645 req, err := http.NewRequest("GET", urls, body)
2646 if err != nil {
2647 return nil, err
2648 }
2649 req.Header = reqHeaders
2650 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2651 }
2652
2653
2654
2655
2656
2657
2658
2659
2660 func (c *ReportsSavedListCall) Do(opts ...googleapi.CallOption) (*SavedReports, error) {
2661 gensupport.SetOptions(c.urlParams_, opts...)
2662 res, err := c.doRequest("json")
2663 if res != nil && res.StatusCode == http.StatusNotModified {
2664 if res.Body != nil {
2665 res.Body.Close()
2666 }
2667 return nil, &googleapi.Error{
2668 Code: res.StatusCode,
2669 Header: res.Header,
2670 }
2671 }
2672 if err != nil {
2673 return nil, err
2674 }
2675 defer googleapi.CloseBody(res)
2676 if err := googleapi.CheckResponse(res); err != nil {
2677 return nil, err
2678 }
2679 ret := &SavedReports{
2680 ServerResponse: googleapi.ServerResponse{
2681 Header: res.Header,
2682 HTTPStatusCode: res.StatusCode,
2683 },
2684 }
2685 target := &ret
2686 if err := gensupport.DecodeResponse(target, res); err != nil {
2687 return nil, err
2688 }
2689 return ret, nil
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719 }
2720
2721
2722
2723
2724 func (c *ReportsSavedListCall) Pages(ctx context.Context, f func(*SavedReports) error) error {
2725 c.ctx_ = ctx
2726 defer c.PageToken(c.urlParams_.Get("pageToken"))
2727 for {
2728 x, err := c.Do()
2729 if err != nil {
2730 return err
2731 }
2732 if err := f(x); err != nil {
2733 return err
2734 }
2735 if x.NextPageToken == "" {
2736 return nil
2737 }
2738 c.PageToken(x.NextPageToken)
2739 }
2740 }
2741
2742
2743
2744 type UrlchannelsListCall struct {
2745 s *Service
2746 adClientId string
2747 urlParams_ gensupport.URLParams
2748 ifNoneMatch_ string
2749 ctx_ context.Context
2750 header_ http.Header
2751 }
2752
2753
2754
2755 func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall {
2756 c := &UrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2757 c.adClientId = adClientId
2758 return c
2759 }
2760
2761
2762
2763 func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall {
2764 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2765 return c
2766 }
2767
2768
2769
2770
2771
2772 func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall {
2773 c.urlParams_.Set("pageToken", pageToken)
2774 return c
2775 }
2776
2777
2778
2779
2780 func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall {
2781 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2782 return c
2783 }
2784
2785
2786
2787
2788
2789
2790 func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall {
2791 c.ifNoneMatch_ = entityTag
2792 return c
2793 }
2794
2795
2796
2797
2798 func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall {
2799 c.ctx_ = ctx
2800 return c
2801 }
2802
2803
2804
2805 func (c *UrlchannelsListCall) Header() http.Header {
2806 if c.header_ == nil {
2807 c.header_ = make(http.Header)
2808 }
2809 return c.header_
2810 }
2811
2812 func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
2813 reqHeaders := make(http.Header)
2814 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2815 for k, v := range c.header_ {
2816 reqHeaders[k] = v
2817 }
2818 reqHeaders.Set("User-Agent", c.s.userAgent())
2819 if c.ifNoneMatch_ != "" {
2820 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2821 }
2822 var body io.Reader = nil
2823 c.urlParams_.Set("alt", alt)
2824 c.urlParams_.Set("prettyPrint", "false")
2825 urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels")
2826 urls += "?" + c.urlParams_.Encode()
2827 req, err := http.NewRequest("GET", urls, body)
2828 if err != nil {
2829 return nil, err
2830 }
2831 req.Header = reqHeaders
2832 googleapi.Expand(req.URL, map[string]string{
2833 "adClientId": c.adClientId,
2834 })
2835 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2836 }
2837
2838
2839
2840
2841
2842
2843
2844
2845 func (c *UrlchannelsListCall) Do(opts ...googleapi.CallOption) (*UrlChannels, error) {
2846 gensupport.SetOptions(c.urlParams_, opts...)
2847 res, err := c.doRequest("json")
2848 if res != nil && res.StatusCode == http.StatusNotModified {
2849 if res.Body != nil {
2850 res.Body.Close()
2851 }
2852 return nil, &googleapi.Error{
2853 Code: res.StatusCode,
2854 Header: res.Header,
2855 }
2856 }
2857 if err != nil {
2858 return nil, err
2859 }
2860 defer googleapi.CloseBody(res)
2861 if err := googleapi.CheckResponse(res); err != nil {
2862 return nil, err
2863 }
2864 ret := &UrlChannels{
2865 ServerResponse: googleapi.ServerResponse{
2866 Header: res.Header,
2867 HTTPStatusCode: res.StatusCode,
2868 },
2869 }
2870 target := &ret
2871 if err := gensupport.DecodeResponse(target, res); err != nil {
2872 return nil, err
2873 }
2874 return ret, nil
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913 }
2914
2915
2916
2917
2918 func (c *UrlchannelsListCall) Pages(ctx context.Context, f func(*UrlChannels) error) error {
2919 c.ctx_ = ctx
2920 defer c.PageToken(c.urlParams_.Get("pageToken"))
2921 for {
2922 x, err := c.Do()
2923 if err != nil {
2924 return err
2925 }
2926 if err := f(x); err != nil {
2927 return err
2928 }
2929 if x.NextPageToken == "" {
2930 return nil
2931 }
2932 c.PageToken(x.NextPageToken)
2933 }
2934 }
2935
View as plain text