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