/
cloud_channel_client.go
3694 lines (3419 loc) · 146 KB
/
cloud_channel_client.go
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
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
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
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
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package channel
import (
"context"
"fmt"
"math"
"net/url"
"time"
"cloud.google.com/go/longrunning"
lroauto "cloud.google.com/go/longrunning/autogen"
"github.com/golang/protobuf/proto"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
gtransport "google.golang.org/api/transport/grpc"
channelpb "google.golang.org/genproto/googleapis/cloud/channel/v1"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
)
var newCloudChannelClientHook clientHook
// CloudChannelCallOptions contains the retry settings for each method of CloudChannelClient.
type CloudChannelCallOptions struct {
ListCustomers []gax.CallOption
GetCustomer []gax.CallOption
CheckCloudIdentityAccountsExist []gax.CallOption
CreateCustomer []gax.CallOption
UpdateCustomer []gax.CallOption
DeleteCustomer []gax.CallOption
ProvisionCloudIdentity []gax.CallOption
ListEntitlements []gax.CallOption
ListTransferableSkus []gax.CallOption
ListTransferableOffers []gax.CallOption
GetEntitlement []gax.CallOption
CreateEntitlement []gax.CallOption
ChangeParameters []gax.CallOption
ChangeRenewalSettings []gax.CallOption
ChangeOffer []gax.CallOption
StartPaidService []gax.CallOption
SuspendEntitlement []gax.CallOption
CancelEntitlement []gax.CallOption
ActivateEntitlement []gax.CallOption
TransferEntitlements []gax.CallOption
TransferEntitlementsToGoogle []gax.CallOption
ListChannelPartnerLinks []gax.CallOption
GetChannelPartnerLink []gax.CallOption
CreateChannelPartnerLink []gax.CallOption
UpdateChannelPartnerLink []gax.CallOption
LookupOffer []gax.CallOption
ListProducts []gax.CallOption
ListSkus []gax.CallOption
ListOffers []gax.CallOption
ListPurchasableSkus []gax.CallOption
ListPurchasableOffers []gax.CallOption
RegisterSubscriber []gax.CallOption
UnregisterSubscriber []gax.CallOption
ListSubscribers []gax.CallOption
}
func defaultCloudChannelGRPCClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("cloudchannel.googleapis.com:443"),
internaloption.WithDefaultMTLSEndpoint("cloudchannel.mtls.googleapis.com:443"),
internaloption.WithDefaultAudience("https://cloudchannel.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
}
func defaultCloudChannelCallOptions() *CloudChannelCallOptions {
return &CloudChannelCallOptions{
ListCustomers: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
GetCustomer: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
CheckCloudIdentityAccountsExist: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
CreateCustomer: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
UpdateCustomer: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
DeleteCustomer: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
ProvisionCloudIdentity: []gax.CallOption{},
ListEntitlements: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
ListTransferableSkus: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
ListTransferableOffers: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
GetEntitlement: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
CreateEntitlement: []gax.CallOption{},
ChangeParameters: []gax.CallOption{},
ChangeRenewalSettings: []gax.CallOption{},
ChangeOffer: []gax.CallOption{},
StartPaidService: []gax.CallOption{},
SuspendEntitlement: []gax.CallOption{},
CancelEntitlement: []gax.CallOption{},
ActivateEntitlement: []gax.CallOption{},
TransferEntitlements: []gax.CallOption{},
TransferEntitlementsToGoogle: []gax.CallOption{},
ListChannelPartnerLinks: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
GetChannelPartnerLink: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
CreateChannelPartnerLink: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
UpdateChannelPartnerLink: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
LookupOffer: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
ListProducts: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
ListSkus: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
ListOffers: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
ListPurchasableSkus: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
ListPurchasableOffers: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
RegisterSubscriber: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
UnregisterSubscriber: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
ListSubscribers: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
}
}
// internalCloudChannelClient is an interface that defines the methods availaible from Cloud Channel API.
type internalCloudChannelClient interface {
Close() error
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
ListCustomers(context.Context, *channelpb.ListCustomersRequest, ...gax.CallOption) *CustomerIterator
GetCustomer(context.Context, *channelpb.GetCustomerRequest, ...gax.CallOption) (*channelpb.Customer, error)
CheckCloudIdentityAccountsExist(context.Context, *channelpb.CheckCloudIdentityAccountsExistRequest, ...gax.CallOption) (*channelpb.CheckCloudIdentityAccountsExistResponse, error)
CreateCustomer(context.Context, *channelpb.CreateCustomerRequest, ...gax.CallOption) (*channelpb.Customer, error)
UpdateCustomer(context.Context, *channelpb.UpdateCustomerRequest, ...gax.CallOption) (*channelpb.Customer, error)
DeleteCustomer(context.Context, *channelpb.DeleteCustomerRequest, ...gax.CallOption) error
ProvisionCloudIdentity(context.Context, *channelpb.ProvisionCloudIdentityRequest, ...gax.CallOption) (*ProvisionCloudIdentityOperation, error)
ProvisionCloudIdentityOperation(name string) *ProvisionCloudIdentityOperation
ListEntitlements(context.Context, *channelpb.ListEntitlementsRequest, ...gax.CallOption) *EntitlementIterator
ListTransferableSkus(context.Context, *channelpb.ListTransferableSkusRequest, ...gax.CallOption) *TransferableSkuIterator
ListTransferableOffers(context.Context, *channelpb.ListTransferableOffersRequest, ...gax.CallOption) *TransferableOfferIterator
GetEntitlement(context.Context, *channelpb.GetEntitlementRequest, ...gax.CallOption) (*channelpb.Entitlement, error)
CreateEntitlement(context.Context, *channelpb.CreateEntitlementRequest, ...gax.CallOption) (*CreateEntitlementOperation, error)
CreateEntitlementOperation(name string) *CreateEntitlementOperation
ChangeParameters(context.Context, *channelpb.ChangeParametersRequest, ...gax.CallOption) (*ChangeParametersOperation, error)
ChangeParametersOperation(name string) *ChangeParametersOperation
ChangeRenewalSettings(context.Context, *channelpb.ChangeRenewalSettingsRequest, ...gax.CallOption) (*ChangeRenewalSettingsOperation, error)
ChangeRenewalSettingsOperation(name string) *ChangeRenewalSettingsOperation
ChangeOffer(context.Context, *channelpb.ChangeOfferRequest, ...gax.CallOption) (*ChangeOfferOperation, error)
ChangeOfferOperation(name string) *ChangeOfferOperation
StartPaidService(context.Context, *channelpb.StartPaidServiceRequest, ...gax.CallOption) (*StartPaidServiceOperation, error)
StartPaidServiceOperation(name string) *StartPaidServiceOperation
SuspendEntitlement(context.Context, *channelpb.SuspendEntitlementRequest, ...gax.CallOption) (*SuspendEntitlementOperation, error)
SuspendEntitlementOperation(name string) *SuspendEntitlementOperation
CancelEntitlement(context.Context, *channelpb.CancelEntitlementRequest, ...gax.CallOption) (*CancelEntitlementOperation, error)
CancelEntitlementOperation(name string) *CancelEntitlementOperation
ActivateEntitlement(context.Context, *channelpb.ActivateEntitlementRequest, ...gax.CallOption) (*ActivateEntitlementOperation, error)
ActivateEntitlementOperation(name string) *ActivateEntitlementOperation
TransferEntitlements(context.Context, *channelpb.TransferEntitlementsRequest, ...gax.CallOption) (*TransferEntitlementsOperation, error)
TransferEntitlementsOperation(name string) *TransferEntitlementsOperation
TransferEntitlementsToGoogle(context.Context, *channelpb.TransferEntitlementsToGoogleRequest, ...gax.CallOption) (*TransferEntitlementsToGoogleOperation, error)
TransferEntitlementsToGoogleOperation(name string) *TransferEntitlementsToGoogleOperation
ListChannelPartnerLinks(context.Context, *channelpb.ListChannelPartnerLinksRequest, ...gax.CallOption) *ChannelPartnerLinkIterator
GetChannelPartnerLink(context.Context, *channelpb.GetChannelPartnerLinkRequest, ...gax.CallOption) (*channelpb.ChannelPartnerLink, error)
CreateChannelPartnerLink(context.Context, *channelpb.CreateChannelPartnerLinkRequest, ...gax.CallOption) (*channelpb.ChannelPartnerLink, error)
UpdateChannelPartnerLink(context.Context, *channelpb.UpdateChannelPartnerLinkRequest, ...gax.CallOption) (*channelpb.ChannelPartnerLink, error)
LookupOffer(context.Context, *channelpb.LookupOfferRequest, ...gax.CallOption) (*channelpb.Offer, error)
ListProducts(context.Context, *channelpb.ListProductsRequest, ...gax.CallOption) *ProductIterator
ListSkus(context.Context, *channelpb.ListSkusRequest, ...gax.CallOption) *SkuIterator
ListOffers(context.Context, *channelpb.ListOffersRequest, ...gax.CallOption) *OfferIterator
ListPurchasableSkus(context.Context, *channelpb.ListPurchasableSkusRequest, ...gax.CallOption) *PurchasableSkuIterator
ListPurchasableOffers(context.Context, *channelpb.ListPurchasableOffersRequest, ...gax.CallOption) *PurchasableOfferIterator
RegisterSubscriber(context.Context, *channelpb.RegisterSubscriberRequest, ...gax.CallOption) (*channelpb.RegisterSubscriberResponse, error)
UnregisterSubscriber(context.Context, *channelpb.UnregisterSubscriberRequest, ...gax.CallOption) (*channelpb.UnregisterSubscriberResponse, error)
ListSubscribers(context.Context, *channelpb.ListSubscribersRequest, ...gax.CallOption) *StringIterator
}
// CloudChannelClient is a client for interacting with Cloud Channel API.
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
//
// CloudChannelService lets Google cloud resellers and distributors manage
// their customers, channel partners, entitlements, and reports.
//
// Using this service:
//
// Resellers and distributors can manage a customer entity.
//
// Distributors can register an authorized reseller in their channel and
// provide them with delegated admin access.
//
// Resellers and distributors can manage customer entitlements.
//
// CloudChannelService exposes the following resources:
//
// Customers: An entity—usually an enterprise—managed by a reseller or
// distributor.
//
// Entitlements: An entity that provides a customer with the means to use
// a service. Entitlements are created or updated as a result of a successful
// fulfillment.
//
// ChannelPartnerLinks: An entity that identifies links between
// distributors and their indirect resellers in a channel.
type CloudChannelClient struct {
// The internal transport-dependent client.
internalClient internalCloudChannelClient
// The call options for this service.
CallOptions *CloudChannelCallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient *lroauto.OperationsClient
}
// Wrapper methods routed to the internal client.
// Close closes the connection to the API service. The user should invoke this when
// the client is no longer required.
func (c *CloudChannelClient) Close() error {
return c.internalClient.Close()
}
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *CloudChannelClient) setGoogleClientInfo(keyval ...string) {
c.internalClient.setGoogleClientInfo(keyval...)
}
// Connection returns a connection to the API service.
//
// Deprecated.
func (c *CloudChannelClient) Connection() *grpc.ClientConn {
return c.internalClient.Connection()
}
// ListCustomers list Customers.
//
// Possible error codes:
//
// PERMISSION_DENIED: The reseller account making the request is different
// from the reseller account in the API request.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// Return value:
// List of Customers, or an empty list if there are no customers.
func (c *CloudChannelClient) ListCustomers(ctx context.Context, req *channelpb.ListCustomersRequest, opts ...gax.CallOption) *CustomerIterator {
return c.internalClient.ListCustomers(ctx, req, opts...)
}
// GetCustomer returns the requested Customer resource.
//
// Possible error codes:
//
// PERMISSION_DENIED: The reseller account making the request is different
// from the reseller account in the API request.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// NOT_FOUND: The customer resource doesn’t exist. Usually the result of an
// invalid name parameter.
//
// Return value:
// The Customer resource.
func (c *CloudChannelClient) GetCustomer(ctx context.Context, req *channelpb.GetCustomerRequest, opts ...gax.CallOption) (*channelpb.Customer, error) {
return c.internalClient.GetCustomer(ctx, req, opts...)
}
// CheckCloudIdentityAccountsExist confirms the existence of Cloud Identity accounts based on the domain and
// if the Cloud Identity accounts are owned by the reseller.
//
// Possible error codes:
//
// PERMISSION_DENIED: The reseller account making the request is different
// from the reseller account in the API request.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// INVALID_VALUE: Invalid domain value in the request.
//
// Return value:
// A list of CloudIdentityCustomerAccount resources for the domain (may be
// empty)
//
// Note: in the v1alpha1 version of the API, a NOT_FOUND error returns if
// no CloudIdentityCustomerAccount resources match the domain.
func (c *CloudChannelClient) CheckCloudIdentityAccountsExist(ctx context.Context, req *channelpb.CheckCloudIdentityAccountsExistRequest, opts ...gax.CallOption) (*channelpb.CheckCloudIdentityAccountsExistResponse, error) {
return c.internalClient.CheckCloudIdentityAccountsExist(ctx, req, opts...)
}
// CreateCustomer creates a new Customer resource under the reseller or distributor
// account.
//
// Possible error codes:
//
// PERMISSION_DENIED: The reseller account making the request is different
// from the reseller account in the API request.
//
// INVALID_ARGUMENT:
//
// Required request parameters are missing or invalid.
//
// Domain field value doesn’t match the primary email domain.
//
// Return value:
// The newly created Customer resource.
func (c *CloudChannelClient) CreateCustomer(ctx context.Context, req *channelpb.CreateCustomerRequest, opts ...gax.CallOption) (*channelpb.Customer, error) {
return c.internalClient.CreateCustomer(ctx, req, opts...)
}
// UpdateCustomer updates an existing Customer resource for the reseller or
// distributor.
//
// Possible error codes:
//
// PERMISSION_DENIED: The reseller account making the request is different
// from the reseller account in the API request.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// NOT_FOUND: No Customer resource found for the name in the request.
//
// Return value:
// The updated Customer resource.
func (c *CloudChannelClient) UpdateCustomer(ctx context.Context, req *channelpb.UpdateCustomerRequest, opts ...gax.CallOption) (*channelpb.Customer, error) {
return c.internalClient.UpdateCustomer(ctx, req, opts...)
}
// DeleteCustomer deletes the given Customer permanently.
//
// Possible error codes:
//
// PERMISSION_DENIED: The account making the request does not own
// this customer.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// FAILED_PRECONDITION: The customer has existing entitlements.
//
// NOT_FOUND: No Customer resource found for the name in the request.
func (c *CloudChannelClient) DeleteCustomer(ctx context.Context, req *channelpb.DeleteCustomerRequest, opts ...gax.CallOption) error {
return c.internalClient.DeleteCustomer(ctx, req, opts...)
}
// ProvisionCloudIdentity creates a Cloud Identity for the given customer using the customer’s
// information, or the information provided here.
//
// Possible error codes:
//
// PERMISSION_DENIED: The customer doesn’t belong to the reseller.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// NOT_FOUND: The customer was not found.
//
// ALREADY_EXISTS: The customer’s primary email already exists. Retry
// after changing the customer’s primary contact email.
//
// INTERNAL: Any non-user error related to a technical issue in the
// backend. Contact Cloud Channel support.
//
// UNKNOWN: Any non-user error related to a technical issue in the backend.
// Contact Cloud Channel support.
//
// Return value:
// The ID of a long-running operation.
//
// To get the results of the operation, call the GetOperation method of
// CloudChannelOperationsService. The Operation metadata contains an
// instance of OperationMetadata.
func (c *CloudChannelClient) ProvisionCloudIdentity(ctx context.Context, req *channelpb.ProvisionCloudIdentityRequest, opts ...gax.CallOption) (*ProvisionCloudIdentityOperation, error) {
return c.internalClient.ProvisionCloudIdentity(ctx, req, opts...)
}
// ProvisionCloudIdentityOperation returns a new ProvisionCloudIdentityOperation from a given name.
// The name must be that of a previously created ProvisionCloudIdentityOperation, possibly from a different process.
func (c *CloudChannelClient) ProvisionCloudIdentityOperation(name string) *ProvisionCloudIdentityOperation {
return c.internalClient.ProvisionCloudIdentityOperation(name)
}
// ListEntitlements lists Entitlements belonging to a customer.
//
// Possible error codes:
//
// PERMISSION_DENIED: The customer doesn’t belong to the reseller.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// Return value:
// A list of the customer’s Entitlements.
func (c *CloudChannelClient) ListEntitlements(ctx context.Context, req *channelpb.ListEntitlementsRequest, opts ...gax.CallOption) *EntitlementIterator {
return c.internalClient.ListEntitlements(ctx, req, opts...)
}
// ListTransferableSkus list TransferableSkus of a customer based on the Cloud Identity ID or
// Customer Name in the request.
//
// Use this method to list the entitlements information of an
// unowned customer. You should provide the customer’s
// Cloud Identity ID or Customer Name.
//
// Possible error codes:
//
// PERMISSION_DENIED:
//
// The customer doesn’t belong to the reseller and has no auth token.
//
// The supplied auth token is invalid.
//
// The reseller account making the request is different
// from the reseller account in the query.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// Return value:
// A list of the customer’s TransferableSku.
func (c *CloudChannelClient) ListTransferableSkus(ctx context.Context, req *channelpb.ListTransferableSkusRequest, opts ...gax.CallOption) *TransferableSkuIterator {
return c.internalClient.ListTransferableSkus(ctx, req, opts...)
}
// ListTransferableOffers list TransferableOffers of a customer based on Cloud Identity ID or
// Customer Name in the request.
//
// Use this method when a reseller gets the entitlement information of an
// unowned customer. The reseller should provide the customer’s
// Cloud Identity ID or Customer Name.
//
// Possible error codes:
//
// PERMISSION_DENIED:
//
// The customer doesn’t belong to the reseller and has no auth token.
//
// The supplied auth token is invalid.
//
// The reseller account making the request is different
// from the reseller account in the query.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// Return value:
// List of TransferableOffer for the given customer and SKU.
func (c *CloudChannelClient) ListTransferableOffers(ctx context.Context, req *channelpb.ListTransferableOffersRequest, opts ...gax.CallOption) *TransferableOfferIterator {
return c.internalClient.ListTransferableOffers(ctx, req, opts...)
}
// GetEntitlement returns the requested Entitlement resource.
//
// Possible error codes:
//
// PERMISSION_DENIED: The customer doesn’t belong to the reseller.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// NOT_FOUND: The customer entitlement was not found.
//
// Return value:
// The requested Entitlement resource.
func (c *CloudChannelClient) GetEntitlement(ctx context.Context, req *channelpb.GetEntitlementRequest, opts ...gax.CallOption) (*channelpb.Entitlement, error) {
return c.internalClient.GetEntitlement(ctx, req, opts...)
}
// CreateEntitlement creates an entitlement for a customer.
//
// Possible error codes:
//
// PERMISSION_DENIED: The customer doesn’t belong to the reseller.
//
// INVALID_ARGUMENT:
//
// Required request parameters are missing or invalid.
//
// There is already a customer entitlement for a SKU from the same
// product family.
//
// INVALID_VALUE: Make sure the OfferId is valid. If it is, contact
// Google Channel support for further troubleshooting.
//
// NOT_FOUND: The customer or offer resource was not found.
//
// ALREADY_EXISTS:
//
// The SKU was already purchased for the customer.
//
// The customer’s primary email already exists. Retry
// after changing the customer’s primary contact email.
//
// CONDITION_NOT_MET or FAILED_PRECONDITION:
//
// The domain required for purchasing a SKU has not been verified.
//
// A pre-requisite SKU required to purchase an Add-On SKU is missing.
// For example, Google Workspace Business Starter is required to purchase
// Vault or Drive.
//
// (Developer accounts only) Reseller and resold domain must meet the
// following naming requirements:
//
// Domain names must start with goog-test.
//
// Domain names must include the reseller domain.
//
// INTERNAL: Any non-user error related to a technical issue in the
// backend. Contact Cloud Channel support.
//
// UNKNOWN: Any non-user error related to a technical issue in the backend.
// Contact Cloud Channel support.
//
// Return value:
// The ID of a long-running operation.
//
// To get the results of the operation, call the GetOperation method of
// CloudChannelOperationsService. The Operation metadata will contain an
// instance of OperationMetadata.
func (c *CloudChannelClient) CreateEntitlement(ctx context.Context, req *channelpb.CreateEntitlementRequest, opts ...gax.CallOption) (*CreateEntitlementOperation, error) {
return c.internalClient.CreateEntitlement(ctx, req, opts...)
}
// CreateEntitlementOperation returns a new CreateEntitlementOperation from a given name.
// The name must be that of a previously created CreateEntitlementOperation, possibly from a different process.
func (c *CloudChannelClient) CreateEntitlementOperation(name string) *CreateEntitlementOperation {
return c.internalClient.CreateEntitlementOperation(name)
}
// ChangeParameters change parameters of the entitlement.
//
// An entitlement update is a long-running operation and it updates the
// entitlement as a result of fulfillment.
//
// Possible error codes:
//
// PERMISSION_DENIED: The customer doesn’t belong to the reseller.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
// For example, the number of seats being changed is greater than the allowed
// number of max seats, or decreasing seats for a commitment based plan.
//
// NOT_FOUND: Entitlement resource not found.
//
// INTERNAL: Any non-user error related to a technical issue in the
// backend. Contact Cloud Channel support.
//
// UNKNOWN: Any non-user error related to a technical issue in the backend.
// Contact Cloud Channel support.
//
// Return value:
// The ID of a long-running operation.
//
// To get the results of the operation, call the GetOperation method of
// CloudChannelOperationsService. The Operation metadata will contain an
// instance of OperationMetadata.
func (c *CloudChannelClient) ChangeParameters(ctx context.Context, req *channelpb.ChangeParametersRequest, opts ...gax.CallOption) (*ChangeParametersOperation, error) {
return c.internalClient.ChangeParameters(ctx, req, opts...)
}
// ChangeParametersOperation returns a new ChangeParametersOperation from a given name.
// The name must be that of a previously created ChangeParametersOperation, possibly from a different process.
func (c *CloudChannelClient) ChangeParametersOperation(name string) *ChangeParametersOperation {
return c.internalClient.ChangeParametersOperation(name)
}
// ChangeRenewalSettings updates the renewal settings for an existing customer entitlement.
//
// An entitlement update is a long-running operation and it updates the
// entitlement as a result of fulfillment.
//
// Possible error codes:
//
// PERMISSION_DENIED: The customer doesn’t belong to the reseller.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// NOT_FOUND: Entitlement resource not found.
//
// NOT_COMMITMENT_PLAN: Renewal Settings are only applicable for a
// commitment plan. Can’t enable or disable renewals for non-commitment plans.
//
// INTERNAL: Any non-user error related to a technical issue in the
// backend. Contact Cloud Channel support.
//
// UNKNOWN: Any non-user error related to a technical issue in the backend.
// Contact Cloud Channel support.
//
// Return value:
// The ID of a long-running operation.
//
// To get the results of the operation, call the GetOperation method of
// CloudChannelOperationsService. The Operation metadata will contain an
// instance of OperationMetadata.
func (c *CloudChannelClient) ChangeRenewalSettings(ctx context.Context, req *channelpb.ChangeRenewalSettingsRequest, opts ...gax.CallOption) (*ChangeRenewalSettingsOperation, error) {
return c.internalClient.ChangeRenewalSettings(ctx, req, opts...)
}
// ChangeRenewalSettingsOperation returns a new ChangeRenewalSettingsOperation from a given name.
// The name must be that of a previously created ChangeRenewalSettingsOperation, possibly from a different process.
func (c *CloudChannelClient) ChangeRenewalSettingsOperation(name string) *ChangeRenewalSettingsOperation {
return c.internalClient.ChangeRenewalSettingsOperation(name)
}
// ChangeOffer updates the Offer for an existing customer entitlement.
//
// An entitlement update is a long-running operation and it updates the
// entitlement as a result of fulfillment.
//
// Possible error codes:
//
// PERMISSION_DENIED: The customer doesn’t belong to the reseller.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// NOT_FOUND: Offer or Entitlement resource not found.
//
// INTERNAL: Any non-user error related to a technical issue in the
// backend. Contact Cloud Channel support.
//
// UNKNOWN: Any non-user error related to a technical issue in the backend.
// Contact Cloud Channel support.
//
// Return value:
// The ID of a long-running operation.
//
// To get the results of the operation, call the GetOperation method of
// CloudChannelOperationsService. The Operation metadata will contain an
// instance of OperationMetadata.
func (c *CloudChannelClient) ChangeOffer(ctx context.Context, req *channelpb.ChangeOfferRequest, opts ...gax.CallOption) (*ChangeOfferOperation, error) {
return c.internalClient.ChangeOffer(ctx, req, opts...)
}
// ChangeOfferOperation returns a new ChangeOfferOperation from a given name.
// The name must be that of a previously created ChangeOfferOperation, possibly from a different process.
func (c *CloudChannelClient) ChangeOfferOperation(name string) *ChangeOfferOperation {
return c.internalClient.ChangeOfferOperation(name)
}
// StartPaidService starts paid service for a trial entitlement.
//
// Starts paid service for a trial entitlement immediately. This method is
// only applicable if a plan is set up for a trial entitlement but has some
// trial days remaining.
//
// Possible error codes:
//
// PERMISSION_DENIED: The customer doesn’t belong to the reseller.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// NOT_FOUND: Entitlement resource not found.
//
// FAILED_PRECONDITION/NOT_IN_TRIAL: This method only works for
// entitlement on trial plans.
//
// INTERNAL: Any non-user error related to a technical issue in the
// backend. Contact Cloud Channel support.
//
// UNKNOWN: Any non-user error related to a technical issue in the backend.
// Contact Cloud Channel support.
//
// Return value:
// The ID of a long-running operation.
//
// To get the results of the operation, call the GetOperation method of
// CloudChannelOperationsService. The Operation metadata will contain an
// instance of OperationMetadata.
func (c *CloudChannelClient) StartPaidService(ctx context.Context, req *channelpb.StartPaidServiceRequest, opts ...gax.CallOption) (*StartPaidServiceOperation, error) {
return c.internalClient.StartPaidService(ctx, req, opts...)
}
// StartPaidServiceOperation returns a new StartPaidServiceOperation from a given name.
// The name must be that of a previously created StartPaidServiceOperation, possibly from a different process.
func (c *CloudChannelClient) StartPaidServiceOperation(name string) *StartPaidServiceOperation {
return c.internalClient.StartPaidServiceOperation(name)
}
// SuspendEntitlement suspends a previously fulfilled entitlement.
//
// An entitlement suspension is a long-running operation.
//
// Possible error codes:
//
// PERMISSION_DENIED: The customer doesn’t belong to the reseller.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// NOT_FOUND: Entitlement resource not found.
//
// NOT_ACTIVE: Entitlement is not active.
//
// INTERNAL: Any non-user error related to a technical issue in the
// backend. Contact Cloud Channel support.
//
// UNKNOWN: Any non-user error related to a technical issue in the backend.
// Contact Cloud Channel support.
//
// Return value:
// The ID of a long-running operation.
//
// To get the results of the operation, call the GetOperation method of
// CloudChannelOperationsService. The Operation metadata will contain an
// instance of OperationMetadata.
func (c *CloudChannelClient) SuspendEntitlement(ctx context.Context, req *channelpb.SuspendEntitlementRequest, opts ...gax.CallOption) (*SuspendEntitlementOperation, error) {
return c.internalClient.SuspendEntitlement(ctx, req, opts...)
}
// SuspendEntitlementOperation returns a new SuspendEntitlementOperation from a given name.
// The name must be that of a previously created SuspendEntitlementOperation, possibly from a different process.
func (c *CloudChannelClient) SuspendEntitlementOperation(name string) *SuspendEntitlementOperation {
return c.internalClient.SuspendEntitlementOperation(name)
}
// CancelEntitlement cancels a previously fulfilled entitlement.
//
// An entitlement cancellation is a long-running operation.
//
// Possible error codes:
//
// PERMISSION_DENIED: The reseller account making the request is different
// from the reseller account in the API request.
//
// FAILED_PRECONDITION: There are Google Cloud projects linked to the
// Google Cloud entitlement’s Cloud Billing subaccount.
//
// INVALID_ARGUMENT: Required request parameters are missing or invalid.
//
// NOT_FOUND: Entitlement resource not found.
//
// DELETION_TYPE_NOT_ALLOWED: Cancel is only allowed for Google Workspace
// add-ons, or entitlements for Google Cloud’s development platform.
//
// INTERNAL: Any non-user error related to a technical issue in the
// backend. Contact Cloud Channel support.
//
// UNKNOWN: Any non-user error related to a technical issue in the backend.
// Contact Cloud Channel support.
//
// Return value:
// The ID of a long-running operation.
//
// To get the results of the operation, call the GetOperation method of
// CloudChannelOperationsService. The response will contain
// google.protobuf.Empty on success. The Operation metadata will contain an
// instance of OperationMetadata.
func (c *CloudChannelClient) CancelEntitlement(ctx context.Context, req *channelpb.CancelEntitlementRequest, opts ...gax.CallOption) (*CancelEntitlementOperation, error) {
return c.internalClient.CancelEntitlement(ctx, req, opts...)
}
// CancelEntitlementOperation returns a new CancelEntitlementOperation from a given name.
// The name must be that of a previously created CancelEntitlementOperation, possibly from a different process.
func (c *CloudChannelClient) CancelEntitlementOperation(name string) *CancelEntitlementOperation {
return c.internalClient.CancelEntitlementOperation(name)
}
// ActivateEntitlement activates a previously suspended entitlement. Entitlements suspended for
// pending ToS acceptance can’t be activated using this method.
//
// An entitlement activation is a long-running operation and it updates
// the state of the customer entitlement.
//
// Possible error codes:
//
// PERMISSION_DENIED: The reseller account making the request is different
// from the reseller account in the API request.