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 cloudbilling
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 = "cloudbilling:v1"
95 const apiName = "cloudbilling"
96 const apiVersion = "v1"
97 const basePath = "https://cloudbilling.googleapis.com/"
98 const basePathTemplate = "https://cloudbilling.UNIVERSE_DOMAIN/"
99 const mtlsBasePath = "https://cloudbilling.mtls.googleapis.com/"
100
101
102 const (
103
104 CloudBillingScope = "https://www.googleapis.com/auth/cloud-billing"
105
106
107 CloudBillingReadonlyScope = "https://www.googleapis.com/auth/cloud-billing.readonly"
108
109
110
111 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
112 )
113
114
115 func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) {
116 scopesOption := internaloption.WithDefaultScopes(
117 "https://www.googleapis.com/auth/cloud-billing",
118 "https://www.googleapis.com/auth/cloud-billing.readonly",
119 "https://www.googleapis.com/auth/cloud-platform",
120 )
121
122 opts = append([]option.ClientOption{scopesOption}, opts...)
123 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
124 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
125 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
126 opts = append(opts, internaloption.EnableNewAuthLibrary())
127 client, endpoint, err := htransport.NewClient(ctx, opts...)
128 if err != nil {
129 return nil, err
130 }
131 s, err := New(client)
132 if err != nil {
133 return nil, err
134 }
135 if endpoint != "" {
136 s.BasePath = endpoint
137 }
138 return s, nil
139 }
140
141
142
143
144
145
146 func New(client *http.Client) (*APIService, error) {
147 if client == nil {
148 return nil, errors.New("client is nil")
149 }
150 s := &APIService{client: client, BasePath: basePath}
151 s.BillingAccounts = NewBillingAccountsService(s)
152 s.Organizations = NewOrganizationsService(s)
153 s.Projects = NewProjectsService(s)
154 s.Services = NewServicesService(s)
155 return s, nil
156 }
157
158 type APIService struct {
159 client *http.Client
160 BasePath string
161 UserAgent string
162
163 BillingAccounts *BillingAccountsService
164
165 Organizations *OrganizationsService
166
167 Projects *ProjectsService
168
169 Services *ServicesService
170 }
171
172 func (s *APIService) userAgent() string {
173 if s.UserAgent == "" {
174 return googleapi.UserAgent
175 }
176 return googleapi.UserAgent + " " + s.UserAgent
177 }
178
179 func NewBillingAccountsService(s *APIService) *BillingAccountsService {
180 rs := &BillingAccountsService{s: s}
181 rs.Projects = NewBillingAccountsProjectsService(s)
182 rs.SubAccounts = NewBillingAccountsSubAccountsService(s)
183 return rs
184 }
185
186 type BillingAccountsService struct {
187 s *APIService
188
189 Projects *BillingAccountsProjectsService
190
191 SubAccounts *BillingAccountsSubAccountsService
192 }
193
194 func NewBillingAccountsProjectsService(s *APIService) *BillingAccountsProjectsService {
195 rs := &BillingAccountsProjectsService{s: s}
196 return rs
197 }
198
199 type BillingAccountsProjectsService struct {
200 s *APIService
201 }
202
203 func NewBillingAccountsSubAccountsService(s *APIService) *BillingAccountsSubAccountsService {
204 rs := &BillingAccountsSubAccountsService{s: s}
205 return rs
206 }
207
208 type BillingAccountsSubAccountsService struct {
209 s *APIService
210 }
211
212 func NewOrganizationsService(s *APIService) *OrganizationsService {
213 rs := &OrganizationsService{s: s}
214 rs.BillingAccounts = NewOrganizationsBillingAccountsService(s)
215 return rs
216 }
217
218 type OrganizationsService struct {
219 s *APIService
220
221 BillingAccounts *OrganizationsBillingAccountsService
222 }
223
224 func NewOrganizationsBillingAccountsService(s *APIService) *OrganizationsBillingAccountsService {
225 rs := &OrganizationsBillingAccountsService{s: s}
226 return rs
227 }
228
229 type OrganizationsBillingAccountsService struct {
230 s *APIService
231 }
232
233 func NewProjectsService(s *APIService) *ProjectsService {
234 rs := &ProjectsService{s: s}
235 return rs
236 }
237
238 type ProjectsService struct {
239 s *APIService
240 }
241
242 func NewServicesService(s *APIService) *ServicesService {
243 rs := &ServicesService{s: s}
244 rs.Skus = NewServicesSkusService(s)
245 return rs
246 }
247
248 type ServicesService struct {
249 s *APIService
250
251 Skus *ServicesSkusService
252 }
253
254 func NewServicesSkusService(s *APIService) *ServicesSkusService {
255 rs := &ServicesSkusService{s: s}
256 return rs
257 }
258
259 type ServicesSkusService struct {
260 s *APIService
261 }
262
263
264
265 type AggregationInfo struct {
266
267
268
269 AggregationCount int64 `json:"aggregationCount,omitempty"`
270
271
272
273
274 AggregationInterval string `json:"aggregationInterval,omitempty"`
275
276
277
278
279 AggregationLevel string `json:"aggregationLevel,omitempty"`
280
281
282
283
284
285 ForceSendFields []string `json:"-"`
286
287
288
289
290 NullFields []string `json:"-"`
291 }
292
293 func (s *AggregationInfo) MarshalJSON() ([]byte, error) {
294 type NoMethod AggregationInfo
295 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
296 }
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314 type AuditConfig struct {
315
316 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
317
318
319
320 Service string `json:"service,omitempty"`
321
322
323
324
325
326 ForceSendFields []string `json:"-"`
327
328
329
330
331 NullFields []string `json:"-"`
332 }
333
334 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
335 type NoMethod AuditConfig
336 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
337 }
338
339
340
341
342
343
344 type AuditLogConfig struct {
345
346
347 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
348
349
350
351
352
353
354
355 LogType string `json:"logType,omitempty"`
356
357
358
359
360
361 ForceSendFields []string `json:"-"`
362
363
364
365
366 NullFields []string `json:"-"`
367 }
368
369 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
370 type NoMethod AuditLogConfig
371 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
372 }
373
374
375
376
377 type BillingAccount struct {
378
379
380 DisplayName string `json:"displayName,omitempty"`
381
382
383
384
385 MasterBillingAccount string `json:"masterBillingAccount,omitempty"`
386
387
388
389
390 Name string `json:"name,omitempty"`
391
392
393
394
395 Open bool `json:"open,omitempty"`
396
397
398
399
400
401 Parent string `json:"parent,omitempty"`
402
403
404 googleapi.ServerResponse `json:"-"`
405
406
407
408
409
410 ForceSendFields []string `json:"-"`
411
412
413
414
415 NullFields []string `json:"-"`
416 }
417
418 func (s *BillingAccount) MarshalJSON() ([]byte, error) {
419 type NoMethod BillingAccount
420 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
421 }
422
423
424 type Binding struct {
425
426
427
428
429
430
431
432
433 Condition *Expr `json:"condition,omitempty"`
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496 Members []string `json:"members,omitempty"`
497
498
499
500
501
502
503 Role string `json:"role,omitempty"`
504
505
506
507
508
509 ForceSendFields []string `json:"-"`
510
511
512
513
514 NullFields []string `json:"-"`
515 }
516
517 func (s *Binding) MarshalJSON() ([]byte, error) {
518 type NoMethod Binding
519 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
520 }
521
522
523 type Category struct {
524
525
526 ResourceFamily string `json:"resourceFamily,omitempty"`
527
528
529 ResourceGroup string `json:"resourceGroup,omitempty"`
530
531 ServiceDisplayName string `json:"serviceDisplayName,omitempty"`
532
533
534 UsageType string `json:"usageType,omitempty"`
535
536
537
538
539
540 ForceSendFields []string `json:"-"`
541
542
543
544
545 NullFields []string `json:"-"`
546 }
547
548 func (s *Category) MarshalJSON() ([]byte, error) {
549 type NoMethod Category
550 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
551 }
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569 type Expr struct {
570
571
572 Description string `json:"description,omitempty"`
573
574
575 Expression string `json:"expression,omitempty"`
576
577
578 Location string `json:"location,omitempty"`
579
580
581
582 Title string `json:"title,omitempty"`
583
584
585
586
587
588 ForceSendFields []string `json:"-"`
589
590
591
592
593 NullFields []string `json:"-"`
594 }
595
596 func (s *Expr) MarshalJSON() ([]byte, error) {
597 type NoMethod Expr
598 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
599 }
600
601
602 type GeoTaxonomy struct {
603
604
605 Regions []string `json:"regions,omitempty"`
606
607
608
609
610
611
612
613
614
615 Type string `json:"type,omitempty"`
616
617
618
619
620
621 ForceSendFields []string `json:"-"`
622
623
624
625
626 NullFields []string `json:"-"`
627 }
628
629 func (s *GeoTaxonomy) MarshalJSON() ([]byte, error) {
630 type NoMethod GeoTaxonomy
631 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
632 }
633
634
635 type ListBillingAccountsResponse struct {
636
637 BillingAccounts []*BillingAccount `json:"billingAccounts,omitempty"`
638
639
640
641 NextPageToken string `json:"nextPageToken,omitempty"`
642
643
644 googleapi.ServerResponse `json:"-"`
645
646
647
648
649
650 ForceSendFields []string `json:"-"`
651
652
653
654
655 NullFields []string `json:"-"`
656 }
657
658 func (s *ListBillingAccountsResponse) MarshalJSON() ([]byte, error) {
659 type NoMethod ListBillingAccountsResponse
660 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
661 }
662
663
664
665 type ListProjectBillingInfoResponse struct {
666
667
668
669
670 NextPageToken string `json:"nextPageToken,omitempty"`
671
672
673 ProjectBillingInfo []*ProjectBillingInfo `json:"projectBillingInfo,omitempty"`
674
675
676 googleapi.ServerResponse `json:"-"`
677
678
679
680
681
682 ForceSendFields []string `json:"-"`
683
684
685
686
687 NullFields []string `json:"-"`
688 }
689
690 func (s *ListProjectBillingInfoResponse) MarshalJSON() ([]byte, error) {
691 type NoMethod ListProjectBillingInfoResponse
692 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
693 }
694
695
696 type ListServicesResponse struct {
697
698
699
700 NextPageToken string `json:"nextPageToken,omitempty"`
701
702 Services []*Service `json:"services,omitempty"`
703
704
705 googleapi.ServerResponse `json:"-"`
706
707
708
709
710
711 ForceSendFields []string `json:"-"`
712
713
714
715
716 NullFields []string `json:"-"`
717 }
718
719 func (s *ListServicesResponse) MarshalJSON() ([]byte, error) {
720 type NoMethod ListServicesResponse
721 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
722 }
723
724
725 type ListSkusResponse struct {
726
727
728
729 NextPageToken string `json:"nextPageToken,omitempty"`
730
731 Skus []*Sku `json:"skus,omitempty"`
732
733
734 googleapi.ServerResponse `json:"-"`
735
736
737
738
739
740 ForceSendFields []string `json:"-"`
741
742
743
744
745 NullFields []string `json:"-"`
746 }
747
748 func (s *ListSkusResponse) MarshalJSON() ([]byte, error) {
749 type NoMethod ListSkusResponse
750 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
751 }
752
753
754 type Money struct {
755
756 CurrencyCode string `json:"currencyCode,omitempty"`
757
758
759
760
761
762 Nanos int64 `json:"nanos,omitempty"`
763
764
765 Units int64 `json:"units,omitempty,string"`
766
767
768
769
770
771 ForceSendFields []string `json:"-"`
772
773
774
775
776 NullFields []string `json:"-"`
777 }
778
779 func (s *Money) MarshalJSON() ([]byte, error) {
780 type NoMethod Money
781 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
782 }
783
784
785 type MoveBillingAccountRequest struct {
786
787
788
789 DestinationParent string `json:"destinationParent,omitempty"`
790
791
792
793
794
795 ForceSendFields []string `json:"-"`
796
797
798
799
800 NullFields []string `json:"-"`
801 }
802
803 func (s *MoveBillingAccountRequest) MarshalJSON() ([]byte, error) {
804 type NoMethod MoveBillingAccountRequest
805 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
806 }
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838 type Policy struct {
839
840 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
841
842
843
844
845
846
847
848
849
850 Bindings []*Binding `json:"bindings,omitempty"`
851
852
853
854
855
856
857
858
859
860
861
862 Etag string `json:"etag,omitempty"`
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878 Version int64 `json:"version,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 *Policy) MarshalJSON() ([]byte, error) {
896 type NoMethod Policy
897 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
898 }
899
900
901
902
903
904
905 type PricingExpression struct {
906
907
908 BaseUnit string `json:"baseUnit,omitempty"`
909
910
911
912
913
914 BaseUnitConversionFactor float64 `json:"baseUnitConversionFactor,omitempty"`
915
916 BaseUnitDescription string `json:"baseUnitDescription,omitempty"`
917
918
919
920
921
922
923
924 DisplayQuantity float64 `json:"displayQuantity,omitempty"`
925
926
927
928 TieredRates []*TierRate `json:"tieredRates,omitempty"`
929
930
931 UsageUnit string `json:"usageUnit,omitempty"`
932
933
934 UsageUnitDescription string `json:"usageUnitDescription,omitempty"`
935
936
937
938
939
940 ForceSendFields []string `json:"-"`
941
942
943
944
945 NullFields []string `json:"-"`
946 }
947
948 func (s *PricingExpression) MarshalJSON() ([]byte, error) {
949 type NoMethod PricingExpression
950 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
951 }
952
953 func (s *PricingExpression) UnmarshalJSON(data []byte) error {
954 type NoMethod PricingExpression
955 var s1 struct {
956 BaseUnitConversionFactor gensupport.JSONFloat64 `json:"baseUnitConversionFactor"`
957 DisplayQuantity gensupport.JSONFloat64 `json:"displayQuantity"`
958 *NoMethod
959 }
960 s1.NoMethod = (*NoMethod)(s)
961 if err := json.Unmarshal(data, &s1); err != nil {
962 return err
963 }
964 s.BaseUnitConversionFactor = float64(s1.BaseUnitConversionFactor)
965 s.DisplayQuantity = float64(s1.DisplayQuantity)
966 return nil
967 }
968
969
970
971 type PricingInfo struct {
972
973
974 AggregationInfo *AggregationInfo `json:"aggregationInfo,omitempty"`
975
976
977
978
979
980 CurrencyConversionRate float64 `json:"currencyConversionRate,omitempty"`
981
982
983
984
985
986
987 EffectiveTime string `json:"effectiveTime,omitempty"`
988
989
990 PricingExpression *PricingExpression `json:"pricingExpression,omitempty"`
991
992
993 Summary string `json:"summary,omitempty"`
994
995
996
997
998
999 ForceSendFields []string `json:"-"`
1000
1001
1002
1003
1004 NullFields []string `json:"-"`
1005 }
1006
1007 func (s *PricingInfo) MarshalJSON() ([]byte, error) {
1008 type NoMethod PricingInfo
1009 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1010 }
1011
1012 func (s *PricingInfo) UnmarshalJSON(data []byte) error {
1013 type NoMethod PricingInfo
1014 var s1 struct {
1015 CurrencyConversionRate gensupport.JSONFloat64 `json:"currencyConversionRate"`
1016 *NoMethod
1017 }
1018 s1.NoMethod = (*NoMethod)(s)
1019 if err := json.Unmarshal(data, &s1); err != nil {
1020 return err
1021 }
1022 s.CurrencyConversionRate = float64(s1.CurrencyConversionRate)
1023 return nil
1024 }
1025
1026
1027
1028
1029 type ProjectBillingInfo struct {
1030
1031
1032 BillingAccountName string `json:"billingAccountName,omitempty"`
1033
1034
1035
1036
1037 BillingEnabled bool `json:"billingEnabled,omitempty"`
1038
1039
1040
1041
1042 Name string `json:"name,omitempty"`
1043
1044
1045
1046 ProjectId string `json:"projectId,omitempty"`
1047
1048
1049 googleapi.ServerResponse `json:"-"`
1050
1051
1052
1053
1054
1055 ForceSendFields []string `json:"-"`
1056
1057
1058
1059
1060 NullFields []string `json:"-"`
1061 }
1062
1063 func (s *ProjectBillingInfo) MarshalJSON() ([]byte, error) {
1064 type NoMethod ProjectBillingInfo
1065 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1066 }
1067
1068
1069 type Service struct {
1070
1071
1072 BusinessEntityName string `json:"businessEntityName,omitempty"`
1073
1074 DisplayName string `json:"displayName,omitempty"`
1075
1076 Name string `json:"name,omitempty"`
1077
1078 ServiceId string `json:"serviceId,omitempty"`
1079
1080
1081
1082
1083
1084 ForceSendFields []string `json:"-"`
1085
1086
1087
1088
1089 NullFields []string `json:"-"`
1090 }
1091
1092 func (s *Service) MarshalJSON() ([]byte, error) {
1093 type NoMethod Service
1094 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1095 }
1096
1097
1098 type SetIamPolicyRequest struct {
1099
1100
1101
1102
1103 Policy *Policy `json:"policy,omitempty"`
1104
1105
1106
1107 UpdateMask string `json:"updateMask,omitempty"`
1108
1109
1110
1111
1112
1113 ForceSendFields []string `json:"-"`
1114
1115
1116
1117
1118 NullFields []string `json:"-"`
1119 }
1120
1121 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1122 type NoMethod SetIamPolicyRequest
1123 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1124 }
1125
1126
1127 type Sku struct {
1128
1129
1130 Category *Category `json:"category,omitempty"`
1131
1132
1133 Description string `json:"description,omitempty"`
1134
1135 GeoTaxonomy *GeoTaxonomy `json:"geoTaxonomy,omitempty"`
1136
1137
1138 Name string `json:"name,omitempty"`
1139
1140 PricingInfo []*PricingInfo `json:"pricingInfo,omitempty"`
1141
1142
1143 ServiceProviderName string `json:"serviceProviderName,omitempty"`
1144
1145
1146
1147 ServiceRegions []string `json:"serviceRegions,omitempty"`
1148
1149 SkuId string `json:"skuId,omitempty"`
1150
1151
1152
1153
1154
1155 ForceSendFields []string `json:"-"`
1156
1157
1158
1159
1160 NullFields []string `json:"-"`
1161 }
1162
1163 func (s *Sku) MarshalJSON() ([]byte, error) {
1164 type NoMethod Sku
1165 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1166 }
1167
1168
1169 type TestIamPermissionsRequest struct {
1170
1171
1172
1173
1174 Permissions []string `json:"permissions,omitempty"`
1175
1176
1177
1178
1179
1180 ForceSendFields []string `json:"-"`
1181
1182
1183
1184
1185 NullFields []string `json:"-"`
1186 }
1187
1188 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1189 type NoMethod TestIamPermissionsRequest
1190 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1191 }
1192
1193
1194
1195 type TestIamPermissionsResponse struct {
1196
1197
1198 Permissions []string `json:"permissions,omitempty"`
1199
1200
1201 googleapi.ServerResponse `json:"-"`
1202
1203
1204
1205
1206
1207 ForceSendFields []string `json:"-"`
1208
1209
1210
1211
1212 NullFields []string `json:"-"`
1213 }
1214
1215 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1216 type NoMethod TestIamPermissionsResponse
1217 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1218 }
1219
1220
1221
1222 type TierRate struct {
1223
1224
1225
1226 StartUsageAmount float64 `json:"startUsageAmount,omitempty"`
1227
1228
1229 UnitPrice *Money `json:"unitPrice,omitempty"`
1230
1231
1232
1233
1234
1235 ForceSendFields []string `json:"-"`
1236
1237
1238
1239
1240 NullFields []string `json:"-"`
1241 }
1242
1243 func (s *TierRate) MarshalJSON() ([]byte, error) {
1244 type NoMethod TierRate
1245 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1246 }
1247
1248 func (s *TierRate) UnmarshalJSON(data []byte) error {
1249 type NoMethod TierRate
1250 var s1 struct {
1251 StartUsageAmount gensupport.JSONFloat64 `json:"startUsageAmount"`
1252 *NoMethod
1253 }
1254 s1.NoMethod = (*NoMethod)(s)
1255 if err := json.Unmarshal(data, &s1); err != nil {
1256 return err
1257 }
1258 s.StartUsageAmount = float64(s1.StartUsageAmount)
1259 return nil
1260 }
1261
1262 type BillingAccountsCreateCall struct {
1263 s *APIService
1264 billingaccount *BillingAccount
1265 urlParams_ gensupport.URLParams
1266 ctx_ context.Context
1267 header_ http.Header
1268 }
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282 func (r *BillingAccountsService) Create(billingaccount *BillingAccount) *BillingAccountsCreateCall {
1283 c := &BillingAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1284 c.billingaccount = billingaccount
1285 return c
1286 }
1287
1288
1289
1290
1291 func (c *BillingAccountsCreateCall) Parent(parent string) *BillingAccountsCreateCall {
1292 c.urlParams_.Set("parent", parent)
1293 return c
1294 }
1295
1296
1297
1298
1299 func (c *BillingAccountsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsCreateCall {
1300 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1301 return c
1302 }
1303
1304
1305 func (c *BillingAccountsCreateCall) Context(ctx context.Context) *BillingAccountsCreateCall {
1306 c.ctx_ = ctx
1307 return c
1308 }
1309
1310
1311
1312 func (c *BillingAccountsCreateCall) Header() http.Header {
1313 if c.header_ == nil {
1314 c.header_ = make(http.Header)
1315 }
1316 return c.header_
1317 }
1318
1319 func (c *BillingAccountsCreateCall) doRequest(alt string) (*http.Response, error) {
1320 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1321 var body io.Reader = nil
1322 body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount)
1323 if err != nil {
1324 return nil, err
1325 }
1326 c.urlParams_.Set("alt", alt)
1327 c.urlParams_.Set("prettyPrint", "false")
1328 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/billingAccounts")
1329 urls += "?" + c.urlParams_.Encode()
1330 req, err := http.NewRequest("POST", urls, body)
1331 if err != nil {
1332 return nil, err
1333 }
1334 req.Header = reqHeaders
1335 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1336 }
1337
1338
1339
1340
1341
1342
1343 func (c *BillingAccountsCreateCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
1344 gensupport.SetOptions(c.urlParams_, opts...)
1345 res, err := c.doRequest("json")
1346 if res != nil && res.StatusCode == http.StatusNotModified {
1347 if res.Body != nil {
1348 res.Body.Close()
1349 }
1350 return nil, gensupport.WrapError(&googleapi.Error{
1351 Code: res.StatusCode,
1352 Header: res.Header,
1353 })
1354 }
1355 if err != nil {
1356 return nil, err
1357 }
1358 defer googleapi.CloseBody(res)
1359 if err := googleapi.CheckResponse(res); err != nil {
1360 return nil, gensupport.WrapError(err)
1361 }
1362 ret := &BillingAccount{
1363 ServerResponse: googleapi.ServerResponse{
1364 Header: res.Header,
1365 HTTPStatusCode: res.StatusCode,
1366 },
1367 }
1368 target := &ret
1369 if err := gensupport.DecodeResponse(target, res); err != nil {
1370 return nil, err
1371 }
1372 return ret, nil
1373 }
1374
1375 type BillingAccountsGetCall struct {
1376 s *APIService
1377 name string
1378 urlParams_ gensupport.URLParams
1379 ifNoneMatch_ string
1380 ctx_ context.Context
1381 header_ http.Header
1382 }
1383
1384
1385
1386
1387
1388
1389
1390 func (r *BillingAccountsService) Get(name string) *BillingAccountsGetCall {
1391 c := &BillingAccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1392 c.name = name
1393 return c
1394 }
1395
1396
1397
1398
1399 func (c *BillingAccountsGetCall) Fields(s ...googleapi.Field) *BillingAccountsGetCall {
1400 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1401 return c
1402 }
1403
1404
1405
1406
1407 func (c *BillingAccountsGetCall) IfNoneMatch(entityTag string) *BillingAccountsGetCall {
1408 c.ifNoneMatch_ = entityTag
1409 return c
1410 }
1411
1412
1413 func (c *BillingAccountsGetCall) Context(ctx context.Context) *BillingAccountsGetCall {
1414 c.ctx_ = ctx
1415 return c
1416 }
1417
1418
1419
1420 func (c *BillingAccountsGetCall) Header() http.Header {
1421 if c.header_ == nil {
1422 c.header_ = make(http.Header)
1423 }
1424 return c.header_
1425 }
1426
1427 func (c *BillingAccountsGetCall) doRequest(alt string) (*http.Response, error) {
1428 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1429 if c.ifNoneMatch_ != "" {
1430 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1431 }
1432 var body io.Reader = nil
1433 c.urlParams_.Set("alt", alt)
1434 c.urlParams_.Set("prettyPrint", "false")
1435 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1436 urls += "?" + c.urlParams_.Encode()
1437 req, err := http.NewRequest("GET", urls, body)
1438 if err != nil {
1439 return nil, err
1440 }
1441 req.Header = reqHeaders
1442 googleapi.Expand(req.URL, map[string]string{
1443 "name": c.name,
1444 })
1445 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1446 }
1447
1448
1449
1450
1451
1452
1453 func (c *BillingAccountsGetCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
1454 gensupport.SetOptions(c.urlParams_, opts...)
1455 res, err := c.doRequest("json")
1456 if res != nil && res.StatusCode == http.StatusNotModified {
1457 if res.Body != nil {
1458 res.Body.Close()
1459 }
1460 return nil, gensupport.WrapError(&googleapi.Error{
1461 Code: res.StatusCode,
1462 Header: res.Header,
1463 })
1464 }
1465 if err != nil {
1466 return nil, err
1467 }
1468 defer googleapi.CloseBody(res)
1469 if err := googleapi.CheckResponse(res); err != nil {
1470 return nil, gensupport.WrapError(err)
1471 }
1472 ret := &BillingAccount{
1473 ServerResponse: googleapi.ServerResponse{
1474 Header: res.Header,
1475 HTTPStatusCode: res.StatusCode,
1476 },
1477 }
1478 target := &ret
1479 if err := gensupport.DecodeResponse(target, res); err != nil {
1480 return nil, err
1481 }
1482 return ret, nil
1483 }
1484
1485 type BillingAccountsGetIamPolicyCall struct {
1486 s *APIService
1487 resource string
1488 urlParams_ gensupport.URLParams
1489 ifNoneMatch_ string
1490 ctx_ context.Context
1491 header_ http.Header
1492 }
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502 func (r *BillingAccountsService) GetIamPolicy(resource string) *BillingAccountsGetIamPolicyCall {
1503 c := &BillingAccountsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1504 c.resource = resource
1505 return c
1506 }
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520 func (c *BillingAccountsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BillingAccountsGetIamPolicyCall {
1521 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
1522 return c
1523 }
1524
1525
1526
1527
1528 func (c *BillingAccountsGetIamPolicyCall) Fields(s ...googleapi.Field) *BillingAccountsGetIamPolicyCall {
1529 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1530 return c
1531 }
1532
1533
1534
1535
1536 func (c *BillingAccountsGetIamPolicyCall) IfNoneMatch(entityTag string) *BillingAccountsGetIamPolicyCall {
1537 c.ifNoneMatch_ = entityTag
1538 return c
1539 }
1540
1541
1542 func (c *BillingAccountsGetIamPolicyCall) Context(ctx context.Context) *BillingAccountsGetIamPolicyCall {
1543 c.ctx_ = ctx
1544 return c
1545 }
1546
1547
1548
1549 func (c *BillingAccountsGetIamPolicyCall) Header() http.Header {
1550 if c.header_ == nil {
1551 c.header_ = make(http.Header)
1552 }
1553 return c.header_
1554 }
1555
1556 func (c *BillingAccountsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1557 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1558 if c.ifNoneMatch_ != "" {
1559 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1560 }
1561 var body io.Reader = nil
1562 c.urlParams_.Set("alt", alt)
1563 c.urlParams_.Set("prettyPrint", "false")
1564 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
1565 urls += "?" + c.urlParams_.Encode()
1566 req, err := http.NewRequest("GET", urls, body)
1567 if err != nil {
1568 return nil, err
1569 }
1570 req.Header = reqHeaders
1571 googleapi.Expand(req.URL, map[string]string{
1572 "resource": c.resource,
1573 })
1574 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1575 }
1576
1577
1578
1579
1580
1581
1582 func (c *BillingAccountsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1583 gensupport.SetOptions(c.urlParams_, opts...)
1584 res, err := c.doRequest("json")
1585 if res != nil && res.StatusCode == http.StatusNotModified {
1586 if res.Body != nil {
1587 res.Body.Close()
1588 }
1589 return nil, gensupport.WrapError(&googleapi.Error{
1590 Code: res.StatusCode,
1591 Header: res.Header,
1592 })
1593 }
1594 if err != nil {
1595 return nil, err
1596 }
1597 defer googleapi.CloseBody(res)
1598 if err := googleapi.CheckResponse(res); err != nil {
1599 return nil, gensupport.WrapError(err)
1600 }
1601 ret := &Policy{
1602 ServerResponse: googleapi.ServerResponse{
1603 Header: res.Header,
1604 HTTPStatusCode: res.StatusCode,
1605 },
1606 }
1607 target := &ret
1608 if err := gensupport.DecodeResponse(target, res); err != nil {
1609 return nil, err
1610 }
1611 return ret, nil
1612 }
1613
1614 type BillingAccountsListCall struct {
1615 s *APIService
1616 urlParams_ gensupport.URLParams
1617 ifNoneMatch_ string
1618 ctx_ context.Context
1619 header_ http.Header
1620 }
1621
1622
1623
1624
1625 func (r *BillingAccountsService) List() *BillingAccountsListCall {
1626 c := &BillingAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1627 return c
1628 }
1629
1630
1631
1632
1633
1634
1635
1636 func (c *BillingAccountsListCall) Filter(filter string) *BillingAccountsListCall {
1637 c.urlParams_.Set("filter", filter)
1638 return c
1639 }
1640
1641
1642
1643 func (c *BillingAccountsListCall) PageSize(pageSize int64) *BillingAccountsListCall {
1644 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1645 return c
1646 }
1647
1648
1649
1650
1651
1652 func (c *BillingAccountsListCall) PageToken(pageToken string) *BillingAccountsListCall {
1653 c.urlParams_.Set("pageToken", pageToken)
1654 return c
1655 }
1656
1657
1658
1659
1660
1661 func (c *BillingAccountsListCall) Parent(parent string) *BillingAccountsListCall {
1662 c.urlParams_.Set("parent", parent)
1663 return c
1664 }
1665
1666
1667
1668
1669 func (c *BillingAccountsListCall) Fields(s ...googleapi.Field) *BillingAccountsListCall {
1670 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1671 return c
1672 }
1673
1674
1675
1676
1677 func (c *BillingAccountsListCall) IfNoneMatch(entityTag string) *BillingAccountsListCall {
1678 c.ifNoneMatch_ = entityTag
1679 return c
1680 }
1681
1682
1683 func (c *BillingAccountsListCall) Context(ctx context.Context) *BillingAccountsListCall {
1684 c.ctx_ = ctx
1685 return c
1686 }
1687
1688
1689
1690 func (c *BillingAccountsListCall) Header() http.Header {
1691 if c.header_ == nil {
1692 c.header_ = make(http.Header)
1693 }
1694 return c.header_
1695 }
1696
1697 func (c *BillingAccountsListCall) doRequest(alt string) (*http.Response, error) {
1698 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1699 if c.ifNoneMatch_ != "" {
1700 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1701 }
1702 var body io.Reader = nil
1703 c.urlParams_.Set("alt", alt)
1704 c.urlParams_.Set("prettyPrint", "false")
1705 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/billingAccounts")
1706 urls += "?" + c.urlParams_.Encode()
1707 req, err := http.NewRequest("GET", urls, body)
1708 if err != nil {
1709 return nil, err
1710 }
1711 req.Header = reqHeaders
1712 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1713 }
1714
1715
1716
1717
1718
1719
1720
1721 func (c *BillingAccountsListCall) Do(opts ...googleapi.CallOption) (*ListBillingAccountsResponse, error) {
1722 gensupport.SetOptions(c.urlParams_, opts...)
1723 res, err := c.doRequest("json")
1724 if res != nil && res.StatusCode == http.StatusNotModified {
1725 if res.Body != nil {
1726 res.Body.Close()
1727 }
1728 return nil, gensupport.WrapError(&googleapi.Error{
1729 Code: res.StatusCode,
1730 Header: res.Header,
1731 })
1732 }
1733 if err != nil {
1734 return nil, err
1735 }
1736 defer googleapi.CloseBody(res)
1737 if err := googleapi.CheckResponse(res); err != nil {
1738 return nil, gensupport.WrapError(err)
1739 }
1740 ret := &ListBillingAccountsResponse{
1741 ServerResponse: googleapi.ServerResponse{
1742 Header: res.Header,
1743 HTTPStatusCode: res.StatusCode,
1744 },
1745 }
1746 target := &ret
1747 if err := gensupport.DecodeResponse(target, res); err != nil {
1748 return nil, err
1749 }
1750 return ret, nil
1751 }
1752
1753
1754
1755
1756 func (c *BillingAccountsListCall) Pages(ctx context.Context, f func(*ListBillingAccountsResponse) error) error {
1757 c.ctx_ = ctx
1758 defer c.PageToken(c.urlParams_.Get("pageToken"))
1759 for {
1760 x, err := c.Do()
1761 if err != nil {
1762 return err
1763 }
1764 if err := f(x); err != nil {
1765 return err
1766 }
1767 if x.NextPageToken == "" {
1768 return nil
1769 }
1770 c.PageToken(x.NextPageToken)
1771 }
1772 }
1773
1774 type BillingAccountsMoveCall struct {
1775 s *APIService
1776 name string
1777 movebillingaccountrequest *MoveBillingAccountRequest
1778 urlParams_ gensupport.URLParams
1779 ctx_ context.Context
1780 header_ http.Header
1781 }
1782
1783
1784
1785
1786
1787
1788
1789 func (r *BillingAccountsService) Move(name string, movebillingaccountrequest *MoveBillingAccountRequest) *BillingAccountsMoveCall {
1790 c := &BillingAccountsMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1791 c.name = name
1792 c.movebillingaccountrequest = movebillingaccountrequest
1793 return c
1794 }
1795
1796
1797
1798
1799 func (c *BillingAccountsMoveCall) Fields(s ...googleapi.Field) *BillingAccountsMoveCall {
1800 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1801 return c
1802 }
1803
1804
1805 func (c *BillingAccountsMoveCall) Context(ctx context.Context) *BillingAccountsMoveCall {
1806 c.ctx_ = ctx
1807 return c
1808 }
1809
1810
1811
1812 func (c *BillingAccountsMoveCall) Header() http.Header {
1813 if c.header_ == nil {
1814 c.header_ = make(http.Header)
1815 }
1816 return c.header_
1817 }
1818
1819 func (c *BillingAccountsMoveCall) doRequest(alt string) (*http.Response, error) {
1820 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1821 var body io.Reader = nil
1822 body, err := googleapi.WithoutDataWrapper.JSONReader(c.movebillingaccountrequest)
1823 if err != nil {
1824 return nil, err
1825 }
1826 c.urlParams_.Set("alt", alt)
1827 c.urlParams_.Set("prettyPrint", "false")
1828 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:move")
1829 urls += "?" + c.urlParams_.Encode()
1830 req, err := http.NewRequest("POST", urls, body)
1831 if err != nil {
1832 return nil, err
1833 }
1834 req.Header = reqHeaders
1835 googleapi.Expand(req.URL, map[string]string{
1836 "name": c.name,
1837 })
1838 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1839 }
1840
1841
1842
1843
1844
1845
1846 func (c *BillingAccountsMoveCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
1847 gensupport.SetOptions(c.urlParams_, opts...)
1848 res, err := c.doRequest("json")
1849 if res != nil && res.StatusCode == http.StatusNotModified {
1850 if res.Body != nil {
1851 res.Body.Close()
1852 }
1853 return nil, gensupport.WrapError(&googleapi.Error{
1854 Code: res.StatusCode,
1855 Header: res.Header,
1856 })
1857 }
1858 if err != nil {
1859 return nil, err
1860 }
1861 defer googleapi.CloseBody(res)
1862 if err := googleapi.CheckResponse(res); err != nil {
1863 return nil, gensupport.WrapError(err)
1864 }
1865 ret := &BillingAccount{
1866 ServerResponse: googleapi.ServerResponse{
1867 Header: res.Header,
1868 HTTPStatusCode: res.StatusCode,
1869 },
1870 }
1871 target := &ret
1872 if err := gensupport.DecodeResponse(target, res); err != nil {
1873 return nil, err
1874 }
1875 return ret, nil
1876 }
1877
1878 type BillingAccountsPatchCall struct {
1879 s *APIService
1880 name string
1881 billingaccount *BillingAccount
1882 urlParams_ gensupport.URLParams
1883 ctx_ context.Context
1884 header_ http.Header
1885 }
1886
1887
1888
1889
1890
1891
1892
1893
1894 func (r *BillingAccountsService) Patch(name string, billingaccount *BillingAccount) *BillingAccountsPatchCall {
1895 c := &BillingAccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1896 c.name = name
1897 c.billingaccount = billingaccount
1898 return c
1899 }
1900
1901
1902
1903 func (c *BillingAccountsPatchCall) UpdateMask(updateMask string) *BillingAccountsPatchCall {
1904 c.urlParams_.Set("updateMask", updateMask)
1905 return c
1906 }
1907
1908
1909
1910
1911 func (c *BillingAccountsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsPatchCall {
1912 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1913 return c
1914 }
1915
1916
1917 func (c *BillingAccountsPatchCall) Context(ctx context.Context) *BillingAccountsPatchCall {
1918 c.ctx_ = ctx
1919 return c
1920 }
1921
1922
1923
1924 func (c *BillingAccountsPatchCall) Header() http.Header {
1925 if c.header_ == nil {
1926 c.header_ = make(http.Header)
1927 }
1928 return c.header_
1929 }
1930
1931 func (c *BillingAccountsPatchCall) doRequest(alt string) (*http.Response, error) {
1932 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1933 var body io.Reader = nil
1934 body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount)
1935 if err != nil {
1936 return nil, err
1937 }
1938 c.urlParams_.Set("alt", alt)
1939 c.urlParams_.Set("prettyPrint", "false")
1940 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1941 urls += "?" + c.urlParams_.Encode()
1942 req, err := http.NewRequest("PATCH", urls, body)
1943 if err != nil {
1944 return nil, err
1945 }
1946 req.Header = reqHeaders
1947 googleapi.Expand(req.URL, map[string]string{
1948 "name": c.name,
1949 })
1950 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1951 }
1952
1953
1954
1955
1956
1957
1958 func (c *BillingAccountsPatchCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
1959 gensupport.SetOptions(c.urlParams_, opts...)
1960 res, err := c.doRequest("json")
1961 if res != nil && res.StatusCode == http.StatusNotModified {
1962 if res.Body != nil {
1963 res.Body.Close()
1964 }
1965 return nil, gensupport.WrapError(&googleapi.Error{
1966 Code: res.StatusCode,
1967 Header: res.Header,
1968 })
1969 }
1970 if err != nil {
1971 return nil, err
1972 }
1973 defer googleapi.CloseBody(res)
1974 if err := googleapi.CheckResponse(res); err != nil {
1975 return nil, gensupport.WrapError(err)
1976 }
1977 ret := &BillingAccount{
1978 ServerResponse: googleapi.ServerResponse{
1979 Header: res.Header,
1980 HTTPStatusCode: res.StatusCode,
1981 },
1982 }
1983 target := &ret
1984 if err := gensupport.DecodeResponse(target, res); err != nil {
1985 return nil, err
1986 }
1987 return ret, nil
1988 }
1989
1990 type BillingAccountsSetIamPolicyCall struct {
1991 s *APIService
1992 resource string
1993 setiampolicyrequest *SetIamPolicyRequest
1994 urlParams_ gensupport.URLParams
1995 ctx_ context.Context
1996 header_ http.Header
1997 }
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008 func (r *BillingAccountsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *BillingAccountsSetIamPolicyCall {
2009 c := &BillingAccountsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2010 c.resource = resource
2011 c.setiampolicyrequest = setiampolicyrequest
2012 return c
2013 }
2014
2015
2016
2017
2018 func (c *BillingAccountsSetIamPolicyCall) Fields(s ...googleapi.Field) *BillingAccountsSetIamPolicyCall {
2019 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2020 return c
2021 }
2022
2023
2024 func (c *BillingAccountsSetIamPolicyCall) Context(ctx context.Context) *BillingAccountsSetIamPolicyCall {
2025 c.ctx_ = ctx
2026 return c
2027 }
2028
2029
2030
2031 func (c *BillingAccountsSetIamPolicyCall) Header() http.Header {
2032 if c.header_ == nil {
2033 c.header_ = make(http.Header)
2034 }
2035 return c.header_
2036 }
2037
2038 func (c *BillingAccountsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2039 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2040 var body io.Reader = nil
2041 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2042 if err != nil {
2043 return nil, err
2044 }
2045 c.urlParams_.Set("alt", alt)
2046 c.urlParams_.Set("prettyPrint", "false")
2047 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
2048 urls += "?" + c.urlParams_.Encode()
2049 req, err := http.NewRequest("POST", urls, body)
2050 if err != nil {
2051 return nil, err
2052 }
2053 req.Header = reqHeaders
2054 googleapi.Expand(req.URL, map[string]string{
2055 "resource": c.resource,
2056 })
2057 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2058 }
2059
2060
2061
2062
2063
2064
2065 func (c *BillingAccountsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2066 gensupport.SetOptions(c.urlParams_, opts...)
2067 res, err := c.doRequest("json")
2068 if res != nil && res.StatusCode == http.StatusNotModified {
2069 if res.Body != nil {
2070 res.Body.Close()
2071 }
2072 return nil, gensupport.WrapError(&googleapi.Error{
2073 Code: res.StatusCode,
2074 Header: res.Header,
2075 })
2076 }
2077 if err != nil {
2078 return nil, err
2079 }
2080 defer googleapi.CloseBody(res)
2081 if err := googleapi.CheckResponse(res); err != nil {
2082 return nil, gensupport.WrapError(err)
2083 }
2084 ret := &Policy{
2085 ServerResponse: googleapi.ServerResponse{
2086 Header: res.Header,
2087 HTTPStatusCode: res.StatusCode,
2088 },
2089 }
2090 target := &ret
2091 if err := gensupport.DecodeResponse(target, res); err != nil {
2092 return nil, err
2093 }
2094 return ret, nil
2095 }
2096
2097 type BillingAccountsTestIamPermissionsCall struct {
2098 s *APIService
2099 resource string
2100 testiampermissionsrequest *TestIamPermissionsRequest
2101 urlParams_ gensupport.URLParams
2102 ctx_ context.Context
2103 header_ http.Header
2104 }
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115 func (r *BillingAccountsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *BillingAccountsTestIamPermissionsCall {
2116 c := &BillingAccountsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2117 c.resource = resource
2118 c.testiampermissionsrequest = testiampermissionsrequest
2119 return c
2120 }
2121
2122
2123
2124
2125 func (c *BillingAccountsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BillingAccountsTestIamPermissionsCall {
2126 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2127 return c
2128 }
2129
2130
2131 func (c *BillingAccountsTestIamPermissionsCall) Context(ctx context.Context) *BillingAccountsTestIamPermissionsCall {
2132 c.ctx_ = ctx
2133 return c
2134 }
2135
2136
2137
2138 func (c *BillingAccountsTestIamPermissionsCall) Header() http.Header {
2139 if c.header_ == nil {
2140 c.header_ = make(http.Header)
2141 }
2142 return c.header_
2143 }
2144
2145 func (c *BillingAccountsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2146 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2147 var body io.Reader = nil
2148 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2149 if err != nil {
2150 return nil, err
2151 }
2152 c.urlParams_.Set("alt", alt)
2153 c.urlParams_.Set("prettyPrint", "false")
2154 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
2155 urls += "?" + c.urlParams_.Encode()
2156 req, err := http.NewRequest("POST", urls, body)
2157 if err != nil {
2158 return nil, err
2159 }
2160 req.Header = reqHeaders
2161 googleapi.Expand(req.URL, map[string]string{
2162 "resource": c.resource,
2163 })
2164 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2165 }
2166
2167
2168
2169
2170
2171
2172
2173 func (c *BillingAccountsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2174 gensupport.SetOptions(c.urlParams_, opts...)
2175 res, err := c.doRequest("json")
2176 if res != nil && res.StatusCode == http.StatusNotModified {
2177 if res.Body != nil {
2178 res.Body.Close()
2179 }
2180 return nil, gensupport.WrapError(&googleapi.Error{
2181 Code: res.StatusCode,
2182 Header: res.Header,
2183 })
2184 }
2185 if err != nil {
2186 return nil, err
2187 }
2188 defer googleapi.CloseBody(res)
2189 if err := googleapi.CheckResponse(res); err != nil {
2190 return nil, gensupport.WrapError(err)
2191 }
2192 ret := &TestIamPermissionsResponse{
2193 ServerResponse: googleapi.ServerResponse{
2194 Header: res.Header,
2195 HTTPStatusCode: res.StatusCode,
2196 },
2197 }
2198 target := &ret
2199 if err := gensupport.DecodeResponse(target, res); err != nil {
2200 return nil, err
2201 }
2202 return ret, nil
2203 }
2204
2205 type BillingAccountsProjectsListCall struct {
2206 s *APIService
2207 name string
2208 urlParams_ gensupport.URLParams
2209 ifNoneMatch_ string
2210 ctx_ context.Context
2211 header_ http.Header
2212 }
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222 func (r *BillingAccountsProjectsService) List(name string) *BillingAccountsProjectsListCall {
2223 c := &BillingAccountsProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2224 c.name = name
2225 return c
2226 }
2227
2228
2229
2230 func (c *BillingAccountsProjectsListCall) PageSize(pageSize int64) *BillingAccountsProjectsListCall {
2231 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2232 return c
2233 }
2234
2235
2236
2237
2238
2239 func (c *BillingAccountsProjectsListCall) PageToken(pageToken string) *BillingAccountsProjectsListCall {
2240 c.urlParams_.Set("pageToken", pageToken)
2241 return c
2242 }
2243
2244
2245
2246
2247 func (c *BillingAccountsProjectsListCall) Fields(s ...googleapi.Field) *BillingAccountsProjectsListCall {
2248 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2249 return c
2250 }
2251
2252
2253
2254
2255 func (c *BillingAccountsProjectsListCall) IfNoneMatch(entityTag string) *BillingAccountsProjectsListCall {
2256 c.ifNoneMatch_ = entityTag
2257 return c
2258 }
2259
2260
2261 func (c *BillingAccountsProjectsListCall) Context(ctx context.Context) *BillingAccountsProjectsListCall {
2262 c.ctx_ = ctx
2263 return c
2264 }
2265
2266
2267
2268 func (c *BillingAccountsProjectsListCall) Header() http.Header {
2269 if c.header_ == nil {
2270 c.header_ = make(http.Header)
2271 }
2272 return c.header_
2273 }
2274
2275 func (c *BillingAccountsProjectsListCall) doRequest(alt string) (*http.Response, error) {
2276 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2277 if c.ifNoneMatch_ != "" {
2278 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2279 }
2280 var body io.Reader = nil
2281 c.urlParams_.Set("alt", alt)
2282 c.urlParams_.Set("prettyPrint", "false")
2283 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/projects")
2284 urls += "?" + c.urlParams_.Encode()
2285 req, err := http.NewRequest("GET", urls, body)
2286 if err != nil {
2287 return nil, err
2288 }
2289 req.Header = reqHeaders
2290 googleapi.Expand(req.URL, map[string]string{
2291 "name": c.name,
2292 })
2293 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2294 }
2295
2296
2297
2298
2299
2300
2301
2302 func (c *BillingAccountsProjectsListCall) Do(opts ...googleapi.CallOption) (*ListProjectBillingInfoResponse, error) {
2303 gensupport.SetOptions(c.urlParams_, opts...)
2304 res, err := c.doRequest("json")
2305 if res != nil && res.StatusCode == http.StatusNotModified {
2306 if res.Body != nil {
2307 res.Body.Close()
2308 }
2309 return nil, gensupport.WrapError(&googleapi.Error{
2310 Code: res.StatusCode,
2311 Header: res.Header,
2312 })
2313 }
2314 if err != nil {
2315 return nil, err
2316 }
2317 defer googleapi.CloseBody(res)
2318 if err := googleapi.CheckResponse(res); err != nil {
2319 return nil, gensupport.WrapError(err)
2320 }
2321 ret := &ListProjectBillingInfoResponse{
2322 ServerResponse: googleapi.ServerResponse{
2323 Header: res.Header,
2324 HTTPStatusCode: res.StatusCode,
2325 },
2326 }
2327 target := &ret
2328 if err := gensupport.DecodeResponse(target, res); err != nil {
2329 return nil, err
2330 }
2331 return ret, nil
2332 }
2333
2334
2335
2336
2337 func (c *BillingAccountsProjectsListCall) Pages(ctx context.Context, f func(*ListProjectBillingInfoResponse) error) error {
2338 c.ctx_ = ctx
2339 defer c.PageToken(c.urlParams_.Get("pageToken"))
2340 for {
2341 x, err := c.Do()
2342 if err != nil {
2343 return err
2344 }
2345 if err := f(x); err != nil {
2346 return err
2347 }
2348 if x.NextPageToken == "" {
2349 return nil
2350 }
2351 c.PageToken(x.NextPageToken)
2352 }
2353 }
2354
2355 type BillingAccountsSubAccountsCreateCall struct {
2356 s *APIService
2357 parent string
2358 billingaccount *BillingAccount
2359 urlParams_ gensupport.URLParams
2360 ctx_ context.Context
2361 header_ http.Header
2362 }
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380 func (r *BillingAccountsSubAccountsService) Create(parent string, billingaccount *BillingAccount) *BillingAccountsSubAccountsCreateCall {
2381 c := &BillingAccountsSubAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2382 c.parent = parent
2383 c.billingaccount = billingaccount
2384 return c
2385 }
2386
2387
2388
2389
2390 func (c *BillingAccountsSubAccountsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsSubAccountsCreateCall {
2391 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2392 return c
2393 }
2394
2395
2396 func (c *BillingAccountsSubAccountsCreateCall) Context(ctx context.Context) *BillingAccountsSubAccountsCreateCall {
2397 c.ctx_ = ctx
2398 return c
2399 }
2400
2401
2402
2403 func (c *BillingAccountsSubAccountsCreateCall) Header() http.Header {
2404 if c.header_ == nil {
2405 c.header_ = make(http.Header)
2406 }
2407 return c.header_
2408 }
2409
2410 func (c *BillingAccountsSubAccountsCreateCall) doRequest(alt string) (*http.Response, error) {
2411 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2412 var body io.Reader = nil
2413 body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount)
2414 if err != nil {
2415 return nil, err
2416 }
2417 c.urlParams_.Set("alt", alt)
2418 c.urlParams_.Set("prettyPrint", "false")
2419 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subAccounts")
2420 urls += "?" + c.urlParams_.Encode()
2421 req, err := http.NewRequest("POST", urls, body)
2422 if err != nil {
2423 return nil, err
2424 }
2425 req.Header = reqHeaders
2426 googleapi.Expand(req.URL, map[string]string{
2427 "parent": c.parent,
2428 })
2429 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2430 }
2431
2432
2433
2434
2435
2436
2437 func (c *BillingAccountsSubAccountsCreateCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
2438 gensupport.SetOptions(c.urlParams_, opts...)
2439 res, err := c.doRequest("json")
2440 if res != nil && res.StatusCode == http.StatusNotModified {
2441 if res.Body != nil {
2442 res.Body.Close()
2443 }
2444 return nil, gensupport.WrapError(&googleapi.Error{
2445 Code: res.StatusCode,
2446 Header: res.Header,
2447 })
2448 }
2449 if err != nil {
2450 return nil, err
2451 }
2452 defer googleapi.CloseBody(res)
2453 if err := googleapi.CheckResponse(res); err != nil {
2454 return nil, gensupport.WrapError(err)
2455 }
2456 ret := &BillingAccount{
2457 ServerResponse: googleapi.ServerResponse{
2458 Header: res.Header,
2459 HTTPStatusCode: res.StatusCode,
2460 },
2461 }
2462 target := &ret
2463 if err := gensupport.DecodeResponse(target, res); err != nil {
2464 return nil, err
2465 }
2466 return ret, nil
2467 }
2468
2469 type BillingAccountsSubAccountsListCall struct {
2470 s *APIService
2471 parent string
2472 urlParams_ gensupport.URLParams
2473 ifNoneMatch_ string
2474 ctx_ context.Context
2475 header_ http.Header
2476 }
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486 func (r *BillingAccountsSubAccountsService) List(parent string) *BillingAccountsSubAccountsListCall {
2487 c := &BillingAccountsSubAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2488 c.parent = parent
2489 return c
2490 }
2491
2492
2493
2494
2495
2496
2497
2498 func (c *BillingAccountsSubAccountsListCall) Filter(filter string) *BillingAccountsSubAccountsListCall {
2499 c.urlParams_.Set("filter", filter)
2500 return c
2501 }
2502
2503
2504
2505 func (c *BillingAccountsSubAccountsListCall) PageSize(pageSize int64) *BillingAccountsSubAccountsListCall {
2506 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2507 return c
2508 }
2509
2510
2511
2512
2513
2514 func (c *BillingAccountsSubAccountsListCall) PageToken(pageToken string) *BillingAccountsSubAccountsListCall {
2515 c.urlParams_.Set("pageToken", pageToken)
2516 return c
2517 }
2518
2519
2520
2521
2522 func (c *BillingAccountsSubAccountsListCall) Fields(s ...googleapi.Field) *BillingAccountsSubAccountsListCall {
2523 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2524 return c
2525 }
2526
2527
2528
2529
2530 func (c *BillingAccountsSubAccountsListCall) IfNoneMatch(entityTag string) *BillingAccountsSubAccountsListCall {
2531 c.ifNoneMatch_ = entityTag
2532 return c
2533 }
2534
2535
2536 func (c *BillingAccountsSubAccountsListCall) Context(ctx context.Context) *BillingAccountsSubAccountsListCall {
2537 c.ctx_ = ctx
2538 return c
2539 }
2540
2541
2542
2543 func (c *BillingAccountsSubAccountsListCall) Header() http.Header {
2544 if c.header_ == nil {
2545 c.header_ = make(http.Header)
2546 }
2547 return c.header_
2548 }
2549
2550 func (c *BillingAccountsSubAccountsListCall) doRequest(alt string) (*http.Response, error) {
2551 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2552 if c.ifNoneMatch_ != "" {
2553 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2554 }
2555 var body io.Reader = nil
2556 c.urlParams_.Set("alt", alt)
2557 c.urlParams_.Set("prettyPrint", "false")
2558 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subAccounts")
2559 urls += "?" + c.urlParams_.Encode()
2560 req, err := http.NewRequest("GET", urls, body)
2561 if err != nil {
2562 return nil, err
2563 }
2564 req.Header = reqHeaders
2565 googleapi.Expand(req.URL, map[string]string{
2566 "parent": c.parent,
2567 })
2568 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2569 }
2570
2571
2572
2573
2574
2575
2576
2577 func (c *BillingAccountsSubAccountsListCall) Do(opts ...googleapi.CallOption) (*ListBillingAccountsResponse, error) {
2578 gensupport.SetOptions(c.urlParams_, opts...)
2579 res, err := c.doRequest("json")
2580 if res != nil && res.StatusCode == http.StatusNotModified {
2581 if res.Body != nil {
2582 res.Body.Close()
2583 }
2584 return nil, gensupport.WrapError(&googleapi.Error{
2585 Code: res.StatusCode,
2586 Header: res.Header,
2587 })
2588 }
2589 if err != nil {
2590 return nil, err
2591 }
2592 defer googleapi.CloseBody(res)
2593 if err := googleapi.CheckResponse(res); err != nil {
2594 return nil, gensupport.WrapError(err)
2595 }
2596 ret := &ListBillingAccountsResponse{
2597 ServerResponse: googleapi.ServerResponse{
2598 Header: res.Header,
2599 HTTPStatusCode: res.StatusCode,
2600 },
2601 }
2602 target := &ret
2603 if err := gensupport.DecodeResponse(target, res); err != nil {
2604 return nil, err
2605 }
2606 return ret, nil
2607 }
2608
2609
2610
2611
2612 func (c *BillingAccountsSubAccountsListCall) Pages(ctx context.Context, f func(*ListBillingAccountsResponse) error) error {
2613 c.ctx_ = ctx
2614 defer c.PageToken(c.urlParams_.Get("pageToken"))
2615 for {
2616 x, err := c.Do()
2617 if err != nil {
2618 return err
2619 }
2620 if err := f(x); err != nil {
2621 return err
2622 }
2623 if x.NextPageToken == "" {
2624 return nil
2625 }
2626 c.PageToken(x.NextPageToken)
2627 }
2628 }
2629
2630 type OrganizationsBillingAccountsCreateCall struct {
2631 s *APIService
2632 parent string
2633 billingaccount *BillingAccount
2634 urlParams_ gensupport.URLParams
2635 ctx_ context.Context
2636 header_ http.Header
2637 }
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655 func (r *OrganizationsBillingAccountsService) Create(parent string, billingaccount *BillingAccount) *OrganizationsBillingAccountsCreateCall {
2656 c := &OrganizationsBillingAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2657 c.parent = parent
2658 c.billingaccount = billingaccount
2659 return c
2660 }
2661
2662
2663
2664
2665 func (c *OrganizationsBillingAccountsCreateCall) Fields(s ...googleapi.Field) *OrganizationsBillingAccountsCreateCall {
2666 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2667 return c
2668 }
2669
2670
2671 func (c *OrganizationsBillingAccountsCreateCall) Context(ctx context.Context) *OrganizationsBillingAccountsCreateCall {
2672 c.ctx_ = ctx
2673 return c
2674 }
2675
2676
2677
2678 func (c *OrganizationsBillingAccountsCreateCall) Header() http.Header {
2679 if c.header_ == nil {
2680 c.header_ = make(http.Header)
2681 }
2682 return c.header_
2683 }
2684
2685 func (c *OrganizationsBillingAccountsCreateCall) doRequest(alt string) (*http.Response, error) {
2686 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2687 var body io.Reader = nil
2688 body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount)
2689 if err != nil {
2690 return nil, err
2691 }
2692 c.urlParams_.Set("alt", alt)
2693 c.urlParams_.Set("prettyPrint", "false")
2694 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/billingAccounts")
2695 urls += "?" + c.urlParams_.Encode()
2696 req, err := http.NewRequest("POST", urls, body)
2697 if err != nil {
2698 return nil, err
2699 }
2700 req.Header = reqHeaders
2701 googleapi.Expand(req.URL, map[string]string{
2702 "parent": c.parent,
2703 })
2704 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2705 }
2706
2707
2708
2709
2710
2711
2712 func (c *OrganizationsBillingAccountsCreateCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
2713 gensupport.SetOptions(c.urlParams_, opts...)
2714 res, err := c.doRequest("json")
2715 if res != nil && res.StatusCode == http.StatusNotModified {
2716 if res.Body != nil {
2717 res.Body.Close()
2718 }
2719 return nil, gensupport.WrapError(&googleapi.Error{
2720 Code: res.StatusCode,
2721 Header: res.Header,
2722 })
2723 }
2724 if err != nil {
2725 return nil, err
2726 }
2727 defer googleapi.CloseBody(res)
2728 if err := googleapi.CheckResponse(res); err != nil {
2729 return nil, gensupport.WrapError(err)
2730 }
2731 ret := &BillingAccount{
2732 ServerResponse: googleapi.ServerResponse{
2733 Header: res.Header,
2734 HTTPStatusCode: res.StatusCode,
2735 },
2736 }
2737 target := &ret
2738 if err := gensupport.DecodeResponse(target, res); err != nil {
2739 return nil, err
2740 }
2741 return ret, nil
2742 }
2743
2744 type OrganizationsBillingAccountsListCall struct {
2745 s *APIService
2746 parent string
2747 urlParams_ gensupport.URLParams
2748 ifNoneMatch_ string
2749 ctx_ context.Context
2750 header_ http.Header
2751 }
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761 func (r *OrganizationsBillingAccountsService) List(parent string) *OrganizationsBillingAccountsListCall {
2762 c := &OrganizationsBillingAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2763 c.parent = parent
2764 return c
2765 }
2766
2767
2768
2769
2770
2771
2772
2773 func (c *OrganizationsBillingAccountsListCall) Filter(filter string) *OrganizationsBillingAccountsListCall {
2774 c.urlParams_.Set("filter", filter)
2775 return c
2776 }
2777
2778
2779
2780 func (c *OrganizationsBillingAccountsListCall) PageSize(pageSize int64) *OrganizationsBillingAccountsListCall {
2781 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2782 return c
2783 }
2784
2785
2786
2787
2788
2789 func (c *OrganizationsBillingAccountsListCall) PageToken(pageToken string) *OrganizationsBillingAccountsListCall {
2790 c.urlParams_.Set("pageToken", pageToken)
2791 return c
2792 }
2793
2794
2795
2796
2797 func (c *OrganizationsBillingAccountsListCall) Fields(s ...googleapi.Field) *OrganizationsBillingAccountsListCall {
2798 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2799 return c
2800 }
2801
2802
2803
2804
2805 func (c *OrganizationsBillingAccountsListCall) IfNoneMatch(entityTag string) *OrganizationsBillingAccountsListCall {
2806 c.ifNoneMatch_ = entityTag
2807 return c
2808 }
2809
2810
2811 func (c *OrganizationsBillingAccountsListCall) Context(ctx context.Context) *OrganizationsBillingAccountsListCall {
2812 c.ctx_ = ctx
2813 return c
2814 }
2815
2816
2817
2818 func (c *OrganizationsBillingAccountsListCall) Header() http.Header {
2819 if c.header_ == nil {
2820 c.header_ = make(http.Header)
2821 }
2822 return c.header_
2823 }
2824
2825 func (c *OrganizationsBillingAccountsListCall) doRequest(alt string) (*http.Response, error) {
2826 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2827 if c.ifNoneMatch_ != "" {
2828 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2829 }
2830 var body io.Reader = nil
2831 c.urlParams_.Set("alt", alt)
2832 c.urlParams_.Set("prettyPrint", "false")
2833 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/billingAccounts")
2834 urls += "?" + c.urlParams_.Encode()
2835 req, err := http.NewRequest("GET", urls, body)
2836 if err != nil {
2837 return nil, err
2838 }
2839 req.Header = reqHeaders
2840 googleapi.Expand(req.URL, map[string]string{
2841 "parent": c.parent,
2842 })
2843 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2844 }
2845
2846
2847
2848
2849
2850
2851
2852 func (c *OrganizationsBillingAccountsListCall) Do(opts ...googleapi.CallOption) (*ListBillingAccountsResponse, error) {
2853 gensupport.SetOptions(c.urlParams_, opts...)
2854 res, err := c.doRequest("json")
2855 if res != nil && res.StatusCode == http.StatusNotModified {
2856 if res.Body != nil {
2857 res.Body.Close()
2858 }
2859 return nil, gensupport.WrapError(&googleapi.Error{
2860 Code: res.StatusCode,
2861 Header: res.Header,
2862 })
2863 }
2864 if err != nil {
2865 return nil, err
2866 }
2867 defer googleapi.CloseBody(res)
2868 if err := googleapi.CheckResponse(res); err != nil {
2869 return nil, gensupport.WrapError(err)
2870 }
2871 ret := &ListBillingAccountsResponse{
2872 ServerResponse: googleapi.ServerResponse{
2873 Header: res.Header,
2874 HTTPStatusCode: res.StatusCode,
2875 },
2876 }
2877 target := &ret
2878 if err := gensupport.DecodeResponse(target, res); err != nil {
2879 return nil, err
2880 }
2881 return ret, nil
2882 }
2883
2884
2885
2886
2887 func (c *OrganizationsBillingAccountsListCall) Pages(ctx context.Context, f func(*ListBillingAccountsResponse) error) error {
2888 c.ctx_ = ctx
2889 defer c.PageToken(c.urlParams_.Get("pageToken"))
2890 for {
2891 x, err := c.Do()
2892 if err != nil {
2893 return err
2894 }
2895 if err := f(x); err != nil {
2896 return err
2897 }
2898 if x.NextPageToken == "" {
2899 return nil
2900 }
2901 c.PageToken(x.NextPageToken)
2902 }
2903 }
2904
2905 type OrganizationsBillingAccountsMoveCall struct {
2906 s *APIService
2907 destinationParent string
2908 name string
2909 urlParams_ gensupport.URLParams
2910 ifNoneMatch_ string
2911 ctx_ context.Context
2912 header_ http.Header
2913 }
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924 func (r *OrganizationsBillingAccountsService) Move(destinationParent string, name string) *OrganizationsBillingAccountsMoveCall {
2925 c := &OrganizationsBillingAccountsMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2926 c.destinationParent = destinationParent
2927 c.name = name
2928 return c
2929 }
2930
2931
2932
2933
2934 func (c *OrganizationsBillingAccountsMoveCall) Fields(s ...googleapi.Field) *OrganizationsBillingAccountsMoveCall {
2935 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2936 return c
2937 }
2938
2939
2940
2941
2942 func (c *OrganizationsBillingAccountsMoveCall) IfNoneMatch(entityTag string) *OrganizationsBillingAccountsMoveCall {
2943 c.ifNoneMatch_ = entityTag
2944 return c
2945 }
2946
2947
2948 func (c *OrganizationsBillingAccountsMoveCall) Context(ctx context.Context) *OrganizationsBillingAccountsMoveCall {
2949 c.ctx_ = ctx
2950 return c
2951 }
2952
2953
2954
2955 func (c *OrganizationsBillingAccountsMoveCall) Header() http.Header {
2956 if c.header_ == nil {
2957 c.header_ = make(http.Header)
2958 }
2959 return c.header_
2960 }
2961
2962 func (c *OrganizationsBillingAccountsMoveCall) doRequest(alt string) (*http.Response, error) {
2963 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2964 if c.ifNoneMatch_ != "" {
2965 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2966 }
2967 var body io.Reader = nil
2968 c.urlParams_.Set("alt", alt)
2969 c.urlParams_.Set("prettyPrint", "false")
2970 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+destinationParent}/{+name}:move")
2971 urls += "?" + c.urlParams_.Encode()
2972 req, err := http.NewRequest("GET", urls, body)
2973 if err != nil {
2974 return nil, err
2975 }
2976 req.Header = reqHeaders
2977 googleapi.Expand(req.URL, map[string]string{
2978 "destinationParent": c.destinationParent,
2979 "name": c.name,
2980 })
2981 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2982 }
2983
2984
2985
2986
2987
2988
2989 func (c *OrganizationsBillingAccountsMoveCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
2990 gensupport.SetOptions(c.urlParams_, opts...)
2991 res, err := c.doRequest("json")
2992 if res != nil && res.StatusCode == http.StatusNotModified {
2993 if res.Body != nil {
2994 res.Body.Close()
2995 }
2996 return nil, gensupport.WrapError(&googleapi.Error{
2997 Code: res.StatusCode,
2998 Header: res.Header,
2999 })
3000 }
3001 if err != nil {
3002 return nil, err
3003 }
3004 defer googleapi.CloseBody(res)
3005 if err := googleapi.CheckResponse(res); err != nil {
3006 return nil, gensupport.WrapError(err)
3007 }
3008 ret := &BillingAccount{
3009 ServerResponse: googleapi.ServerResponse{
3010 Header: res.Header,
3011 HTTPStatusCode: res.StatusCode,
3012 },
3013 }
3014 target := &ret
3015 if err := gensupport.DecodeResponse(target, res); err != nil {
3016 return nil, err
3017 }
3018 return ret, nil
3019 }
3020
3021 type ProjectsGetBillingInfoCall struct {
3022 s *APIService
3023 name string
3024 urlParams_ gensupport.URLParams
3025 ifNoneMatch_ string
3026 ctx_ context.Context
3027 header_ http.Header
3028 }
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038 func (r *ProjectsService) GetBillingInfo(name string) *ProjectsGetBillingInfoCall {
3039 c := &ProjectsGetBillingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3040 c.name = name
3041 return c
3042 }
3043
3044
3045
3046
3047 func (c *ProjectsGetBillingInfoCall) Fields(s ...googleapi.Field) *ProjectsGetBillingInfoCall {
3048 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3049 return c
3050 }
3051
3052
3053
3054
3055 func (c *ProjectsGetBillingInfoCall) IfNoneMatch(entityTag string) *ProjectsGetBillingInfoCall {
3056 c.ifNoneMatch_ = entityTag
3057 return c
3058 }
3059
3060
3061 func (c *ProjectsGetBillingInfoCall) Context(ctx context.Context) *ProjectsGetBillingInfoCall {
3062 c.ctx_ = ctx
3063 return c
3064 }
3065
3066
3067
3068 func (c *ProjectsGetBillingInfoCall) Header() http.Header {
3069 if c.header_ == nil {
3070 c.header_ = make(http.Header)
3071 }
3072 return c.header_
3073 }
3074
3075 func (c *ProjectsGetBillingInfoCall) doRequest(alt string) (*http.Response, error) {
3076 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3077 if c.ifNoneMatch_ != "" {
3078 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3079 }
3080 var body io.Reader = nil
3081 c.urlParams_.Set("alt", alt)
3082 c.urlParams_.Set("prettyPrint", "false")
3083 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/billingInfo")
3084 urls += "?" + c.urlParams_.Encode()
3085 req, err := http.NewRequest("GET", urls, body)
3086 if err != nil {
3087 return nil, err
3088 }
3089 req.Header = reqHeaders
3090 googleapi.Expand(req.URL, map[string]string{
3091 "name": c.name,
3092 })
3093 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3094 }
3095
3096
3097
3098
3099
3100
3101
3102 func (c *ProjectsGetBillingInfoCall) Do(opts ...googleapi.CallOption) (*ProjectBillingInfo, error) {
3103 gensupport.SetOptions(c.urlParams_, opts...)
3104 res, err := c.doRequest("json")
3105 if res != nil && res.StatusCode == http.StatusNotModified {
3106 if res.Body != nil {
3107 res.Body.Close()
3108 }
3109 return nil, gensupport.WrapError(&googleapi.Error{
3110 Code: res.StatusCode,
3111 Header: res.Header,
3112 })
3113 }
3114 if err != nil {
3115 return nil, err
3116 }
3117 defer googleapi.CloseBody(res)
3118 if err := googleapi.CheckResponse(res); err != nil {
3119 return nil, gensupport.WrapError(err)
3120 }
3121 ret := &ProjectBillingInfo{
3122 ServerResponse: googleapi.ServerResponse{
3123 Header: res.Header,
3124 HTTPStatusCode: res.StatusCode,
3125 },
3126 }
3127 target := &ret
3128 if err := gensupport.DecodeResponse(target, res); err != nil {
3129 return nil, err
3130 }
3131 return ret, nil
3132 }
3133
3134 type ProjectsUpdateBillingInfoCall struct {
3135 s *APIService
3136 name string
3137 projectbillinginfo *ProjectBillingInfo
3138 urlParams_ gensupport.URLParams
3139 ctx_ context.Context
3140 header_ http.Header
3141 }
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172 func (r *ProjectsService) UpdateBillingInfo(name string, projectbillinginfo *ProjectBillingInfo) *ProjectsUpdateBillingInfoCall {
3173 c := &ProjectsUpdateBillingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3174 c.name = name
3175 c.projectbillinginfo = projectbillinginfo
3176 return c
3177 }
3178
3179
3180
3181
3182 func (c *ProjectsUpdateBillingInfoCall) Fields(s ...googleapi.Field) *ProjectsUpdateBillingInfoCall {
3183 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3184 return c
3185 }
3186
3187
3188 func (c *ProjectsUpdateBillingInfoCall) Context(ctx context.Context) *ProjectsUpdateBillingInfoCall {
3189 c.ctx_ = ctx
3190 return c
3191 }
3192
3193
3194
3195 func (c *ProjectsUpdateBillingInfoCall) Header() http.Header {
3196 if c.header_ == nil {
3197 c.header_ = make(http.Header)
3198 }
3199 return c.header_
3200 }
3201
3202 func (c *ProjectsUpdateBillingInfoCall) doRequest(alt string) (*http.Response, error) {
3203 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3204 var body io.Reader = nil
3205 body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectbillinginfo)
3206 if err != nil {
3207 return nil, err
3208 }
3209 c.urlParams_.Set("alt", alt)
3210 c.urlParams_.Set("prettyPrint", "false")
3211 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/billingInfo")
3212 urls += "?" + c.urlParams_.Encode()
3213 req, err := http.NewRequest("PUT", urls, body)
3214 if err != nil {
3215 return nil, err
3216 }
3217 req.Header = reqHeaders
3218 googleapi.Expand(req.URL, map[string]string{
3219 "name": c.name,
3220 })
3221 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3222 }
3223
3224
3225
3226
3227
3228
3229
3230 func (c *ProjectsUpdateBillingInfoCall) Do(opts ...googleapi.CallOption) (*ProjectBillingInfo, error) {
3231 gensupport.SetOptions(c.urlParams_, opts...)
3232 res, err := c.doRequest("json")
3233 if res != nil && res.StatusCode == http.StatusNotModified {
3234 if res.Body != nil {
3235 res.Body.Close()
3236 }
3237 return nil, gensupport.WrapError(&googleapi.Error{
3238 Code: res.StatusCode,
3239 Header: res.Header,
3240 })
3241 }
3242 if err != nil {
3243 return nil, err
3244 }
3245 defer googleapi.CloseBody(res)
3246 if err := googleapi.CheckResponse(res); err != nil {
3247 return nil, gensupport.WrapError(err)
3248 }
3249 ret := &ProjectBillingInfo{
3250 ServerResponse: googleapi.ServerResponse{
3251 Header: res.Header,
3252 HTTPStatusCode: res.StatusCode,
3253 },
3254 }
3255 target := &ret
3256 if err := gensupport.DecodeResponse(target, res); err != nil {
3257 return nil, err
3258 }
3259 return ret, nil
3260 }
3261
3262 type ServicesListCall struct {
3263 s *APIService
3264 urlParams_ gensupport.URLParams
3265 ifNoneMatch_ string
3266 ctx_ context.Context
3267 header_ http.Header
3268 }
3269
3270
3271 func (r *ServicesService) List() *ServicesListCall {
3272 c := &ServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3273 return c
3274 }
3275
3276
3277
3278 func (c *ServicesListCall) PageSize(pageSize int64) *ServicesListCall {
3279 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3280 return c
3281 }
3282
3283
3284
3285
3286
3287 func (c *ServicesListCall) PageToken(pageToken string) *ServicesListCall {
3288 c.urlParams_.Set("pageToken", pageToken)
3289 return c
3290 }
3291
3292
3293
3294
3295 func (c *ServicesListCall) Fields(s ...googleapi.Field) *ServicesListCall {
3296 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3297 return c
3298 }
3299
3300
3301
3302
3303 func (c *ServicesListCall) IfNoneMatch(entityTag string) *ServicesListCall {
3304 c.ifNoneMatch_ = entityTag
3305 return c
3306 }
3307
3308
3309 func (c *ServicesListCall) Context(ctx context.Context) *ServicesListCall {
3310 c.ctx_ = ctx
3311 return c
3312 }
3313
3314
3315
3316 func (c *ServicesListCall) Header() http.Header {
3317 if c.header_ == nil {
3318 c.header_ = make(http.Header)
3319 }
3320 return c.header_
3321 }
3322
3323 func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) {
3324 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3325 if c.ifNoneMatch_ != "" {
3326 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3327 }
3328 var body io.Reader = nil
3329 c.urlParams_.Set("alt", alt)
3330 c.urlParams_.Set("prettyPrint", "false")
3331 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services")
3332 urls += "?" + c.urlParams_.Encode()
3333 req, err := http.NewRequest("GET", urls, body)
3334 if err != nil {
3335 return nil, err
3336 }
3337 req.Header = reqHeaders
3338 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3339 }
3340
3341
3342
3343
3344
3345
3346
3347 func (c *ServicesListCall) Do(opts ...googleapi.CallOption) (*ListServicesResponse, error) {
3348 gensupport.SetOptions(c.urlParams_, opts...)
3349 res, err := c.doRequest("json")
3350 if res != nil && res.StatusCode == http.StatusNotModified {
3351 if res.Body != nil {
3352 res.Body.Close()
3353 }
3354 return nil, gensupport.WrapError(&googleapi.Error{
3355 Code: res.StatusCode,
3356 Header: res.Header,
3357 })
3358 }
3359 if err != nil {
3360 return nil, err
3361 }
3362 defer googleapi.CloseBody(res)
3363 if err := googleapi.CheckResponse(res); err != nil {
3364 return nil, gensupport.WrapError(err)
3365 }
3366 ret := &ListServicesResponse{
3367 ServerResponse: googleapi.ServerResponse{
3368 Header: res.Header,
3369 HTTPStatusCode: res.StatusCode,
3370 },
3371 }
3372 target := &ret
3373 if err := gensupport.DecodeResponse(target, res); err != nil {
3374 return nil, err
3375 }
3376 return ret, nil
3377 }
3378
3379
3380
3381
3382 func (c *ServicesListCall) Pages(ctx context.Context, f func(*ListServicesResponse) error) error {
3383 c.ctx_ = ctx
3384 defer c.PageToken(c.urlParams_.Get("pageToken"))
3385 for {
3386 x, err := c.Do()
3387 if err != nil {
3388 return err
3389 }
3390 if err := f(x); err != nil {
3391 return err
3392 }
3393 if x.NextPageToken == "" {
3394 return nil
3395 }
3396 c.PageToken(x.NextPageToken)
3397 }
3398 }
3399
3400 type ServicesSkusListCall struct {
3401 s *APIService
3402 parent string
3403 urlParams_ gensupport.URLParams
3404 ifNoneMatch_ string
3405 ctx_ context.Context
3406 header_ http.Header
3407 }
3408
3409
3410
3411
3412 func (r *ServicesSkusService) List(parent string) *ServicesSkusListCall {
3413 c := &ServicesSkusListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3414 c.parent = parent
3415 return c
3416 }
3417
3418
3419
3420
3421 func (c *ServicesSkusListCall) CurrencyCode(currencyCode string) *ServicesSkusListCall {
3422 c.urlParams_.Set("currencyCode", currencyCode)
3423 return c
3424 }
3425
3426
3427
3428
3429
3430
3431
3432 func (c *ServicesSkusListCall) EndTime(endTime string) *ServicesSkusListCall {
3433 c.urlParams_.Set("endTime", endTime)
3434 return c
3435 }
3436
3437
3438
3439 func (c *ServicesSkusListCall) PageSize(pageSize int64) *ServicesSkusListCall {
3440 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3441 return c
3442 }
3443
3444
3445
3446
3447
3448 func (c *ServicesSkusListCall) PageToken(pageToken string) *ServicesSkusListCall {
3449 c.urlParams_.Set("pageToken", pageToken)
3450 return c
3451 }
3452
3453
3454
3455
3456
3457
3458
3459 func (c *ServicesSkusListCall) StartTime(startTime string) *ServicesSkusListCall {
3460 c.urlParams_.Set("startTime", startTime)
3461 return c
3462 }
3463
3464
3465
3466
3467 func (c *ServicesSkusListCall) Fields(s ...googleapi.Field) *ServicesSkusListCall {
3468 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3469 return c
3470 }
3471
3472
3473
3474
3475 func (c *ServicesSkusListCall) IfNoneMatch(entityTag string) *ServicesSkusListCall {
3476 c.ifNoneMatch_ = entityTag
3477 return c
3478 }
3479
3480
3481 func (c *ServicesSkusListCall) Context(ctx context.Context) *ServicesSkusListCall {
3482 c.ctx_ = ctx
3483 return c
3484 }
3485
3486
3487
3488 func (c *ServicesSkusListCall) Header() http.Header {
3489 if c.header_ == nil {
3490 c.header_ = make(http.Header)
3491 }
3492 return c.header_
3493 }
3494
3495 func (c *ServicesSkusListCall) doRequest(alt string) (*http.Response, error) {
3496 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3497 if c.ifNoneMatch_ != "" {
3498 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3499 }
3500 var body io.Reader = nil
3501 c.urlParams_.Set("alt", alt)
3502 c.urlParams_.Set("prettyPrint", "false")
3503 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/skus")
3504 urls += "?" + c.urlParams_.Encode()
3505 req, err := http.NewRequest("GET", urls, body)
3506 if err != nil {
3507 return nil, err
3508 }
3509 req.Header = reqHeaders
3510 googleapi.Expand(req.URL, map[string]string{
3511 "parent": c.parent,
3512 })
3513 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3514 }
3515
3516
3517
3518
3519
3520
3521
3522 func (c *ServicesSkusListCall) Do(opts ...googleapi.CallOption) (*ListSkusResponse, error) {
3523 gensupport.SetOptions(c.urlParams_, opts...)
3524 res, err := c.doRequest("json")
3525 if res != nil && res.StatusCode == http.StatusNotModified {
3526 if res.Body != nil {
3527 res.Body.Close()
3528 }
3529 return nil, gensupport.WrapError(&googleapi.Error{
3530 Code: res.StatusCode,
3531 Header: res.Header,
3532 })
3533 }
3534 if err != nil {
3535 return nil, err
3536 }
3537 defer googleapi.CloseBody(res)
3538 if err := googleapi.CheckResponse(res); err != nil {
3539 return nil, gensupport.WrapError(err)
3540 }
3541 ret := &ListSkusResponse{
3542 ServerResponse: googleapi.ServerResponse{
3543 Header: res.Header,
3544 HTTPStatusCode: res.StatusCode,
3545 },
3546 }
3547 target := &ret
3548 if err := gensupport.DecodeResponse(target, res); err != nil {
3549 return nil, err
3550 }
3551 return ret, nil
3552 }
3553
3554
3555
3556
3557 func (c *ServicesSkusListCall) Pages(ctx context.Context, f func(*ListSkusResponse) error) error {
3558 c.ctx_ = ctx
3559 defer c.PageToken(c.urlParams_.Get("pageToken"))
3560 for {
3561 x, err := c.Do()
3562 if err != nil {
3563 return err
3564 }
3565 if err := f(x); err != nil {
3566 return err
3567 }
3568 if x.NextPageToken == "" {
3569 return nil
3570 }
3571 c.PageToken(x.NextPageToken)
3572 }
3573 }
3574
View as plain text