-
Notifications
You must be signed in to change notification settings - Fork 4
/
accounts.clj
1918 lines (1634 loc) · 89.4 KB
/
accounts.clj
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
(ns happygapi.cloudchannel.accounts
"Cloud Channel API: accounts.
The Cloud Channel API enables Google Cloud partners to have a single unified resale platform and APIs across all of Google Cloud including GCP, Workspace, Maps and Chrome.
See: https://cloud.google.com/channelapi/reference/rest/v1/accounts"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn checkCloudIdentityAccountsExist$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/checkCloudIdentityAccountsExist
Required parameters: parent
Optional parameters: none
Body:
{:domain string}
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}:checkCloudIdentityAccountsExist"
#{:parent}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn listTransferableSkus$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/listTransferableSkus
Required parameters: parent
Optional parameters: none
Body:
{:cloudIdentityId string,
:customerName string,
:pageSize integer,
:pageToken string,
:authToken string,
:languageCode string}
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}:listTransferableSkus"
#{:parent}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn listTransferableOffers$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/listTransferableOffers
Required parameters: parent
Optional parameters: none
Body:
{:cloudIdentityId string,
:customerName string,
:pageSize integer,
:pageToken string,
:sku string,
:languageCode string,
:billingAccount string}
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 customer provided incorrect reseller information when generating auth token. * The reseller account making the request is different from the reseller account in the query. * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: List of TransferableOffer for the given customer and SKU."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}:listTransferableOffers"
#{:parent}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn register$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/register
Required parameters: account
Optional parameters: none
Body:
{:serviceAccount string}
Registers a service account with subscriber privileges on the Cloud Pub/Sub topic for this Channel Services account. After you create a subscriber, you get the events through SubscriberEvent Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * 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 topic name with the registered service email address."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:account})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+account}:register"
#{:account}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn unregister$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/unregister
Required parameters: account
Optional parameters: none
Body:
{:serviceAccount string}
Unregisters a service account with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. If there are no service accounts left with subscriber privileges, this deletes the topic. You can call ListSubscribers to check for these accounts. Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The topic resource doesn't exist. * 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 topic name that unregistered the service email address. Returns a success response if the service email address wasn't registered with the topic."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:account})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+account}:unregister"
#{:account}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn listSubscribers$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/listSubscribers
Required parameters: account
Optional parameters: pageSize, pageToken
Lists service accounts with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The topic resource doesn't exist. * 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: A list of service email addresses."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:account})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+account}:listSubscribers"
#{:account}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn reports-run$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/reports/run
Required parameters: name
Optional parameters: none
Body:
{:dateRange {:usageStartDateTime GoogleTypeDateTime,
:usageEndDateTime GoogleTypeDateTime,
:invoiceStartDate GoogleTypeDate,
:invoiceEndDate GoogleTypeDate},
:filter string,
:languageCode string}
Begins generation of data for a given report. The report identifier is a UID (for example, `613bf59q`). Possible error codes: * PERMISSION_DENIED: The user doesn't have access to this report. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The report identifier was 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 contains an instance of OperationMetadata. To get the results of report generation, call CloudChannelReportsService.FetchReportResults with the RunReportJobResponse.report_job. Deprecated: Please use [Export Channel Services data to BigQuery](https://cloud.google.com/channel/docs/rebilling/export-data-to-bigquery) instead."
{:scopes ["https://www.googleapis.com/auth/apps.reports.usage.readonly"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+name}:run"
#{:name}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn reports-list$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/reports/list
Required parameters: parent
Optional parameters: pageSize, pageToken, languageCode
Lists the reports that RunReportJob can run. These reports include an ID, a description, and the list of columns that will be in the result. Deprecated: Please use [Export Channel Services data to BigQuery](https://cloud.google.com/channel/docs/rebilling/export-data-to-bigquery) instead."
{:scopes ["https://www.googleapis.com/auth/apps.reports.usage.readonly"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}/reports"
#{:parent}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn reportJobs-fetchReportResults$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/reportJobs/fetchReportResults
Required parameters: reportJob
Optional parameters: none
Body:
{:pageSize integer, :pageToken string, :partitionKeys [string]}
Retrieves data generated by CloudChannelReportsService.RunReportJob. Deprecated: Please use [Export Channel Services data to BigQuery](https://cloud.google.com/channel/docs/rebilling/export-data-to-bigquery) instead."
{:scopes ["https://www.googleapis.com/auth/apps.reports.usage.readonly"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:reportJob})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+reportJob}:fetchReportResults"
#{:reportJob}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-transferEntitlementsToGoogle$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/transferEntitlementsToGoogle
Required parameters: parent
Optional parameters: none
Body:
{:entitlements [{:purchaseOrderId string,
:billingAccount string,
:provisioningState string,
:offer string,
:name string,
:commitmentSettings GoogleCloudChannelV1CommitmentSettings,
:createTime string,
:trialSettings GoogleCloudChannelV1TrialSettings,
:suspensionReasons [string],
:updateTime string,
:associationInfo GoogleCloudChannelV1AssociationInfo,
:parameters [GoogleCloudChannelV1Parameter],
:provisionedService GoogleCloudChannelV1ProvisionedService}],
:requestId string}
Transfers customer entitlements from their current reseller to Google. 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 or offer resource was not found. * ALREADY_EXISTS: The SKU was already transferred for the customer. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The SKU requires domain verification to transfer, but the domain is not verified. * An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic). * (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 response will contain google.protobuf.Empty on success. The Operation metadata will contain an instance of OperationMetadata."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}:transferEntitlementsToGoogle"
#{:parent}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-transferEntitlements$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/transferEntitlements
Required parameters: parent
Optional parameters: none
Body:
{:entitlements [{:purchaseOrderId string,
:billingAccount string,
:provisioningState string,
:offer string,
:name string,
:commitmentSettings GoogleCloudChannelV1CommitmentSettings,
:createTime string,
:trialSettings GoogleCloudChannelV1TrialSettings,
:suspensionReasons [string],
:updateTime string,
:associationInfo GoogleCloudChannelV1AssociationInfo,
:parameters [GoogleCloudChannelV1Parameter],
:provisionedService GoogleCloudChannelV1ProvisionedService}],
:authToken string,
:requestId string}
Transfers customer entitlements to new reseller. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller. * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: The SKU was already transferred for the customer. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The SKU requires domain verification to transfer, but the domain is not verified. * An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic). * (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. * Specify all transferring entitlements. * 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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}:transferEntitlements"
#{:parent}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-get$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/get
Required parameters: name
Optional parameters: none
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+name}"
#{:name}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-patch$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/patch
Required parameters: name
Optional parameters: updateMask
Body:
{:alternateEmail string,
:primaryContactInfo {:firstName string,
:lastName string,
:displayName string,
:email string,
:title string,
:phone string},
:correlationId string,
:name string,
:createTime string,
:cloudIdentityId string,
:orgPostalAddress {:sortingCode string,
:locality string,
:revision integer,
:administrativeArea string,
:addressLines [string],
:organization string,
:recipients [string],
:languageCode string,
:regionCode string,
:postalCode string,
:sublocality string},
:updateTime string,
:orgDisplayName string,
:languageCode string,
:domain string,
:channelPartnerId string,
:cloudIdentityInfo {:customerType string,
:primaryDomain string,
:isDomainVerified boolean,
:alternateEmail string,
:phoneNumber string,
:languageCode string,
:adminConsoleUri string,
:eduData GoogleCloudChannelV1EduData}}
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/patch
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+name}"
#{:name}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-create$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/create
Required parameters: parent
Optional parameters: none
Body:
{:alternateEmail string,
:primaryContactInfo {:firstName string,
:lastName string,
:displayName string,
:email string,
:title string,
:phone string},
:correlationId string,
:name string,
:createTime string,
:cloudIdentityId string,
:orgPostalAddress {:sortingCode string,
:locality string,
:revision integer,
:administrativeArea string,
:addressLines [string],
:organization string,
:recipients [string],
:languageCode string,
:regionCode string,
:postalCode string,
:sublocality string},
:updateTime string,
:orgDisplayName string,
:languageCode string,
:domain string,
:channelPartnerId string,
:cloudIdentityInfo {:customerType string,
:primaryDomain string,
:isDomainVerified boolean,
:alternateEmail string,
:phoneNumber string,
:languageCode string,
:adminConsoleUri string,
:eduData GoogleCloudChannelV1EduData}}
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. * You are not authorized to create a customer. See https://support.google.com/channelservices/answer/9759265 * 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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}/customers"
#{:parent}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-provisionCloudIdentity$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/provisionCloudIdentity
Required parameters: customer
Optional parameters: none
Body:
{:cloudIdentityInfo {:customerType string,
:primaryDomain string,
:isDomainVerified boolean,
:alternateEmail string,
:phoneNumber string,
:languageCode string,
:adminConsoleUri string,
:eduData GoogleCloudChannelV1EduData},
:user {:email string, :givenName string, :familyName string},
:validateOnly boolean}
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. * You are not authorized to provision cloud identity id. See https://support.google.com/channelservices/answer/9759265 * 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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:customer})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+customer}:provisionCloudIdentity"
#{:customer}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-delete$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/delete
Required parameters: name
Optional parameters: none
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/delete
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+name}"
#{:name}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-listPurchasableOffers$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/listPurchasableOffers
Required parameters: customer
Optional parameters: changeOfferPurchase.billingAccount, pageToken, languageCode, createEntitlementPurchase.sku, createEntitlementPurchase.billingAccount, pageSize, changeOfferPurchase.entitlement, changeOfferPurchase.newSku
Lists the following: * Offers that you can purchase for a customer. * Offers that you can change for an entitlement. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: Required request parameters are missing or invalid."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:customer})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+customer}:listPurchasableOffers"
#{:customer}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-list$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/list
Required parameters: parent
Optional parameters: pageSize, pageToken, filter
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}/customers"
#{:parent}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-queryEligibleBillingAccounts$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/queryEligibleBillingAccounts
Required parameters: customer
Optional parameters: skus
Lists the billing accounts that are eligible to purchase particular SKUs for a given 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: Based on the provided list of SKUs, returns a list of SKU groups that must be purchased using the same billing account and the billing accounts eligible to purchase each SKU group."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:customer})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+customer}:queryEligibleBillingAccounts"
#{:customer}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-import$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/import
Required parameters: parent
Optional parameters: none
Body:
{:domain string,
:cloudIdentityId string,
:authToken string,
:overwriteIfExists boolean,
:channelPartnerId string,
:customer string}
Imports a Customer from the Cloud Identity associated with the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked Customer already exists and overwrite_if_exists is true, it will update that Customer's data. Possible error codes: * PERMISSION_DENIED: * The reseller account making the request is different from the reseller account in the API request. * You are not authorized to import the customer. See https://support.google.com/channelservices/answer/9759265 * NOT_FOUND: Cloud Identity doesn't exist or was deleted. * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or invalid. * ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires an overwrite. Return value: The Customer."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}/customers:import"
#{:parent}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-listPurchasableSkus$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/listPurchasableSkus
Required parameters: customer
Optional parameters: createEntitlementPurchase.product, changeOfferPurchase.entitlement, changeOfferPurchase.changeType, pageSize, pageToken, languageCode
Lists the following: * SKUs that you can purchase for a customer * SKUs that you can upgrade or downgrade for an entitlement. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:customer})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+customer}:listPurchasableSkus"
#{:customer}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-entitlements-changeParameters$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/entitlements/changeParameters
Required parameters: name
Optional parameters: none
Body:
{:parameters [{:name string,
:value GoogleCloudChannelV1Value,
:editable boolean}],
:requestId string,
:purchaseOrderId string}
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+name}:changeParameters"
#{:name}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-entitlements-changeOffer$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/entitlements/changeOffer
Required parameters: name
Optional parameters: none
Body:
{:offer string,
:parameters [{:name string,
:value GoogleCloudChannelV1Value,
:editable boolean}],
:purchaseOrderId string,
:requestId string,
:billingAccount string}
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+name}:changeOffer"
#{:name}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-entitlements-get$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/entitlements/get
Required parameters: name
Optional parameters: none
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+name}"
#{:name}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-entitlements-create$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/entitlements/create
Required parameters: parent
Optional parameters: none
Body:
{:entitlement {:purchaseOrderId string,
:billingAccount string,
:provisioningState string,
:offer string,
:name string,
:commitmentSettings GoogleCloudChannelV1CommitmentSettings,
:createTime string,
:trialSettings GoogleCloudChannelV1TrialSettings,
:suspensionReasons [string],
:updateTime string,
:associationInfo GoogleCloudChannelV1AssociationInfo,
:parameters [GoogleCloudChannelV1Parameter],
:provisionedService GoogleCloudChannelV1ProvisionedService},
:requestId string}
Creates an entitlement for a customer. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller. * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * 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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}/entitlements"
#{:parent}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-entitlements-listEntitlementChanges$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/entitlements/listEntitlementChanges
Required parameters: parent
Optional parameters: pageSize, pageToken, filter
List entitlement history. Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different. * INVALID_ARGUMENT: Missing or invalid required fields in the request. * NOT_FOUND: The parent resource doesn't exist. Usually the result of an invalid name parameter. * INTERNAL: Any non-user error related to a technical issue in the backend. In this case, contact CloudChannel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. In this case, contact Cloud Channel support. Return value: List of EntitlementChanges."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+parent}:listEntitlementChanges"
#{:parent}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-entitlements-changeRenewalSettings$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/entitlements/changeRenewalSettings
Required parameters: name
Optional parameters: none
Body:
{:renewalSettings {:enableRenewal boolean,
:resizeUnitCount boolean,
:paymentPlan string,
:paymentCycle GoogleCloudChannelV1Period},
:requestId string}
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."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/post
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+name}:changeRenewalSettings"
#{:name}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-entitlements-lookupOffer$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/entitlements/lookupOffer
Required parameters: entitlement
Optional parameters: none
Returns the requested Offer resource. Possible error codes: * PERMISSION_DENIED: The entitlement doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement or offer was not found. Return value: The Offer resource."
{:scopes ["https://www.googleapis.com/auth/apps.order"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:entitlement})]}
(util/get-response
(http/get
(util/get-url
"https://cloudchannel.googleapis.com/"
"v1/{+entitlement}:lookupOffer"
#{:entitlement}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn customers-entitlements-suspend$
"https://cloud.google.com/channelapi/reference/rest/v1/accounts/customers/entitlements/suspend
Required parameters: name
Optional parameters: none
Body:
{:requestId string}