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
43
44
45
46
47
48
49
50
51
52
53
54
55
56 package adsense
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "net/http"
66 "net/url"
67 "strconv"
68 "strings"
69
70 googleapi "google.golang.org/api/googleapi"
71 internal "google.golang.org/api/internal"
72 gensupport "google.golang.org/api/internal/gensupport"
73 option "google.golang.org/api/option"
74 internaloption "google.golang.org/api/option/internaloption"
75 htransport "google.golang.org/api/transport/http"
76 )
77
78
79
80 var _ = bytes.NewBuffer
81 var _ = strconv.Itoa
82 var _ = fmt.Sprintf
83 var _ = json.NewDecoder
84 var _ = io.Copy
85 var _ = url.Parse
86 var _ = gensupport.MarshalJSON
87 var _ = googleapi.Version
88 var _ = errors.New
89 var _ = strings.Replace
90 var _ = context.Canceled
91 var _ = internaloption.WithDefaultEndpoint
92 var _ = internal.Version
93
94 const apiId = "adsense:v2"
95 const apiName = "adsense"
96 const apiVersion = "v2"
97 const basePath = "https://adsense.googleapis.com/"
98 const basePathTemplate = "https://adsense.UNIVERSE_DOMAIN/"
99 const mtlsBasePath = "https://adsense.mtls.googleapis.com/"
100
101
102 const (
103
104 AdsenseScope = "https://www.googleapis.com/auth/adsense"
105
106
107 AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.readonly"
108 )
109
110
111 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
112 scopesOption := internaloption.WithDefaultScopes(
113 "https://www.googleapis.com/auth/adsense",
114 "https://www.googleapis.com/auth/adsense.readonly",
115 )
116
117 opts = append([]option.ClientOption{scopesOption}, opts...)
118 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
119 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
120 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
121 opts = append(opts, internaloption.EnableNewAuthLibrary())
122 client, endpoint, err := htransport.NewClient(ctx, opts...)
123 if err != nil {
124 return nil, err
125 }
126 s, err := New(client)
127 if err != nil {
128 return nil, err
129 }
130 if endpoint != "" {
131 s.BasePath = endpoint
132 }
133 return s, nil
134 }
135
136
137
138
139
140
141 func New(client *http.Client) (*Service, error) {
142 if client == nil {
143 return nil, errors.New("client is nil")
144 }
145 s := &Service{client: client, BasePath: basePath}
146 s.Accounts = NewAccountsService(s)
147 return s, nil
148 }
149
150 type Service struct {
151 client *http.Client
152 BasePath string
153 UserAgent string
154
155 Accounts *AccountsService
156 }
157
158 func (s *Service) userAgent() string {
159 if s.UserAgent == "" {
160 return googleapi.UserAgent
161 }
162 return googleapi.UserAgent + " " + s.UserAgent
163 }
164
165 func NewAccountsService(s *Service) *AccountsService {
166 rs := &AccountsService{s: s}
167 rs.Adclients = NewAccountsAdclientsService(s)
168 rs.Alerts = NewAccountsAlertsService(s)
169 rs.Payments = NewAccountsPaymentsService(s)
170 rs.PolicyIssues = NewAccountsPolicyIssuesService(s)
171 rs.Reports = NewAccountsReportsService(s)
172 rs.Sites = NewAccountsSitesService(s)
173 return rs
174 }
175
176 type AccountsService struct {
177 s *Service
178
179 Adclients *AccountsAdclientsService
180
181 Alerts *AccountsAlertsService
182
183 Payments *AccountsPaymentsService
184
185 PolicyIssues *AccountsPolicyIssuesService
186
187 Reports *AccountsReportsService
188
189 Sites *AccountsSitesService
190 }
191
192 func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService {
193 rs := &AccountsAdclientsService{s: s}
194 rs.Adunits = NewAccountsAdclientsAdunitsService(s)
195 rs.Customchannels = NewAccountsAdclientsCustomchannelsService(s)
196 rs.Urlchannels = NewAccountsAdclientsUrlchannelsService(s)
197 return rs
198 }
199
200 type AccountsAdclientsService struct {
201 s *Service
202
203 Adunits *AccountsAdclientsAdunitsService
204
205 Customchannels *AccountsAdclientsCustomchannelsService
206
207 Urlchannels *AccountsAdclientsUrlchannelsService
208 }
209
210 func NewAccountsAdclientsAdunitsService(s *Service) *AccountsAdclientsAdunitsService {
211 rs := &AccountsAdclientsAdunitsService{s: s}
212 return rs
213 }
214
215 type AccountsAdclientsAdunitsService struct {
216 s *Service
217 }
218
219 func NewAccountsAdclientsCustomchannelsService(s *Service) *AccountsAdclientsCustomchannelsService {
220 rs := &AccountsAdclientsCustomchannelsService{s: s}
221 return rs
222 }
223
224 type AccountsAdclientsCustomchannelsService struct {
225 s *Service
226 }
227
228 func NewAccountsAdclientsUrlchannelsService(s *Service) *AccountsAdclientsUrlchannelsService {
229 rs := &AccountsAdclientsUrlchannelsService{s: s}
230 return rs
231 }
232
233 type AccountsAdclientsUrlchannelsService struct {
234 s *Service
235 }
236
237 func NewAccountsAlertsService(s *Service) *AccountsAlertsService {
238 rs := &AccountsAlertsService{s: s}
239 return rs
240 }
241
242 type AccountsAlertsService struct {
243 s *Service
244 }
245
246 func NewAccountsPaymentsService(s *Service) *AccountsPaymentsService {
247 rs := &AccountsPaymentsService{s: s}
248 return rs
249 }
250
251 type AccountsPaymentsService struct {
252 s *Service
253 }
254
255 func NewAccountsPolicyIssuesService(s *Service) *AccountsPolicyIssuesService {
256 rs := &AccountsPolicyIssuesService{s: s}
257 return rs
258 }
259
260 type AccountsPolicyIssuesService struct {
261 s *Service
262 }
263
264 func NewAccountsReportsService(s *Service) *AccountsReportsService {
265 rs := &AccountsReportsService{s: s}
266 rs.Saved = NewAccountsReportsSavedService(s)
267 return rs
268 }
269
270 type AccountsReportsService struct {
271 s *Service
272
273 Saved *AccountsReportsSavedService
274 }
275
276 func NewAccountsReportsSavedService(s *Service) *AccountsReportsSavedService {
277 rs := &AccountsReportsSavedService{s: s}
278 return rs
279 }
280
281 type AccountsReportsSavedService struct {
282 s *Service
283 }
284
285 func NewAccountsSitesService(s *Service) *AccountsSitesService {
286 rs := &AccountsSitesService{s: s}
287 return rs
288 }
289
290 type AccountsSitesService struct {
291 s *Service
292 }
293
294
295 type Account struct {
296
297 CreateTime string `json:"createTime,omitempty"`
298
299 DisplayName string `json:"displayName,omitempty"`
300
301 Name string `json:"name,omitempty"`
302
303
304
305 PendingTasks []string `json:"pendingTasks,omitempty"`
306
307 Premium bool `json:"premium,omitempty"`
308
309
310
311
312
313
314
315
316 State string `json:"state,omitempty"`
317
318
319
320 TimeZone *TimeZone `json:"timeZone,omitempty"`
321
322
323 googleapi.ServerResponse `json:"-"`
324
325
326
327
328
329 ForceSendFields []string `json:"-"`
330
331
332
333
334 NullFields []string `json:"-"`
335 }
336
337 func (s *Account) MarshalJSON() ([]byte, error) {
338 type NoMethod Account
339 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
340 }
341
342
343
344 type AdBlockingRecoveryTag struct {
345
346
347
348
349 ErrorProtectionCode string `json:"errorProtectionCode,omitempty"`
350
351
352
353
354 Tag string `json:"tag,omitempty"`
355
356
357 googleapi.ServerResponse `json:"-"`
358
359
360
361
362
363 ForceSendFields []string `json:"-"`
364
365
366
367
368 NullFields []string `json:"-"`
369 }
370
371 func (s *AdBlockingRecoveryTag) MarshalJSON() ([]byte, error) {
372 type NoMethod AdBlockingRecoveryTag
373 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
374 }
375
376
377
378 type AdClient struct {
379
380
381 Name string `json:"name,omitempty"`
382
383
384
385 ProductCode string `json:"productCode,omitempty"`
386
387
388
389 ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
390
391
392
393
394
395
396
397
398
399 State string `json:"state,omitempty"`
400
401
402 googleapi.ServerResponse `json:"-"`
403
404
405
406
407
408 ForceSendFields []string `json:"-"`
409
410
411
412
413 NullFields []string `json:"-"`
414 }
415
416 func (s *AdClient) MarshalJSON() ([]byte, error) {
417 type NoMethod AdClient
418 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
419 }
420
421
422
423
424 type AdClientAdCode struct {
425
426
427 AdCode string `json:"adCode,omitempty"`
428
429
430 AmpBody string `json:"ampBody,omitempty"`
431
432
433 AmpHead string `json:"ampHead,omitempty"`
434
435
436 googleapi.ServerResponse `json:"-"`
437
438
439
440
441
442 ForceSendFields []string `json:"-"`
443
444
445
446
447 NullFields []string `json:"-"`
448 }
449
450 func (s *AdClientAdCode) MarshalJSON() ([]byte, error) {
451 type NoMethod AdClientAdCode
452 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
453 }
454
455
456
457
458 type AdUnit struct {
459
460 ContentAdsSettings *ContentAdsSettings `json:"contentAdsSettings,omitempty"`
461
462
463 DisplayName string `json:"displayName,omitempty"`
464
465
466 Name string `json:"name,omitempty"`
467
468
469 ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
470
471
472
473
474
475
476
477
478 State string `json:"state,omitempty"`
479
480
481 googleapi.ServerResponse `json:"-"`
482
483
484
485
486
487 ForceSendFields []string `json:"-"`
488
489
490
491
492 NullFields []string `json:"-"`
493 }
494
495 func (s *AdUnit) MarshalJSON() ([]byte, error) {
496 type NoMethod AdUnit
497 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
498 }
499
500
501
502
503
504 type AdUnitAdCode struct {
505
506 AdCode string `json:"adCode,omitempty"`
507
508
509 googleapi.ServerResponse `json:"-"`
510
511
512
513
514
515 ForceSendFields []string `json:"-"`
516
517
518
519
520 NullFields []string `json:"-"`
521 }
522
523 func (s *AdUnitAdCode) MarshalJSON() ([]byte, error) {
524 type NoMethod AdUnitAdCode
525 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
526 }
527
528
529 type Alert struct {
530
531
532 Message string `json:"message,omitempty"`
533
534
535 Name string `json:"name,omitempty"`
536
537
538
539
540
541
542
543 Severity string `json:"severity,omitempty"`
544
545
546
547 Type string `json:"type,omitempty"`
548
549
550
551
552
553 ForceSendFields []string `json:"-"`
554
555
556
557
558 NullFields []string `json:"-"`
559 }
560
561 func (s *Alert) MarshalJSON() ([]byte, error) {
562 type NoMethod Alert
563 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
564 }
565
566
567 type Cell struct {
568
569
570 Value string `json:"value,omitempty"`
571
572
573
574
575
576 ForceSendFields []string `json:"-"`
577
578
579
580
581 NullFields []string `json:"-"`
582 }
583
584 func (s *Cell) MarshalJSON() ([]byte, error) {
585 type NoMethod Cell
586 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
587 }
588
589
590 type ContentAdsSettings struct {
591
592
593 Size string `json:"size,omitempty"`
594
595
596
597
598
599
600
601
602
603
604 Type string `json:"type,omitempty"`
605
606
607
608
609
610 ForceSendFields []string `json:"-"`
611
612
613
614
615 NullFields []string `json:"-"`
616 }
617
618 func (s *ContentAdsSettings) MarshalJSON() ([]byte, error) {
619 type NoMethod ContentAdsSettings
620 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
621 }
622
623
624 type CustomChannel struct {
625
626
627 Active bool `json:"active,omitempty"`
628
629 DisplayName string `json:"displayName,omitempty"`
630
631
632 Name string `json:"name,omitempty"`
633
634
635 ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
636
637
638 googleapi.ServerResponse `json:"-"`
639
640
641
642
643
644 ForceSendFields []string `json:"-"`
645
646
647
648
649 NullFields []string `json:"-"`
650 }
651
652 func (s *CustomChannel) MarshalJSON() ([]byte, error) {
653 type NoMethod CustomChannel
654 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
655 }
656
657
658
659
660
661
662
663
664
665
666 type Date struct {
667
668
669
670 Day int64 `json:"day,omitempty"`
671
672
673 Month int64 `json:"month,omitempty"`
674
675
676 Year int64 `json:"year,omitempty"`
677
678
679
680
681
682 ForceSendFields []string `json:"-"`
683
684
685
686
687 NullFields []string `json:"-"`
688 }
689
690 func (s *Date) MarshalJSON() ([]byte, error) {
691 type NoMethod Date
692 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
693 }
694
695
696
697
698
699 type Empty struct {
700
701 googleapi.ServerResponse `json:"-"`
702 }
703
704
705 type Header struct {
706
707
708
709 CurrencyCode string `json:"currencyCode,omitempty"`
710
711 Name string `json:"name,omitempty"`
712
713
714
715
716
717
718
719
720
721
722 Type string `json:"type,omitempty"`
723
724
725
726
727
728 ForceSendFields []string `json:"-"`
729
730
731
732
733 NullFields []string `json:"-"`
734 }
735
736 func (s *Header) MarshalJSON() ([]byte, error) {
737 type NoMethod Header
738 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
739 }
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758 type HttpBody struct {
759
760
761 ContentType string `json:"contentType,omitempty"`
762
763 Data string `json:"data,omitempty"`
764
765
766 Extensions []googleapi.RawMessage `json:"extensions,omitempty"`
767
768
769 googleapi.ServerResponse `json:"-"`
770
771
772
773
774
775 ForceSendFields []string `json:"-"`
776
777
778
779
780 NullFields []string `json:"-"`
781 }
782
783 func (s *HttpBody) MarshalJSON() ([]byte, error) {
784 type NoMethod HttpBody
785 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
786 }
787
788
789 type ListAccountsResponse struct {
790
791 Accounts []*Account `json:"accounts,omitempty"`
792
793
794
795 NextPageToken string `json:"nextPageToken,omitempty"`
796
797
798 googleapi.ServerResponse `json:"-"`
799
800
801
802
803
804 ForceSendFields []string `json:"-"`
805
806
807
808
809 NullFields []string `json:"-"`
810 }
811
812 func (s *ListAccountsResponse) MarshalJSON() ([]byte, error) {
813 type NoMethod ListAccountsResponse
814 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
815 }
816
817
818 type ListAdClientsResponse struct {
819
820 AdClients []*AdClient `json:"adClients,omitempty"`
821
822
823
824 NextPageToken string `json:"nextPageToken,omitempty"`
825
826
827 googleapi.ServerResponse `json:"-"`
828
829
830
831
832
833 ForceSendFields []string `json:"-"`
834
835
836
837
838 NullFields []string `json:"-"`
839 }
840
841 func (s *ListAdClientsResponse) MarshalJSON() ([]byte, error) {
842 type NoMethod ListAdClientsResponse
843 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
844 }
845
846
847 type ListAdUnitsResponse struct {
848
849 AdUnits []*AdUnit `json:"adUnits,omitempty"`
850
851
852
853 NextPageToken string `json:"nextPageToken,omitempty"`
854
855
856 googleapi.ServerResponse `json:"-"`
857
858
859
860
861
862 ForceSendFields []string `json:"-"`
863
864
865
866
867 NullFields []string `json:"-"`
868 }
869
870 func (s *ListAdUnitsResponse) MarshalJSON() ([]byte, error) {
871 type NoMethod ListAdUnitsResponse
872 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
873 }
874
875
876 type ListAlertsResponse struct {
877
878 Alerts []*Alert `json:"alerts,omitempty"`
879
880
881 googleapi.ServerResponse `json:"-"`
882
883
884
885
886
887 ForceSendFields []string `json:"-"`
888
889
890
891
892 NullFields []string `json:"-"`
893 }
894
895 func (s *ListAlertsResponse) MarshalJSON() ([]byte, error) {
896 type NoMethod ListAlertsResponse
897 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
898 }
899
900
901
902 type ListChildAccountsResponse struct {
903
904 Accounts []*Account `json:"accounts,omitempty"`
905
906
907
908 NextPageToken string `json:"nextPageToken,omitempty"`
909
910
911 googleapi.ServerResponse `json:"-"`
912
913
914
915
916
917 ForceSendFields []string `json:"-"`
918
919
920
921
922 NullFields []string `json:"-"`
923 }
924
925 func (s *ListChildAccountsResponse) MarshalJSON() ([]byte, error) {
926 type NoMethod ListChildAccountsResponse
927 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
928 }
929
930
931
932 type ListCustomChannelsResponse struct {
933
934 CustomChannels []*CustomChannel `json:"customChannels,omitempty"`
935
936
937
938 NextPageToken string `json:"nextPageToken,omitempty"`
939
940
941 googleapi.ServerResponse `json:"-"`
942
943
944
945
946
947 ForceSendFields []string `json:"-"`
948
949
950
951
952 NullFields []string `json:"-"`
953 }
954
955 func (s *ListCustomChannelsResponse) MarshalJSON() ([]byte, error) {
956 type NoMethod ListCustomChannelsResponse
957 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
958 }
959
960
961
962 type ListLinkedAdUnitsResponse struct {
963
964 AdUnits []*AdUnit `json:"adUnits,omitempty"`
965
966
967
968 NextPageToken string `json:"nextPageToken,omitempty"`
969
970
971 googleapi.ServerResponse `json:"-"`
972
973
974
975
976
977 ForceSendFields []string `json:"-"`
978
979
980
981
982 NullFields []string `json:"-"`
983 }
984
985 func (s *ListLinkedAdUnitsResponse) MarshalJSON() ([]byte, error) {
986 type NoMethod ListLinkedAdUnitsResponse
987 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
988 }
989
990
991
992 type ListLinkedCustomChannelsResponse struct {
993
994 CustomChannels []*CustomChannel `json:"customChannels,omitempty"`
995
996
997
998 NextPageToken string `json:"nextPageToken,omitempty"`
999
1000
1001 googleapi.ServerResponse `json:"-"`
1002
1003
1004
1005
1006
1007 ForceSendFields []string `json:"-"`
1008
1009
1010
1011
1012 NullFields []string `json:"-"`
1013 }
1014
1015 func (s *ListLinkedCustomChannelsResponse) MarshalJSON() ([]byte, error) {
1016 type NoMethod ListLinkedCustomChannelsResponse
1017 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1018 }
1019
1020
1021 type ListPaymentsResponse struct {
1022
1023 Payments []*Payment `json:"payments,omitempty"`
1024
1025
1026 googleapi.ServerResponse `json:"-"`
1027
1028
1029
1030
1031
1032 ForceSendFields []string `json:"-"`
1033
1034
1035
1036
1037 NullFields []string `json:"-"`
1038 }
1039
1040 func (s *ListPaymentsResponse) MarshalJSON() ([]byte, error) {
1041 type NoMethod ListPaymentsResponse
1042 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1043 }
1044
1045
1046
1047
1048
1049 type ListPolicyIssuesResponse struct {
1050
1051
1052
1053 NextPageToken string `json:"nextPageToken,omitempty"`
1054
1055 PolicyIssues []*PolicyIssue `json:"policyIssues,omitempty"`
1056
1057
1058 googleapi.ServerResponse `json:"-"`
1059
1060
1061
1062
1063
1064 ForceSendFields []string `json:"-"`
1065
1066
1067
1068
1069 NullFields []string `json:"-"`
1070 }
1071
1072 func (s *ListPolicyIssuesResponse) MarshalJSON() ([]byte, error) {
1073 type NoMethod ListPolicyIssuesResponse
1074 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1075 }
1076
1077
1078
1079 type ListSavedReportsResponse struct {
1080
1081
1082
1083 NextPageToken string `json:"nextPageToken,omitempty"`
1084
1085 SavedReports []*SavedReport `json:"savedReports,omitempty"`
1086
1087
1088 googleapi.ServerResponse `json:"-"`
1089
1090
1091
1092
1093
1094 ForceSendFields []string `json:"-"`
1095
1096
1097
1098
1099 NullFields []string `json:"-"`
1100 }
1101
1102 func (s *ListSavedReportsResponse) MarshalJSON() ([]byte, error) {
1103 type NoMethod ListSavedReportsResponse
1104 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1105 }
1106
1107
1108 type ListSitesResponse struct {
1109
1110
1111
1112 NextPageToken string `json:"nextPageToken,omitempty"`
1113
1114 Sites []*Site `json:"sites,omitempty"`
1115
1116
1117 googleapi.ServerResponse `json:"-"`
1118
1119
1120
1121
1122
1123 ForceSendFields []string `json:"-"`
1124
1125
1126
1127
1128 NullFields []string `json:"-"`
1129 }
1130
1131 func (s *ListSitesResponse) MarshalJSON() ([]byte, error) {
1132 type NoMethod ListSitesResponse
1133 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1134 }
1135
1136
1137 type ListUrlChannelsResponse struct {
1138
1139
1140
1141 NextPageToken string `json:"nextPageToken,omitempty"`
1142
1143 UrlChannels []*UrlChannel `json:"urlChannels,omitempty"`
1144
1145
1146 googleapi.ServerResponse `json:"-"`
1147
1148
1149
1150
1151
1152 ForceSendFields []string `json:"-"`
1153
1154
1155
1156
1157 NullFields []string `json:"-"`
1158 }
1159
1160 func (s *ListUrlChannelsResponse) MarshalJSON() ([]byte, error) {
1161 type NoMethod ListUrlChannelsResponse
1162 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1163 }
1164
1165
1166
1167
1168
1169
1170 type Payment struct {
1171
1172
1173 Amount string `json:"amount,omitempty"`
1174
1175
1176
1177 Date *Date `json:"date,omitempty"`
1178
1179
1180
1181
1182
1183
1184 Name string `json:"name,omitempty"`
1185
1186
1187
1188
1189
1190 ForceSendFields []string `json:"-"`
1191
1192
1193
1194
1195 NullFields []string `json:"-"`
1196 }
1197
1198 func (s *Payment) MarshalJSON() ([]byte, error) {
1199 type NoMethod Payment
1200 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1201 }
1202
1203
1204
1205
1206
1207
1208
1209 type PolicyIssue struct {
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228 Action string `json:"action,omitempty"`
1229
1230
1231
1232
1233 AdClients []string `json:"adClients,omitempty"`
1234
1235
1236 AdRequestCount int64 `json:"adRequestCount,omitempty,string"`
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246 EntityType string `json:"entityType,omitempty"`
1247
1248
1249 FirstDetectedDate *Date `json:"firstDetectedDate,omitempty"`
1250
1251
1252 LastDetectedDate *Date `json:"lastDetectedDate,omitempty"`
1253
1254
1255 Name string `json:"name,omitempty"`
1256
1257
1258 PolicyTopics []*PolicyTopic `json:"policyTopics,omitempty"`
1259
1260
1261
1262 Site string `json:"site,omitempty"`
1263
1264
1265
1266 SiteSection string `json:"siteSection,omitempty"`
1267
1268
1269
1270 Uri string `json:"uri,omitempty"`
1271
1272
1273
1274
1275 WarningEscalationDate *Date `json:"warningEscalationDate,omitempty"`
1276
1277
1278 googleapi.ServerResponse `json:"-"`
1279
1280
1281
1282
1283
1284 ForceSendFields []string `json:"-"`
1285
1286
1287
1288
1289 NullFields []string `json:"-"`
1290 }
1291
1292 func (s *PolicyIssue) MarshalJSON() ([]byte, error) {
1293 type NoMethod PolicyIssue
1294 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1295 }
1296
1297
1298
1299
1300
1301
1302 type PolicyTopic struct {
1303
1304
1305
1306
1307
1308 MustFix bool `json:"mustFix,omitempty"`
1309
1310
1311 Topic string `json:"topic,omitempty"`
1312
1313
1314
1315
1316
1317 ForceSendFields []string `json:"-"`
1318
1319
1320
1321
1322 NullFields []string `json:"-"`
1323 }
1324
1325 func (s *PolicyTopic) MarshalJSON() ([]byte, error) {
1326 type NoMethod PolicyTopic
1327 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1328 }
1329
1330
1331 type ReportResult struct {
1332
1333
1334 Averages *Row `json:"averages,omitempty"`
1335
1336 EndDate *Date `json:"endDate,omitempty"`
1337
1338
1339 Headers []*Header `json:"headers,omitempty"`
1340
1341
1342
1343 Rows []*Row `json:"rows,omitempty"`
1344
1345 StartDate *Date `json:"startDate,omitempty"`
1346
1347 TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"`
1348
1349
1350 Totals *Row `json:"totals,omitempty"`
1351
1352
1353 Warnings []string `json:"warnings,omitempty"`
1354
1355
1356 googleapi.ServerResponse `json:"-"`
1357
1358
1359
1360
1361
1362 ForceSendFields []string `json:"-"`
1363
1364
1365
1366
1367 NullFields []string `json:"-"`
1368 }
1369
1370 func (s *ReportResult) MarshalJSON() ([]byte, error) {
1371 type NoMethod ReportResult
1372 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1373 }
1374
1375
1376 type Row struct {
1377
1378 Cells []*Cell `json:"cells,omitempty"`
1379
1380
1381
1382
1383
1384 ForceSendFields []string `json:"-"`
1385
1386
1387
1388
1389 NullFields []string `json:"-"`
1390 }
1391
1392 func (s *Row) MarshalJSON() ([]byte, error) {
1393 type NoMethod Row
1394 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1395 }
1396
1397
1398 type SavedReport struct {
1399
1400
1401 Name string `json:"name,omitempty"`
1402
1403 Title string `json:"title,omitempty"`
1404
1405
1406 googleapi.ServerResponse `json:"-"`
1407
1408
1409
1410
1411
1412 ForceSendFields []string `json:"-"`
1413
1414
1415
1416
1417 NullFields []string `json:"-"`
1418 }
1419
1420 func (s *SavedReport) MarshalJSON() ([]byte, error) {
1421 type NoMethod SavedReport
1422 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1423 }
1424
1425
1426 type Site struct {
1427
1428 AutoAdsEnabled bool `json:"autoAdsEnabled,omitempty"`
1429
1430
1431
1432 Domain string `json:"domain,omitempty"`
1433
1434
1435 Name string `json:"name,omitempty"`
1436
1437
1438 ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454 State string `json:"state,omitempty"`
1455
1456
1457 googleapi.ServerResponse `json:"-"`
1458
1459
1460
1461
1462
1463 ForceSendFields []string `json:"-"`
1464
1465
1466
1467
1468 NullFields []string `json:"-"`
1469 }
1470
1471 func (s *Site) MarshalJSON() ([]byte, error) {
1472 type NoMethod Site
1473 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1474 }
1475
1476
1477
1478 type TimeZone struct {
1479
1480 Id string `json:"id,omitempty"`
1481
1482 Version string `json:"version,omitempty"`
1483
1484
1485
1486
1487
1488 ForceSendFields []string `json:"-"`
1489
1490
1491
1492
1493 NullFields []string `json:"-"`
1494 }
1495
1496 func (s *TimeZone) MarshalJSON() ([]byte, error) {
1497 type NoMethod TimeZone
1498 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1499 }
1500
1501
1502
1503
1504 type UrlChannel struct {
1505
1506
1507 Name string `json:"name,omitempty"`
1508
1509
1510 ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
1511
1512
1513 UriPattern string `json:"uriPattern,omitempty"`
1514
1515
1516 googleapi.ServerResponse `json:"-"`
1517
1518
1519
1520
1521
1522 ForceSendFields []string `json:"-"`
1523
1524
1525
1526
1527 NullFields []string `json:"-"`
1528 }
1529
1530 func (s *UrlChannel) MarshalJSON() ([]byte, error) {
1531 type NoMethod UrlChannel
1532 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1533 }
1534
1535 type AccountsGetCall struct {
1536 s *Service
1537 name string
1538 urlParams_ gensupport.URLParams
1539 ifNoneMatch_ string
1540 ctx_ context.Context
1541 header_ http.Header
1542 }
1543
1544
1545
1546
1547 func (r *AccountsService) Get(name string) *AccountsGetCall {
1548 c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1549 c.name = name
1550 return c
1551 }
1552
1553
1554
1555
1556 func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
1557 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1558 return c
1559 }
1560
1561
1562
1563
1564 func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
1565 c.ifNoneMatch_ = entityTag
1566 return c
1567 }
1568
1569
1570 func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
1571 c.ctx_ = ctx
1572 return c
1573 }
1574
1575
1576
1577 func (c *AccountsGetCall) Header() http.Header {
1578 if c.header_ == nil {
1579 c.header_ = make(http.Header)
1580 }
1581 return c.header_
1582 }
1583
1584 func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
1585 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1586 if c.ifNoneMatch_ != "" {
1587 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1588 }
1589 var body io.Reader = nil
1590 c.urlParams_.Set("alt", alt)
1591 c.urlParams_.Set("prettyPrint", "false")
1592 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
1593 urls += "?" + c.urlParams_.Encode()
1594 req, err := http.NewRequest("GET", urls, body)
1595 if err != nil {
1596 return nil, err
1597 }
1598 req.Header = reqHeaders
1599 googleapi.Expand(req.URL, map[string]string{
1600 "name": c.name,
1601 })
1602 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1603 }
1604
1605
1606
1607
1608
1609
1610 func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
1611 gensupport.SetOptions(c.urlParams_, opts...)
1612 res, err := c.doRequest("json")
1613 if res != nil && res.StatusCode == http.StatusNotModified {
1614 if res.Body != nil {
1615 res.Body.Close()
1616 }
1617 return nil, gensupport.WrapError(&googleapi.Error{
1618 Code: res.StatusCode,
1619 Header: res.Header,
1620 })
1621 }
1622 if err != nil {
1623 return nil, err
1624 }
1625 defer googleapi.CloseBody(res)
1626 if err := googleapi.CheckResponse(res); err != nil {
1627 return nil, gensupport.WrapError(err)
1628 }
1629 ret := &Account{
1630 ServerResponse: googleapi.ServerResponse{
1631 Header: res.Header,
1632 HTTPStatusCode: res.StatusCode,
1633 },
1634 }
1635 target := &ret
1636 if err := gensupport.DecodeResponse(target, res); err != nil {
1637 return nil, err
1638 }
1639 return ret, nil
1640 }
1641
1642 type AccountsGetAdBlockingRecoveryTagCall struct {
1643 s *Service
1644 name string
1645 urlParams_ gensupport.URLParams
1646 ifNoneMatch_ string
1647 ctx_ context.Context
1648 header_ http.Header
1649 }
1650
1651
1652
1653
1654
1655 func (r *AccountsService) GetAdBlockingRecoveryTag(name string) *AccountsGetAdBlockingRecoveryTagCall {
1656 c := &AccountsGetAdBlockingRecoveryTagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1657 c.name = name
1658 return c
1659 }
1660
1661
1662
1663
1664 func (c *AccountsGetAdBlockingRecoveryTagCall) Fields(s ...googleapi.Field) *AccountsGetAdBlockingRecoveryTagCall {
1665 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1666 return c
1667 }
1668
1669
1670
1671
1672 func (c *AccountsGetAdBlockingRecoveryTagCall) IfNoneMatch(entityTag string) *AccountsGetAdBlockingRecoveryTagCall {
1673 c.ifNoneMatch_ = entityTag
1674 return c
1675 }
1676
1677
1678 func (c *AccountsGetAdBlockingRecoveryTagCall) Context(ctx context.Context) *AccountsGetAdBlockingRecoveryTagCall {
1679 c.ctx_ = ctx
1680 return c
1681 }
1682
1683
1684
1685 func (c *AccountsGetAdBlockingRecoveryTagCall) Header() http.Header {
1686 if c.header_ == nil {
1687 c.header_ = make(http.Header)
1688 }
1689 return c.header_
1690 }
1691
1692 func (c *AccountsGetAdBlockingRecoveryTagCall) doRequest(alt string) (*http.Response, error) {
1693 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1694 if c.ifNoneMatch_ != "" {
1695 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1696 }
1697 var body io.Reader = nil
1698 c.urlParams_.Set("alt", alt)
1699 c.urlParams_.Set("prettyPrint", "false")
1700 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/adBlockingRecoveryTag")
1701 urls += "?" + c.urlParams_.Encode()
1702 req, err := http.NewRequest("GET", urls, body)
1703 if err != nil {
1704 return nil, err
1705 }
1706 req.Header = reqHeaders
1707 googleapi.Expand(req.URL, map[string]string{
1708 "name": c.name,
1709 })
1710 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1711 }
1712
1713
1714
1715
1716
1717
1718
1719 func (c *AccountsGetAdBlockingRecoveryTagCall) Do(opts ...googleapi.CallOption) (*AdBlockingRecoveryTag, error) {
1720 gensupport.SetOptions(c.urlParams_, opts...)
1721 res, err := c.doRequest("json")
1722 if res != nil && res.StatusCode == http.StatusNotModified {
1723 if res.Body != nil {
1724 res.Body.Close()
1725 }
1726 return nil, gensupport.WrapError(&googleapi.Error{
1727 Code: res.StatusCode,
1728 Header: res.Header,
1729 })
1730 }
1731 if err != nil {
1732 return nil, err
1733 }
1734 defer googleapi.CloseBody(res)
1735 if err := googleapi.CheckResponse(res); err != nil {
1736 return nil, gensupport.WrapError(err)
1737 }
1738 ret := &AdBlockingRecoveryTag{
1739 ServerResponse: googleapi.ServerResponse{
1740 Header: res.Header,
1741 HTTPStatusCode: res.StatusCode,
1742 },
1743 }
1744 target := &ret
1745 if err := gensupport.DecodeResponse(target, res); err != nil {
1746 return nil, err
1747 }
1748 return ret, nil
1749 }
1750
1751 type AccountsListCall struct {
1752 s *Service
1753 urlParams_ gensupport.URLParams
1754 ifNoneMatch_ string
1755 ctx_ context.Context
1756 header_ http.Header
1757 }
1758
1759
1760 func (r *AccountsService) List() *AccountsListCall {
1761 c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1762 return c
1763 }
1764
1765
1766
1767
1768
1769 func (c *AccountsListCall) PageSize(pageSize int64) *AccountsListCall {
1770 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1771 return c
1772 }
1773
1774
1775
1776
1777
1778 func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
1779 c.urlParams_.Set("pageToken", pageToken)
1780 return c
1781 }
1782
1783
1784
1785
1786 func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
1787 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1788 return c
1789 }
1790
1791
1792
1793
1794 func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
1795 c.ifNoneMatch_ = entityTag
1796 return c
1797 }
1798
1799
1800 func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
1801 c.ctx_ = ctx
1802 return c
1803 }
1804
1805
1806
1807 func (c *AccountsListCall) Header() http.Header {
1808 if c.header_ == nil {
1809 c.header_ = make(http.Header)
1810 }
1811 return c.header_
1812 }
1813
1814 func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
1815 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1816 if c.ifNoneMatch_ != "" {
1817 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1818 }
1819 var body io.Reader = nil
1820 c.urlParams_.Set("alt", alt)
1821 c.urlParams_.Set("prettyPrint", "false")
1822 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/accounts")
1823 urls += "?" + c.urlParams_.Encode()
1824 req, err := http.NewRequest("GET", urls, body)
1825 if err != nil {
1826 return nil, err
1827 }
1828 req.Header = reqHeaders
1829 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1830 }
1831
1832
1833
1834
1835
1836
1837
1838 func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListAccountsResponse, error) {
1839 gensupport.SetOptions(c.urlParams_, opts...)
1840 res, err := c.doRequest("json")
1841 if res != nil && res.StatusCode == http.StatusNotModified {
1842 if res.Body != nil {
1843 res.Body.Close()
1844 }
1845 return nil, gensupport.WrapError(&googleapi.Error{
1846 Code: res.StatusCode,
1847 Header: res.Header,
1848 })
1849 }
1850 if err != nil {
1851 return nil, err
1852 }
1853 defer googleapi.CloseBody(res)
1854 if err := googleapi.CheckResponse(res); err != nil {
1855 return nil, gensupport.WrapError(err)
1856 }
1857 ret := &ListAccountsResponse{
1858 ServerResponse: googleapi.ServerResponse{
1859 Header: res.Header,
1860 HTTPStatusCode: res.StatusCode,
1861 },
1862 }
1863 target := &ret
1864 if err := gensupport.DecodeResponse(target, res); err != nil {
1865 return nil, err
1866 }
1867 return ret, nil
1868 }
1869
1870
1871
1872
1873 func (c *AccountsListCall) Pages(ctx context.Context, f func(*ListAccountsResponse) error) error {
1874 c.ctx_ = ctx
1875 defer c.PageToken(c.urlParams_.Get("pageToken"))
1876 for {
1877 x, err := c.Do()
1878 if err != nil {
1879 return err
1880 }
1881 if err := f(x); err != nil {
1882 return err
1883 }
1884 if x.NextPageToken == "" {
1885 return nil
1886 }
1887 c.PageToken(x.NextPageToken)
1888 }
1889 }
1890
1891 type AccountsListChildAccountsCall struct {
1892 s *Service
1893 parent string
1894 urlParams_ gensupport.URLParams
1895 ifNoneMatch_ string
1896 ctx_ context.Context
1897 header_ http.Header
1898 }
1899
1900
1901
1902
1903
1904
1905 func (r *AccountsService) ListChildAccounts(parent string) *AccountsListChildAccountsCall {
1906 c := &AccountsListChildAccountsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1907 c.parent = parent
1908 return c
1909 }
1910
1911
1912
1913
1914
1915 func (c *AccountsListChildAccountsCall) PageSize(pageSize int64) *AccountsListChildAccountsCall {
1916 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1917 return c
1918 }
1919
1920
1921
1922
1923
1924 func (c *AccountsListChildAccountsCall) PageToken(pageToken string) *AccountsListChildAccountsCall {
1925 c.urlParams_.Set("pageToken", pageToken)
1926 return c
1927 }
1928
1929
1930
1931
1932 func (c *AccountsListChildAccountsCall) Fields(s ...googleapi.Field) *AccountsListChildAccountsCall {
1933 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1934 return c
1935 }
1936
1937
1938
1939
1940 func (c *AccountsListChildAccountsCall) IfNoneMatch(entityTag string) *AccountsListChildAccountsCall {
1941 c.ifNoneMatch_ = entityTag
1942 return c
1943 }
1944
1945
1946 func (c *AccountsListChildAccountsCall) Context(ctx context.Context) *AccountsListChildAccountsCall {
1947 c.ctx_ = ctx
1948 return c
1949 }
1950
1951
1952
1953 func (c *AccountsListChildAccountsCall) Header() http.Header {
1954 if c.header_ == nil {
1955 c.header_ = make(http.Header)
1956 }
1957 return c.header_
1958 }
1959
1960 func (c *AccountsListChildAccountsCall) doRequest(alt string) (*http.Response, error) {
1961 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1962 if c.ifNoneMatch_ != "" {
1963 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1964 }
1965 var body io.Reader = nil
1966 c.urlParams_.Set("alt", alt)
1967 c.urlParams_.Set("prettyPrint", "false")
1968 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}:listChildAccounts")
1969 urls += "?" + c.urlParams_.Encode()
1970 req, err := http.NewRequest("GET", urls, body)
1971 if err != nil {
1972 return nil, err
1973 }
1974 req.Header = reqHeaders
1975 googleapi.Expand(req.URL, map[string]string{
1976 "parent": c.parent,
1977 })
1978 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1979 }
1980
1981
1982
1983
1984
1985
1986
1987 func (c *AccountsListChildAccountsCall) Do(opts ...googleapi.CallOption) (*ListChildAccountsResponse, error) {
1988 gensupport.SetOptions(c.urlParams_, opts...)
1989 res, err := c.doRequest("json")
1990 if res != nil && res.StatusCode == http.StatusNotModified {
1991 if res.Body != nil {
1992 res.Body.Close()
1993 }
1994 return nil, gensupport.WrapError(&googleapi.Error{
1995 Code: res.StatusCode,
1996 Header: res.Header,
1997 })
1998 }
1999 if err != nil {
2000 return nil, err
2001 }
2002 defer googleapi.CloseBody(res)
2003 if err := googleapi.CheckResponse(res); err != nil {
2004 return nil, gensupport.WrapError(err)
2005 }
2006 ret := &ListChildAccountsResponse{
2007 ServerResponse: googleapi.ServerResponse{
2008 Header: res.Header,
2009 HTTPStatusCode: res.StatusCode,
2010 },
2011 }
2012 target := &ret
2013 if err := gensupport.DecodeResponse(target, res); err != nil {
2014 return nil, err
2015 }
2016 return ret, nil
2017 }
2018
2019
2020
2021
2022 func (c *AccountsListChildAccountsCall) Pages(ctx context.Context, f func(*ListChildAccountsResponse) error) error {
2023 c.ctx_ = ctx
2024 defer c.PageToken(c.urlParams_.Get("pageToken"))
2025 for {
2026 x, err := c.Do()
2027 if err != nil {
2028 return err
2029 }
2030 if err := f(x); err != nil {
2031 return err
2032 }
2033 if x.NextPageToken == "" {
2034 return nil
2035 }
2036 c.PageToken(x.NextPageToken)
2037 }
2038 }
2039
2040 type AccountsAdclientsGetCall struct {
2041 s *Service
2042 name string
2043 urlParams_ gensupport.URLParams
2044 ifNoneMatch_ string
2045 ctx_ context.Context
2046 header_ http.Header
2047 }
2048
2049
2050
2051
2052
2053 func (r *AccountsAdclientsService) Get(name string) *AccountsAdclientsGetCall {
2054 c := &AccountsAdclientsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2055 c.name = name
2056 return c
2057 }
2058
2059
2060
2061
2062 func (c *AccountsAdclientsGetCall) Fields(s ...googleapi.Field) *AccountsAdclientsGetCall {
2063 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2064 return c
2065 }
2066
2067
2068
2069
2070 func (c *AccountsAdclientsGetCall) IfNoneMatch(entityTag string) *AccountsAdclientsGetCall {
2071 c.ifNoneMatch_ = entityTag
2072 return c
2073 }
2074
2075
2076 func (c *AccountsAdclientsGetCall) Context(ctx context.Context) *AccountsAdclientsGetCall {
2077 c.ctx_ = ctx
2078 return c
2079 }
2080
2081
2082
2083 func (c *AccountsAdclientsGetCall) Header() http.Header {
2084 if c.header_ == nil {
2085 c.header_ = make(http.Header)
2086 }
2087 return c.header_
2088 }
2089
2090 func (c *AccountsAdclientsGetCall) doRequest(alt string) (*http.Response, error) {
2091 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2092 if c.ifNoneMatch_ != "" {
2093 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2094 }
2095 var body io.Reader = nil
2096 c.urlParams_.Set("alt", alt)
2097 c.urlParams_.Set("prettyPrint", "false")
2098 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
2099 urls += "?" + c.urlParams_.Encode()
2100 req, err := http.NewRequest("GET", urls, body)
2101 if err != nil {
2102 return nil, err
2103 }
2104 req.Header = reqHeaders
2105 googleapi.Expand(req.URL, map[string]string{
2106 "name": c.name,
2107 })
2108 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2109 }
2110
2111
2112
2113
2114
2115
2116 func (c *AccountsAdclientsGetCall) Do(opts ...googleapi.CallOption) (*AdClient, error) {
2117 gensupport.SetOptions(c.urlParams_, opts...)
2118 res, err := c.doRequest("json")
2119 if res != nil && res.StatusCode == http.StatusNotModified {
2120 if res.Body != nil {
2121 res.Body.Close()
2122 }
2123 return nil, gensupport.WrapError(&googleapi.Error{
2124 Code: res.StatusCode,
2125 Header: res.Header,
2126 })
2127 }
2128 if err != nil {
2129 return nil, err
2130 }
2131 defer googleapi.CloseBody(res)
2132 if err := googleapi.CheckResponse(res); err != nil {
2133 return nil, gensupport.WrapError(err)
2134 }
2135 ret := &AdClient{
2136 ServerResponse: googleapi.ServerResponse{
2137 Header: res.Header,
2138 HTTPStatusCode: res.StatusCode,
2139 },
2140 }
2141 target := &ret
2142 if err := gensupport.DecodeResponse(target, res); err != nil {
2143 return nil, err
2144 }
2145 return ret, nil
2146 }
2147
2148 type AccountsAdclientsGetAdcodeCall struct {
2149 s *Service
2150 name string
2151 urlParams_ gensupport.URLParams
2152 ifNoneMatch_ string
2153 ctx_ context.Context
2154 header_ http.Header
2155 }
2156
2157
2158
2159
2160
2161
2162
2163
2164 func (r *AccountsAdclientsService) GetAdcode(name string) *AccountsAdclientsGetAdcodeCall {
2165 c := &AccountsAdclientsGetAdcodeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2166 c.name = name
2167 return c
2168 }
2169
2170
2171
2172
2173 func (c *AccountsAdclientsGetAdcodeCall) Fields(s ...googleapi.Field) *AccountsAdclientsGetAdcodeCall {
2174 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2175 return c
2176 }
2177
2178
2179
2180
2181 func (c *AccountsAdclientsGetAdcodeCall) IfNoneMatch(entityTag string) *AccountsAdclientsGetAdcodeCall {
2182 c.ifNoneMatch_ = entityTag
2183 return c
2184 }
2185
2186
2187 func (c *AccountsAdclientsGetAdcodeCall) Context(ctx context.Context) *AccountsAdclientsGetAdcodeCall {
2188 c.ctx_ = ctx
2189 return c
2190 }
2191
2192
2193
2194 func (c *AccountsAdclientsGetAdcodeCall) Header() http.Header {
2195 if c.header_ == nil {
2196 c.header_ = make(http.Header)
2197 }
2198 return c.header_
2199 }
2200
2201 func (c *AccountsAdclientsGetAdcodeCall) doRequest(alt string) (*http.Response, error) {
2202 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2203 if c.ifNoneMatch_ != "" {
2204 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2205 }
2206 var body io.Reader = nil
2207 c.urlParams_.Set("alt", alt)
2208 c.urlParams_.Set("prettyPrint", "false")
2209 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/adcode")
2210 urls += "?" + c.urlParams_.Encode()
2211 req, err := http.NewRequest("GET", urls, body)
2212 if err != nil {
2213 return nil, err
2214 }
2215 req.Header = reqHeaders
2216 googleapi.Expand(req.URL, map[string]string{
2217 "name": c.name,
2218 })
2219 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2220 }
2221
2222
2223
2224
2225
2226
2227 func (c *AccountsAdclientsGetAdcodeCall) Do(opts ...googleapi.CallOption) (*AdClientAdCode, error) {
2228 gensupport.SetOptions(c.urlParams_, opts...)
2229 res, err := c.doRequest("json")
2230 if res != nil && res.StatusCode == http.StatusNotModified {
2231 if res.Body != nil {
2232 res.Body.Close()
2233 }
2234 return nil, gensupport.WrapError(&googleapi.Error{
2235 Code: res.StatusCode,
2236 Header: res.Header,
2237 })
2238 }
2239 if err != nil {
2240 return nil, err
2241 }
2242 defer googleapi.CloseBody(res)
2243 if err := googleapi.CheckResponse(res); err != nil {
2244 return nil, gensupport.WrapError(err)
2245 }
2246 ret := &AdClientAdCode{
2247 ServerResponse: googleapi.ServerResponse{
2248 Header: res.Header,
2249 HTTPStatusCode: res.StatusCode,
2250 },
2251 }
2252 target := &ret
2253 if err := gensupport.DecodeResponse(target, res); err != nil {
2254 return nil, err
2255 }
2256 return ret, nil
2257 }
2258
2259 type AccountsAdclientsListCall struct {
2260 s *Service
2261 parent string
2262 urlParams_ gensupport.URLParams
2263 ifNoneMatch_ string
2264 ctx_ context.Context
2265 header_ http.Header
2266 }
2267
2268
2269
2270
2271
2272 func (r *AccountsAdclientsService) List(parent string) *AccountsAdclientsListCall {
2273 c := &AccountsAdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2274 c.parent = parent
2275 return c
2276 }
2277
2278
2279
2280
2281
2282 func (c *AccountsAdclientsListCall) PageSize(pageSize int64) *AccountsAdclientsListCall {
2283 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2284 return c
2285 }
2286
2287
2288
2289
2290
2291 func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall {
2292 c.urlParams_.Set("pageToken", pageToken)
2293 return c
2294 }
2295
2296
2297
2298
2299 func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall {
2300 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2301 return c
2302 }
2303
2304
2305
2306
2307 func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall {
2308 c.ifNoneMatch_ = entityTag
2309 return c
2310 }
2311
2312
2313 func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall {
2314 c.ctx_ = ctx
2315 return c
2316 }
2317
2318
2319
2320 func (c *AccountsAdclientsListCall) Header() http.Header {
2321 if c.header_ == nil {
2322 c.header_ = make(http.Header)
2323 }
2324 return c.header_
2325 }
2326
2327 func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) {
2328 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2329 if c.ifNoneMatch_ != "" {
2330 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2331 }
2332 var body io.Reader = nil
2333 c.urlParams_.Set("alt", alt)
2334 c.urlParams_.Set("prettyPrint", "false")
2335 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/adclients")
2336 urls += "?" + c.urlParams_.Encode()
2337 req, err := http.NewRequest("GET", urls, body)
2338 if err != nil {
2339 return nil, err
2340 }
2341 req.Header = reqHeaders
2342 googleapi.Expand(req.URL, map[string]string{
2343 "parent": c.parent,
2344 })
2345 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2346 }
2347
2348
2349
2350
2351
2352
2353
2354 func (c *AccountsAdclientsListCall) Do(opts ...googleapi.CallOption) (*ListAdClientsResponse, error) {
2355 gensupport.SetOptions(c.urlParams_, opts...)
2356 res, err := c.doRequest("json")
2357 if res != nil && res.StatusCode == http.StatusNotModified {
2358 if res.Body != nil {
2359 res.Body.Close()
2360 }
2361 return nil, gensupport.WrapError(&googleapi.Error{
2362 Code: res.StatusCode,
2363 Header: res.Header,
2364 })
2365 }
2366 if err != nil {
2367 return nil, err
2368 }
2369 defer googleapi.CloseBody(res)
2370 if err := googleapi.CheckResponse(res); err != nil {
2371 return nil, gensupport.WrapError(err)
2372 }
2373 ret := &ListAdClientsResponse{
2374 ServerResponse: googleapi.ServerResponse{
2375 Header: res.Header,
2376 HTTPStatusCode: res.StatusCode,
2377 },
2378 }
2379 target := &ret
2380 if err := gensupport.DecodeResponse(target, res); err != nil {
2381 return nil, err
2382 }
2383 return ret, nil
2384 }
2385
2386
2387
2388
2389 func (c *AccountsAdclientsListCall) Pages(ctx context.Context, f func(*ListAdClientsResponse) error) error {
2390 c.ctx_ = ctx
2391 defer c.PageToken(c.urlParams_.Get("pageToken"))
2392 for {
2393 x, err := c.Do()
2394 if err != nil {
2395 return err
2396 }
2397 if err := f(x); err != nil {
2398 return err
2399 }
2400 if x.NextPageToken == "" {
2401 return nil
2402 }
2403 c.PageToken(x.NextPageToken)
2404 }
2405 }
2406
2407 type AccountsAdclientsAdunitsCreateCall struct {
2408 s *Service
2409 parent string
2410 adunit *AdUnit
2411 urlParams_ gensupport.URLParams
2412 ctx_ context.Context
2413 header_ http.Header
2414 }
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428 func (r *AccountsAdclientsAdunitsService) Create(parent string, adunit *AdUnit) *AccountsAdclientsAdunitsCreateCall {
2429 c := &AccountsAdclientsAdunitsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2430 c.parent = parent
2431 c.adunit = adunit
2432 return c
2433 }
2434
2435
2436
2437
2438 func (c *AccountsAdclientsAdunitsCreateCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsCreateCall {
2439 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2440 return c
2441 }
2442
2443
2444 func (c *AccountsAdclientsAdunitsCreateCall) Context(ctx context.Context) *AccountsAdclientsAdunitsCreateCall {
2445 c.ctx_ = ctx
2446 return c
2447 }
2448
2449
2450
2451 func (c *AccountsAdclientsAdunitsCreateCall) Header() http.Header {
2452 if c.header_ == nil {
2453 c.header_ = make(http.Header)
2454 }
2455 return c.header_
2456 }
2457
2458 func (c *AccountsAdclientsAdunitsCreateCall) doRequest(alt string) (*http.Response, error) {
2459 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2460 var body io.Reader = nil
2461 body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit)
2462 if err != nil {
2463 return nil, err
2464 }
2465 c.urlParams_.Set("alt", alt)
2466 c.urlParams_.Set("prettyPrint", "false")
2467 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/adunits")
2468 urls += "?" + c.urlParams_.Encode()
2469 req, err := http.NewRequest("POST", urls, body)
2470 if err != nil {
2471 return nil, err
2472 }
2473 req.Header = reqHeaders
2474 googleapi.Expand(req.URL, map[string]string{
2475 "parent": c.parent,
2476 })
2477 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2478 }
2479
2480
2481
2482
2483
2484
2485 func (c *AccountsAdclientsAdunitsCreateCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
2486 gensupport.SetOptions(c.urlParams_, opts...)
2487 res, err := c.doRequest("json")
2488 if res != nil && res.StatusCode == http.StatusNotModified {
2489 if res.Body != nil {
2490 res.Body.Close()
2491 }
2492 return nil, gensupport.WrapError(&googleapi.Error{
2493 Code: res.StatusCode,
2494 Header: res.Header,
2495 })
2496 }
2497 if err != nil {
2498 return nil, err
2499 }
2500 defer googleapi.CloseBody(res)
2501 if err := googleapi.CheckResponse(res); err != nil {
2502 return nil, gensupport.WrapError(err)
2503 }
2504 ret := &AdUnit{
2505 ServerResponse: googleapi.ServerResponse{
2506 Header: res.Header,
2507 HTTPStatusCode: res.StatusCode,
2508 },
2509 }
2510 target := &ret
2511 if err := gensupport.DecodeResponse(target, res); err != nil {
2512 return nil, err
2513 }
2514 return ret, nil
2515 }
2516
2517 type AccountsAdclientsAdunitsGetCall struct {
2518 s *Service
2519 name string
2520 urlParams_ gensupport.URLParams
2521 ifNoneMatch_ string
2522 ctx_ context.Context
2523 header_ http.Header
2524 }
2525
2526
2527
2528
2529
2530 func (r *AccountsAdclientsAdunitsService) Get(name string) *AccountsAdclientsAdunitsGetCall {
2531 c := &AccountsAdclientsAdunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2532 c.name = name
2533 return c
2534 }
2535
2536
2537
2538
2539 func (c *AccountsAdclientsAdunitsGetCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsGetCall {
2540 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2541 return c
2542 }
2543
2544
2545
2546
2547 func (c *AccountsAdclientsAdunitsGetCall) IfNoneMatch(entityTag string) *AccountsAdclientsAdunitsGetCall {
2548 c.ifNoneMatch_ = entityTag
2549 return c
2550 }
2551
2552
2553 func (c *AccountsAdclientsAdunitsGetCall) Context(ctx context.Context) *AccountsAdclientsAdunitsGetCall {
2554 c.ctx_ = ctx
2555 return c
2556 }
2557
2558
2559
2560 func (c *AccountsAdclientsAdunitsGetCall) Header() http.Header {
2561 if c.header_ == nil {
2562 c.header_ = make(http.Header)
2563 }
2564 return c.header_
2565 }
2566
2567 func (c *AccountsAdclientsAdunitsGetCall) doRequest(alt string) (*http.Response, error) {
2568 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2569 if c.ifNoneMatch_ != "" {
2570 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2571 }
2572 var body io.Reader = nil
2573 c.urlParams_.Set("alt", alt)
2574 c.urlParams_.Set("prettyPrint", "false")
2575 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
2576 urls += "?" + c.urlParams_.Encode()
2577 req, err := http.NewRequest("GET", urls, body)
2578 if err != nil {
2579 return nil, err
2580 }
2581 req.Header = reqHeaders
2582 googleapi.Expand(req.URL, map[string]string{
2583 "name": c.name,
2584 })
2585 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2586 }
2587
2588
2589
2590
2591
2592
2593 func (c *AccountsAdclientsAdunitsGetCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
2594 gensupport.SetOptions(c.urlParams_, opts...)
2595 res, err := c.doRequest("json")
2596 if res != nil && res.StatusCode == http.StatusNotModified {
2597 if res.Body != nil {
2598 res.Body.Close()
2599 }
2600 return nil, gensupport.WrapError(&googleapi.Error{
2601 Code: res.StatusCode,
2602 Header: res.Header,
2603 })
2604 }
2605 if err != nil {
2606 return nil, err
2607 }
2608 defer googleapi.CloseBody(res)
2609 if err := googleapi.CheckResponse(res); err != nil {
2610 return nil, gensupport.WrapError(err)
2611 }
2612 ret := &AdUnit{
2613 ServerResponse: googleapi.ServerResponse{
2614 Header: res.Header,
2615 HTTPStatusCode: res.StatusCode,
2616 },
2617 }
2618 target := &ret
2619 if err := gensupport.DecodeResponse(target, res); err != nil {
2620 return nil, err
2621 }
2622 return ret, nil
2623 }
2624
2625 type AccountsAdclientsAdunitsGetAdcodeCall struct {
2626 s *Service
2627 name string
2628 urlParams_ gensupport.URLParams
2629 ifNoneMatch_ string
2630 ctx_ context.Context
2631 header_ http.Header
2632 }
2633
2634
2635
2636
2637
2638
2639
2640
2641 func (r *AccountsAdclientsAdunitsService) GetAdcode(name string) *AccountsAdclientsAdunitsGetAdcodeCall {
2642 c := &AccountsAdclientsAdunitsGetAdcodeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2643 c.name = name
2644 return c
2645 }
2646
2647
2648
2649
2650 func (c *AccountsAdclientsAdunitsGetAdcodeCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsGetAdcodeCall {
2651 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2652 return c
2653 }
2654
2655
2656
2657
2658 func (c *AccountsAdclientsAdunitsGetAdcodeCall) IfNoneMatch(entityTag string) *AccountsAdclientsAdunitsGetAdcodeCall {
2659 c.ifNoneMatch_ = entityTag
2660 return c
2661 }
2662
2663
2664 func (c *AccountsAdclientsAdunitsGetAdcodeCall) Context(ctx context.Context) *AccountsAdclientsAdunitsGetAdcodeCall {
2665 c.ctx_ = ctx
2666 return c
2667 }
2668
2669
2670
2671 func (c *AccountsAdclientsAdunitsGetAdcodeCall) Header() http.Header {
2672 if c.header_ == nil {
2673 c.header_ = make(http.Header)
2674 }
2675 return c.header_
2676 }
2677
2678 func (c *AccountsAdclientsAdunitsGetAdcodeCall) doRequest(alt string) (*http.Response, error) {
2679 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2680 if c.ifNoneMatch_ != "" {
2681 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2682 }
2683 var body io.Reader = nil
2684 c.urlParams_.Set("alt", alt)
2685 c.urlParams_.Set("prettyPrint", "false")
2686 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/adcode")
2687 urls += "?" + c.urlParams_.Encode()
2688 req, err := http.NewRequest("GET", urls, body)
2689 if err != nil {
2690 return nil, err
2691 }
2692 req.Header = reqHeaders
2693 googleapi.Expand(req.URL, map[string]string{
2694 "name": c.name,
2695 })
2696 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2697 }
2698
2699
2700
2701
2702
2703
2704 func (c *AccountsAdclientsAdunitsGetAdcodeCall) Do(opts ...googleapi.CallOption) (*AdUnitAdCode, error) {
2705 gensupport.SetOptions(c.urlParams_, opts...)
2706 res, err := c.doRequest("json")
2707 if res != nil && res.StatusCode == http.StatusNotModified {
2708 if res.Body != nil {
2709 res.Body.Close()
2710 }
2711 return nil, gensupport.WrapError(&googleapi.Error{
2712 Code: res.StatusCode,
2713 Header: res.Header,
2714 })
2715 }
2716 if err != nil {
2717 return nil, err
2718 }
2719 defer googleapi.CloseBody(res)
2720 if err := googleapi.CheckResponse(res); err != nil {
2721 return nil, gensupport.WrapError(err)
2722 }
2723 ret := &AdUnitAdCode{
2724 ServerResponse: googleapi.ServerResponse{
2725 Header: res.Header,
2726 HTTPStatusCode: res.StatusCode,
2727 },
2728 }
2729 target := &ret
2730 if err := gensupport.DecodeResponse(target, res); err != nil {
2731 return nil, err
2732 }
2733 return ret, nil
2734 }
2735
2736 type AccountsAdclientsAdunitsListCall struct {
2737 s *Service
2738 parent string
2739 urlParams_ gensupport.URLParams
2740 ifNoneMatch_ string
2741 ctx_ context.Context
2742 header_ http.Header
2743 }
2744
2745
2746
2747
2748
2749 func (r *AccountsAdclientsAdunitsService) List(parent string) *AccountsAdclientsAdunitsListCall {
2750 c := &AccountsAdclientsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2751 c.parent = parent
2752 return c
2753 }
2754
2755
2756
2757
2758
2759 func (c *AccountsAdclientsAdunitsListCall) PageSize(pageSize int64) *AccountsAdclientsAdunitsListCall {
2760 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2761 return c
2762 }
2763
2764
2765
2766
2767
2768 func (c *AccountsAdclientsAdunitsListCall) PageToken(pageToken string) *AccountsAdclientsAdunitsListCall {
2769 c.urlParams_.Set("pageToken", pageToken)
2770 return c
2771 }
2772
2773
2774
2775
2776 func (c *AccountsAdclientsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsListCall {
2777 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2778 return c
2779 }
2780
2781
2782
2783
2784 func (c *AccountsAdclientsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsAdunitsListCall {
2785 c.ifNoneMatch_ = entityTag
2786 return c
2787 }
2788
2789
2790 func (c *AccountsAdclientsAdunitsListCall) Context(ctx context.Context) *AccountsAdclientsAdunitsListCall {
2791 c.ctx_ = ctx
2792 return c
2793 }
2794
2795
2796
2797 func (c *AccountsAdclientsAdunitsListCall) Header() http.Header {
2798 if c.header_ == nil {
2799 c.header_ = make(http.Header)
2800 }
2801 return c.header_
2802 }
2803
2804 func (c *AccountsAdclientsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
2805 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2806 if c.ifNoneMatch_ != "" {
2807 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2808 }
2809 var body io.Reader = nil
2810 c.urlParams_.Set("alt", alt)
2811 c.urlParams_.Set("prettyPrint", "false")
2812 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/adunits")
2813 urls += "?" + c.urlParams_.Encode()
2814 req, err := http.NewRequest("GET", urls, body)
2815 if err != nil {
2816 return nil, err
2817 }
2818 req.Header = reqHeaders
2819 googleapi.Expand(req.URL, map[string]string{
2820 "parent": c.parent,
2821 })
2822 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2823 }
2824
2825
2826
2827
2828
2829
2830
2831 func (c *AccountsAdclientsAdunitsListCall) Do(opts ...googleapi.CallOption) (*ListAdUnitsResponse, error) {
2832 gensupport.SetOptions(c.urlParams_, opts...)
2833 res, err := c.doRequest("json")
2834 if res != nil && res.StatusCode == http.StatusNotModified {
2835 if res.Body != nil {
2836 res.Body.Close()
2837 }
2838 return nil, gensupport.WrapError(&googleapi.Error{
2839 Code: res.StatusCode,
2840 Header: res.Header,
2841 })
2842 }
2843 if err != nil {
2844 return nil, err
2845 }
2846 defer googleapi.CloseBody(res)
2847 if err := googleapi.CheckResponse(res); err != nil {
2848 return nil, gensupport.WrapError(err)
2849 }
2850 ret := &ListAdUnitsResponse{
2851 ServerResponse: googleapi.ServerResponse{
2852 Header: res.Header,
2853 HTTPStatusCode: res.StatusCode,
2854 },
2855 }
2856 target := &ret
2857 if err := gensupport.DecodeResponse(target, res); err != nil {
2858 return nil, err
2859 }
2860 return ret, nil
2861 }
2862
2863
2864
2865
2866 func (c *AccountsAdclientsAdunitsListCall) Pages(ctx context.Context, f func(*ListAdUnitsResponse) error) error {
2867 c.ctx_ = ctx
2868 defer c.PageToken(c.urlParams_.Get("pageToken"))
2869 for {
2870 x, err := c.Do()
2871 if err != nil {
2872 return err
2873 }
2874 if err := f(x); err != nil {
2875 return err
2876 }
2877 if x.NextPageToken == "" {
2878 return nil
2879 }
2880 c.PageToken(x.NextPageToken)
2881 }
2882 }
2883
2884 type AccountsAdclientsAdunitsListLinkedCustomChannelsCall struct {
2885 s *Service
2886 parent string
2887 urlParams_ gensupport.URLParams
2888 ifNoneMatch_ string
2889 ctx_ context.Context
2890 header_ http.Header
2891 }
2892
2893
2894
2895
2896
2897
2898 func (r *AccountsAdclientsAdunitsService) ListLinkedCustomChannels(parent string) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
2899 c := &AccountsAdclientsAdunitsListLinkedCustomChannelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2900 c.parent = parent
2901 return c
2902 }
2903
2904
2905
2906
2907
2908 func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) PageSize(pageSize int64) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
2909 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2910 return c
2911 }
2912
2913
2914
2915
2916
2917 func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) PageToken(pageToken string) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
2918 c.urlParams_.Set("pageToken", pageToken)
2919 return c
2920 }
2921
2922
2923
2924
2925 func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
2926 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2927 return c
2928 }
2929
2930
2931
2932
2933 func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) IfNoneMatch(entityTag string) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
2934 c.ifNoneMatch_ = entityTag
2935 return c
2936 }
2937
2938
2939 func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Context(ctx context.Context) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
2940 c.ctx_ = ctx
2941 return c
2942 }
2943
2944
2945
2946 func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Header() http.Header {
2947 if c.header_ == nil {
2948 c.header_ = make(http.Header)
2949 }
2950 return c.header_
2951 }
2952
2953 func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) doRequest(alt string) (*http.Response, error) {
2954 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2955 if c.ifNoneMatch_ != "" {
2956 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2957 }
2958 var body io.Reader = nil
2959 c.urlParams_.Set("alt", alt)
2960 c.urlParams_.Set("prettyPrint", "false")
2961 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}:listLinkedCustomChannels")
2962 urls += "?" + c.urlParams_.Encode()
2963 req, err := http.NewRequest("GET", urls, body)
2964 if err != nil {
2965 return nil, err
2966 }
2967 req.Header = reqHeaders
2968 googleapi.Expand(req.URL, map[string]string{
2969 "parent": c.parent,
2970 })
2971 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2972 }
2973
2974
2975
2976
2977
2978
2979
2980 func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Do(opts ...googleapi.CallOption) (*ListLinkedCustomChannelsResponse, error) {
2981 gensupport.SetOptions(c.urlParams_, opts...)
2982 res, err := c.doRequest("json")
2983 if res != nil && res.StatusCode == http.StatusNotModified {
2984 if res.Body != nil {
2985 res.Body.Close()
2986 }
2987 return nil, gensupport.WrapError(&googleapi.Error{
2988 Code: res.StatusCode,
2989 Header: res.Header,
2990 })
2991 }
2992 if err != nil {
2993 return nil, err
2994 }
2995 defer googleapi.CloseBody(res)
2996 if err := googleapi.CheckResponse(res); err != nil {
2997 return nil, gensupport.WrapError(err)
2998 }
2999 ret := &ListLinkedCustomChannelsResponse{
3000 ServerResponse: googleapi.ServerResponse{
3001 Header: res.Header,
3002 HTTPStatusCode: res.StatusCode,
3003 },
3004 }
3005 target := &ret
3006 if err := gensupport.DecodeResponse(target, res); err != nil {
3007 return nil, err
3008 }
3009 return ret, nil
3010 }
3011
3012
3013
3014
3015 func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Pages(ctx context.Context, f func(*ListLinkedCustomChannelsResponse) error) error {
3016 c.ctx_ = ctx
3017 defer c.PageToken(c.urlParams_.Get("pageToken"))
3018 for {
3019 x, err := c.Do()
3020 if err != nil {
3021 return err
3022 }
3023 if err := f(x); err != nil {
3024 return err
3025 }
3026 if x.NextPageToken == "" {
3027 return nil
3028 }
3029 c.PageToken(x.NextPageToken)
3030 }
3031 }
3032
3033 type AccountsAdclientsAdunitsPatchCall struct {
3034 s *Service
3035 name string
3036 adunit *AdUnit
3037 urlParams_ gensupport.URLParams
3038 ctx_ context.Context
3039 header_ http.Header
3040 }
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051 func (r *AccountsAdclientsAdunitsService) Patch(name string, adunit *AdUnit) *AccountsAdclientsAdunitsPatchCall {
3052 c := &AccountsAdclientsAdunitsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3053 c.name = name
3054 c.adunit = adunit
3055 return c
3056 }
3057
3058
3059
3060 func (c *AccountsAdclientsAdunitsPatchCall) UpdateMask(updateMask string) *AccountsAdclientsAdunitsPatchCall {
3061 c.urlParams_.Set("updateMask", updateMask)
3062 return c
3063 }
3064
3065
3066
3067
3068 func (c *AccountsAdclientsAdunitsPatchCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsPatchCall {
3069 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3070 return c
3071 }
3072
3073
3074 func (c *AccountsAdclientsAdunitsPatchCall) Context(ctx context.Context) *AccountsAdclientsAdunitsPatchCall {
3075 c.ctx_ = ctx
3076 return c
3077 }
3078
3079
3080
3081 func (c *AccountsAdclientsAdunitsPatchCall) Header() http.Header {
3082 if c.header_ == nil {
3083 c.header_ = make(http.Header)
3084 }
3085 return c.header_
3086 }
3087
3088 func (c *AccountsAdclientsAdunitsPatchCall) doRequest(alt string) (*http.Response, error) {
3089 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3090 var body io.Reader = nil
3091 body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit)
3092 if err != nil {
3093 return nil, err
3094 }
3095 c.urlParams_.Set("alt", alt)
3096 c.urlParams_.Set("prettyPrint", "false")
3097 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3098 urls += "?" + c.urlParams_.Encode()
3099 req, err := http.NewRequest("PATCH", urls, body)
3100 if err != nil {
3101 return nil, err
3102 }
3103 req.Header = reqHeaders
3104 googleapi.Expand(req.URL, map[string]string{
3105 "name": c.name,
3106 })
3107 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3108 }
3109
3110
3111
3112
3113
3114
3115 func (c *AccountsAdclientsAdunitsPatchCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
3116 gensupport.SetOptions(c.urlParams_, opts...)
3117 res, err := c.doRequest("json")
3118 if res != nil && res.StatusCode == http.StatusNotModified {
3119 if res.Body != nil {
3120 res.Body.Close()
3121 }
3122 return nil, gensupport.WrapError(&googleapi.Error{
3123 Code: res.StatusCode,
3124 Header: res.Header,
3125 })
3126 }
3127 if err != nil {
3128 return nil, err
3129 }
3130 defer googleapi.CloseBody(res)
3131 if err := googleapi.CheckResponse(res); err != nil {
3132 return nil, gensupport.WrapError(err)
3133 }
3134 ret := &AdUnit{
3135 ServerResponse: googleapi.ServerResponse{
3136 Header: res.Header,
3137 HTTPStatusCode: res.StatusCode,
3138 },
3139 }
3140 target := &ret
3141 if err := gensupport.DecodeResponse(target, res); err != nil {
3142 return nil, err
3143 }
3144 return ret, nil
3145 }
3146
3147 type AccountsAdclientsCustomchannelsCreateCall struct {
3148 s *Service
3149 parent string
3150 customchannel *CustomChannel
3151 urlParams_ gensupport.URLParams
3152 ctx_ context.Context
3153 header_ http.Header
3154 }
3155
3156
3157
3158
3159
3160
3161
3162
3163 func (r *AccountsAdclientsCustomchannelsService) Create(parent string, customchannel *CustomChannel) *AccountsAdclientsCustomchannelsCreateCall {
3164 c := &AccountsAdclientsCustomchannelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3165 c.parent = parent
3166 c.customchannel = customchannel
3167 return c
3168 }
3169
3170
3171
3172
3173 func (c *AccountsAdclientsCustomchannelsCreateCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsCreateCall {
3174 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3175 return c
3176 }
3177
3178
3179 func (c *AccountsAdclientsCustomchannelsCreateCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsCreateCall {
3180 c.ctx_ = ctx
3181 return c
3182 }
3183
3184
3185
3186 func (c *AccountsAdclientsCustomchannelsCreateCall) Header() http.Header {
3187 if c.header_ == nil {
3188 c.header_ = make(http.Header)
3189 }
3190 return c.header_
3191 }
3192
3193 func (c *AccountsAdclientsCustomchannelsCreateCall) doRequest(alt string) (*http.Response, error) {
3194 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3195 var body io.Reader = nil
3196 body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel)
3197 if err != nil {
3198 return nil, err
3199 }
3200 c.urlParams_.Set("alt", alt)
3201 c.urlParams_.Set("prettyPrint", "false")
3202 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/customchannels")
3203 urls += "?" + c.urlParams_.Encode()
3204 req, err := http.NewRequest("POST", urls, body)
3205 if err != nil {
3206 return nil, err
3207 }
3208 req.Header = reqHeaders
3209 googleapi.Expand(req.URL, map[string]string{
3210 "parent": c.parent,
3211 })
3212 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3213 }
3214
3215
3216
3217
3218
3219
3220 func (c *AccountsAdclientsCustomchannelsCreateCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
3221 gensupport.SetOptions(c.urlParams_, opts...)
3222 res, err := c.doRequest("json")
3223 if res != nil && res.StatusCode == http.StatusNotModified {
3224 if res.Body != nil {
3225 res.Body.Close()
3226 }
3227 return nil, gensupport.WrapError(&googleapi.Error{
3228 Code: res.StatusCode,
3229 Header: res.Header,
3230 })
3231 }
3232 if err != nil {
3233 return nil, err
3234 }
3235 defer googleapi.CloseBody(res)
3236 if err := googleapi.CheckResponse(res); err != nil {
3237 return nil, gensupport.WrapError(err)
3238 }
3239 ret := &CustomChannel{
3240 ServerResponse: googleapi.ServerResponse{
3241 Header: res.Header,
3242 HTTPStatusCode: res.StatusCode,
3243 },
3244 }
3245 target := &ret
3246 if err := gensupport.DecodeResponse(target, res); err != nil {
3247 return nil, err
3248 }
3249 return ret, nil
3250 }
3251
3252 type AccountsAdclientsCustomchannelsDeleteCall struct {
3253 s *Service
3254 name string
3255 urlParams_ gensupport.URLParams
3256 ctx_ context.Context
3257 header_ http.Header
3258 }
3259
3260
3261
3262
3263
3264
3265
3266
3267 func (r *AccountsAdclientsCustomchannelsService) Delete(name string) *AccountsAdclientsCustomchannelsDeleteCall {
3268 c := &AccountsAdclientsCustomchannelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3269 c.name = name
3270 return c
3271 }
3272
3273
3274
3275
3276 func (c *AccountsAdclientsCustomchannelsDeleteCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsDeleteCall {
3277 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3278 return c
3279 }
3280
3281
3282 func (c *AccountsAdclientsCustomchannelsDeleteCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsDeleteCall {
3283 c.ctx_ = ctx
3284 return c
3285 }
3286
3287
3288
3289 func (c *AccountsAdclientsCustomchannelsDeleteCall) Header() http.Header {
3290 if c.header_ == nil {
3291 c.header_ = make(http.Header)
3292 }
3293 return c.header_
3294 }
3295
3296 func (c *AccountsAdclientsCustomchannelsDeleteCall) doRequest(alt string) (*http.Response, error) {
3297 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3298 var body io.Reader = nil
3299 c.urlParams_.Set("alt", alt)
3300 c.urlParams_.Set("prettyPrint", "false")
3301 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3302 urls += "?" + c.urlParams_.Encode()
3303 req, err := http.NewRequest("DELETE", urls, body)
3304 if err != nil {
3305 return nil, err
3306 }
3307 req.Header = reqHeaders
3308 googleapi.Expand(req.URL, map[string]string{
3309 "name": c.name,
3310 })
3311 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3312 }
3313
3314
3315
3316
3317
3318
3319 func (c *AccountsAdclientsCustomchannelsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3320 gensupport.SetOptions(c.urlParams_, opts...)
3321 res, err := c.doRequest("json")
3322 if res != nil && res.StatusCode == http.StatusNotModified {
3323 if res.Body != nil {
3324 res.Body.Close()
3325 }
3326 return nil, gensupport.WrapError(&googleapi.Error{
3327 Code: res.StatusCode,
3328 Header: res.Header,
3329 })
3330 }
3331 if err != nil {
3332 return nil, err
3333 }
3334 defer googleapi.CloseBody(res)
3335 if err := googleapi.CheckResponse(res); err != nil {
3336 return nil, gensupport.WrapError(err)
3337 }
3338 ret := &Empty{
3339 ServerResponse: googleapi.ServerResponse{
3340 Header: res.Header,
3341 HTTPStatusCode: res.StatusCode,
3342 },
3343 }
3344 target := &ret
3345 if err := gensupport.DecodeResponse(target, res); err != nil {
3346 return nil, err
3347 }
3348 return ret, nil
3349 }
3350
3351 type AccountsAdclientsCustomchannelsGetCall struct {
3352 s *Service
3353 name string
3354 urlParams_ gensupport.URLParams
3355 ifNoneMatch_ string
3356 ctx_ context.Context
3357 header_ http.Header
3358 }
3359
3360
3361
3362
3363
3364 func (r *AccountsAdclientsCustomchannelsService) Get(name string) *AccountsAdclientsCustomchannelsGetCall {
3365 c := &AccountsAdclientsCustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3366 c.name = name
3367 return c
3368 }
3369
3370
3371
3372
3373 func (c *AccountsAdclientsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsGetCall {
3374 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3375 return c
3376 }
3377
3378
3379
3380
3381 func (c *AccountsAdclientsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsAdclientsCustomchannelsGetCall {
3382 c.ifNoneMatch_ = entityTag
3383 return c
3384 }
3385
3386
3387 func (c *AccountsAdclientsCustomchannelsGetCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsGetCall {
3388 c.ctx_ = ctx
3389 return c
3390 }
3391
3392
3393
3394 func (c *AccountsAdclientsCustomchannelsGetCall) Header() http.Header {
3395 if c.header_ == nil {
3396 c.header_ = make(http.Header)
3397 }
3398 return c.header_
3399 }
3400
3401 func (c *AccountsAdclientsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
3402 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3403 if c.ifNoneMatch_ != "" {
3404 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3405 }
3406 var body io.Reader = nil
3407 c.urlParams_.Set("alt", alt)
3408 c.urlParams_.Set("prettyPrint", "false")
3409 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3410 urls += "?" + c.urlParams_.Encode()
3411 req, err := http.NewRequest("GET", urls, body)
3412 if err != nil {
3413 return nil, err
3414 }
3415 req.Header = reqHeaders
3416 googleapi.Expand(req.URL, map[string]string{
3417 "name": c.name,
3418 })
3419 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3420 }
3421
3422
3423
3424
3425
3426
3427 func (c *AccountsAdclientsCustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
3428 gensupport.SetOptions(c.urlParams_, opts...)
3429 res, err := c.doRequest("json")
3430 if res != nil && res.StatusCode == http.StatusNotModified {
3431 if res.Body != nil {
3432 res.Body.Close()
3433 }
3434 return nil, gensupport.WrapError(&googleapi.Error{
3435 Code: res.StatusCode,
3436 Header: res.Header,
3437 })
3438 }
3439 if err != nil {
3440 return nil, err
3441 }
3442 defer googleapi.CloseBody(res)
3443 if err := googleapi.CheckResponse(res); err != nil {
3444 return nil, gensupport.WrapError(err)
3445 }
3446 ret := &CustomChannel{
3447 ServerResponse: googleapi.ServerResponse{
3448 Header: res.Header,
3449 HTTPStatusCode: res.StatusCode,
3450 },
3451 }
3452 target := &ret
3453 if err := gensupport.DecodeResponse(target, res); err != nil {
3454 return nil, err
3455 }
3456 return ret, nil
3457 }
3458
3459 type AccountsAdclientsCustomchannelsListCall struct {
3460 s *Service
3461 parent string
3462 urlParams_ gensupport.URLParams
3463 ifNoneMatch_ string
3464 ctx_ context.Context
3465 header_ http.Header
3466 }
3467
3468
3469
3470
3471
3472 func (r *AccountsAdclientsCustomchannelsService) List(parent string) *AccountsAdclientsCustomchannelsListCall {
3473 c := &AccountsAdclientsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3474 c.parent = parent
3475 return c
3476 }
3477
3478
3479
3480
3481
3482 func (c *AccountsAdclientsCustomchannelsListCall) PageSize(pageSize int64) *AccountsAdclientsCustomchannelsListCall {
3483 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3484 return c
3485 }
3486
3487
3488
3489
3490
3491 func (c *AccountsAdclientsCustomchannelsListCall) PageToken(pageToken string) *AccountsAdclientsCustomchannelsListCall {
3492 c.urlParams_.Set("pageToken", pageToken)
3493 return c
3494 }
3495
3496
3497
3498
3499 func (c *AccountsAdclientsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsListCall {
3500 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3501 return c
3502 }
3503
3504
3505
3506
3507 func (c *AccountsAdclientsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsCustomchannelsListCall {
3508 c.ifNoneMatch_ = entityTag
3509 return c
3510 }
3511
3512
3513 func (c *AccountsAdclientsCustomchannelsListCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsListCall {
3514 c.ctx_ = ctx
3515 return c
3516 }
3517
3518
3519
3520 func (c *AccountsAdclientsCustomchannelsListCall) Header() http.Header {
3521 if c.header_ == nil {
3522 c.header_ = make(http.Header)
3523 }
3524 return c.header_
3525 }
3526
3527 func (c *AccountsAdclientsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
3528 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3529 if c.ifNoneMatch_ != "" {
3530 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3531 }
3532 var body io.Reader = nil
3533 c.urlParams_.Set("alt", alt)
3534 c.urlParams_.Set("prettyPrint", "false")
3535 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/customchannels")
3536 urls += "?" + c.urlParams_.Encode()
3537 req, err := http.NewRequest("GET", urls, body)
3538 if err != nil {
3539 return nil, err
3540 }
3541 req.Header = reqHeaders
3542 googleapi.Expand(req.URL, map[string]string{
3543 "parent": c.parent,
3544 })
3545 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3546 }
3547
3548
3549
3550
3551
3552
3553
3554 func (c *AccountsAdclientsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*ListCustomChannelsResponse, error) {
3555 gensupport.SetOptions(c.urlParams_, opts...)
3556 res, err := c.doRequest("json")
3557 if res != nil && res.StatusCode == http.StatusNotModified {
3558 if res.Body != nil {
3559 res.Body.Close()
3560 }
3561 return nil, gensupport.WrapError(&googleapi.Error{
3562 Code: res.StatusCode,
3563 Header: res.Header,
3564 })
3565 }
3566 if err != nil {
3567 return nil, err
3568 }
3569 defer googleapi.CloseBody(res)
3570 if err := googleapi.CheckResponse(res); err != nil {
3571 return nil, gensupport.WrapError(err)
3572 }
3573 ret := &ListCustomChannelsResponse{
3574 ServerResponse: googleapi.ServerResponse{
3575 Header: res.Header,
3576 HTTPStatusCode: res.StatusCode,
3577 },
3578 }
3579 target := &ret
3580 if err := gensupport.DecodeResponse(target, res); err != nil {
3581 return nil, err
3582 }
3583 return ret, nil
3584 }
3585
3586
3587
3588
3589 func (c *AccountsAdclientsCustomchannelsListCall) Pages(ctx context.Context, f func(*ListCustomChannelsResponse) error) error {
3590 c.ctx_ = ctx
3591 defer c.PageToken(c.urlParams_.Get("pageToken"))
3592 for {
3593 x, err := c.Do()
3594 if err != nil {
3595 return err
3596 }
3597 if err := f(x); err != nil {
3598 return err
3599 }
3600 if x.NextPageToken == "" {
3601 return nil
3602 }
3603 c.PageToken(x.NextPageToken)
3604 }
3605 }
3606
3607 type AccountsAdclientsCustomchannelsListLinkedAdUnitsCall struct {
3608 s *Service
3609 parent string
3610 urlParams_ gensupport.URLParams
3611 ifNoneMatch_ string
3612 ctx_ context.Context
3613 header_ http.Header
3614 }
3615
3616
3617
3618
3619
3620 func (r *AccountsAdclientsCustomchannelsService) ListLinkedAdUnits(parent string) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
3621 c := &AccountsAdclientsCustomchannelsListLinkedAdUnitsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3622 c.parent = parent
3623 return c
3624 }
3625
3626
3627
3628
3629
3630 func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) PageSize(pageSize int64) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
3631 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3632 return c
3633 }
3634
3635
3636
3637
3638
3639 func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) PageToken(pageToken string) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
3640 c.urlParams_.Set("pageToken", pageToken)
3641 return c
3642 }
3643
3644
3645
3646
3647 func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
3648 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3649 return c
3650 }
3651
3652
3653
3654
3655 func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) IfNoneMatch(entityTag string) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
3656 c.ifNoneMatch_ = entityTag
3657 return c
3658 }
3659
3660
3661 func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
3662 c.ctx_ = ctx
3663 return c
3664 }
3665
3666
3667
3668 func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Header() http.Header {
3669 if c.header_ == nil {
3670 c.header_ = make(http.Header)
3671 }
3672 return c.header_
3673 }
3674
3675 func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) doRequest(alt string) (*http.Response, error) {
3676 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3677 if c.ifNoneMatch_ != "" {
3678 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3679 }
3680 var body io.Reader = nil
3681 c.urlParams_.Set("alt", alt)
3682 c.urlParams_.Set("prettyPrint", "false")
3683 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}:listLinkedAdUnits")
3684 urls += "?" + c.urlParams_.Encode()
3685 req, err := http.NewRequest("GET", urls, body)
3686 if err != nil {
3687 return nil, err
3688 }
3689 req.Header = reqHeaders
3690 googleapi.Expand(req.URL, map[string]string{
3691 "parent": c.parent,
3692 })
3693 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3694 }
3695
3696
3697
3698
3699
3700
3701
3702 func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Do(opts ...googleapi.CallOption) (*ListLinkedAdUnitsResponse, error) {
3703 gensupport.SetOptions(c.urlParams_, opts...)
3704 res, err := c.doRequest("json")
3705 if res != nil && res.StatusCode == http.StatusNotModified {
3706 if res.Body != nil {
3707 res.Body.Close()
3708 }
3709 return nil, gensupport.WrapError(&googleapi.Error{
3710 Code: res.StatusCode,
3711 Header: res.Header,
3712 })
3713 }
3714 if err != nil {
3715 return nil, err
3716 }
3717 defer googleapi.CloseBody(res)
3718 if err := googleapi.CheckResponse(res); err != nil {
3719 return nil, gensupport.WrapError(err)
3720 }
3721 ret := &ListLinkedAdUnitsResponse{
3722 ServerResponse: googleapi.ServerResponse{
3723 Header: res.Header,
3724 HTTPStatusCode: res.StatusCode,
3725 },
3726 }
3727 target := &ret
3728 if err := gensupport.DecodeResponse(target, res); err != nil {
3729 return nil, err
3730 }
3731 return ret, nil
3732 }
3733
3734
3735
3736
3737 func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Pages(ctx context.Context, f func(*ListLinkedAdUnitsResponse) error) error {
3738 c.ctx_ = ctx
3739 defer c.PageToken(c.urlParams_.Get("pageToken"))
3740 for {
3741 x, err := c.Do()
3742 if err != nil {
3743 return err
3744 }
3745 if err := f(x); err != nil {
3746 return err
3747 }
3748 if x.NextPageToken == "" {
3749 return nil
3750 }
3751 c.PageToken(x.NextPageToken)
3752 }
3753 }
3754
3755 type AccountsAdclientsCustomchannelsPatchCall struct {
3756 s *Service
3757 name string
3758 customchannel *CustomChannel
3759 urlParams_ gensupport.URLParams
3760 ctx_ context.Context
3761 header_ http.Header
3762 }
3763
3764
3765
3766
3767
3768
3769
3770
3771 func (r *AccountsAdclientsCustomchannelsService) Patch(name string, customchannel *CustomChannel) *AccountsAdclientsCustomchannelsPatchCall {
3772 c := &AccountsAdclientsCustomchannelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3773 c.name = name
3774 c.customchannel = customchannel
3775 return c
3776 }
3777
3778
3779
3780 func (c *AccountsAdclientsCustomchannelsPatchCall) UpdateMask(updateMask string) *AccountsAdclientsCustomchannelsPatchCall {
3781 c.urlParams_.Set("updateMask", updateMask)
3782 return c
3783 }
3784
3785
3786
3787
3788 func (c *AccountsAdclientsCustomchannelsPatchCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsPatchCall {
3789 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3790 return c
3791 }
3792
3793
3794 func (c *AccountsAdclientsCustomchannelsPatchCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsPatchCall {
3795 c.ctx_ = ctx
3796 return c
3797 }
3798
3799
3800
3801 func (c *AccountsAdclientsCustomchannelsPatchCall) Header() http.Header {
3802 if c.header_ == nil {
3803 c.header_ = make(http.Header)
3804 }
3805 return c.header_
3806 }
3807
3808 func (c *AccountsAdclientsCustomchannelsPatchCall) doRequest(alt string) (*http.Response, error) {
3809 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3810 var body io.Reader = nil
3811 body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel)
3812 if err != nil {
3813 return nil, err
3814 }
3815 c.urlParams_.Set("alt", alt)
3816 c.urlParams_.Set("prettyPrint", "false")
3817 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3818 urls += "?" + c.urlParams_.Encode()
3819 req, err := http.NewRequest("PATCH", urls, body)
3820 if err != nil {
3821 return nil, err
3822 }
3823 req.Header = reqHeaders
3824 googleapi.Expand(req.URL, map[string]string{
3825 "name": c.name,
3826 })
3827 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3828 }
3829
3830
3831
3832
3833
3834
3835 func (c *AccountsAdclientsCustomchannelsPatchCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
3836 gensupport.SetOptions(c.urlParams_, opts...)
3837 res, err := c.doRequest("json")
3838 if res != nil && res.StatusCode == http.StatusNotModified {
3839 if res.Body != nil {
3840 res.Body.Close()
3841 }
3842 return nil, gensupport.WrapError(&googleapi.Error{
3843 Code: res.StatusCode,
3844 Header: res.Header,
3845 })
3846 }
3847 if err != nil {
3848 return nil, err
3849 }
3850 defer googleapi.CloseBody(res)
3851 if err := googleapi.CheckResponse(res); err != nil {
3852 return nil, gensupport.WrapError(err)
3853 }
3854 ret := &CustomChannel{
3855 ServerResponse: googleapi.ServerResponse{
3856 Header: res.Header,
3857 HTTPStatusCode: res.StatusCode,
3858 },
3859 }
3860 target := &ret
3861 if err := gensupport.DecodeResponse(target, res); err != nil {
3862 return nil, err
3863 }
3864 return ret, nil
3865 }
3866
3867 type AccountsAdclientsUrlchannelsGetCall struct {
3868 s *Service
3869 name string
3870 urlParams_ gensupport.URLParams
3871 ifNoneMatch_ string
3872 ctx_ context.Context
3873 header_ http.Header
3874 }
3875
3876
3877
3878
3879
3880 func (r *AccountsAdclientsUrlchannelsService) Get(name string) *AccountsAdclientsUrlchannelsGetCall {
3881 c := &AccountsAdclientsUrlchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3882 c.name = name
3883 return c
3884 }
3885
3886
3887
3888
3889 func (c *AccountsAdclientsUrlchannelsGetCall) Fields(s ...googleapi.Field) *AccountsAdclientsUrlchannelsGetCall {
3890 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3891 return c
3892 }
3893
3894
3895
3896
3897 func (c *AccountsAdclientsUrlchannelsGetCall) IfNoneMatch(entityTag string) *AccountsAdclientsUrlchannelsGetCall {
3898 c.ifNoneMatch_ = entityTag
3899 return c
3900 }
3901
3902
3903 func (c *AccountsAdclientsUrlchannelsGetCall) Context(ctx context.Context) *AccountsAdclientsUrlchannelsGetCall {
3904 c.ctx_ = ctx
3905 return c
3906 }
3907
3908
3909
3910 func (c *AccountsAdclientsUrlchannelsGetCall) Header() http.Header {
3911 if c.header_ == nil {
3912 c.header_ = make(http.Header)
3913 }
3914 return c.header_
3915 }
3916
3917 func (c *AccountsAdclientsUrlchannelsGetCall) doRequest(alt string) (*http.Response, error) {
3918 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3919 if c.ifNoneMatch_ != "" {
3920 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3921 }
3922 var body io.Reader = nil
3923 c.urlParams_.Set("alt", alt)
3924 c.urlParams_.Set("prettyPrint", "false")
3925 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3926 urls += "?" + c.urlParams_.Encode()
3927 req, err := http.NewRequest("GET", urls, body)
3928 if err != nil {
3929 return nil, err
3930 }
3931 req.Header = reqHeaders
3932 googleapi.Expand(req.URL, map[string]string{
3933 "name": c.name,
3934 })
3935 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3936 }
3937
3938
3939
3940
3941
3942
3943 func (c *AccountsAdclientsUrlchannelsGetCall) Do(opts ...googleapi.CallOption) (*UrlChannel, error) {
3944 gensupport.SetOptions(c.urlParams_, opts...)
3945 res, err := c.doRequest("json")
3946 if res != nil && res.StatusCode == http.StatusNotModified {
3947 if res.Body != nil {
3948 res.Body.Close()
3949 }
3950 return nil, gensupport.WrapError(&googleapi.Error{
3951 Code: res.StatusCode,
3952 Header: res.Header,
3953 })
3954 }
3955 if err != nil {
3956 return nil, err
3957 }
3958 defer googleapi.CloseBody(res)
3959 if err := googleapi.CheckResponse(res); err != nil {
3960 return nil, gensupport.WrapError(err)
3961 }
3962 ret := &UrlChannel{
3963 ServerResponse: googleapi.ServerResponse{
3964 Header: res.Header,
3965 HTTPStatusCode: res.StatusCode,
3966 },
3967 }
3968 target := &ret
3969 if err := gensupport.DecodeResponse(target, res); err != nil {
3970 return nil, err
3971 }
3972 return ret, nil
3973 }
3974
3975 type AccountsAdclientsUrlchannelsListCall struct {
3976 s *Service
3977 parent string
3978 urlParams_ gensupport.URLParams
3979 ifNoneMatch_ string
3980 ctx_ context.Context
3981 header_ http.Header
3982 }
3983
3984
3985
3986
3987
3988 func (r *AccountsAdclientsUrlchannelsService) List(parent string) *AccountsAdclientsUrlchannelsListCall {
3989 c := &AccountsAdclientsUrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3990 c.parent = parent
3991 return c
3992 }
3993
3994
3995
3996
3997
3998 func (c *AccountsAdclientsUrlchannelsListCall) PageSize(pageSize int64) *AccountsAdclientsUrlchannelsListCall {
3999 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4000 return c
4001 }
4002
4003
4004
4005
4006
4007 func (c *AccountsAdclientsUrlchannelsListCall) PageToken(pageToken string) *AccountsAdclientsUrlchannelsListCall {
4008 c.urlParams_.Set("pageToken", pageToken)
4009 return c
4010 }
4011
4012
4013
4014
4015 func (c *AccountsAdclientsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsUrlchannelsListCall {
4016 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4017 return c
4018 }
4019
4020
4021
4022
4023 func (c *AccountsAdclientsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsUrlchannelsListCall {
4024 c.ifNoneMatch_ = entityTag
4025 return c
4026 }
4027
4028
4029 func (c *AccountsAdclientsUrlchannelsListCall) Context(ctx context.Context) *AccountsAdclientsUrlchannelsListCall {
4030 c.ctx_ = ctx
4031 return c
4032 }
4033
4034
4035
4036 func (c *AccountsAdclientsUrlchannelsListCall) Header() http.Header {
4037 if c.header_ == nil {
4038 c.header_ = make(http.Header)
4039 }
4040 return c.header_
4041 }
4042
4043 func (c *AccountsAdclientsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
4044 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4045 if c.ifNoneMatch_ != "" {
4046 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4047 }
4048 var body io.Reader = nil
4049 c.urlParams_.Set("alt", alt)
4050 c.urlParams_.Set("prettyPrint", "false")
4051 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/urlchannels")
4052 urls += "?" + c.urlParams_.Encode()
4053 req, err := http.NewRequest("GET", urls, body)
4054 if err != nil {
4055 return nil, err
4056 }
4057 req.Header = reqHeaders
4058 googleapi.Expand(req.URL, map[string]string{
4059 "parent": c.parent,
4060 })
4061 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4062 }
4063
4064
4065
4066
4067
4068
4069
4070 func (c *AccountsAdclientsUrlchannelsListCall) Do(opts ...googleapi.CallOption) (*ListUrlChannelsResponse, error) {
4071 gensupport.SetOptions(c.urlParams_, opts...)
4072 res, err := c.doRequest("json")
4073 if res != nil && res.StatusCode == http.StatusNotModified {
4074 if res.Body != nil {
4075 res.Body.Close()
4076 }
4077 return nil, gensupport.WrapError(&googleapi.Error{
4078 Code: res.StatusCode,
4079 Header: res.Header,
4080 })
4081 }
4082 if err != nil {
4083 return nil, err
4084 }
4085 defer googleapi.CloseBody(res)
4086 if err := googleapi.CheckResponse(res); err != nil {
4087 return nil, gensupport.WrapError(err)
4088 }
4089 ret := &ListUrlChannelsResponse{
4090 ServerResponse: googleapi.ServerResponse{
4091 Header: res.Header,
4092 HTTPStatusCode: res.StatusCode,
4093 },
4094 }
4095 target := &ret
4096 if err := gensupport.DecodeResponse(target, res); err != nil {
4097 return nil, err
4098 }
4099 return ret, nil
4100 }
4101
4102
4103
4104
4105 func (c *AccountsAdclientsUrlchannelsListCall) Pages(ctx context.Context, f func(*ListUrlChannelsResponse) error) error {
4106 c.ctx_ = ctx
4107 defer c.PageToken(c.urlParams_.Get("pageToken"))
4108 for {
4109 x, err := c.Do()
4110 if err != nil {
4111 return err
4112 }
4113 if err := f(x); err != nil {
4114 return err
4115 }
4116 if x.NextPageToken == "" {
4117 return nil
4118 }
4119 c.PageToken(x.NextPageToken)
4120 }
4121 }
4122
4123 type AccountsAlertsListCall struct {
4124 s *Service
4125 parent string
4126 urlParams_ gensupport.URLParams
4127 ifNoneMatch_ string
4128 ctx_ context.Context
4129 header_ http.Header
4130 }
4131
4132
4133
4134
4135
4136 func (r *AccountsAlertsService) List(parent string) *AccountsAlertsListCall {
4137 c := &AccountsAlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4138 c.parent = parent
4139 return c
4140 }
4141
4142
4143
4144
4145
4146
4147 func (c *AccountsAlertsListCall) LanguageCode(languageCode string) *AccountsAlertsListCall {
4148 c.urlParams_.Set("languageCode", languageCode)
4149 return c
4150 }
4151
4152
4153
4154
4155 func (c *AccountsAlertsListCall) Fields(s ...googleapi.Field) *AccountsAlertsListCall {
4156 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4157 return c
4158 }
4159
4160
4161
4162
4163 func (c *AccountsAlertsListCall) IfNoneMatch(entityTag string) *AccountsAlertsListCall {
4164 c.ifNoneMatch_ = entityTag
4165 return c
4166 }
4167
4168
4169 func (c *AccountsAlertsListCall) Context(ctx context.Context) *AccountsAlertsListCall {
4170 c.ctx_ = ctx
4171 return c
4172 }
4173
4174
4175
4176 func (c *AccountsAlertsListCall) Header() http.Header {
4177 if c.header_ == nil {
4178 c.header_ = make(http.Header)
4179 }
4180 return c.header_
4181 }
4182
4183 func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) {
4184 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4185 if c.ifNoneMatch_ != "" {
4186 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4187 }
4188 var body io.Reader = nil
4189 c.urlParams_.Set("alt", alt)
4190 c.urlParams_.Set("prettyPrint", "false")
4191 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/alerts")
4192 urls += "?" + c.urlParams_.Encode()
4193 req, err := http.NewRequest("GET", urls, body)
4194 if err != nil {
4195 return nil, err
4196 }
4197 req.Header = reqHeaders
4198 googleapi.Expand(req.URL, map[string]string{
4199 "parent": c.parent,
4200 })
4201 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4202 }
4203
4204
4205
4206
4207
4208
4209
4210 func (c *AccountsAlertsListCall) Do(opts ...googleapi.CallOption) (*ListAlertsResponse, error) {
4211 gensupport.SetOptions(c.urlParams_, opts...)
4212 res, err := c.doRequest("json")
4213 if res != nil && res.StatusCode == http.StatusNotModified {
4214 if res.Body != nil {
4215 res.Body.Close()
4216 }
4217 return nil, gensupport.WrapError(&googleapi.Error{
4218 Code: res.StatusCode,
4219 Header: res.Header,
4220 })
4221 }
4222 if err != nil {
4223 return nil, err
4224 }
4225 defer googleapi.CloseBody(res)
4226 if err := googleapi.CheckResponse(res); err != nil {
4227 return nil, gensupport.WrapError(err)
4228 }
4229 ret := &ListAlertsResponse{
4230 ServerResponse: googleapi.ServerResponse{
4231 Header: res.Header,
4232 HTTPStatusCode: res.StatusCode,
4233 },
4234 }
4235 target := &ret
4236 if err := gensupport.DecodeResponse(target, res); err != nil {
4237 return nil, err
4238 }
4239 return ret, nil
4240 }
4241
4242 type AccountsPaymentsListCall struct {
4243 s *Service
4244 parent string
4245 urlParams_ gensupport.URLParams
4246 ifNoneMatch_ string
4247 ctx_ context.Context
4248 header_ http.Header
4249 }
4250
4251
4252
4253
4254
4255 func (r *AccountsPaymentsService) List(parent string) *AccountsPaymentsListCall {
4256 c := &AccountsPaymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4257 c.parent = parent
4258 return c
4259 }
4260
4261
4262
4263
4264 func (c *AccountsPaymentsListCall) Fields(s ...googleapi.Field) *AccountsPaymentsListCall {
4265 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4266 return c
4267 }
4268
4269
4270
4271
4272 func (c *AccountsPaymentsListCall) IfNoneMatch(entityTag string) *AccountsPaymentsListCall {
4273 c.ifNoneMatch_ = entityTag
4274 return c
4275 }
4276
4277
4278 func (c *AccountsPaymentsListCall) Context(ctx context.Context) *AccountsPaymentsListCall {
4279 c.ctx_ = ctx
4280 return c
4281 }
4282
4283
4284
4285 func (c *AccountsPaymentsListCall) Header() http.Header {
4286 if c.header_ == nil {
4287 c.header_ = make(http.Header)
4288 }
4289 return c.header_
4290 }
4291
4292 func (c *AccountsPaymentsListCall) doRequest(alt string) (*http.Response, error) {
4293 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4294 if c.ifNoneMatch_ != "" {
4295 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4296 }
4297 var body io.Reader = nil
4298 c.urlParams_.Set("alt", alt)
4299 c.urlParams_.Set("prettyPrint", "false")
4300 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/payments")
4301 urls += "?" + c.urlParams_.Encode()
4302 req, err := http.NewRequest("GET", urls, body)
4303 if err != nil {
4304 return nil, err
4305 }
4306 req.Header = reqHeaders
4307 googleapi.Expand(req.URL, map[string]string{
4308 "parent": c.parent,
4309 })
4310 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4311 }
4312
4313
4314
4315
4316
4317
4318
4319 func (c *AccountsPaymentsListCall) Do(opts ...googleapi.CallOption) (*ListPaymentsResponse, error) {
4320 gensupport.SetOptions(c.urlParams_, opts...)
4321 res, err := c.doRequest("json")
4322 if res != nil && res.StatusCode == http.StatusNotModified {
4323 if res.Body != nil {
4324 res.Body.Close()
4325 }
4326 return nil, gensupport.WrapError(&googleapi.Error{
4327 Code: res.StatusCode,
4328 Header: res.Header,
4329 })
4330 }
4331 if err != nil {
4332 return nil, err
4333 }
4334 defer googleapi.CloseBody(res)
4335 if err := googleapi.CheckResponse(res); err != nil {
4336 return nil, gensupport.WrapError(err)
4337 }
4338 ret := &ListPaymentsResponse{
4339 ServerResponse: googleapi.ServerResponse{
4340 Header: res.Header,
4341 HTTPStatusCode: res.StatusCode,
4342 },
4343 }
4344 target := &ret
4345 if err := gensupport.DecodeResponse(target, res); err != nil {
4346 return nil, err
4347 }
4348 return ret, nil
4349 }
4350
4351 type AccountsPolicyIssuesGetCall struct {
4352 s *Service
4353 name string
4354 urlParams_ gensupport.URLParams
4355 ifNoneMatch_ string
4356 ctx_ context.Context
4357 header_ http.Header
4358 }
4359
4360
4361
4362
4363
4364 func (r *AccountsPolicyIssuesService) Get(name string) *AccountsPolicyIssuesGetCall {
4365 c := &AccountsPolicyIssuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4366 c.name = name
4367 return c
4368 }
4369
4370
4371
4372
4373 func (c *AccountsPolicyIssuesGetCall) Fields(s ...googleapi.Field) *AccountsPolicyIssuesGetCall {
4374 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4375 return c
4376 }
4377
4378
4379
4380
4381 func (c *AccountsPolicyIssuesGetCall) IfNoneMatch(entityTag string) *AccountsPolicyIssuesGetCall {
4382 c.ifNoneMatch_ = entityTag
4383 return c
4384 }
4385
4386
4387 func (c *AccountsPolicyIssuesGetCall) Context(ctx context.Context) *AccountsPolicyIssuesGetCall {
4388 c.ctx_ = ctx
4389 return c
4390 }
4391
4392
4393
4394 func (c *AccountsPolicyIssuesGetCall) Header() http.Header {
4395 if c.header_ == nil {
4396 c.header_ = make(http.Header)
4397 }
4398 return c.header_
4399 }
4400
4401 func (c *AccountsPolicyIssuesGetCall) doRequest(alt string) (*http.Response, error) {
4402 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4403 if c.ifNoneMatch_ != "" {
4404 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4405 }
4406 var body io.Reader = nil
4407 c.urlParams_.Set("alt", alt)
4408 c.urlParams_.Set("prettyPrint", "false")
4409 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4410 urls += "?" + c.urlParams_.Encode()
4411 req, err := http.NewRequest("GET", urls, body)
4412 if err != nil {
4413 return nil, err
4414 }
4415 req.Header = reqHeaders
4416 googleapi.Expand(req.URL, map[string]string{
4417 "name": c.name,
4418 })
4419 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4420 }
4421
4422
4423
4424
4425
4426
4427 func (c *AccountsPolicyIssuesGetCall) Do(opts ...googleapi.CallOption) (*PolicyIssue, error) {
4428 gensupport.SetOptions(c.urlParams_, opts...)
4429 res, err := c.doRequest("json")
4430 if res != nil && res.StatusCode == http.StatusNotModified {
4431 if res.Body != nil {
4432 res.Body.Close()
4433 }
4434 return nil, gensupport.WrapError(&googleapi.Error{
4435 Code: res.StatusCode,
4436 Header: res.Header,
4437 })
4438 }
4439 if err != nil {
4440 return nil, err
4441 }
4442 defer googleapi.CloseBody(res)
4443 if err := googleapi.CheckResponse(res); err != nil {
4444 return nil, gensupport.WrapError(err)
4445 }
4446 ret := &PolicyIssue{
4447 ServerResponse: googleapi.ServerResponse{
4448 Header: res.Header,
4449 HTTPStatusCode: res.StatusCode,
4450 },
4451 }
4452 target := &ret
4453 if err := gensupport.DecodeResponse(target, res); err != nil {
4454 return nil, err
4455 }
4456 return ret, nil
4457 }
4458
4459 type AccountsPolicyIssuesListCall struct {
4460 s *Service
4461 parent string
4462 urlParams_ gensupport.URLParams
4463 ifNoneMatch_ string
4464 ctx_ context.Context
4465 header_ http.Header
4466 }
4467
4468
4469
4470
4471
4472
4473 func (r *AccountsPolicyIssuesService) List(parent string) *AccountsPolicyIssuesListCall {
4474 c := &AccountsPolicyIssuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4475 c.parent = parent
4476 return c
4477 }
4478
4479
4480
4481
4482
4483 func (c *AccountsPolicyIssuesListCall) PageSize(pageSize int64) *AccountsPolicyIssuesListCall {
4484 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4485 return c
4486 }
4487
4488
4489
4490
4491
4492 func (c *AccountsPolicyIssuesListCall) PageToken(pageToken string) *AccountsPolicyIssuesListCall {
4493 c.urlParams_.Set("pageToken", pageToken)
4494 return c
4495 }
4496
4497
4498
4499
4500 func (c *AccountsPolicyIssuesListCall) Fields(s ...googleapi.Field) *AccountsPolicyIssuesListCall {
4501 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4502 return c
4503 }
4504
4505
4506
4507
4508 func (c *AccountsPolicyIssuesListCall) IfNoneMatch(entityTag string) *AccountsPolicyIssuesListCall {
4509 c.ifNoneMatch_ = entityTag
4510 return c
4511 }
4512
4513
4514 func (c *AccountsPolicyIssuesListCall) Context(ctx context.Context) *AccountsPolicyIssuesListCall {
4515 c.ctx_ = ctx
4516 return c
4517 }
4518
4519
4520
4521 func (c *AccountsPolicyIssuesListCall) Header() http.Header {
4522 if c.header_ == nil {
4523 c.header_ = make(http.Header)
4524 }
4525 return c.header_
4526 }
4527
4528 func (c *AccountsPolicyIssuesListCall) doRequest(alt string) (*http.Response, error) {
4529 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4530 if c.ifNoneMatch_ != "" {
4531 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4532 }
4533 var body io.Reader = nil
4534 c.urlParams_.Set("alt", alt)
4535 c.urlParams_.Set("prettyPrint", "false")
4536 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/policyIssues")
4537 urls += "?" + c.urlParams_.Encode()
4538 req, err := http.NewRequest("GET", urls, body)
4539 if err != nil {
4540 return nil, err
4541 }
4542 req.Header = reqHeaders
4543 googleapi.Expand(req.URL, map[string]string{
4544 "parent": c.parent,
4545 })
4546 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4547 }
4548
4549
4550
4551
4552
4553
4554
4555 func (c *AccountsPolicyIssuesListCall) Do(opts ...googleapi.CallOption) (*ListPolicyIssuesResponse, error) {
4556 gensupport.SetOptions(c.urlParams_, opts...)
4557 res, err := c.doRequest("json")
4558 if res != nil && res.StatusCode == http.StatusNotModified {
4559 if res.Body != nil {
4560 res.Body.Close()
4561 }
4562 return nil, gensupport.WrapError(&googleapi.Error{
4563 Code: res.StatusCode,
4564 Header: res.Header,
4565 })
4566 }
4567 if err != nil {
4568 return nil, err
4569 }
4570 defer googleapi.CloseBody(res)
4571 if err := googleapi.CheckResponse(res); err != nil {
4572 return nil, gensupport.WrapError(err)
4573 }
4574 ret := &ListPolicyIssuesResponse{
4575 ServerResponse: googleapi.ServerResponse{
4576 Header: res.Header,
4577 HTTPStatusCode: res.StatusCode,
4578 },
4579 }
4580 target := &ret
4581 if err := gensupport.DecodeResponse(target, res); err != nil {
4582 return nil, err
4583 }
4584 return ret, nil
4585 }
4586
4587
4588
4589
4590 func (c *AccountsPolicyIssuesListCall) Pages(ctx context.Context, f func(*ListPolicyIssuesResponse) error) error {
4591 c.ctx_ = ctx
4592 defer c.PageToken(c.urlParams_.Get("pageToken"))
4593 for {
4594 x, err := c.Do()
4595 if err != nil {
4596 return err
4597 }
4598 if err := f(x); err != nil {
4599 return err
4600 }
4601 if x.NextPageToken == "" {
4602 return nil
4603 }
4604 c.PageToken(x.NextPageToken)
4605 }
4606 }
4607
4608 type AccountsReportsGenerateCall struct {
4609 s *Service
4610 account string
4611 urlParams_ gensupport.URLParams
4612 ifNoneMatch_ string
4613 ctx_ context.Context
4614 header_ http.Header
4615 }
4616
4617
4618
4619
4620
4621 func (r *AccountsReportsService) Generate(account string) *AccountsReportsGenerateCall {
4622 c := &AccountsReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4623 c.account = account
4624 return c
4625 }
4626
4627
4628
4629
4630 func (c *AccountsReportsGenerateCall) CurrencyCode(currencyCode string) *AccountsReportsGenerateCall {
4631 c.urlParams_.Set("currencyCode", currencyCode)
4632 return c
4633 }
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659 func (c *AccountsReportsGenerateCall) DateRange(dateRange string) *AccountsReportsGenerateCall {
4660 c.urlParams_.Set("dateRange", dateRange)
4661 return c
4662 }
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
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
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849 func (c *AccountsReportsGenerateCall) Dimensions(dimensions ...string) *AccountsReportsGenerateCall {
4850 c.urlParams_.SetMulti("dimensions", append([]string{}, dimensions...))
4851 return c
4852 }
4853
4854
4855
4856
4857 func (c *AccountsReportsGenerateCall) EndDateDay(endDateDay int64) *AccountsReportsGenerateCall {
4858 c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
4859 return c
4860 }
4861
4862
4863
4864 func (c *AccountsReportsGenerateCall) EndDateMonth(endDateMonth int64) *AccountsReportsGenerateCall {
4865 c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
4866 return c
4867 }
4868
4869
4870
4871 func (c *AccountsReportsGenerateCall) EndDateYear(endDateYear int64) *AccountsReportsGenerateCall {
4872 c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
4873 return c
4874 }
4875
4876
4877
4878
4879
4880 func (c *AccountsReportsGenerateCall) Filters(filters ...string) *AccountsReportsGenerateCall {
4881 c.urlParams_.SetMulti("filters", append([]string{}, filters...))
4882 return c
4883 }
4884
4885
4886
4887
4888
4889
4890 func (c *AccountsReportsGenerateCall) LanguageCode(languageCode string) *AccountsReportsGenerateCall {
4891 c.urlParams_.Set("languageCode", languageCode)
4892 return c
4893 }
4894
4895
4896
4897
4898
4899
4900
4901
4902 func (c *AccountsReportsGenerateCall) Limit(limit int64) *AccountsReportsGenerateCall {
4903 c.urlParams_.Set("limit", fmt.Sprint(limit))
4904 return c
4905 }
4906
4907
4908
4909
4910
4911
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
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047 func (c *AccountsReportsGenerateCall) Metrics(metrics ...string) *AccountsReportsGenerateCall {
5048 c.urlParams_.SetMulti("metrics", append([]string{}, metrics...))
5049 return c
5050 }
5051
5052
5053
5054
5055
5056 func (c *AccountsReportsGenerateCall) OrderBy(orderBy ...string) *AccountsReportsGenerateCall {
5057 c.urlParams_.SetMulti("orderBy", append([]string{}, orderBy...))
5058 return c
5059 }
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073 func (c *AccountsReportsGenerateCall) ReportingTimeZone(reportingTimeZone string) *AccountsReportsGenerateCall {
5074 c.urlParams_.Set("reportingTimeZone", reportingTimeZone)
5075 return c
5076 }
5077
5078
5079
5080
5081 func (c *AccountsReportsGenerateCall) StartDateDay(startDateDay int64) *AccountsReportsGenerateCall {
5082 c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
5083 return c
5084 }
5085
5086
5087
5088 func (c *AccountsReportsGenerateCall) StartDateMonth(startDateMonth int64) *AccountsReportsGenerateCall {
5089 c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
5090 return c
5091 }
5092
5093
5094
5095 func (c *AccountsReportsGenerateCall) StartDateYear(startDateYear int64) *AccountsReportsGenerateCall {
5096 c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
5097 return c
5098 }
5099
5100
5101
5102
5103 func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall {
5104 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5105 return c
5106 }
5107
5108
5109
5110
5111 func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall {
5112 c.ifNoneMatch_ = entityTag
5113 return c
5114 }
5115
5116
5117 func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall {
5118 c.ctx_ = ctx
5119 return c
5120 }
5121
5122
5123
5124 func (c *AccountsReportsGenerateCall) Header() http.Header {
5125 if c.header_ == nil {
5126 c.header_ = make(http.Header)
5127 }
5128 return c.header_
5129 }
5130
5131 func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
5132 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5133 if c.ifNoneMatch_ != "" {
5134 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5135 }
5136 var body io.Reader = nil
5137 c.urlParams_.Set("alt", alt)
5138 c.urlParams_.Set("prettyPrint", "false")
5139 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+account}/reports:generate")
5140 urls += "?" + c.urlParams_.Encode()
5141 req, err := http.NewRequest("GET", urls, body)
5142 if err != nil {
5143 return nil, err
5144 }
5145 req.Header = reqHeaders
5146 googleapi.Expand(req.URL, map[string]string{
5147 "account": c.account,
5148 })
5149 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5150 }
5151
5152
5153
5154
5155
5156
5157 func (c *AccountsReportsGenerateCall) Do(opts ...googleapi.CallOption) (*ReportResult, error) {
5158 gensupport.SetOptions(c.urlParams_, opts...)
5159 res, err := c.doRequest("json")
5160 if res != nil && res.StatusCode == http.StatusNotModified {
5161 if res.Body != nil {
5162 res.Body.Close()
5163 }
5164 return nil, gensupport.WrapError(&googleapi.Error{
5165 Code: res.StatusCode,
5166 Header: res.Header,
5167 })
5168 }
5169 if err != nil {
5170 return nil, err
5171 }
5172 defer googleapi.CloseBody(res)
5173 if err := googleapi.CheckResponse(res); err != nil {
5174 return nil, gensupport.WrapError(err)
5175 }
5176 ret := &ReportResult{
5177 ServerResponse: googleapi.ServerResponse{
5178 Header: res.Header,
5179 HTTPStatusCode: res.StatusCode,
5180 },
5181 }
5182 target := &ret
5183 if err := gensupport.DecodeResponse(target, res); err != nil {
5184 return nil, err
5185 }
5186 return ret, nil
5187 }
5188
5189 type AccountsReportsGenerateCsvCall struct {
5190 s *Service
5191 account string
5192 urlParams_ gensupport.URLParams
5193 ifNoneMatch_ string
5194 ctx_ context.Context
5195 header_ http.Header
5196 }
5197
5198
5199
5200
5201
5202 func (r *AccountsReportsService) GenerateCsv(account string) *AccountsReportsGenerateCsvCall {
5203 c := &AccountsReportsGenerateCsvCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5204 c.account = account
5205 return c
5206 }
5207
5208
5209
5210
5211 func (c *AccountsReportsGenerateCsvCall) CurrencyCode(currencyCode string) *AccountsReportsGenerateCsvCall {
5212 c.urlParams_.Set("currencyCode", currencyCode)
5213 return c
5214 }
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240 func (c *AccountsReportsGenerateCsvCall) DateRange(dateRange string) *AccountsReportsGenerateCsvCall {
5241 c.urlParams_.Set("dateRange", dateRange)
5242 return c
5243 }
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
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
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430 func (c *AccountsReportsGenerateCsvCall) Dimensions(dimensions ...string) *AccountsReportsGenerateCsvCall {
5431 c.urlParams_.SetMulti("dimensions", append([]string{}, dimensions...))
5432 return c
5433 }
5434
5435
5436
5437
5438 func (c *AccountsReportsGenerateCsvCall) EndDateDay(endDateDay int64) *AccountsReportsGenerateCsvCall {
5439 c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
5440 return c
5441 }
5442
5443
5444
5445 func (c *AccountsReportsGenerateCsvCall) EndDateMonth(endDateMonth int64) *AccountsReportsGenerateCsvCall {
5446 c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
5447 return c
5448 }
5449
5450
5451
5452 func (c *AccountsReportsGenerateCsvCall) EndDateYear(endDateYear int64) *AccountsReportsGenerateCsvCall {
5453 c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
5454 return c
5455 }
5456
5457
5458
5459
5460
5461 func (c *AccountsReportsGenerateCsvCall) Filters(filters ...string) *AccountsReportsGenerateCsvCall {
5462 c.urlParams_.SetMulti("filters", append([]string{}, filters...))
5463 return c
5464 }
5465
5466
5467
5468
5469
5470
5471 func (c *AccountsReportsGenerateCsvCall) LanguageCode(languageCode string) *AccountsReportsGenerateCsvCall {
5472 c.urlParams_.Set("languageCode", languageCode)
5473 return c
5474 }
5475
5476
5477
5478
5479
5480
5481
5482
5483 func (c *AccountsReportsGenerateCsvCall) Limit(limit int64) *AccountsReportsGenerateCsvCall {
5484 c.urlParams_.Set("limit", fmt.Sprint(limit))
5485 return c
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
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628 func (c *AccountsReportsGenerateCsvCall) Metrics(metrics ...string) *AccountsReportsGenerateCsvCall {
5629 c.urlParams_.SetMulti("metrics", append([]string{}, metrics...))
5630 return c
5631 }
5632
5633
5634
5635
5636
5637 func (c *AccountsReportsGenerateCsvCall) OrderBy(orderBy ...string) *AccountsReportsGenerateCsvCall {
5638 c.urlParams_.SetMulti("orderBy", append([]string{}, orderBy...))
5639 return c
5640 }
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654 func (c *AccountsReportsGenerateCsvCall) ReportingTimeZone(reportingTimeZone string) *AccountsReportsGenerateCsvCall {
5655 c.urlParams_.Set("reportingTimeZone", reportingTimeZone)
5656 return c
5657 }
5658
5659
5660
5661
5662 func (c *AccountsReportsGenerateCsvCall) StartDateDay(startDateDay int64) *AccountsReportsGenerateCsvCall {
5663 c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
5664 return c
5665 }
5666
5667
5668
5669 func (c *AccountsReportsGenerateCsvCall) StartDateMonth(startDateMonth int64) *AccountsReportsGenerateCsvCall {
5670 c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
5671 return c
5672 }
5673
5674
5675
5676 func (c *AccountsReportsGenerateCsvCall) StartDateYear(startDateYear int64) *AccountsReportsGenerateCsvCall {
5677 c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
5678 return c
5679 }
5680
5681
5682
5683
5684 func (c *AccountsReportsGenerateCsvCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCsvCall {
5685 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5686 return c
5687 }
5688
5689
5690
5691
5692 func (c *AccountsReportsGenerateCsvCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCsvCall {
5693 c.ifNoneMatch_ = entityTag
5694 return c
5695 }
5696
5697
5698 func (c *AccountsReportsGenerateCsvCall) Context(ctx context.Context) *AccountsReportsGenerateCsvCall {
5699 c.ctx_ = ctx
5700 return c
5701 }
5702
5703
5704
5705 func (c *AccountsReportsGenerateCsvCall) Header() http.Header {
5706 if c.header_ == nil {
5707 c.header_ = make(http.Header)
5708 }
5709 return c.header_
5710 }
5711
5712 func (c *AccountsReportsGenerateCsvCall) doRequest(alt string) (*http.Response, error) {
5713 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5714 if c.ifNoneMatch_ != "" {
5715 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5716 }
5717 var body io.Reader = nil
5718 c.urlParams_.Set("alt", alt)
5719 c.urlParams_.Set("prettyPrint", "false")
5720 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+account}/reports:generateCsv")
5721 urls += "?" + c.urlParams_.Encode()
5722 req, err := http.NewRequest("GET", urls, body)
5723 if err != nil {
5724 return nil, err
5725 }
5726 req.Header = reqHeaders
5727 googleapi.Expand(req.URL, map[string]string{
5728 "account": c.account,
5729 })
5730 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5731 }
5732
5733
5734
5735
5736
5737
5738 func (c *AccountsReportsGenerateCsvCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
5739 gensupport.SetOptions(c.urlParams_, opts...)
5740 res, err := c.doRequest("json")
5741 if res != nil && res.StatusCode == http.StatusNotModified {
5742 if res.Body != nil {
5743 res.Body.Close()
5744 }
5745 return nil, gensupport.WrapError(&googleapi.Error{
5746 Code: res.StatusCode,
5747 Header: res.Header,
5748 })
5749 }
5750 if err != nil {
5751 return nil, err
5752 }
5753 defer googleapi.CloseBody(res)
5754 if err := googleapi.CheckResponse(res); err != nil {
5755 return nil, gensupport.WrapError(err)
5756 }
5757 ret := &HttpBody{
5758 ServerResponse: googleapi.ServerResponse{
5759 Header: res.Header,
5760 HTTPStatusCode: res.StatusCode,
5761 },
5762 }
5763 target := &ret
5764 if err := gensupport.DecodeResponse(target, res); err != nil {
5765 return nil, err
5766 }
5767 return ret, nil
5768 }
5769
5770 type AccountsReportsGetSavedCall struct {
5771 s *Service
5772 name string
5773 urlParams_ gensupport.URLParams
5774 ifNoneMatch_ string
5775 ctx_ context.Context
5776 header_ http.Header
5777 }
5778
5779
5780
5781
5782
5783 func (r *AccountsReportsService) GetSaved(name string) *AccountsReportsGetSavedCall {
5784 c := &AccountsReportsGetSavedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5785 c.name = name
5786 return c
5787 }
5788
5789
5790
5791
5792 func (c *AccountsReportsGetSavedCall) Fields(s ...googleapi.Field) *AccountsReportsGetSavedCall {
5793 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5794 return c
5795 }
5796
5797
5798
5799
5800 func (c *AccountsReportsGetSavedCall) IfNoneMatch(entityTag string) *AccountsReportsGetSavedCall {
5801 c.ifNoneMatch_ = entityTag
5802 return c
5803 }
5804
5805
5806 func (c *AccountsReportsGetSavedCall) Context(ctx context.Context) *AccountsReportsGetSavedCall {
5807 c.ctx_ = ctx
5808 return c
5809 }
5810
5811
5812
5813 func (c *AccountsReportsGetSavedCall) Header() http.Header {
5814 if c.header_ == nil {
5815 c.header_ = make(http.Header)
5816 }
5817 return c.header_
5818 }
5819
5820 func (c *AccountsReportsGetSavedCall) doRequest(alt string) (*http.Response, error) {
5821 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5822 if c.ifNoneMatch_ != "" {
5823 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5824 }
5825 var body io.Reader = nil
5826 c.urlParams_.Set("alt", alt)
5827 c.urlParams_.Set("prettyPrint", "false")
5828 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/saved")
5829 urls += "?" + c.urlParams_.Encode()
5830 req, err := http.NewRequest("GET", urls, body)
5831 if err != nil {
5832 return nil, err
5833 }
5834 req.Header = reqHeaders
5835 googleapi.Expand(req.URL, map[string]string{
5836 "name": c.name,
5837 })
5838 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5839 }
5840
5841
5842
5843
5844
5845
5846 func (c *AccountsReportsGetSavedCall) Do(opts ...googleapi.CallOption) (*SavedReport, error) {
5847 gensupport.SetOptions(c.urlParams_, opts...)
5848 res, err := c.doRequest("json")
5849 if res != nil && res.StatusCode == http.StatusNotModified {
5850 if res.Body != nil {
5851 res.Body.Close()
5852 }
5853 return nil, gensupport.WrapError(&googleapi.Error{
5854 Code: res.StatusCode,
5855 Header: res.Header,
5856 })
5857 }
5858 if err != nil {
5859 return nil, err
5860 }
5861 defer googleapi.CloseBody(res)
5862 if err := googleapi.CheckResponse(res); err != nil {
5863 return nil, gensupport.WrapError(err)
5864 }
5865 ret := &SavedReport{
5866 ServerResponse: googleapi.ServerResponse{
5867 Header: res.Header,
5868 HTTPStatusCode: res.StatusCode,
5869 },
5870 }
5871 target := &ret
5872 if err := gensupport.DecodeResponse(target, res); err != nil {
5873 return nil, err
5874 }
5875 return ret, nil
5876 }
5877
5878 type AccountsReportsSavedGenerateCall struct {
5879 s *Service
5880 name string
5881 urlParams_ gensupport.URLParams
5882 ifNoneMatch_ string
5883 ctx_ context.Context
5884 header_ http.Header
5885 }
5886
5887
5888
5889
5890
5891 func (r *AccountsReportsSavedService) Generate(name string) *AccountsReportsSavedGenerateCall {
5892 c := &AccountsReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5893 c.name = name
5894 return c
5895 }
5896
5897
5898
5899
5900 func (c *AccountsReportsSavedGenerateCall) CurrencyCode(currencyCode string) *AccountsReportsSavedGenerateCall {
5901 c.urlParams_.Set("currencyCode", currencyCode)
5902 return c
5903 }
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929 func (c *AccountsReportsSavedGenerateCall) DateRange(dateRange string) *AccountsReportsSavedGenerateCall {
5930 c.urlParams_.Set("dateRange", dateRange)
5931 return c
5932 }
5933
5934
5935
5936
5937 func (c *AccountsReportsSavedGenerateCall) EndDateDay(endDateDay int64) *AccountsReportsSavedGenerateCall {
5938 c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
5939 return c
5940 }
5941
5942
5943
5944 func (c *AccountsReportsSavedGenerateCall) EndDateMonth(endDateMonth int64) *AccountsReportsSavedGenerateCall {
5945 c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
5946 return c
5947 }
5948
5949
5950
5951 func (c *AccountsReportsSavedGenerateCall) EndDateYear(endDateYear int64) *AccountsReportsSavedGenerateCall {
5952 c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
5953 return c
5954 }
5955
5956
5957
5958
5959
5960
5961 func (c *AccountsReportsSavedGenerateCall) LanguageCode(languageCode string) *AccountsReportsSavedGenerateCall {
5962 c.urlParams_.Set("languageCode", languageCode)
5963 return c
5964 }
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978 func (c *AccountsReportsSavedGenerateCall) ReportingTimeZone(reportingTimeZone string) *AccountsReportsSavedGenerateCall {
5979 c.urlParams_.Set("reportingTimeZone", reportingTimeZone)
5980 return c
5981 }
5982
5983
5984
5985
5986 func (c *AccountsReportsSavedGenerateCall) StartDateDay(startDateDay int64) *AccountsReportsSavedGenerateCall {
5987 c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
5988 return c
5989 }
5990
5991
5992
5993 func (c *AccountsReportsSavedGenerateCall) StartDateMonth(startDateMonth int64) *AccountsReportsSavedGenerateCall {
5994 c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
5995 return c
5996 }
5997
5998
5999
6000 func (c *AccountsReportsSavedGenerateCall) StartDateYear(startDateYear int64) *AccountsReportsSavedGenerateCall {
6001 c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
6002 return c
6003 }
6004
6005
6006
6007
6008 func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall {
6009 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6010 return c
6011 }
6012
6013
6014
6015
6016 func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall {
6017 c.ifNoneMatch_ = entityTag
6018 return c
6019 }
6020
6021
6022 func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall {
6023 c.ctx_ = ctx
6024 return c
6025 }
6026
6027
6028
6029 func (c *AccountsReportsSavedGenerateCall) Header() http.Header {
6030 if c.header_ == nil {
6031 c.header_ = make(http.Header)
6032 }
6033 return c.header_
6034 }
6035
6036 func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
6037 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6038 if c.ifNoneMatch_ != "" {
6039 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6040 }
6041 var body io.Reader = nil
6042 c.urlParams_.Set("alt", alt)
6043 c.urlParams_.Set("prettyPrint", "false")
6044 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/saved:generate")
6045 urls += "?" + c.urlParams_.Encode()
6046 req, err := http.NewRequest("GET", urls, body)
6047 if err != nil {
6048 return nil, err
6049 }
6050 req.Header = reqHeaders
6051 googleapi.Expand(req.URL, map[string]string{
6052 "name": c.name,
6053 })
6054 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6055 }
6056
6057
6058
6059
6060
6061
6062 func (c *AccountsReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*ReportResult, error) {
6063 gensupport.SetOptions(c.urlParams_, opts...)
6064 res, err := c.doRequest("json")
6065 if res != nil && res.StatusCode == http.StatusNotModified {
6066 if res.Body != nil {
6067 res.Body.Close()
6068 }
6069 return nil, gensupport.WrapError(&googleapi.Error{
6070 Code: res.StatusCode,
6071 Header: res.Header,
6072 })
6073 }
6074 if err != nil {
6075 return nil, err
6076 }
6077 defer googleapi.CloseBody(res)
6078 if err := googleapi.CheckResponse(res); err != nil {
6079 return nil, gensupport.WrapError(err)
6080 }
6081 ret := &ReportResult{
6082 ServerResponse: googleapi.ServerResponse{
6083 Header: res.Header,
6084 HTTPStatusCode: res.StatusCode,
6085 },
6086 }
6087 target := &ret
6088 if err := gensupport.DecodeResponse(target, res); err != nil {
6089 return nil, err
6090 }
6091 return ret, nil
6092 }
6093
6094 type AccountsReportsSavedGenerateCsvCall struct {
6095 s *Service
6096 name string
6097 urlParams_ gensupport.URLParams
6098 ifNoneMatch_ string
6099 ctx_ context.Context
6100 header_ http.Header
6101 }
6102
6103
6104
6105
6106
6107 func (r *AccountsReportsSavedService) GenerateCsv(name string) *AccountsReportsSavedGenerateCsvCall {
6108 c := &AccountsReportsSavedGenerateCsvCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6109 c.name = name
6110 return c
6111 }
6112
6113
6114
6115
6116 func (c *AccountsReportsSavedGenerateCsvCall) CurrencyCode(currencyCode string) *AccountsReportsSavedGenerateCsvCall {
6117 c.urlParams_.Set("currencyCode", currencyCode)
6118 return c
6119 }
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145 func (c *AccountsReportsSavedGenerateCsvCall) DateRange(dateRange string) *AccountsReportsSavedGenerateCsvCall {
6146 c.urlParams_.Set("dateRange", dateRange)
6147 return c
6148 }
6149
6150
6151
6152
6153 func (c *AccountsReportsSavedGenerateCsvCall) EndDateDay(endDateDay int64) *AccountsReportsSavedGenerateCsvCall {
6154 c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
6155 return c
6156 }
6157
6158
6159
6160 func (c *AccountsReportsSavedGenerateCsvCall) EndDateMonth(endDateMonth int64) *AccountsReportsSavedGenerateCsvCall {
6161 c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
6162 return c
6163 }
6164
6165
6166
6167 func (c *AccountsReportsSavedGenerateCsvCall) EndDateYear(endDateYear int64) *AccountsReportsSavedGenerateCsvCall {
6168 c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
6169 return c
6170 }
6171
6172
6173
6174
6175
6176
6177 func (c *AccountsReportsSavedGenerateCsvCall) LanguageCode(languageCode string) *AccountsReportsSavedGenerateCsvCall {
6178 c.urlParams_.Set("languageCode", languageCode)
6179 return c
6180 }
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194 func (c *AccountsReportsSavedGenerateCsvCall) ReportingTimeZone(reportingTimeZone string) *AccountsReportsSavedGenerateCsvCall {
6195 c.urlParams_.Set("reportingTimeZone", reportingTimeZone)
6196 return c
6197 }
6198
6199
6200
6201
6202 func (c *AccountsReportsSavedGenerateCsvCall) StartDateDay(startDateDay int64) *AccountsReportsSavedGenerateCsvCall {
6203 c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
6204 return c
6205 }
6206
6207
6208
6209 func (c *AccountsReportsSavedGenerateCsvCall) StartDateMonth(startDateMonth int64) *AccountsReportsSavedGenerateCsvCall {
6210 c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
6211 return c
6212 }
6213
6214
6215
6216 func (c *AccountsReportsSavedGenerateCsvCall) StartDateYear(startDateYear int64) *AccountsReportsSavedGenerateCsvCall {
6217 c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
6218 return c
6219 }
6220
6221
6222
6223
6224 func (c *AccountsReportsSavedGenerateCsvCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCsvCall {
6225 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6226 return c
6227 }
6228
6229
6230
6231
6232 func (c *AccountsReportsSavedGenerateCsvCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCsvCall {
6233 c.ifNoneMatch_ = entityTag
6234 return c
6235 }
6236
6237
6238 func (c *AccountsReportsSavedGenerateCsvCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCsvCall {
6239 c.ctx_ = ctx
6240 return c
6241 }
6242
6243
6244
6245 func (c *AccountsReportsSavedGenerateCsvCall) Header() http.Header {
6246 if c.header_ == nil {
6247 c.header_ = make(http.Header)
6248 }
6249 return c.header_
6250 }
6251
6252 func (c *AccountsReportsSavedGenerateCsvCall) doRequest(alt string) (*http.Response, error) {
6253 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6254 if c.ifNoneMatch_ != "" {
6255 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6256 }
6257 var body io.Reader = nil
6258 c.urlParams_.Set("alt", alt)
6259 c.urlParams_.Set("prettyPrint", "false")
6260 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/saved:generateCsv")
6261 urls += "?" + c.urlParams_.Encode()
6262 req, err := http.NewRequest("GET", urls, body)
6263 if err != nil {
6264 return nil, err
6265 }
6266 req.Header = reqHeaders
6267 googleapi.Expand(req.URL, map[string]string{
6268 "name": c.name,
6269 })
6270 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6271 }
6272
6273
6274
6275
6276
6277
6278 func (c *AccountsReportsSavedGenerateCsvCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
6279 gensupport.SetOptions(c.urlParams_, opts...)
6280 res, err := c.doRequest("json")
6281 if res != nil && res.StatusCode == http.StatusNotModified {
6282 if res.Body != nil {
6283 res.Body.Close()
6284 }
6285 return nil, gensupport.WrapError(&googleapi.Error{
6286 Code: res.StatusCode,
6287 Header: res.Header,
6288 })
6289 }
6290 if err != nil {
6291 return nil, err
6292 }
6293 defer googleapi.CloseBody(res)
6294 if err := googleapi.CheckResponse(res); err != nil {
6295 return nil, gensupport.WrapError(err)
6296 }
6297 ret := &HttpBody{
6298 ServerResponse: googleapi.ServerResponse{
6299 Header: res.Header,
6300 HTTPStatusCode: res.StatusCode,
6301 },
6302 }
6303 target := &ret
6304 if err := gensupport.DecodeResponse(target, res); err != nil {
6305 return nil, err
6306 }
6307 return ret, nil
6308 }
6309
6310 type AccountsReportsSavedListCall struct {
6311 s *Service
6312 parent string
6313 urlParams_ gensupport.URLParams
6314 ifNoneMatch_ string
6315 ctx_ context.Context
6316 header_ http.Header
6317 }
6318
6319
6320
6321
6322
6323 func (r *AccountsReportsSavedService) List(parent string) *AccountsReportsSavedListCall {
6324 c := &AccountsReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6325 c.parent = parent
6326 return c
6327 }
6328
6329
6330
6331
6332
6333 func (c *AccountsReportsSavedListCall) PageSize(pageSize int64) *AccountsReportsSavedListCall {
6334 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6335 return c
6336 }
6337
6338
6339
6340
6341
6342 func (c *AccountsReportsSavedListCall) PageToken(pageToken string) *AccountsReportsSavedListCall {
6343 c.urlParams_.Set("pageToken", pageToken)
6344 return c
6345 }
6346
6347
6348
6349
6350 func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall {
6351 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6352 return c
6353 }
6354
6355
6356
6357
6358 func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall {
6359 c.ifNoneMatch_ = entityTag
6360 return c
6361 }
6362
6363
6364 func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall {
6365 c.ctx_ = ctx
6366 return c
6367 }
6368
6369
6370
6371 func (c *AccountsReportsSavedListCall) Header() http.Header {
6372 if c.header_ == nil {
6373 c.header_ = make(http.Header)
6374 }
6375 return c.header_
6376 }
6377
6378 func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
6379 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6380 if c.ifNoneMatch_ != "" {
6381 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6382 }
6383 var body io.Reader = nil
6384 c.urlParams_.Set("alt", alt)
6385 c.urlParams_.Set("prettyPrint", "false")
6386 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/reports/saved")
6387 urls += "?" + c.urlParams_.Encode()
6388 req, err := http.NewRequest("GET", urls, body)
6389 if err != nil {
6390 return nil, err
6391 }
6392 req.Header = reqHeaders
6393 googleapi.Expand(req.URL, map[string]string{
6394 "parent": c.parent,
6395 })
6396 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6397 }
6398
6399
6400
6401
6402
6403
6404
6405 func (c *AccountsReportsSavedListCall) Do(opts ...googleapi.CallOption) (*ListSavedReportsResponse, error) {
6406 gensupport.SetOptions(c.urlParams_, opts...)
6407 res, err := c.doRequest("json")
6408 if res != nil && res.StatusCode == http.StatusNotModified {
6409 if res.Body != nil {
6410 res.Body.Close()
6411 }
6412 return nil, gensupport.WrapError(&googleapi.Error{
6413 Code: res.StatusCode,
6414 Header: res.Header,
6415 })
6416 }
6417 if err != nil {
6418 return nil, err
6419 }
6420 defer googleapi.CloseBody(res)
6421 if err := googleapi.CheckResponse(res); err != nil {
6422 return nil, gensupport.WrapError(err)
6423 }
6424 ret := &ListSavedReportsResponse{
6425 ServerResponse: googleapi.ServerResponse{
6426 Header: res.Header,
6427 HTTPStatusCode: res.StatusCode,
6428 },
6429 }
6430 target := &ret
6431 if err := gensupport.DecodeResponse(target, res); err != nil {
6432 return nil, err
6433 }
6434 return ret, nil
6435 }
6436
6437
6438
6439
6440 func (c *AccountsReportsSavedListCall) Pages(ctx context.Context, f func(*ListSavedReportsResponse) error) error {
6441 c.ctx_ = ctx
6442 defer c.PageToken(c.urlParams_.Get("pageToken"))
6443 for {
6444 x, err := c.Do()
6445 if err != nil {
6446 return err
6447 }
6448 if err := f(x); err != nil {
6449 return err
6450 }
6451 if x.NextPageToken == "" {
6452 return nil
6453 }
6454 c.PageToken(x.NextPageToken)
6455 }
6456 }
6457
6458 type AccountsSitesGetCall struct {
6459 s *Service
6460 name string
6461 urlParams_ gensupport.URLParams
6462 ifNoneMatch_ string
6463 ctx_ context.Context
6464 header_ http.Header
6465 }
6466
6467
6468
6469
6470 func (r *AccountsSitesService) Get(name string) *AccountsSitesGetCall {
6471 c := &AccountsSitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6472 c.name = name
6473 return c
6474 }
6475
6476
6477
6478
6479 func (c *AccountsSitesGetCall) Fields(s ...googleapi.Field) *AccountsSitesGetCall {
6480 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6481 return c
6482 }
6483
6484
6485
6486
6487 func (c *AccountsSitesGetCall) IfNoneMatch(entityTag string) *AccountsSitesGetCall {
6488 c.ifNoneMatch_ = entityTag
6489 return c
6490 }
6491
6492
6493 func (c *AccountsSitesGetCall) Context(ctx context.Context) *AccountsSitesGetCall {
6494 c.ctx_ = ctx
6495 return c
6496 }
6497
6498
6499
6500 func (c *AccountsSitesGetCall) Header() http.Header {
6501 if c.header_ == nil {
6502 c.header_ = make(http.Header)
6503 }
6504 return c.header_
6505 }
6506
6507 func (c *AccountsSitesGetCall) doRequest(alt string) (*http.Response, error) {
6508 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6509 if c.ifNoneMatch_ != "" {
6510 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6511 }
6512 var body io.Reader = nil
6513 c.urlParams_.Set("alt", alt)
6514 c.urlParams_.Set("prettyPrint", "false")
6515 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
6516 urls += "?" + c.urlParams_.Encode()
6517 req, err := http.NewRequest("GET", urls, body)
6518 if err != nil {
6519 return nil, err
6520 }
6521 req.Header = reqHeaders
6522 googleapi.Expand(req.URL, map[string]string{
6523 "name": c.name,
6524 })
6525 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6526 }
6527
6528
6529
6530
6531
6532
6533 func (c *AccountsSitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
6534 gensupport.SetOptions(c.urlParams_, opts...)
6535 res, err := c.doRequest("json")
6536 if res != nil && res.StatusCode == http.StatusNotModified {
6537 if res.Body != nil {
6538 res.Body.Close()
6539 }
6540 return nil, gensupport.WrapError(&googleapi.Error{
6541 Code: res.StatusCode,
6542 Header: res.Header,
6543 })
6544 }
6545 if err != nil {
6546 return nil, err
6547 }
6548 defer googleapi.CloseBody(res)
6549 if err := googleapi.CheckResponse(res); err != nil {
6550 return nil, gensupport.WrapError(err)
6551 }
6552 ret := &Site{
6553 ServerResponse: googleapi.ServerResponse{
6554 Header: res.Header,
6555 HTTPStatusCode: res.StatusCode,
6556 },
6557 }
6558 target := &ret
6559 if err := gensupport.DecodeResponse(target, res); err != nil {
6560 return nil, err
6561 }
6562 return ret, nil
6563 }
6564
6565 type AccountsSitesListCall struct {
6566 s *Service
6567 parent string
6568 urlParams_ gensupport.URLParams
6569 ifNoneMatch_ string
6570 ctx_ context.Context
6571 header_ http.Header
6572 }
6573
6574
6575
6576
6577
6578 func (r *AccountsSitesService) List(parent string) *AccountsSitesListCall {
6579 c := &AccountsSitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6580 c.parent = parent
6581 return c
6582 }
6583
6584
6585
6586
6587
6588 func (c *AccountsSitesListCall) PageSize(pageSize int64) *AccountsSitesListCall {
6589 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6590 return c
6591 }
6592
6593
6594
6595
6596
6597 func (c *AccountsSitesListCall) PageToken(pageToken string) *AccountsSitesListCall {
6598 c.urlParams_.Set("pageToken", pageToken)
6599 return c
6600 }
6601
6602
6603
6604
6605 func (c *AccountsSitesListCall) Fields(s ...googleapi.Field) *AccountsSitesListCall {
6606 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6607 return c
6608 }
6609
6610
6611
6612
6613 func (c *AccountsSitesListCall) IfNoneMatch(entityTag string) *AccountsSitesListCall {
6614 c.ifNoneMatch_ = entityTag
6615 return c
6616 }
6617
6618
6619 func (c *AccountsSitesListCall) Context(ctx context.Context) *AccountsSitesListCall {
6620 c.ctx_ = ctx
6621 return c
6622 }
6623
6624
6625
6626 func (c *AccountsSitesListCall) Header() http.Header {
6627 if c.header_ == nil {
6628 c.header_ = make(http.Header)
6629 }
6630 return c.header_
6631 }
6632
6633 func (c *AccountsSitesListCall) doRequest(alt string) (*http.Response, error) {
6634 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6635 if c.ifNoneMatch_ != "" {
6636 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6637 }
6638 var body io.Reader = nil
6639 c.urlParams_.Set("alt", alt)
6640 c.urlParams_.Set("prettyPrint", "false")
6641 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sites")
6642 urls += "?" + c.urlParams_.Encode()
6643 req, err := http.NewRequest("GET", urls, body)
6644 if err != nil {
6645 return nil, err
6646 }
6647 req.Header = reqHeaders
6648 googleapi.Expand(req.URL, map[string]string{
6649 "parent": c.parent,
6650 })
6651 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6652 }
6653
6654
6655
6656
6657
6658
6659
6660 func (c *AccountsSitesListCall) Do(opts ...googleapi.CallOption) (*ListSitesResponse, error) {
6661 gensupport.SetOptions(c.urlParams_, opts...)
6662 res, err := c.doRequest("json")
6663 if res != nil && res.StatusCode == http.StatusNotModified {
6664 if res.Body != nil {
6665 res.Body.Close()
6666 }
6667 return nil, gensupport.WrapError(&googleapi.Error{
6668 Code: res.StatusCode,
6669 Header: res.Header,
6670 })
6671 }
6672 if err != nil {
6673 return nil, err
6674 }
6675 defer googleapi.CloseBody(res)
6676 if err := googleapi.CheckResponse(res); err != nil {
6677 return nil, gensupport.WrapError(err)
6678 }
6679 ret := &ListSitesResponse{
6680 ServerResponse: googleapi.ServerResponse{
6681 Header: res.Header,
6682 HTTPStatusCode: res.StatusCode,
6683 },
6684 }
6685 target := &ret
6686 if err := gensupport.DecodeResponse(target, res); err != nil {
6687 return nil, err
6688 }
6689 return ret, nil
6690 }
6691
6692
6693
6694
6695 func (c *AccountsSitesListCall) Pages(ctx context.Context, f func(*ListSitesResponse) error) error {
6696 c.ctx_ = ctx
6697 defer c.PageToken(c.urlParams_.Get("pageToken"))
6698 for {
6699 x, err := c.Do()
6700 if err != nil {
6701 return err
6702 }
6703 if err := f(x); err != nil {
6704 return err
6705 }
6706 if x.NextPageToken == "" {
6707 return nil
6708 }
6709 c.PageToken(x.NextPageToken)
6710 }
6711 }
6712
View as plain text