@sylphx/sdk 0.32.3 → 0.32.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/money.js CHANGED
@@ -3,6 +3,9 @@
3
3
  import * as runtime from './runtime.js';
4
4
  import './common.js';
5
5
  runtime.registerSchemas({
6
+ 'sylphx.money.v1.AdvanceTestClockRequest': [
7
+ ['frozenTime', 'frozen_time'],
8
+ ],
6
9
  'sylphx.money.v1.AppStoreConnection': [
7
10
  ['bundleIds', 'bundle_ids'],
8
11
  ['issuerId', 'issuer_id'],
@@ -55,6 +58,12 @@ runtime.registerSchemas({
55
58
  ['entitlementGrant', 'entitlement_grant'],
56
59
  ['expireTime', 'expire_time'],
57
60
  ],
61
+ 'sylphx.money.v1.CheckMerchantAccountProcessorPermissionsRequest': [],
62
+ 'sylphx.money.v1.CheckMerchantAccountProcessorPermissionsResponse': [
63
+ ['merchantAccount', 'merchant_account'],
64
+ ['permissions', 'permissions', 'sylphx.money.v1.ProcessorReadPermission'],
65
+ ['checkTime', 'check_time'],
66
+ ],
58
67
  'sylphx.money.v1.CheckUsageStandingRequest': [
59
68
  ['subject', 'subject', 'sylphx.money.v1.Subject'],
60
69
  ['subjectProof', 'subject_proof'],
@@ -146,6 +155,10 @@ runtime.registerSchemas({
146
155
  ['storeConnection', 'store_connection', 'sylphx.money.v1.StoreConnection'],
147
156
  ['validateOnly', 'validate_only'],
148
157
  ],
158
+ 'sylphx.money.v1.CreateTestClockRequest': [
159
+ ['testClock', 'test_clock', 'sylphx.money.v1.TestClock'],
160
+ ['testClockId', 'test_clock_id'],
161
+ ],
149
162
  'sylphx.money.v1.CreateUsageEventRequest': [
150
163
  ['usageEvent', 'usage_event', 'sylphx.money.v1.UsageEvent'],
151
164
  ],
@@ -180,6 +193,7 @@ runtime.registerSchemas({
180
193
  ],
181
194
  'sylphx.money.v1.DeleteStoreConnectionRequest': [],
182
195
  'sylphx.money.v1.DisconnectMerchantAccountRequest': [],
196
+ 'sylphx.money.v1.DismissProcessorEventRequest': [],
183
197
  'sylphx.money.v1.EntitlementGrant': [
184
198
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
185
199
  ['subject', 'subject', 'sylphx.money.v1.Subject'],
@@ -209,6 +223,7 @@ runtime.registerSchemas({
209
223
  'sylphx.money.v1.GetLicenceKeyRequest': [],
210
224
  'sylphx.money.v1.GetMerchantAccountRequest': [],
211
225
  'sylphx.money.v1.GetPortalSessionRequest': [],
226
+ 'sylphx.money.v1.GetProcessorEventRequest': [],
212
227
  'sylphx.money.v1.GetRevenueSourceRequest': [],
213
228
  'sylphx.money.v1.GetRevenueSummaryRequest': [
214
229
  ['startDay', 'start_day'],
@@ -218,6 +233,7 @@ runtime.registerSchemas({
218
233
  ],
219
234
  'sylphx.money.v1.GetStoreConnectionRequest': [],
220
235
  'sylphx.money.v1.GetStorePurchaseRequest': [],
236
+ 'sylphx.money.v1.GetTestClockRequest': [],
221
237
  'sylphx.money.v1.GetUsageInvoiceRequest': [],
222
238
  'sylphx.money.v1.GetUsageMeterRequest': [],
223
239
  'sylphx.money.v1.GetUsageReservationRequest': [],
@@ -324,6 +340,14 @@ runtime.registerSchemas({
324
340
  ['merchantAccounts', 'merchant_accounts', 'sylphx.money.v1.MerchantAccount'],
325
341
  ['nextPageToken', 'next_page_token'],
326
342
  ],
343
+ 'sylphx.money.v1.ListProcessorEventsRequest': [
344
+ ['pageSize', 'page_size'],
345
+ ['pageToken', 'page_token'],
346
+ ],
347
+ 'sylphx.money.v1.ListProcessorEventsResponse': [
348
+ ['processorEvents', 'processor_events', 'sylphx.money.v1.ProcessorEvent'],
349
+ ['nextPageToken', 'next_page_token'],
350
+ ],
327
351
  'sylphx.money.v1.ListRevenueFactsRequest': [
328
352
  ['pageSize', 'page_size'],
329
353
  ['pageToken', 'page_token'],
@@ -414,6 +438,9 @@ runtime.registerSchemas({
414
438
  ['defaultCurrencyCode', 'default_currency_code'],
415
439
  ['refreshTime', 'refresh_time'],
416
440
  ['automaticTax', 'automatic_tax'],
441
+ ['processorReadPermissions', 'processor_read_permissions', 'sylphx.money.v1.ProcessorReadPermission'],
442
+ ['processorPermissionsCheckTime', 'processor_permissions_check_time'],
443
+ ['processorWarnings', 'processor_warnings'],
417
444
  ],
418
445
  'sylphx.money.v1.PortalSession': [
419
446
  ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
@@ -429,6 +456,20 @@ runtime.registerSchemas({
429
456
  ['defaultCurrency', 'default_currency'],
430
457
  ['introductoryUnitAmounts', 'introductory_unit_amounts', undefined, 'map'],
431
458
  ],
459
+ 'sylphx.money.v1.ProcessorEvent': [
460
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
461
+ ['accountId', 'account_id'],
462
+ ['eventType', 'event_type'],
463
+ ['objectId', 'object_id'],
464
+ ['holdReason', 'hold_reason'],
465
+ ['modeKnown', 'mode_known'],
466
+ ['lastRecovery', 'last_recovery', 'sylphx.money.v1.ProcessorEventRecovery'],
467
+ ],
468
+ 'sylphx.money.v1.ProcessorEventRecovery': [
469
+ ['receiptId', 'receipt_id'],
470
+ ['createTime', 'create_time'],
471
+ ],
472
+ 'sylphx.money.v1.ProcessorReadPermission': [],
432
473
  'sylphx.money.v1.Product': [
433
474
  ['displayName', 'display_name'],
434
475
  ['features', 'features', undefined, 'map'],
@@ -455,6 +496,7 @@ runtime.registerSchemas({
455
496
  'sylphx.money.v1.ReleaseUsageReservationRequest': [],
456
497
  'sylphx.money.v1.ResumeCustomerSubscriptionRequest': [],
457
498
  'sylphx.money.v1.RetireLicenceKeyRequest': [],
499
+ 'sylphx.money.v1.RetryProcessorEventRequest': [],
458
500
  'sylphx.money.v1.RevenueBucket': [
459
501
  ['startDay', 'start_day'],
460
502
  ['unconvertedCount', 'unconverted_count'],
@@ -587,6 +629,12 @@ runtime.registerSchemas({
587
629
  ['sourceUrl', 'source_url'],
588
630
  ['effectiveTime', 'effective_time'],
589
631
  ],
632
+ 'sylphx.money.v1.TestClock': [
633
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
634
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
635
+ ['frozenTime', 'frozen_time'],
636
+ ['processorClockId', 'processor_clock_id'],
637
+ ],
590
638
  'sylphx.money.v1.UnconvertedAmount': [
591
639
  ['currencyCode', 'currency_code'],
592
640
  ],
@@ -731,6 +779,10 @@ runtime.registerSchemas({
731
779
  * Namespace of Sylphx Money on `Sylphx`.
732
780
  */
733
781
  export class MoneyApi {
782
+ /** The `processor_events` collection. */
783
+ processorEvents;
784
+ /** The `merchant_accounts` collection. */
785
+ merchantAccounts;
734
786
  /** The `price_catalogs` collection. */
735
787
  priceCatalogs;
736
788
  /** The `checkout_policies` collection. */
@@ -743,8 +795,8 @@ export class MoneyApi {
743
795
  customerSubscriptions;
744
796
  /** The `entitlement_grants` collection. */
745
797
  entitlementGrants;
746
- /** The `merchant_accounts` collection. */
747
- merchantAccounts;
798
+ /** The `test_clocks` collection. */
799
+ testClocks;
748
800
  /** The `checkout_sessions` collection. */
749
801
  checkoutSessions;
750
802
  /** The `tax_threshold_statuses` collection. */
@@ -780,13 +832,15 @@ export class MoneyApi {
780
832
  /** The `exchange_rates` collection. */
781
833
  exchangeRates;
782
834
  constructor(client) {
835
+ this.processorEvents = new ProcessorEventsCollection(client);
836
+ this.merchantAccounts = new MerchantAccountsCollection(client);
783
837
  this.priceCatalogs = new PriceCatalogsCollection(client);
784
838
  this.checkoutPolicies = new CheckoutPoliciesCollection(client);
785
839
  this.storeConnections = new StoreConnectionsCollection(client);
786
840
  this.storePurchases = new StorePurchasesCollection(client);
787
841
  this.customerSubscriptions = new CustomerSubscriptionsCollection(client);
788
842
  this.entitlementGrants = new EntitlementGrantsCollection(client);
789
- this.merchantAccounts = new MerchantAccountsCollection(client);
843
+ this.testClocks = new TestClocksCollection(client);
790
844
  this.checkoutSessions = new CheckoutSessionsCollection(client);
791
845
  this.taxThresholdStatuses = new TaxThresholdStatusesCollection(client);
792
846
  this.portalSessions = new PortalSessionsCollection(client);
@@ -806,6 +860,225 @@ export class MoneyApi {
806
860
  this.exchangeRates = new ExchangeRatesCollection(client);
807
861
  }
808
862
  }
863
+ /** `processor_events` of Sylphx Money: Resource type `money.sylphx.com/ProcessorEvent`. */
864
+ export class ProcessorEventsCollection {
865
+ client;
866
+ constructor(client) {
867
+ this.client = client;
868
+ }
869
+ /**
870
+ * Gets one stored processor hint, with its safe hold reason.
871
+ *
872
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/processor_events/*}` · permission `billing:processor_events:read` · effect `read`
873
+ *
874
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
875
+ */
876
+ async get(request) {
877
+ return this.client.call({
878
+ method: 'GET',
879
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/processor_events/*', 'name')}`,
880
+ responseType: 'sylphx.money.v1.ProcessorEvent',
881
+ mutation: false,
882
+ });
883
+ }
884
+ /**
885
+ * Lists stored processor hints; defaults to held events.
886
+ *
887
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/processor_events` · permission `billing:processor_events:read` · effect `read`
888
+ *
889
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
890
+ */
891
+ async list(request) {
892
+ return this.client.call({
893
+ method: 'GET',
894
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/processor_events`,
895
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
896
+ responseType: 'sylphx.money.v1.ListProcessorEventsResponse',
897
+ mutation: false,
898
+ });
899
+ }
900
+ /** Every item of every page of `list`. */
901
+ async *listAll(request) {
902
+ let next = request;
903
+ for (;;) {
904
+ const page = await this.list(next);
905
+ yield* page.processorEvents ?? [];
906
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
907
+ return;
908
+ next = { ...request, pageToken: page.nextPageToken };
909
+ }
910
+ }
911
+ /**
912
+ * Schedules a held event through the existing idempotent application path. The decision is audited; an etag is required.
913
+ *
914
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/processor_events/*}:retry` · permission `billing:processor_events:write` · effect `write`
915
+ *
916
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`.
917
+ */
918
+ async retry(request) {
919
+ return this.client.call({
920
+ method: 'POST',
921
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/processor_events/*', 'name')}:retry`,
922
+ body: runtime.omit(request, ['name']),
923
+ bodyType: 'sylphx.money.v1.RetryProcessorEventRequest',
924
+ responseType: 'sylphx.money.v1.ProcessorEvent',
925
+ mutation: true,
926
+ });
927
+ }
928
+ /**
929
+ * Dismisses only a held test-mode payout observation, retaining the row and audit. Live, unknown-mode and payment events are refused.
930
+ *
931
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/processor_events/*}:dismiss` · permission `billing:processor_events:write` · effect `write`
932
+ *
933
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`.
934
+ */
935
+ async dismiss(request) {
936
+ return this.client.call({
937
+ method: 'POST',
938
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/processor_events/*', 'name')}:dismiss`,
939
+ body: runtime.omit(request, ['name']),
940
+ bodyType: 'sylphx.money.v1.DismissProcessorEventRequest',
941
+ responseType: 'sylphx.money.v1.ProcessorEvent',
942
+ mutation: true,
943
+ });
944
+ }
945
+ }
946
+ /** `merchant_accounts` of Sylphx Money: Resource type `money.sylphx.com/MerchantAccount`. */
947
+ export class MerchantAccountsCollection {
948
+ client;
949
+ constructor(client) {
950
+ this.client = client;
951
+ }
952
+ /**
953
+ * Checks Payouts and Balance read without modifying a merchant, its key or checkout.
954
+ *
955
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:checkProcessorPermissions` · permission `billing:read` · effect `read`
956
+ *
957
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`.
958
+ */
959
+ async checkProcessorPermissions(request) {
960
+ return this.client.call({
961
+ method: 'GET',
962
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}:checkProcessorPermissions`,
963
+ responseType: 'sylphx.money.v1.CheckMerchantAccountProcessorPermissionsResponse',
964
+ mutation: false,
965
+ });
966
+ }
967
+ /**
968
+ * Gets a merchant account.
969
+ *
970
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:read` · effect `read`
971
+ *
972
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
973
+ */
974
+ async get(request) {
975
+ return this.client.call({
976
+ method: 'GET',
977
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}`,
978
+ responseType: 'sylphx.money.v1.MerchantAccount',
979
+ mutation: false,
980
+ });
981
+ }
982
+ /**
983
+ * Lists merchant accounts.
984
+ *
985
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts` · permission `billing:read` · effect `read`
986
+ *
987
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
988
+ */
989
+ async list(request) {
990
+ return this.client.call({
991
+ method: 'GET',
992
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/merchant_accounts`,
993
+ query: { page_size: request.pageSize, page_token: request.pageToken },
994
+ responseType: 'sylphx.money.v1.ListMerchantAccountsResponse',
995
+ mutation: false,
996
+ });
997
+ }
998
+ /** Every item of every page of `list`. */
999
+ async *listAll(request) {
1000
+ let next = request;
1001
+ for (;;) {
1002
+ const page = await this.list(next);
1003
+ yield* page.merchantAccounts ?? [];
1004
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1005
+ return;
1006
+ next = { ...request, pageToken: page.nextPageToken };
1007
+ }
1008
+ }
1009
+ /**
1010
+ * Starts connecting a Stripe account: returns the processor's authorisation
1011
+ * URL for an org owner to open, which the processor's redirect completes.
1012
+ * With a restricted key in the request the account connects at once
1013
+ * instead, and the connected merchant account comes back in the response.
1014
+ *
1015
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts:connect` · permission `billing:write` · effect `write`
1016
+ *
1017
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNAVAILABLE`.
1018
+ */
1019
+ async connect(request) {
1020
+ return this.client.call({
1021
+ method: 'POST',
1022
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/merchant_accounts:connect`,
1023
+ body: runtime.omit(request, ['parent']),
1024
+ bodyType: 'sylphx.money.v1.ConnectMerchantAccountRequest',
1025
+ responseType: 'sylphx.money.v1.ConnectMerchantAccountResponse',
1026
+ mutation: true,
1027
+ });
1028
+ }
1029
+ /**
1030
+ * Reads the connected account back from the processor.
1031
+ *
1032
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:refresh` · permission `billing:write` · effect `write`
1033
+ *
1034
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1035
+ */
1036
+ async refresh(request) {
1037
+ return this.client.call({
1038
+ method: 'POST',
1039
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}:refresh`,
1040
+ body: runtime.omit(request, ['name']),
1041
+ bodyType: 'sylphx.money.v1.RefreshMerchantAccountRequest',
1042
+ responseType: 'sylphx.money.v1.MerchantAccount',
1043
+ mutation: true,
1044
+ });
1045
+ }
1046
+ /**
1047
+ * Disconnects the account: Sylphx loses access; checkout is refused.
1048
+ *
1049
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:disconnect` · permission `billing:write` · effect `destructive`
1050
+ *
1051
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1052
+ */
1053
+ async disconnect(request) {
1054
+ return this.client.call({
1055
+ method: 'POST',
1056
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}:disconnect`,
1057
+ body: runtime.omit(request, ['name']),
1058
+ bodyType: 'sylphx.money.v1.DisconnectMerchantAccountRequest',
1059
+ responseType: 'sylphx.money.v1.MerchantAccount',
1060
+ mutation: true,
1061
+ });
1062
+ }
1063
+ /**
1064
+ * Updates the merchant account's own settings: the fields named in `update_mask`.
1065
+ *
1066
+ * `PATCH /v1/{merchant_account.name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:write` · effect `write`
1067
+ *
1068
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1069
+ */
1070
+ async update(request) {
1071
+ return this.client.call({
1072
+ method: 'PATCH',
1073
+ path: `/v1/${runtime.pathParam(request.merchantAccount?.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'merchant_account.name')}`,
1074
+ query: { update_mask: request.updateMask },
1075
+ body: request.merchantAccount ?? {},
1076
+ bodyType: 'sylphx.money.v1.MerchantAccount',
1077
+ responseType: 'sylphx.money.v1.MerchantAccount',
1078
+ mutation: true,
1079
+ });
1080
+ }
1081
+ }
809
1082
  /** `price_catalogs` of Sylphx Money: Resource type `money.sylphx.com/PriceCatalog`. */
810
1083
  export class PriceCatalogsCollection {
811
1084
  client;
@@ -1330,123 +1603,62 @@ export class EntitlementGrantsCollection {
1330
1603
  });
1331
1604
  }
1332
1605
  }
1333
- /** `merchant_accounts` of Sylphx Money: Resource type `money.sylphx.com/MerchantAccount`. */
1334
- export class MerchantAccountsCollection {
1606
+ /** `test_clocks` of Sylphx Money: Resource type `money.sylphx.com/TestClock`. */
1607
+ export class TestClocksCollection {
1335
1608
  client;
1336
1609
  constructor(client) {
1337
1610
  this.client = client;
1338
1611
  }
1339
1612
  /**
1340
- * Gets a merchant account.
1341
- *
1342
- * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:read` · effect `read`
1343
- *
1344
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1345
- */
1346
- async get(request) {
1347
- return this.client.call({
1348
- method: 'GET',
1349
- path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}`,
1350
- responseType: 'sylphx.money.v1.MerchantAccount',
1351
- mutation: false,
1352
- });
1353
- }
1354
- /**
1355
- * Lists merchant accounts.
1356
- *
1357
- * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts` · permission `billing:read` · effect `read`
1358
- *
1359
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1360
- */
1361
- async list(request) {
1362
- return this.client.call({
1363
- method: 'GET',
1364
- path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/merchant_accounts`,
1365
- query: { page_size: request.pageSize, page_token: request.pageToken },
1366
- responseType: 'sylphx.money.v1.ListMerchantAccountsResponse',
1367
- mutation: false,
1368
- });
1369
- }
1370
- /** Every item of every page of `list`. */
1371
- async *listAll(request) {
1372
- let next = request;
1373
- for (;;) {
1374
- const page = await this.list(next);
1375
- yield* page.merchantAccounts ?? [];
1376
- if (page.nextPageToken === undefined || page.nextPageToken === '')
1377
- return;
1378
- next = { ...request, pageToken: page.nextPageToken };
1379
- }
1380
- }
1381
- /**
1382
- * Starts connecting a Stripe account: returns the processor's authorisation
1383
- * URL for an org owner to open, which the processor's redirect completes.
1384
- * With a restricted key in the request the account connects at once
1385
- * instead, and the connected merchant account comes back in the response.
1613
+ * Creates a test-only Stripe simulation before the subject's first checkout.
1614
+ * No catalogue, payment, subscription, or entitlement is changed.
1386
1615
  *
1387
- * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts:connect` · permission `billing:write` · effect `write`
1616
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/test_clocks` · permission `billing:write` · effect `write`
1388
1617
  *
1389
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNAVAILABLE`.
1618
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_ALREADY_EXISTS`, `UNAVAILABLE`.
1390
1619
  */
1391
- async connect(request) {
1620
+ async create(request) {
1392
1621
  return this.client.call({
1393
1622
  method: 'POST',
1394
- path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/merchant_accounts:connect`,
1395
- body: runtime.omit(request, ['parent']),
1396
- bodyType: 'sylphx.money.v1.ConnectMerchantAccountRequest',
1397
- responseType: 'sylphx.money.v1.ConnectMerchantAccountResponse',
1623
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/test_clocks`,
1624
+ query: { test_clock_id: request.testClockId },
1625
+ body: request.testClock ?? {},
1626
+ bodyType: 'sylphx.money.v1.TestClock',
1627
+ responseType: 'sylphx.money.v1.TestClock',
1398
1628
  mutation: true,
1399
1629
  });
1400
1630
  }
1401
1631
  /**
1402
- * Reads the connected account back from the processor.
1632
+ * Reads the owned test clock back from Stripe. Live keys are refused.
1403
1633
  *
1404
- * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:refresh` · permission `billing:write` · effect `write`
1634
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/test_clocks/*}` · permission `billing:read` · effect `read`
1405
1635
  *
1406
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1636
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_STATE`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1407
1637
  */
1408
- async refresh(request) {
1638
+ async get(request) {
1409
1639
  return this.client.call({
1410
- method: 'POST',
1411
- path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}:refresh`,
1412
- body: runtime.omit(request, ['name']),
1413
- bodyType: 'sylphx.money.v1.RefreshMerchantAccountRequest',
1414
- responseType: 'sylphx.money.v1.MerchantAccount',
1415
- mutation: true,
1640
+ method: 'GET',
1641
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/test_clocks/*', 'name')}`,
1642
+ responseType: 'sylphx.money.v1.TestClock',
1643
+ mutation: false,
1416
1644
  });
1417
1645
  }
1418
1646
  /**
1419
- * Disconnects the account: Sylphx loses access; checkout is refused.
1647
+ * Advances Stripe time, never entitlements. Stripe processes asynchronously;
1648
+ * poll GetTestClock until ready, then observe the genuine webhook's effects.
1649
+ * Time only moves forward, within Stripe's subscription-interval bound.
1420
1650
  *
1421
- * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:disconnect` · permission `billing:write` · effect `destructive`
1651
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/test_clocks/*}:advance` · permission `billing:write` · effect `write`
1422
1652
  *
1423
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1653
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1424
1654
  */
1425
- async disconnect(request) {
1655
+ async advance(request) {
1426
1656
  return this.client.call({
1427
1657
  method: 'POST',
1428
- path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}:disconnect`,
1658
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/test_clocks/*', 'name')}:advance`,
1429
1659
  body: runtime.omit(request, ['name']),
1430
- bodyType: 'sylphx.money.v1.DisconnectMerchantAccountRequest',
1431
- responseType: 'sylphx.money.v1.MerchantAccount',
1432
- mutation: true,
1433
- });
1434
- }
1435
- /**
1436
- * Updates the merchant account's own settings: the fields named in `update_mask`.
1437
- *
1438
- * `PATCH /v1/{merchant_account.name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:write` · effect `write`
1439
- *
1440
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1441
- */
1442
- async update(request) {
1443
- return this.client.call({
1444
- method: 'PATCH',
1445
- path: `/v1/${runtime.pathParam(request.merchantAccount?.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'merchant_account.name')}`,
1446
- query: { update_mask: request.updateMask },
1447
- body: request.merchantAccount ?? {},
1448
- bodyType: 'sylphx.money.v1.MerchantAccount',
1449
- responseType: 'sylphx.money.v1.MerchantAccount',
1660
+ bodyType: 'sylphx.money.v1.AdvanceTestClockRequest',
1661
+ responseType: 'sylphx.money.v1.TestClock',
1450
1662
  mutation: true,
1451
1663
  });
1452
1664
  }