@sylphx/sdk 0.31.0 → 0.32.1

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.
Files changed (120) hide show
  1. package/README.md +131 -4
  2. package/dist/access.d.ts +146 -17
  3. package/dist/access.js +114 -8
  4. package/dist/access.js.map +1 -1
  5. package/dist/agents.d.ts +1564 -0
  6. package/dist/agents.js +1096 -0
  7. package/dist/agents.js.map +1 -0
  8. package/dist/ai.d.ts +1 -2
  9. package/dist/ai.js +2 -3
  10. package/dist/ai.js.map +1 -1
  11. package/dist/artifacts.d.ts +1 -1
  12. package/dist/artifacts.js +2 -2
  13. package/dist/assets.d.ts +447 -0
  14. package/dist/assets.js +266 -0
  15. package/dist/assets.js.map +1 -0
  16. package/dist/auth/client.d.ts +239 -0
  17. package/dist/auth/client.js +337 -0
  18. package/dist/auth/client.js.map +1 -0
  19. package/dist/auth/end-user-keys-mock.d.ts +83 -0
  20. package/dist/auth/end-user-keys-mock.js +427 -0
  21. package/dist/auth/end-user-keys-mock.js.map +1 -0
  22. package/dist/auth/end-user-keys.d.ts +219 -0
  23. package/dist/auth/end-user-keys.js +240 -0
  24. package/dist/auth/end-user-keys.js.map +1 -0
  25. package/dist/auth/verify.d.ts +38 -3
  26. package/dist/auth/verify.js +58 -8
  27. package/dist/auth/verify.js.map +1 -1
  28. package/dist/auth.d.ts +656 -9
  29. package/dist/auth.js +563 -6
  30. package/dist/auth.js.map +1 -1
  31. package/dist/billing.d.ts +99 -21
  32. package/dist/billing.js +43 -5
  33. package/dist/billing.js.map +1 -1
  34. package/dist/broker.d.ts +5 -4
  35. package/dist/broker.js +3 -3
  36. package/dist/broker.js.map +1 -1
  37. package/dist/build.d.ts +362 -29
  38. package/dist/build.js +302 -10
  39. package/dist/build.js.map +1 -1
  40. package/dist/common.d.ts +1 -1
  41. package/dist/common.js +1 -1
  42. package/dist/config/flags.d.ts +140 -0
  43. package/dist/config/flags.js +462 -0
  44. package/dist/config/flags.js.map +1 -0
  45. package/dist/config.d.ts +380 -15
  46. package/dist/config.js +283 -5
  47. package/dist/config.js.map +1 -1
  48. package/dist/connections.d.ts +6 -6
  49. package/dist/connections.js +3 -3
  50. package/dist/data.d.ts +612 -7
  51. package/dist/data.js +566 -4
  52. package/dist/data.js.map +1 -1
  53. package/dist/entitlement.d.ts +10 -8
  54. package/dist/entitlement.js +3 -4
  55. package/dist/entitlement.js.map +1 -1
  56. package/dist/events/realtime.d.ts +69 -0
  57. package/dist/events/realtime.js +107 -0
  58. package/dist/events/realtime.js.map +1 -0
  59. package/dist/events/webhooks.d.ts +40 -0
  60. package/dist/events/webhooks.js +110 -0
  61. package/dist/events/webhooks.js.map +1 -0
  62. package/dist/events.d.ts +369 -22
  63. package/dist/events.js +311 -8
  64. package/dist/events.js.map +1 -1
  65. package/dist/flags.d.ts +18 -0
  66. package/dist/flags.js +44 -0
  67. package/dist/flags.js.map +1 -0
  68. package/dist/hosting.d.ts +13 -14
  69. package/dist/hosting.js +3 -4
  70. package/dist/hosting.js.map +1 -1
  71. package/dist/ids.d.ts +987 -0
  72. package/dist/ids.js +317 -0
  73. package/dist/ids.js.map +1 -0
  74. package/dist/index.d.ts +25 -1
  75. package/dist/index.js +34 -2
  76. package/dist/index.js.map +1 -1
  77. package/dist/keys.d.ts +2 -2
  78. package/dist/keys.js +3 -3
  79. package/dist/knowledge.d.ts +1192 -0
  80. package/dist/knowledge.js +1002 -0
  81. package/dist/knowledge.js.map +1 -0
  82. package/dist/localization.d.ts +663 -0
  83. package/dist/localization.js +491 -0
  84. package/dist/localization.js.map +1 -0
  85. package/dist/methods.js +3251 -133
  86. package/dist/methods.js.map +1 -1
  87. package/dist/money.d.ts +3086 -0
  88. package/dist/money.js +2358 -0
  89. package/dist/money.js.map +1 -0
  90. package/dist/network.d.ts +4 -5
  91. package/dist/network.js +3 -4
  92. package/dist/network.js.map +1 -1
  93. package/dist/notify.d.ts +667 -125
  94. package/dist/notify.js +471 -73
  95. package/dist/notify.js.map +1 -1
  96. package/dist/observability.d.ts +322 -7
  97. package/dist/observability.js +244 -8
  98. package/dist/observability.js.map +1 -1
  99. package/dist/realtime.d.ts +404 -0
  100. package/dist/realtime.js +312 -0
  101. package/dist/realtime.js.map +1 -0
  102. package/dist/release.d.ts +14 -15
  103. package/dist/release.js +3 -4
  104. package/dist/release.js.map +1 -1
  105. package/dist/runners.d.ts +2 -3
  106. package/dist/runners.js +3 -4
  107. package/dist/runners.js.map +1 -1
  108. package/dist/runtime.d.ts +5 -1
  109. package/dist/runtime.js +7 -3
  110. package/dist/runtime.js.map +1 -1
  111. package/dist/sandboxes.d.ts +64 -20
  112. package/dist/sandboxes.js +9 -4
  113. package/dist/sandboxes.js.map +1 -1
  114. package/dist/secrets.d.ts +342 -6
  115. package/dist/secrets.js +271 -4
  116. package/dist/secrets.js.map +1 -1
  117. package/dist/workflows.d.ts +969 -15
  118. package/dist/workflows.js +815 -6
  119. package/dist/workflows.js.map +1 -1
  120. package/package.json +2 -2
package/dist/money.js ADDED
@@ -0,0 +1,2358 @@
1
+ // @generated by sylphx-gen 0.1.0 from contracts@c8a7361c53e572321b0ec9fb014fd1e8279b007b62562423038e0d0e5b9d767a. Do not edit.
2
+ // `sylphx.money.v1`.
3
+ import * as runtime from './runtime.js';
4
+ import './common.js';
5
+ runtime.registerSchemas({
6
+ 'sylphx.money.v1.AppStoreConnection': [
7
+ ['bundleIds', 'bundle_ids'],
8
+ ['issuerId', 'issuer_id'],
9
+ ['keyId', 'key_id'],
10
+ ['privateKey', 'private_key'],
11
+ ['appAppleId', 'app_apple_id'],
12
+ ['accountTokenPrefix', 'account_token_prefix'],
13
+ ],
14
+ 'sylphx.money.v1.BatchIngestUsageEventsRequest': [
15
+ ['usageEvents', 'usage_events', 'sylphx.money.v1.IngestedUsageEvent'],
16
+ ],
17
+ 'sylphx.money.v1.BatchIngestUsageEventsResponse': [
18
+ ['results', 'results', 'sylphx.money.v1.IngestedUsageEventResult'],
19
+ ],
20
+ 'sylphx.money.v1.CancelCustomerSubscriptionRequest': [
21
+ ['atPeriodEnd', 'at_period_end'],
22
+ ['refundLastPayment', 'refund_last_payment'],
23
+ ],
24
+ 'sylphx.money.v1.Catalog': [
25
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
26
+ ['spec', 'spec', 'sylphx.money.v1.CatalogSpec'],
27
+ ['status', 'status', 'sylphx.money.v1.CatalogStatus'],
28
+ ],
29
+ 'sylphx.money.v1.CatalogSpec': [
30
+ ['features', 'features', 'sylphx.money.v1.Feature'],
31
+ ['products', 'products', 'sylphx.money.v1.Product'],
32
+ ['clientGrantTtl', 'client_grant_ttl'],
33
+ ['refundClawBack', 'refund_claw_back'],
34
+ ],
35
+ 'sylphx.money.v1.CatalogStatus': [
36
+ ['observedGeneration', 'observed_generation'],
37
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
38
+ ['syncTime', 'sync_time'],
39
+ ['processorPriceIds', 'processor_price_ids', undefined, 'map'],
40
+ ],
41
+ 'sylphx.money.v1.ChangeCustomerSubscriptionPlanRequest': [
42
+ ['prorationBehavior', 'proration_behavior'],
43
+ ['validateOnly', 'validate_only'],
44
+ ],
45
+ 'sylphx.money.v1.CheckEntitlementRequest': [
46
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
47
+ ],
48
+ 'sylphx.money.v1.CheckEntitlementResponse': [
49
+ ['entitlementGrant', 'entitlement_grant'],
50
+ ['expireTime', 'expire_time'],
51
+ ],
52
+ 'sylphx.money.v1.CheckUsageStandingRequest': [
53
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
54
+ ['subjectProof', 'subject_proof'],
55
+ ['actorProof', 'actor_proof'],
56
+ ],
57
+ 'sylphx.money.v1.CheckoutPolicy': [
58
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
59
+ ['spec', 'spec', 'sylphx.money.v1.CheckoutPolicySpec'],
60
+ ],
61
+ 'sylphx.money.v1.CheckoutPolicySpec': [
62
+ ['deniedCountryCodes', 'denied_country_codes'],
63
+ ['allowTaxIdBuyers', 'allow_tax_id_buyers'],
64
+ ],
65
+ 'sylphx.money.v1.CheckoutSession': [
66
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
67
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
68
+ ['lineItems', 'line_items', 'sylphx.money.v1.LineItem'],
69
+ ['successUrl', 'success_url'],
70
+ ['cancelUrl', 'cancel_url'],
71
+ ['currencyCode', 'currency_code'],
72
+ ['metadata', 'metadata', undefined, 'map'],
73
+ ['allowPromotionCodes', 'allow_promotion_codes'],
74
+ ['buyerCountryCode', 'buyer_country_code'],
75
+ ['expireTime', 'expire_time'],
76
+ ['processorSessionId', 'processor_session_id'],
77
+ ['deniedReason', 'denied_reason'],
78
+ ['billingCountryCode', 'billing_country_code'],
79
+ ['billingSubdivisionCode', 'billing_subdivision_code'],
80
+ ],
81
+ 'sylphx.money.v1.ClientVerifyStorePurchaseRequest': [
82
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
83
+ ['signedTransaction', 'signed_transaction'],
84
+ ['purchaseToken', 'purchase_token'],
85
+ ['productId', 'product_id'],
86
+ ['packageName', 'package_name'],
87
+ ['accountToken', 'account_token'],
88
+ ],
89
+ 'sylphx.money.v1.ConnectMerchantAccountRequest': [
90
+ ['merchantAccountId', 'merchant_account_id'],
91
+ ['returnUrl', 'return_url'],
92
+ ['restrictedKey', 'restricted_key'],
93
+ ],
94
+ 'sylphx.money.v1.ConnectMerchantAccountResponse': [
95
+ ['authorizeUrl', 'authorize_url'],
96
+ ['expireTime', 'expire_time'],
97
+ ['merchantAccount', 'merchant_account', 'sylphx.money.v1.MerchantAccount'],
98
+ ],
99
+ 'sylphx.money.v1.CreateCheckoutSessionRequest': [
100
+ ['checkoutSession', 'checkout_session', 'sylphx.money.v1.CheckoutSession'],
101
+ ['checkoutSessionId', 'checkout_session_id'],
102
+ ],
103
+ 'sylphx.money.v1.CreateCreditGrantRequest': [
104
+ ['creditGrant', 'credit_grant', 'sylphx.money.v1.CreditGrant'],
105
+ ],
106
+ 'sylphx.money.v1.CreateEntitlementGrantRequest': [
107
+ ['entitlementGrantId', 'entitlement_grant_id'],
108
+ ['entitlementGrant', 'entitlement_grant', 'sylphx.money.v1.EntitlementGrant'],
109
+ ],
110
+ 'sylphx.money.v1.CreatePortalSessionRequest': [
111
+ ['portalSession', 'portal_session', 'sylphx.money.v1.PortalSession'],
112
+ ['portalSessionId', 'portal_session_id'],
113
+ ],
114
+ 'sylphx.money.v1.CreateRevenueSourceRequest': [
115
+ ['revenueSourceId', 'revenue_source_id'],
116
+ ['revenueSource', 'revenue_source', 'sylphx.money.v1.RevenueSource'],
117
+ ['validateOnly', 'validate_only'],
118
+ ],
119
+ 'sylphx.money.v1.CreateStoreConnectionRequest': [
120
+ ['storeConnectionId', 'store_connection_id'],
121
+ ['storeConnection', 'store_connection', 'sylphx.money.v1.StoreConnection'],
122
+ ['validateOnly', 'validate_only'],
123
+ ],
124
+ 'sylphx.money.v1.CreateUsageEventRequest': [
125
+ ['usageEvent', 'usage_event', 'sylphx.money.v1.UsageEvent'],
126
+ ],
127
+ 'sylphx.money.v1.CreateUsageMeterPriceRequest': [
128
+ ['usageMeterPrice', 'usage_meter_price', 'sylphx.money.v1.UsageMeterPrice'],
129
+ ],
130
+ 'sylphx.money.v1.CreateUsageReservationRequest': [
131
+ ['usageReservation', 'usage_reservation', 'sylphx.money.v1.UsageReservation'],
132
+ ],
133
+ 'sylphx.money.v1.CreditGrant': [
134
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
135
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
136
+ ['amountMinor', 'amount_minor'],
137
+ ['startTime', 'start_time'],
138
+ ['expireTime', 'expire_time'],
139
+ ['taxTreatment', 'tax_treatment'],
140
+ ['collectionMode', 'collection_mode'],
141
+ ],
142
+ 'sylphx.money.v1.CustomerSubscription': [
143
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
144
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
145
+ ['processorSubscriptionId', 'processor_subscription_id'],
146
+ ['items', 'items', 'sylphx.money.v1.LineItem'],
147
+ ['currentPeriodEndTime', 'current_period_end_time'],
148
+ ['cancelAtPeriodEnd', 'cancel_at_period_end'],
149
+ ['trialEndTime', 'trial_end_time'],
150
+ ['metadata', 'metadata', undefined, 'json'],
151
+ ],
152
+ 'sylphx.money.v1.DeleteRevenueSourceRequest': [
153
+ ['validateOnly', 'validate_only'],
154
+ ],
155
+ 'sylphx.money.v1.DeleteStoreConnectionRequest': [],
156
+ 'sylphx.money.v1.DisconnectMerchantAccountRequest': [],
157
+ 'sylphx.money.v1.EntitlementGrant': [
158
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
159
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
160
+ ['expireTime', 'expire_time'],
161
+ ['approvalRef', 'approval_ref'],
162
+ ],
163
+ 'sylphx.money.v1.ExchangeRate': [
164
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
165
+ ['currencyCode', 'currency_code'],
166
+ ['perUsd', 'per_usd'],
167
+ ['publicationDay', 'publication_day'],
168
+ ],
169
+ 'sylphx.money.v1.Feature': [
170
+ ['displayName', 'display_name'],
171
+ ],
172
+ 'sylphx.money.v1.GenerateLicenceKeyRequest': [
173
+ ['licenceKeyId', 'licence_key_id'],
174
+ ['spec', 'spec', 'sylphx.money.v1.LicenceKeySpec'],
175
+ ],
176
+ 'sylphx.money.v1.GetCatalogRequest': [],
177
+ 'sylphx.money.v1.GetCheckoutPolicyRequest': [],
178
+ 'sylphx.money.v1.GetCheckoutSessionRequest': [],
179
+ 'sylphx.money.v1.GetCreditGrantRequest': [],
180
+ 'sylphx.money.v1.GetCustomerSubscriptionRequest': [],
181
+ 'sylphx.money.v1.GetEntitlementGrantRequest': [],
182
+ 'sylphx.money.v1.GetLicenceKeyRequest': [],
183
+ 'sylphx.money.v1.GetMerchantAccountRequest': [],
184
+ 'sylphx.money.v1.GetPortalSessionRequest': [],
185
+ 'sylphx.money.v1.GetRevenueSourceRequest': [],
186
+ 'sylphx.money.v1.GetRevenueSummaryRequest': [
187
+ ['startDay', 'start_day'],
188
+ ['endDay', 'end_day'],
189
+ ['groupBy', 'group_by'],
190
+ ['currencyCode', 'currency_code'],
191
+ ],
192
+ 'sylphx.money.v1.GetStoreConnectionRequest': [],
193
+ 'sylphx.money.v1.GetStorePurchaseRequest': [],
194
+ 'sylphx.money.v1.GetUsageInvoiceRequest': [],
195
+ 'sylphx.money.v1.GetUsageMeterRequest': [],
196
+ 'sylphx.money.v1.GetUsageReservationRequest': [],
197
+ 'sylphx.money.v1.GetUsageSettingsRequest': [],
198
+ 'sylphx.money.v1.GooglePlayConnection': [
199
+ ['packageNames', 'package_names'],
200
+ ['serviceAccountJson', 'service_account_json'],
201
+ ['notificationAudience', 'notification_audience'],
202
+ ['notificationServiceAccount', 'notification_service_account'],
203
+ ],
204
+ 'sylphx.money.v1.ImportLicenceKeyRequest': [
205
+ ['licenceKeyId', 'licence_key_id'],
206
+ ['privateKeyPkcs8', 'private_key_pkcs8'],
207
+ ['expectedPublicKey', 'expected_public_key'],
208
+ ['spec', 'spec', 'sylphx.money.v1.LicenceKeySpec'],
209
+ ],
210
+ 'sylphx.money.v1.IngestedUsageEvent': [
211
+ ['eventId', 'event_id'],
212
+ ['meterVersion', 'meter_version'],
213
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
214
+ ['occurredTime', 'occurred_time'],
215
+ ],
216
+ 'sylphx.money.v1.IngestedUsageEventResult': [
217
+ ['eventId', 'event_id'],
218
+ ['usageEvent', 'usage_event'],
219
+ ],
220
+ 'sylphx.money.v1.LicenceKey': [
221
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
222
+ ['spec', 'spec', 'sylphx.money.v1.LicenceKeySpec'],
223
+ ['status', 'status', 'sylphx.money.v1.LicenceKeyStatus'],
224
+ ],
225
+ 'sylphx.money.v1.LicenceKeySpec': [],
226
+ 'sylphx.money.v1.LicenceKeyStatus': [
227
+ ['observedGeneration', 'observed_generation'],
228
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
229
+ ['publicKey', 'public_key'],
230
+ ['retireTime', 'retire_time'],
231
+ ],
232
+ 'sylphx.money.v1.LicencePolicy': [
233
+ ['tokenProduct', 'token_product'],
234
+ ['term', 'term', 'sylphx.money.v1.LicenceTerm'],
235
+ ],
236
+ 'sylphx.money.v1.LicenceTerm': [],
237
+ 'sylphx.money.v1.LicenceToken': [
238
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
239
+ ['tokenProduct', 'token_product'],
240
+ ['issueTime', 'issue_time'],
241
+ ['expireTime', 'expire_time'],
242
+ ],
243
+ 'sylphx.money.v1.LineItem': [],
244
+ 'sylphx.money.v1.ListCreditGrantsRequest': [
245
+ ['pageSize', 'page_size'],
246
+ ['pageToken', 'page_token'],
247
+ ],
248
+ 'sylphx.money.v1.ListCreditGrantsResponse': [
249
+ ['creditGrants', 'credit_grants', 'sylphx.money.v1.CreditGrant'],
250
+ ['nextPageToken', 'next_page_token'],
251
+ ],
252
+ 'sylphx.money.v1.ListCustomerSubscriptionsRequest': [
253
+ ['pageSize', 'page_size'],
254
+ ['pageToken', 'page_token'],
255
+ ],
256
+ 'sylphx.money.v1.ListCustomerSubscriptionsResponse': [
257
+ ['customerSubscriptions', 'customer_subscriptions', 'sylphx.money.v1.CustomerSubscription'],
258
+ ['nextPageToken', 'next_page_token'],
259
+ ],
260
+ 'sylphx.money.v1.ListEntitlementGrantsRequest': [
261
+ ['pageSize', 'page_size'],
262
+ ['pageToken', 'page_token'],
263
+ ],
264
+ 'sylphx.money.v1.ListEntitlementGrantsResponse': [
265
+ ['entitlementGrants', 'entitlement_grants', 'sylphx.money.v1.EntitlementGrant'],
266
+ ['nextPageToken', 'next_page_token'],
267
+ ],
268
+ 'sylphx.money.v1.ListExchangeRatesRequest': [
269
+ ['pageSize', 'page_size'],
270
+ ['pageToken', 'page_token'],
271
+ ],
272
+ 'sylphx.money.v1.ListExchangeRatesResponse': [
273
+ ['exchangeRates', 'exchange_rates', 'sylphx.money.v1.ExchangeRate'],
274
+ ['nextPageToken', 'next_page_token'],
275
+ ],
276
+ 'sylphx.money.v1.ListLicenceKeysRequest': [
277
+ ['pageSize', 'page_size'],
278
+ ['pageToken', 'page_token'],
279
+ ],
280
+ 'sylphx.money.v1.ListLicenceKeysResponse': [
281
+ ['licenceKeys', 'licence_keys', 'sylphx.money.v1.LicenceKey'],
282
+ ['nextPageToken', 'next_page_token'],
283
+ ],
284
+ 'sylphx.money.v1.ListLicenceTokensRequest': [
285
+ ['pageSize', 'page_size'],
286
+ ['pageToken', 'page_token'],
287
+ ],
288
+ 'sylphx.money.v1.ListLicenceTokensResponse': [
289
+ ['licenceTokens', 'licence_tokens', 'sylphx.money.v1.LicenceToken'],
290
+ ['nextPageToken', 'next_page_token'],
291
+ ],
292
+ 'sylphx.money.v1.ListMerchantAccountsRequest': [
293
+ ['pageSize', 'page_size'],
294
+ ['pageToken', 'page_token'],
295
+ ],
296
+ 'sylphx.money.v1.ListMerchantAccountsResponse': [
297
+ ['merchantAccounts', 'merchant_accounts', 'sylphx.money.v1.MerchantAccount'],
298
+ ['nextPageToken', 'next_page_token'],
299
+ ],
300
+ 'sylphx.money.v1.ListRevenueFactsRequest': [
301
+ ['pageSize', 'page_size'],
302
+ ['pageToken', 'page_token'],
303
+ ],
304
+ 'sylphx.money.v1.ListRevenueFactsResponse': [
305
+ ['revenueFacts', 'revenue_facts', 'sylphx.money.v1.RevenueFact'],
306
+ ['nextPageToken', 'next_page_token'],
307
+ ],
308
+ 'sylphx.money.v1.ListRevenueSourcesRequest': [
309
+ ['pageSize', 'page_size'],
310
+ ['pageToken', 'page_token'],
311
+ ],
312
+ 'sylphx.money.v1.ListRevenueSourcesResponse': [
313
+ ['revenueSources', 'revenue_sources', 'sylphx.money.v1.RevenueSource'],
314
+ ['nextPageToken', 'next_page_token'],
315
+ ],
316
+ 'sylphx.money.v1.ListStoreConnectionsRequest': [
317
+ ['pageSize', 'page_size'],
318
+ ['pageToken', 'page_token'],
319
+ ],
320
+ 'sylphx.money.v1.ListStoreConnectionsResponse': [
321
+ ['storeConnections', 'store_connections', 'sylphx.money.v1.StoreConnection'],
322
+ ['nextPageToken', 'next_page_token'],
323
+ ],
324
+ 'sylphx.money.v1.ListStorePurchasesRequest': [
325
+ ['pageSize', 'page_size'],
326
+ ['pageToken', 'page_token'],
327
+ ],
328
+ 'sylphx.money.v1.ListStorePurchasesResponse': [
329
+ ['storePurchases', 'store_purchases', 'sylphx.money.v1.StorePurchase'],
330
+ ['nextPageToken', 'next_page_token'],
331
+ ],
332
+ 'sylphx.money.v1.ListTaxThresholdStatusesRequest': [
333
+ ['pageSize', 'page_size'],
334
+ ['pageToken', 'page_token'],
335
+ ],
336
+ 'sylphx.money.v1.ListTaxThresholdStatusesResponse': [
337
+ ['taxThresholdStatuses', 'tax_threshold_statuses', 'sylphx.money.v1.TaxThresholdStatus'],
338
+ ['nextPageToken', 'next_page_token'],
339
+ ],
340
+ 'sylphx.money.v1.ListUsageEventsRequest': [
341
+ ['pageSize', 'page_size'],
342
+ ['pageToken', 'page_token'],
343
+ ],
344
+ 'sylphx.money.v1.ListUsageEventsResponse': [
345
+ ['usageEvents', 'usage_events', 'sylphx.money.v1.UsageEvent'],
346
+ ['nextPageToken', 'next_page_token'],
347
+ ],
348
+ 'sylphx.money.v1.ListUsageInvoicesRequest': [
349
+ ['pageSize', 'page_size'],
350
+ ['pageToken', 'page_token'],
351
+ ],
352
+ 'sylphx.money.v1.ListUsageInvoicesResponse': [
353
+ ['usageInvoices', 'usage_invoices', 'sylphx.money.v1.UsageInvoice'],
354
+ ['nextPageToken', 'next_page_token'],
355
+ ],
356
+ 'sylphx.money.v1.ListUsageMeterPricesRequest': [
357
+ ['pageSize', 'page_size'],
358
+ ['pageToken', 'page_token'],
359
+ ],
360
+ 'sylphx.money.v1.ListUsageMeterPricesResponse': [
361
+ ['usageMeterPrices', 'usage_meter_prices', 'sylphx.money.v1.UsageMeterPrice'],
362
+ ['nextPageToken', 'next_page_token'],
363
+ ],
364
+ 'sylphx.money.v1.ListUsageMetersRequest': [
365
+ ['pageSize', 'page_size'],
366
+ ['pageToken', 'page_token'],
367
+ ],
368
+ 'sylphx.money.v1.ListUsageMetersResponse': [
369
+ ['usageMeters', 'usage_meters', 'sylphx.money.v1.UsageMeter'],
370
+ ['nextPageToken', 'next_page_token'],
371
+ ],
372
+ 'sylphx.money.v1.ListUsageTiersRequest': [
373
+ ['pageSize', 'page_size'],
374
+ ['pageToken', 'page_token'],
375
+ ],
376
+ 'sylphx.money.v1.ListUsageTiersResponse': [
377
+ ['usageTiers', 'usage_tiers', 'sylphx.money.v1.UsageTier'],
378
+ ['nextPageToken', 'next_page_token'],
379
+ ],
380
+ 'sylphx.money.v1.MerchantAccount': [
381
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
382
+ ['accountId', 'account_id'],
383
+ ['chargesEnabled', 'charges_enabled'],
384
+ ['payoutsEnabled', 'payouts_enabled'],
385
+ ['businessName', 'business_name'],
386
+ ['regionCode', 'region_code'],
387
+ ['defaultCurrencyCode', 'default_currency_code'],
388
+ ['refreshTime', 'refresh_time'],
389
+ ['automaticTax', 'automatic_tax'],
390
+ ],
391
+ 'sylphx.money.v1.PortalSession': [
392
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
393
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
394
+ ['returnUrl', 'return_url'],
395
+ ],
396
+ 'sylphx.money.v1.Price': [
397
+ ['recurringInterval', 'recurring_interval'],
398
+ ['recurringIntervalCount', 'recurring_interval_count'],
399
+ ['unitAmounts', 'unit_amounts', undefined, 'map'],
400
+ ['taxBehavior', 'tax_behavior'],
401
+ ['trialDays', 'trial_days'],
402
+ ['defaultCurrency', 'default_currency'],
403
+ ],
404
+ 'sylphx.money.v1.Product': [
405
+ ['displayName', 'display_name'],
406
+ ['features', 'features', undefined, 'map'],
407
+ ['prices', 'prices', 'sylphx.money.v1.Price'],
408
+ ['storeProductIds', 'store_product_ids', undefined, 'map'],
409
+ ['grants', 'grants', undefined, 'map'],
410
+ ['licence', 'licence', 'sylphx.money.v1.LicencePolicy'],
411
+ ],
412
+ 'sylphx.money.v1.RefreshMerchantAccountRequest': [],
413
+ 'sylphx.money.v1.ReleaseUsageInvoiceCollectionRequest': [],
414
+ 'sylphx.money.v1.ReleaseUsageReservationRequest': [],
415
+ 'sylphx.money.v1.ResumeCustomerSubscriptionRequest': [],
416
+ 'sylphx.money.v1.RetireLicenceKeyRequest': [],
417
+ 'sylphx.money.v1.RevenueBucket': [
418
+ ['startDay', 'start_day'],
419
+ ['unconvertedCount', 'unconverted_count'],
420
+ ['lines', 'lines', 'sylphx.money.v1.RevenueLine'],
421
+ ],
422
+ 'sylphx.money.v1.RevenueFact': [
423
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
424
+ ['externalKey', 'external_key'],
425
+ ['storeKind', 'store_kind'],
426
+ ['accountRef', 'account_ref'],
427
+ ['productRef', 'product_ref'],
428
+ ['regionCode', 'region_code'],
429
+ ['currencyCode', 'currency_code'],
430
+ ['settledOn', 'settled_on'],
431
+ ],
432
+ 'sylphx.money.v1.RevenueLine': [],
433
+ 'sylphx.money.v1.RevenueSource': [
434
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
435
+ ['spec', 'spec', 'sylphx.money.v1.RevenueSourceSpec'],
436
+ ['status', 'status', 'sylphx.money.v1.RevenueSourceStatus'],
437
+ ],
438
+ 'sylphx.money.v1.RevenueSourceSpec': [
439
+ ['displayName', 'display_name'],
440
+ ['config', 'config', undefined, 'map'],
441
+ ],
442
+ 'sylphx.money.v1.RevenueSourceStatus': [
443
+ ['observedGeneration', 'observed_generation'],
444
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
445
+ ['lastSuccessTime', 'last_success_time'],
446
+ ['newestDay', 'newest_day'],
447
+ ['lastRunState', 'last_run_state'],
448
+ ['lastRunError', 'last_run_error'],
449
+ ],
450
+ 'sylphx.money.v1.RevenueSummary': [
451
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
452
+ ['startDay', 'start_day'],
453
+ ['endDay', 'end_day'],
454
+ ['currencyCode', 'currency_code'],
455
+ ['groupBy', 'group_by'],
456
+ ['buckets', 'buckets', 'sylphx.money.v1.RevenueBucket'],
457
+ ['lines', 'lines', 'sylphx.money.v1.RevenueLine'],
458
+ ['staleSources', 'stale_sources', 'sylphx.money.v1.StaleRevenueSource'],
459
+ ['unconverted', 'unconverted', 'sylphx.money.v1.UnconvertedAmount'],
460
+ ['unconvertedCount', 'unconverted_count'],
461
+ ],
462
+ 'sylphx.money.v1.RunRevenueSourceRequest': [
463
+ ['startDay', 'start_day'],
464
+ ['endDay', 'end_day'],
465
+ ],
466
+ 'sylphx.money.v1.RunRevenueSourceResponse': [
467
+ ['revenueSource', 'revenue_source', 'sylphx.money.v1.RevenueSource'],
468
+ ],
469
+ 'sylphx.money.v1.SettleUsageReservationRequest': [
470
+ ['quantityUsed', 'quantity_used'],
471
+ ['occurredTime', 'occurred_time'],
472
+ ],
473
+ 'sylphx.money.v1.StaleRevenueSource': [
474
+ ['displayName', 'display_name'],
475
+ ['newestDay', 'newest_day'],
476
+ ],
477
+ 'sylphx.money.v1.StoreConnection': [
478
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
479
+ ['spec', 'spec', 'sylphx.money.v1.StoreConnectionSpec'],
480
+ ['status', 'status', 'sylphx.money.v1.StoreConnectionStatus'],
481
+ ],
482
+ 'sylphx.money.v1.StoreConnectionSpec': [
483
+ ['appStore', 'app_store', 'sylphx.money.v1.AppStoreConnection'],
484
+ ['googlePlay', 'google_play', 'sylphx.money.v1.GooglePlayConnection'],
485
+ ['allowSandbox', 'allow_sandbox'],
486
+ ['requireAccountToken', 'require_account_token'],
487
+ ['clientVerify', 'client_verify'],
488
+ ],
489
+ 'sylphx.money.v1.StoreConnectionStatus': [
490
+ ['observedGeneration', 'observed_generation'],
491
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
492
+ ['credentialSet', 'credential_set'],
493
+ ['notificationUrl', 'notification_url'],
494
+ ['serviceAccountEmail', 'service_account_email'],
495
+ ],
496
+ 'sylphx.money.v1.StorePurchase': [
497
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
498
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
499
+ ['productId', 'product_id'],
500
+ ['bundleOrPackage', 'bundle_or_package'],
501
+ ['transactionId', 'transaction_id'],
502
+ ['originalTransactionId', 'original_transaction_id'],
503
+ ['purchaseTime', 'purchase_time'],
504
+ ['revokeTime', 'revoke_time'],
505
+ ['currencyCode', 'currency_code'],
506
+ ['customerSubscription', 'customer_subscription'],
507
+ ['regionCode', 'region_code'],
508
+ ['originalPurchaseTime', 'original_purchase_time'],
509
+ ['clawBack', 'claw_back'],
510
+ ],
511
+ 'sylphx.money.v1.Subject': [
512
+ ['endUser', 'end_user'],
513
+ ['customerOrganization', 'customer_organization'],
514
+ ],
515
+ 'sylphx.money.v1.SyncCatalogRequest': [],
516
+ 'sylphx.money.v1.TaxThresholdStatus': [
517
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
518
+ ['regionCode', 'region_code'],
519
+ ['subdivisionCode', 'subdivision_code'],
520
+ ['taxName', 'tax_name'],
521
+ ['currencyCode', 'currency_code'],
522
+ ['thresholdAmount', 'threshold_amount'],
523
+ ['thresholdTransactionCount', 'threshold_transaction_count'],
524
+ ['windowKind', 'window_kind'],
525
+ ['windowStartTime', 'window_start_time'],
526
+ ['windowEndTime', 'window_end_time'],
527
+ ['salesAmount', 'sales_amount'],
528
+ ['salesTransactionCount', 'sales_transaction_count'],
529
+ ['alertedPercent', 'alerted_percent'],
530
+ ['unconvertedCurrencyCodes', 'unconverted_currency_codes'],
531
+ ['sourceUrl', 'source_url'],
532
+ ['effectiveTime', 'effective_time'],
533
+ ],
534
+ 'sylphx.money.v1.UnconvertedAmount': [
535
+ ['currencyCode', 'currency_code'],
536
+ ],
537
+ 'sylphx.money.v1.UpdateCatalogRequest': [
538
+ ['catalog', 'catalog', 'sylphx.money.v1.Catalog'],
539
+ ['updateMask', 'update_mask'],
540
+ ['allowMissing', 'allow_missing'],
541
+ ['validateOnly', 'validate_only'],
542
+ ],
543
+ 'sylphx.money.v1.UpdateCheckoutPolicyRequest': [
544
+ ['checkoutPolicy', 'checkout_policy', 'sylphx.money.v1.CheckoutPolicy'],
545
+ ['updateMask', 'update_mask'],
546
+ ['allowMissing', 'allow_missing'],
547
+ ['validateOnly', 'validate_only'],
548
+ ],
549
+ 'sylphx.money.v1.UpdateCustomerSubscriptionQuantityRequest': [
550
+ ['prorationBehavior', 'proration_behavior'],
551
+ ],
552
+ 'sylphx.money.v1.UpdateMerchantAccountRequest': [
553
+ ['merchantAccount', 'merchant_account', 'sylphx.money.v1.MerchantAccount'],
554
+ ['updateMask', 'update_mask'],
555
+ ],
556
+ 'sylphx.money.v1.UpdateRevenueSourceRequest': [
557
+ ['revenueSource', 'revenue_source', 'sylphx.money.v1.RevenueSource'],
558
+ ['updateMask', 'update_mask'],
559
+ ['validateOnly', 'validate_only'],
560
+ ],
561
+ 'sylphx.money.v1.UpdateStoreConnectionRequest': [
562
+ ['storeConnection', 'store_connection', 'sylphx.money.v1.StoreConnection'],
563
+ ['updateMask', 'update_mask'],
564
+ ['allowMissing', 'allow_missing'],
565
+ ['validateOnly', 'validate_only'],
566
+ ],
567
+ 'sylphx.money.v1.UpdateUsageMeterRequest': [
568
+ ['usageMeter', 'usage_meter', 'sylphx.money.v1.UsageMeter'],
569
+ ['updateMask', 'update_mask'],
570
+ ],
571
+ 'sylphx.money.v1.UpdateUsageSettingsRequest': [
572
+ ['usageSettings', 'usage_settings', 'sylphx.money.v1.UsageSettings'],
573
+ ['updateMask', 'update_mask'],
574
+ ],
575
+ 'sylphx.money.v1.UpdateUsageTierRequest': [
576
+ ['usageTier', 'usage_tier', 'sylphx.money.v1.UsageTier'],
577
+ ['updateMask', 'update_mask'],
578
+ ],
579
+ 'sylphx.money.v1.UsageEvent': [
580
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
581
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
582
+ ['subjectProof', 'subject_proof'],
583
+ ['actorProof', 'actor_proof'],
584
+ ['occurredTime', 'occurred_time'],
585
+ ['amountNano', 'amount_nano'],
586
+ ['usageReservation', 'usage_reservation'],
587
+ ],
588
+ 'sylphx.money.v1.UsageInvoice': [
589
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
590
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
591
+ ['taxPendingReason', 'tax_pending_reason'],
592
+ ['grossMinor', 'gross_minor'],
593
+ ['subtotalMinor', 'subtotal_minor'],
594
+ ['taxMinor', 'tax_minor'],
595
+ ['postTaxCreditMinor', 'post_tax_credit_minor'],
596
+ ['totalMinor', 'total_minor'],
597
+ ['amountPaidMinor', 'amount_paid_minor'],
598
+ ['collectionMode', 'collection_mode'],
599
+ ['issueTime', 'issue_time'],
600
+ ['dueTime', 'due_time'],
601
+ ],
602
+ 'sylphx.money.v1.UsageMeter': [
603
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
604
+ ['displayName', 'display_name'],
605
+ ['reservationOptional', 'reservation_optional'],
606
+ ['currentUnitPriceNano', 'current_unit_price_nano'],
607
+ ],
608
+ 'sylphx.money.v1.UsageMeterPrice': [
609
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
610
+ ['currencyCode', 'currency_code'],
611
+ ['unitPriceNano', 'unit_price_nano'],
612
+ ['effectiveTime', 'effective_time'],
613
+ ['taxCode', 'tax_code'],
614
+ ],
615
+ 'sylphx.money.v1.UsageReservation': [
616
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
617
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
618
+ ['subjectProof', 'subject_proof'],
619
+ ['actorProof', 'actor_proof'],
620
+ ['maxQuantity', 'max_quantity'],
621
+ ['grantedQuantity', 'granted_quantity'],
622
+ ['expireTime', 'expire_time'],
623
+ ['darkRefusal', 'dark_refusal'],
624
+ ],
625
+ 'sylphx.money.v1.UsageSettings': [
626
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
627
+ ['currencyCode', 'currency_code'],
628
+ ['enforcementEnabled', 'enforcement_enabled'],
629
+ ['freeAllowanceNano', 'free_allowance_nano'],
630
+ ['pastDueGraceDays', 'past_due_grace_days'],
631
+ ['suspendGraceDays', 'suspend_grace_days'],
632
+ ['extraIssuer', 'extra_issuer'],
633
+ ['extraIssuerJwksUrl', 'extra_issuer_jwks_url'],
634
+ ['extraIssuerAudience', 'extra_issuer_audience'],
635
+ ['extraIssuerOrgClaim', 'extra_issuer_org_claim'],
636
+ ],
637
+ 'sylphx.money.v1.UsageStanding': [
638
+ ['paymentMethodOnFile', 'payment_method_on_file'],
639
+ ['headroomMinor', 'headroom_minor'],
640
+ ['thresholdMinor', 'threshold_minor'],
641
+ ],
642
+ 'sylphx.money.v1.UsageTier': [
643
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
644
+ ['dailyLimitMinor', 'daily_limit_minor'],
645
+ ['monthlyLimitMinor', 'monthly_limit_minor'],
646
+ ['thresholdMinor', 'threshold_minor'],
647
+ ['requiresPaidInvoices', 'requires_paid_invoices'],
648
+ ['requiresPaidMinor', 'requires_paid_minor'],
649
+ ],
650
+ 'sylphx.money.v1.VerifyStorePurchaseRequest': [
651
+ ['subject', 'subject', 'sylphx.money.v1.Subject'],
652
+ ['signedTransaction', 'signed_transaction'],
653
+ ['purchaseToken', 'purchase_token'],
654
+ ['productId', 'product_id'],
655
+ ['packageName', 'package_name'],
656
+ ['validateOnly', 'validate_only'],
657
+ ['transactionId', 'transaction_id'],
658
+ ['bundleId', 'bundle_id'],
659
+ ],
660
+ 'sylphx.money.v1.VerifyStorePurchaseResponse': [
661
+ ['storePurchase', 'store_purchase', 'sylphx.money.v1.StorePurchase'],
662
+ ['grantToken', 'grant_token'],
663
+ ['alreadyVerified', 'already_verified'],
664
+ ['customerSubscription', 'customer_subscription', 'sylphx.money.v1.CustomerSubscription'],
665
+ ['grantClaims', 'grant_claims', undefined, 'json'],
666
+ ['storeCompletion', 'store_completion'],
667
+ ],
668
+ });
669
+ /**
670
+ * MoneyService is Sylphx Money's customer payments: an app sells to its own
671
+ * users through the stores and processors Money integrates once, and asks one
672
+ * question on its request path, "does this subject have this feature"
673
+ * (docs/services/money/customer-payments.md).
674
+ *
675
+ * Namespace of Sylphx Money on `Sylphx`.
676
+ */
677
+ export class MoneyApi {
678
+ /** The `price_catalogs` collection. */
679
+ priceCatalogs;
680
+ /** The `checkout_policies` collection. */
681
+ checkoutPolicies;
682
+ /** The `store_connections` collection. */
683
+ storeConnections;
684
+ /** The `store_purchases` collection. */
685
+ storePurchases;
686
+ /** The `customer_subscriptions` collection. */
687
+ customerSubscriptions;
688
+ /** The `entitlement_grants` collection. */
689
+ entitlementGrants;
690
+ /** The `merchant_accounts` collection. */
691
+ merchantAccounts;
692
+ /** The `checkout_sessions` collection. */
693
+ checkoutSessions;
694
+ /** The `tax_threshold_statuses` collection. */
695
+ taxThresholdStatuses;
696
+ /** The `portal_sessions` collection. */
697
+ portalSessions;
698
+ /** The `licence_keys` collection. */
699
+ licenceKeys;
700
+ /** The `licence_tokens` collection. */
701
+ licenceTokens;
702
+ /** The `usage_settings` collection. */
703
+ usageSettings;
704
+ /** The `usage_tiers` collection. */
705
+ usageTiers;
706
+ /** The `usage_reservations` collection. */
707
+ usageReservations;
708
+ /** The `usage_events` collection. */
709
+ usageEvents;
710
+ /** The `credit_grants` collection. */
711
+ creditGrants;
712
+ /** The `usage_invoices` collection. */
713
+ usageInvoices;
714
+ /** The `usage_meters` collection. */
715
+ usageMeters;
716
+ /** The `usage_meter_prices` collection. */
717
+ usageMeterPrices;
718
+ /** The `revenue_sources` collection. */
719
+ revenueSources;
720
+ /** The `revenue` collection. */
721
+ revenue;
722
+ /** The `revenue_facts` collection. */
723
+ revenueFacts;
724
+ /** The `exchange_rates` collection. */
725
+ exchangeRates;
726
+ constructor(client) {
727
+ this.priceCatalogs = new PriceCatalogsCollection(client);
728
+ this.checkoutPolicies = new CheckoutPoliciesCollection(client);
729
+ this.storeConnections = new StoreConnectionsCollection(client);
730
+ this.storePurchases = new StorePurchasesCollection(client);
731
+ this.customerSubscriptions = new CustomerSubscriptionsCollection(client);
732
+ this.entitlementGrants = new EntitlementGrantsCollection(client);
733
+ this.merchantAccounts = new MerchantAccountsCollection(client);
734
+ this.checkoutSessions = new CheckoutSessionsCollection(client);
735
+ this.taxThresholdStatuses = new TaxThresholdStatusesCollection(client);
736
+ this.portalSessions = new PortalSessionsCollection(client);
737
+ this.licenceKeys = new LicenceKeysCollection(client);
738
+ this.licenceTokens = new LicenceTokensCollection(client);
739
+ this.usageSettings = new UsageSettingsCollection(client);
740
+ this.usageTiers = new UsageTiersCollection(client);
741
+ this.usageReservations = new UsageReservationsCollection(client);
742
+ this.usageEvents = new UsageEventsCollection(client);
743
+ this.creditGrants = new CreditGrantsCollection(client);
744
+ this.usageInvoices = new UsageInvoicesCollection(client);
745
+ this.usageMeters = new UsageMetersCollection(client);
746
+ this.usageMeterPrices = new UsageMeterPricesCollection(client);
747
+ this.revenueSources = new RevenueSourcesCollection(client);
748
+ this.revenue = new RevenueCollection(client);
749
+ this.revenueFacts = new RevenueFactsCollection(client);
750
+ this.exchangeRates = new ExchangeRatesCollection(client);
751
+ }
752
+ }
753
+ /** `price_catalogs` of Sylphx Money: Resource type `money.sylphx.com/PriceCatalog`. */
754
+ export class PriceCatalogsCollection {
755
+ client;
756
+ constructor(client) {
757
+ this.client = client;
758
+ }
759
+ /**
760
+ * Gets the environment's catalog.
761
+ *
762
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/price_catalogs/*}` · permission `billing:read` · effect `read`
763
+ *
764
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
765
+ */
766
+ async get(request) {
767
+ return this.client.call({
768
+ method: 'GET',
769
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/price_catalogs/*', 'name')}`,
770
+ responseType: 'sylphx.money.v1.Catalog',
771
+ mutation: false,
772
+ });
773
+ }
774
+ /**
775
+ * Updates the environment's catalog: its features and products, whole.
776
+ *
777
+ * `PATCH /v1/{catalog.name=orgs/*\/projects/*\/envs/*\/price_catalogs/*}` · permission `billing:write` · effect `write`
778
+ *
779
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
780
+ */
781
+ async update(request) {
782
+ return this.client.call({
783
+ method: 'PATCH',
784
+ path: `/v1/${runtime.pathParam(request.catalog?.name, 'orgs/*/projects/*/envs/*/price_catalogs/*', 'catalog.name')}`,
785
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
786
+ body: request.catalog ?? {},
787
+ bodyType: 'sylphx.money.v1.Catalog',
788
+ responseType: 'sylphx.money.v1.Catalog',
789
+ mutation: true,
790
+ });
791
+ }
792
+ /**
793
+ * Pushes the catalog to the merchant account's processor now: products and
794
+ * prices by lookup key; an amount change makes a new price.
795
+ *
796
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/price_catalogs/*}:sync` · permission `billing:write` · effect `write`
797
+ *
798
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `UNAVAILABLE`.
799
+ */
800
+ async sync(request) {
801
+ return this.client.call({
802
+ method: 'POST',
803
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/price_catalogs/*', 'name')}:sync`,
804
+ body: runtime.omit(request, ['name']),
805
+ bodyType: 'sylphx.money.v1.SyncCatalogRequest',
806
+ responseType: 'sylphx.money.v1.Catalog',
807
+ mutation: true,
808
+ });
809
+ }
810
+ }
811
+ /** `checkout_policies` of Sylphx Money: Resource type `money.sylphx.com/CheckoutPolicy`. */
812
+ export class CheckoutPoliciesCollection {
813
+ client;
814
+ constructor(client) {
815
+ this.client = client;
816
+ }
817
+ /**
818
+ * Gets the environment's checkout policy: which buyer countries consumer
819
+ * checkout refuses. An environment that never wrote one refuses none.
820
+ *
821
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/checkout_policies/*}` · permission `billing:read` · effect `read`
822
+ *
823
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
824
+ */
825
+ async get(request) {
826
+ return this.client.call({
827
+ method: 'GET',
828
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/checkout_policies/*', 'name')}`,
829
+ responseType: 'sylphx.money.v1.CheckoutPolicy',
830
+ mutation: false,
831
+ });
832
+ }
833
+ /**
834
+ * Updates the environment's checkout policy, whole.
835
+ *
836
+ * `PATCH /v1/{checkout_policy.name=orgs/*\/projects/*\/envs/*\/checkout_policies/*}` · permission `billing:write` · effect `write`
837
+ *
838
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
839
+ */
840
+ async update(request) {
841
+ return this.client.call({
842
+ method: 'PATCH',
843
+ path: `/v1/${runtime.pathParam(request.checkoutPolicy?.name, 'orgs/*/projects/*/envs/*/checkout_policies/*', 'checkout_policy.name')}`,
844
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
845
+ body: request.checkoutPolicy ?? {},
846
+ bodyType: 'sylphx.money.v1.CheckoutPolicy',
847
+ responseType: 'sylphx.money.v1.CheckoutPolicy',
848
+ mutation: true,
849
+ });
850
+ }
851
+ }
852
+ /** `store_connections` of Sylphx Money: Resource type `money.sylphx.com/StoreConnection`. */
853
+ export class StoreConnectionsCollection {
854
+ client;
855
+ constructor(client) {
856
+ this.client = client;
857
+ }
858
+ /**
859
+ * Gets a store connection.
860
+ *
861
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/store_connections/*}` · permission `billing:read` · effect `read`
862
+ *
863
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
864
+ */
865
+ async get(request) {
866
+ return this.client.call({
867
+ method: 'GET',
868
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/store_connections/*', 'name')}`,
869
+ responseType: 'sylphx.money.v1.StoreConnection',
870
+ mutation: false,
871
+ });
872
+ }
873
+ /**
874
+ * Lists store connections.
875
+ *
876
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/store_connections` · permission `billing:read` · effect `read`
877
+ *
878
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
879
+ */
880
+ async list(request) {
881
+ return this.client.call({
882
+ method: 'GET',
883
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/store_connections`,
884
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
885
+ responseType: 'sylphx.money.v1.ListStoreConnectionsResponse',
886
+ mutation: false,
887
+ });
888
+ }
889
+ /** Every item of every page of `list`. */
890
+ async *listAll(request) {
891
+ let next = request;
892
+ for (;;) {
893
+ const page = await this.list(next);
894
+ yield* page.storeConnections ?? [];
895
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
896
+ return;
897
+ next = { ...request, pageToken: page.nextPageToken };
898
+ }
899
+ }
900
+ /**
901
+ * Creates a store connection; its credential is sealed and never returned.
902
+ *
903
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/store_connections` · permission `billing:write` · effect `write`
904
+ *
905
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
906
+ */
907
+ async create(request) {
908
+ return this.client.call({
909
+ method: 'POST',
910
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/store_connections`,
911
+ query: { store_connection_id: request.storeConnectionId, validate_only: request.validateOnly },
912
+ body: request.storeConnection ?? {},
913
+ bodyType: 'sylphx.money.v1.StoreConnection',
914
+ responseType: 'sylphx.money.v1.StoreConnection',
915
+ mutation: true,
916
+ });
917
+ }
918
+ /**
919
+ * Updates a store connection; a new credential replaces the stored one.
920
+ *
921
+ * `PATCH /v1/{store_connection.name=orgs/*\/projects/*\/envs/*\/store_connections/*}` · permission `billing:write` · effect `write`
922
+ *
923
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
924
+ */
925
+ async update(request) {
926
+ return this.client.call({
927
+ method: 'PATCH',
928
+ path: `/v1/${runtime.pathParam(request.storeConnection?.name, 'orgs/*/projects/*/envs/*/store_connections/*', 'store_connection.name')}`,
929
+ query: { update_mask: request.updateMask, allow_missing: request.allowMissing, validate_only: request.validateOnly },
930
+ body: request.storeConnection ?? {},
931
+ bodyType: 'sylphx.money.v1.StoreConnection',
932
+ responseType: 'sylphx.money.v1.StoreConnection',
933
+ mutation: true,
934
+ });
935
+ }
936
+ /**
937
+ * Deletes a store connection and its sealed credential.
938
+ *
939
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/store_connections/*}` · permission `billing:write` · effect `destructive`
940
+ *
941
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
942
+ */
943
+ async delete(request) {
944
+ return this.client.call({
945
+ method: 'DELETE',
946
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/store_connections/*', 'name')}`,
947
+ query: { etag: request.etag },
948
+ mutation: true,
949
+ });
950
+ }
951
+ }
952
+ /** `store_purchases` of Sylphx Money: Resource type `money.sylphx.com/StorePurchase`. */
953
+ export class StorePurchasesCollection {
954
+ client;
955
+ constructor(client) {
956
+ this.client = client;
957
+ }
958
+ /**
959
+ * Verifies a store purchase with the store, binds it to the subject, and
960
+ * returns its record and a signed grant. Re-verifying returns the same
961
+ * record and grant. Called from the app's server with a secret key that
962
+ * holds `billing:write`; a publishable key cannot call it.
963
+ *
964
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/store_purchases:verify` · permission `billing:write` · effect `write`
965
+ *
966
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_IN_USE`, `UNAVAILABLE`.
967
+ */
968
+ async verify(request) {
969
+ return this.client.call({
970
+ method: 'POST',
971
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/store_purchases:verify`,
972
+ body: runtime.omit(request, ['parent']),
973
+ bodyType: 'sylphx.money.v1.VerifyStorePurchaseRequest',
974
+ responseType: 'sylphx.money.v1.VerifyStorePurchaseResponse',
975
+ mutation: true,
976
+ });
977
+ }
978
+ /**
979
+ * Verifies a store purchase for an app with no server: called with the
980
+ * environment's publishable key (`billing:client`), the subject is an
981
+ * install id (`inst_` and a UUID), and Money completes the purchase with the
982
+ * store (acknowledges or consumes it) so the app never calls the store's
983
+ * server API. Works only on store connections that set `client_verify`.
984
+ * Re-calling returns the same record and grant.
985
+ *
986
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/store_purchases:clientVerify` · permission `billing:client` · effect `write`
987
+ *
988
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_IN_USE`, `RATE_LIMITED`, `UNAVAILABLE`.
989
+ */
990
+ async clientVerify(request) {
991
+ return this.client.call({
992
+ method: 'POST',
993
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/store_purchases:clientVerify`,
994
+ body: runtime.omit(request, ['parent']),
995
+ bodyType: 'sylphx.money.v1.ClientVerifyStorePurchaseRequest',
996
+ responseType: 'sylphx.money.v1.VerifyStorePurchaseResponse',
997
+ mutation: true,
998
+ });
999
+ }
1000
+ /**
1001
+ * Gets a store purchase.
1002
+ *
1003
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/store_purchases/*}` · permission `billing:read` · effect `read`
1004
+ *
1005
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1006
+ */
1007
+ async get(request) {
1008
+ return this.client.call({
1009
+ method: 'GET',
1010
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/store_purchases/*', 'name')}`,
1011
+ responseType: 'sylphx.money.v1.StorePurchase',
1012
+ mutation: false,
1013
+ });
1014
+ }
1015
+ /**
1016
+ * Lists store purchases, newest first.
1017
+ *
1018
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/store_purchases` · permission `billing:read` · effect `read`
1019
+ *
1020
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1021
+ */
1022
+ async list(request) {
1023
+ return this.client.call({
1024
+ method: 'GET',
1025
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/store_purchases`,
1026
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1027
+ responseType: 'sylphx.money.v1.ListStorePurchasesResponse',
1028
+ mutation: false,
1029
+ });
1030
+ }
1031
+ /** Every item of every page of `list`. */
1032
+ async *listAll(request) {
1033
+ let next = request;
1034
+ for (;;) {
1035
+ const page = await this.list(next);
1036
+ yield* page.storePurchases ?? [];
1037
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1038
+ return;
1039
+ next = { ...request, pageToken: page.nextPageToken };
1040
+ }
1041
+ }
1042
+ }
1043
+ /** `customer_subscriptions` of Sylphx Money: Resource type `money.sylphx.com/CustomerSubscription`. */
1044
+ export class CustomerSubscriptionsCollection {
1045
+ client;
1046
+ constructor(client) {
1047
+ this.client = client;
1048
+ }
1049
+ /**
1050
+ * Gets a customer subscription.
1051
+ *
1052
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}` · permission `billing:read` · effect `read`
1053
+ *
1054
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1055
+ */
1056
+ async get(request) {
1057
+ return this.client.call({
1058
+ method: 'GET',
1059
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}`,
1060
+ responseType: 'sylphx.money.v1.CustomerSubscription',
1061
+ mutation: false,
1062
+ });
1063
+ }
1064
+ /**
1065
+ * Lists customer subscriptions, newest first.
1066
+ *
1067
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/customer_subscriptions` · permission `billing:read` · effect `read`
1068
+ *
1069
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1070
+ */
1071
+ async list(request) {
1072
+ return this.client.call({
1073
+ method: 'GET',
1074
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/customer_subscriptions`,
1075
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1076
+ responseType: 'sylphx.money.v1.ListCustomerSubscriptionsResponse',
1077
+ mutation: false,
1078
+ });
1079
+ }
1080
+ /** Every item of every page of `list`. */
1081
+ async *listAll(request) {
1082
+ let next = request;
1083
+ for (;;) {
1084
+ const page = await this.list(next);
1085
+ yield* page.customerSubscriptions ?? [];
1086
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1087
+ return;
1088
+ next = { ...request, pageToken: page.nextPageToken };
1089
+ }
1090
+ }
1091
+ /**
1092
+ * Cancels a web subscription, now or at the period end, and optionally
1093
+ * refunds its last payment (for example a statutory cancellation window).
1094
+ *
1095
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}:cancel` · permission `billing:write` · effect `destructive`
1096
+ *
1097
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `UNAVAILABLE`.
1098
+ */
1099
+ async cancel(request) {
1100
+ return this.client.call({
1101
+ method: 'POST',
1102
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}:cancel`,
1103
+ body: runtime.omit(request, ['name']),
1104
+ bodyType: 'sylphx.money.v1.CancelCustomerSubscriptionRequest',
1105
+ responseType: 'sylphx.money.v1.CustomerSubscription',
1106
+ mutation: true,
1107
+ });
1108
+ }
1109
+ /**
1110
+ * Resumes a web subscription set to cancel at its period end.
1111
+ *
1112
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}:resume` · permission `billing:write` · effect `write`
1113
+ *
1114
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `UNAVAILABLE`.
1115
+ */
1116
+ async resume(request) {
1117
+ return this.client.call({
1118
+ method: 'POST',
1119
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}:resume`,
1120
+ body: runtime.omit(request, ['name']),
1121
+ bodyType: 'sylphx.money.v1.ResumeCustomerSubscriptionRequest',
1122
+ responseType: 'sylphx.money.v1.CustomerSubscription',
1123
+ mutation: true,
1124
+ });
1125
+ }
1126
+ /**
1127
+ * Changes the seat quantity of a web subscription, now, and syncs the
1128
+ * processor's subscription item to it. A retry with the same
1129
+ * `Idempotency-Key` (required) and the same request changes nothing twice.
1130
+ *
1131
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}:updateQuantity` · permission `billing:write` · effect `write`
1132
+ *
1133
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
1134
+ */
1135
+ async updateQuantity(request) {
1136
+ return this.client.call({
1137
+ method: 'POST',
1138
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}:updateQuantity`,
1139
+ body: runtime.omit(request, ['name']),
1140
+ bodyType: 'sylphx.money.v1.UpdateCustomerSubscriptionQuantityRequest',
1141
+ responseType: 'sylphx.money.v1.CustomerSubscription',
1142
+ mutation: true,
1143
+ });
1144
+ }
1145
+ /**
1146
+ * Move a web subscription onto another recurring catalog plan.
1147
+ *
1148
+ * Stripe changes the subscription's one item and bills the difference as
1149
+ * `proration_behavior` says; Money reads the subscription back and replaces
1150
+ * its entitlements from it. Needs an `Idempotency-Key` unless `validate_only`.
1151
+ * A store subscription is refused (`store_managed`): the store owns it.
1152
+ *
1153
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/customer_subscriptions/*}:changePlan` · permission `billing:write` · effect `write`
1154
+ *
1155
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
1156
+ */
1157
+ async changePlan(request) {
1158
+ return this.client.call({
1159
+ method: 'POST',
1160
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/customer_subscriptions/*', 'name')}:changePlan`,
1161
+ body: runtime.omit(request, ['name']),
1162
+ bodyType: 'sylphx.money.v1.ChangeCustomerSubscriptionPlanRequest',
1163
+ responseType: 'sylphx.money.v1.CustomerSubscription',
1164
+ mutation: true,
1165
+ });
1166
+ }
1167
+ }
1168
+ /** `entitlement_grants` of Sylphx Money: Resource type `money.sylphx.com/EntitlementGrant`. */
1169
+ export class EntitlementGrantsCollection {
1170
+ client;
1171
+ constructor(client) {
1172
+ this.client = client;
1173
+ }
1174
+ /**
1175
+ * Gets an entitlement grant.
1176
+ *
1177
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/entitlement_grants/*}` · permission `billing:read` · effect `read`
1178
+ *
1179
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1180
+ */
1181
+ async get(request) {
1182
+ return this.client.call({
1183
+ method: 'GET',
1184
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/entitlement_grants/*', 'name')}`,
1185
+ responseType: 'sylphx.money.v1.EntitlementGrant',
1186
+ mutation: false,
1187
+ });
1188
+ }
1189
+ /**
1190
+ * Lists entitlement grants.
1191
+ *
1192
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/entitlement_grants` · permission `billing:read` · effect `read`
1193
+ *
1194
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1195
+ */
1196
+ async list(request) {
1197
+ return this.client.call({
1198
+ method: 'GET',
1199
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entitlement_grants`,
1200
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1201
+ responseType: 'sylphx.money.v1.ListEntitlementGrantsResponse',
1202
+ mutation: false,
1203
+ });
1204
+ }
1205
+ /** Every item of every page of `list`. */
1206
+ async *listAll(request) {
1207
+ let next = request;
1208
+ for (;;) {
1209
+ const page = await this.list(next);
1210
+ yield* page.entitlementGrants ?? [];
1211
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1212
+ return;
1213
+ next = { ...request, pageToken: page.nextPageToken };
1214
+ }
1215
+ }
1216
+ /**
1217
+ * Answers whether a subject holds a feature now, and how much of it.
1218
+ *
1219
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entitlement_grants:check` · permission `billing:read` · effect `read`
1220
+ *
1221
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
1222
+ */
1223
+ async check(request) {
1224
+ return this.client.call({
1225
+ method: 'POST',
1226
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entitlement_grants:check`,
1227
+ body: runtime.omit(request, ['parent']),
1228
+ bodyType: 'sylphx.money.v1.CheckEntitlementRequest',
1229
+ responseType: 'sylphx.money.v1.CheckEntitlementResponse',
1230
+ mutation: true,
1231
+ });
1232
+ }
1233
+ /**
1234
+ * Creates a manual entitlement grant (support, comp, grace). Append-only;
1235
+ * needs the approval-class scope. The approver recorded is the key's principal.
1236
+ *
1237
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/entitlement_grants` · permission `billing:credits.approve` · effect `write`
1238
+ *
1239
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `RESOURCE_ALREADY_EXISTS`.
1240
+ */
1241
+ async create(request) {
1242
+ return this.client.call({
1243
+ method: 'POST',
1244
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/entitlement_grants`,
1245
+ query: { entitlement_grant_id: request.entitlementGrantId },
1246
+ body: request.entitlementGrant ?? {},
1247
+ bodyType: 'sylphx.money.v1.EntitlementGrant',
1248
+ responseType: 'sylphx.money.v1.EntitlementGrant',
1249
+ mutation: true,
1250
+ });
1251
+ }
1252
+ }
1253
+ /** `merchant_accounts` of Sylphx Money: Resource type `money.sylphx.com/MerchantAccount`. */
1254
+ export class MerchantAccountsCollection {
1255
+ client;
1256
+ constructor(client) {
1257
+ this.client = client;
1258
+ }
1259
+ /**
1260
+ * Gets a merchant account.
1261
+ *
1262
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:read` · effect `read`
1263
+ *
1264
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1265
+ */
1266
+ async get(request) {
1267
+ return this.client.call({
1268
+ method: 'GET',
1269
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}`,
1270
+ responseType: 'sylphx.money.v1.MerchantAccount',
1271
+ mutation: false,
1272
+ });
1273
+ }
1274
+ /**
1275
+ * Lists merchant accounts.
1276
+ *
1277
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts` · permission `billing:read` · effect `read`
1278
+ *
1279
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1280
+ */
1281
+ async list(request) {
1282
+ return this.client.call({
1283
+ method: 'GET',
1284
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/merchant_accounts`,
1285
+ query: { page_size: request.pageSize, page_token: request.pageToken },
1286
+ responseType: 'sylphx.money.v1.ListMerchantAccountsResponse',
1287
+ mutation: false,
1288
+ });
1289
+ }
1290
+ /** Every item of every page of `list`. */
1291
+ async *listAll(request) {
1292
+ let next = request;
1293
+ for (;;) {
1294
+ const page = await this.list(next);
1295
+ yield* page.merchantAccounts ?? [];
1296
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1297
+ return;
1298
+ next = { ...request, pageToken: page.nextPageToken };
1299
+ }
1300
+ }
1301
+ /**
1302
+ * Starts connecting a Stripe account: returns the processor's authorisation
1303
+ * URL for an org owner to open, which the processor's redirect completes.
1304
+ * With a restricted key in the request the account connects at once
1305
+ * instead, and the connected merchant account comes back in the response.
1306
+ *
1307
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/merchant_accounts:connect` · permission `billing:write` · effect `write`
1308
+ *
1309
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNAVAILABLE`.
1310
+ */
1311
+ async connect(request) {
1312
+ return this.client.call({
1313
+ method: 'POST',
1314
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/merchant_accounts:connect`,
1315
+ body: runtime.omit(request, ['parent']),
1316
+ bodyType: 'sylphx.money.v1.ConnectMerchantAccountRequest',
1317
+ responseType: 'sylphx.money.v1.ConnectMerchantAccountResponse',
1318
+ mutation: true,
1319
+ });
1320
+ }
1321
+ /**
1322
+ * Reads the connected account back from the processor.
1323
+ *
1324
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:refresh` · permission `billing:write` · effect `write`
1325
+ *
1326
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1327
+ */
1328
+ async refresh(request) {
1329
+ return this.client.call({
1330
+ method: 'POST',
1331
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}:refresh`,
1332
+ body: runtime.omit(request, ['name']),
1333
+ bodyType: 'sylphx.money.v1.RefreshMerchantAccountRequest',
1334
+ responseType: 'sylphx.money.v1.MerchantAccount',
1335
+ mutation: true,
1336
+ });
1337
+ }
1338
+ /**
1339
+ * Disconnects the account: Sylphx loses access; checkout is refused.
1340
+ *
1341
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}:disconnect` · permission `billing:write` · effect `destructive`
1342
+ *
1343
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNAVAILABLE`.
1344
+ */
1345
+ async disconnect(request) {
1346
+ return this.client.call({
1347
+ method: 'POST',
1348
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'name')}:disconnect`,
1349
+ body: runtime.omit(request, ['name']),
1350
+ bodyType: 'sylphx.money.v1.DisconnectMerchantAccountRequest',
1351
+ responseType: 'sylphx.money.v1.MerchantAccount',
1352
+ mutation: true,
1353
+ });
1354
+ }
1355
+ /**
1356
+ * Updates the merchant account's own settings: the fields named in `update_mask`.
1357
+ *
1358
+ * `PATCH /v1/{merchant_account.name=orgs/*\/projects/*\/envs/*\/merchant_accounts/*}` · permission `billing:write` · effect `write`
1359
+ *
1360
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1361
+ */
1362
+ async update(request) {
1363
+ return this.client.call({
1364
+ method: 'PATCH',
1365
+ path: `/v1/${runtime.pathParam(request.merchantAccount?.name, 'orgs/*/projects/*/envs/*/merchant_accounts/*', 'merchant_account.name')}`,
1366
+ query: { update_mask: request.updateMask },
1367
+ body: request.merchantAccount ?? {},
1368
+ bodyType: 'sylphx.money.v1.MerchantAccount',
1369
+ responseType: 'sylphx.money.v1.MerchantAccount',
1370
+ mutation: true,
1371
+ });
1372
+ }
1373
+ }
1374
+ /** `checkout_sessions` of Sylphx Money: Resource type `money.sylphx.com/CheckoutSession`. */
1375
+ export class CheckoutSessionsCollection {
1376
+ client;
1377
+ constructor(client) {
1378
+ this.client = client;
1379
+ }
1380
+ /**
1381
+ * Creates a hosted checkout for a subject.
1382
+ *
1383
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/checkout_sessions` · permission `billing:write` · effect `write`
1384
+ *
1385
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `UNAVAILABLE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1386
+ */
1387
+ async create(request) {
1388
+ return this.client.call({
1389
+ method: 'POST',
1390
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/checkout_sessions`,
1391
+ query: { checkout_session_id: request.checkoutSessionId },
1392
+ body: request.checkoutSession ?? {},
1393
+ bodyType: 'sylphx.money.v1.CheckoutSession',
1394
+ responseType: 'sylphx.money.v1.CheckoutSession',
1395
+ mutation: true,
1396
+ });
1397
+ }
1398
+ /**
1399
+ * Gets a checkout session.
1400
+ *
1401
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/checkout_sessions/*}` · permission `billing:read` · effect `read`
1402
+ *
1403
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1404
+ */
1405
+ async get(request) {
1406
+ return this.client.call({
1407
+ method: 'GET',
1408
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/checkout_sessions/*', 'name')}`,
1409
+ responseType: 'sylphx.money.v1.CheckoutSession',
1410
+ mutation: false,
1411
+ });
1412
+ }
1413
+ }
1414
+ /** `tax_threshold_statuses` of Sylphx Money: Resource type `money.sylphx.com/TaxThresholdStatus`. */
1415
+ export class TaxThresholdStatusesCollection {
1416
+ client;
1417
+ constructor(client) {
1418
+ this.client = client;
1419
+ }
1420
+ /**
1421
+ * Lists where the environment's consumer sales stand against each
1422
+ * jurisdiction's digital-services tax registration threshold, per its own
1423
+ * window. EU and UK have no threshold and are not tracked.
1424
+ *
1425
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/tax_threshold_statuses` · permission `billing:read` · effect `read`
1426
+ *
1427
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
1428
+ */
1429
+ async list(request) {
1430
+ return this.client.call({
1431
+ method: 'GET',
1432
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/tax_threshold_statuses`,
1433
+ query: { page_size: request.pageSize, page_token: request.pageToken },
1434
+ responseType: 'sylphx.money.v1.ListTaxThresholdStatusesResponse',
1435
+ mutation: false,
1436
+ });
1437
+ }
1438
+ /** Every item of every page of `list`. */
1439
+ async *listAll(request) {
1440
+ let next = request;
1441
+ for (;;) {
1442
+ const page = await this.list(next);
1443
+ yield* page.taxThresholdStatuses ?? [];
1444
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1445
+ return;
1446
+ next = { ...request, pageToken: page.nextPageToken };
1447
+ }
1448
+ }
1449
+ }
1450
+ /** `portal_sessions` of Sylphx Money: Resource type `money.sylphx.com/PortalSession`. */
1451
+ export class PortalSessionsCollection {
1452
+ client;
1453
+ constructor(client) {
1454
+ this.client = client;
1455
+ }
1456
+ /**
1457
+ * Creates a customer portal session for a subject.
1458
+ *
1459
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/portal_sessions` · permission `billing:write` · effect `write`
1460
+ *
1461
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `UNAVAILABLE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1462
+ */
1463
+ async create(request) {
1464
+ return this.client.call({
1465
+ method: 'POST',
1466
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/portal_sessions`,
1467
+ query: { portal_session_id: request.portalSessionId },
1468
+ body: request.portalSession ?? {},
1469
+ bodyType: 'sylphx.money.v1.PortalSession',
1470
+ responseType: 'sylphx.money.v1.PortalSession',
1471
+ mutation: true,
1472
+ });
1473
+ }
1474
+ /**
1475
+ * Gets a portal session.
1476
+ *
1477
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/portal_sessions/*}` · permission `billing:read` · effect `read`
1478
+ *
1479
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1480
+ */
1481
+ async get(request) {
1482
+ return this.client.call({
1483
+ method: 'GET',
1484
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/portal_sessions/*', 'name')}`,
1485
+ responseType: 'sylphx.money.v1.PortalSession',
1486
+ mutation: false,
1487
+ });
1488
+ }
1489
+ }
1490
+ /** `licence_keys` of Sylphx Money: Resource type `money.sylphx.com/LicenceKey`. */
1491
+ export class LicenceKeysCollection {
1492
+ client;
1493
+ constructor(client) {
1494
+ this.client = client;
1495
+ }
1496
+ /**
1497
+ * Generates a licence key: Money creates the Ed25519 key, seals it, and never
1498
+ * returns the private half. Needs the approval-class scope, which the developer
1499
+ * role does not hold.
1500
+ *
1501
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/licence_keys:generate` · permission `billing:licence_keys.approve` · effect `write`
1502
+ *
1503
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1504
+ */
1505
+ async generate(request) {
1506
+ return this.client.call({
1507
+ method: 'POST',
1508
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/licence_keys:generate`,
1509
+ body: runtime.omit(request, ['parent']),
1510
+ bodyType: 'sylphx.money.v1.GenerateLicenceKeyRequest',
1511
+ responseType: 'sylphx.money.v1.LicenceKey',
1512
+ mutation: true,
1513
+ });
1514
+ }
1515
+ /**
1516
+ * Imports an existing Ed25519 key (PKCS8), for a key already pinned in shipped
1517
+ * clients. Refused unless the expected public key is the imported key's public
1518
+ * half.
1519
+ *
1520
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/licence_keys:import` · permission `billing:licence_keys.approve` · effect `write`
1521
+ *
1522
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1523
+ */
1524
+ async import(request) {
1525
+ return this.client.call({
1526
+ method: 'POST',
1527
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/licence_keys:import`,
1528
+ body: runtime.omit(request, ['parent']),
1529
+ bodyType: 'sylphx.money.v1.ImportLicenceKeyRequest',
1530
+ responseType: 'sylphx.money.v1.LicenceKey',
1531
+ mutation: true,
1532
+ });
1533
+ }
1534
+ /**
1535
+ * Retires a licence key: it stops signing new terms and stays exported for
1536
+ * verification.
1537
+ *
1538
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/licence_keys/*}:retire` · permission `billing:licence_keys.approve` · effect `write`
1539
+ *
1540
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1541
+ */
1542
+ async retire(request) {
1543
+ return this.client.call({
1544
+ method: 'POST',
1545
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/licence_keys/*', 'name')}:retire`,
1546
+ body: runtime.omit(request, ['name']),
1547
+ bodyType: 'sylphx.money.v1.RetireLicenceKeyRequest',
1548
+ responseType: 'sylphx.money.v1.LicenceKey',
1549
+ mutation: true,
1550
+ });
1551
+ }
1552
+ /**
1553
+ * Gets a licence key (its public half, never the private).
1554
+ *
1555
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/licence_keys/*}` · permission `billing:read` · effect `read`
1556
+ *
1557
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1558
+ */
1559
+ async get(request) {
1560
+ return this.client.call({
1561
+ method: 'GET',
1562
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/licence_keys/*', 'name')}`,
1563
+ responseType: 'sylphx.money.v1.LicenceKey',
1564
+ mutation: false,
1565
+ });
1566
+ }
1567
+ /**
1568
+ * Lists licence keys, newest first.
1569
+ *
1570
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/licence_keys` · permission `billing:read` · effect `read`
1571
+ *
1572
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `PAGE_TOKEN_MISMATCH`.
1573
+ */
1574
+ async list(request) {
1575
+ return this.client.call({
1576
+ method: 'GET',
1577
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/licence_keys`,
1578
+ query: { page_size: request.pageSize, page_token: request.pageToken },
1579
+ responseType: 'sylphx.money.v1.ListLicenceKeysResponse',
1580
+ mutation: false,
1581
+ });
1582
+ }
1583
+ /** Every item of every page of `list`. */
1584
+ async *listAll(request) {
1585
+ let next = request;
1586
+ for (;;) {
1587
+ const page = await this.list(next);
1588
+ yield* page.licenceKeys ?? [];
1589
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1590
+ return;
1591
+ next = { ...request, pageToken: page.nextPageToken };
1592
+ }
1593
+ }
1594
+ }
1595
+ /** `licence_tokens` of Sylphx Money: Resource type `money.sylphx.com/LicenceToken`. */
1596
+ export class LicenceTokensCollection {
1597
+ client;
1598
+ constructor(client) {
1599
+ this.client = client;
1600
+ }
1601
+ /**
1602
+ * Lists a subject's unexpired offline licence tokens of paid orders, for
1603
+ * support. Re-derived from the frozen terms: the same bytes as at purchase.
1604
+ *
1605
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/licence_tokens` · permission `billing:read` · effect `read`
1606
+ *
1607
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1608
+ */
1609
+ async list(request) {
1610
+ return this.client.call({
1611
+ method: 'GET',
1612
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/licence_tokens`,
1613
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1614
+ responseType: 'sylphx.money.v1.ListLicenceTokensResponse',
1615
+ mutation: false,
1616
+ });
1617
+ }
1618
+ /** Every item of every page of `list`. */
1619
+ async *listAll(request) {
1620
+ let next = request;
1621
+ for (;;) {
1622
+ const page = await this.list(next);
1623
+ yield* page.licenceTokens ?? [];
1624
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1625
+ return;
1626
+ next = { ...request, pageToken: page.nextPageToken };
1627
+ }
1628
+ }
1629
+ }
1630
+ /** `usage_settings` of Sylphx Money: Resource type `money.sylphx.com/UsageSettings`. */
1631
+ export class UsageSettingsCollection {
1632
+ client;
1633
+ constructor(client) {
1634
+ this.client = client;
1635
+ }
1636
+ /**
1637
+ * Gets the environment's usage settings.
1638
+ *
1639
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/usage_settings/*}` · permission `billing:read` · effect `read`
1640
+ *
1641
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1642
+ */
1643
+ async get(request) {
1644
+ return this.client.call({
1645
+ method: 'GET',
1646
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/usage_settings/*', 'name')}`,
1647
+ responseType: 'sylphx.money.v1.UsageSettings',
1648
+ mutation: false,
1649
+ });
1650
+ }
1651
+ /**
1652
+ * Updates the usage settings, the enforcement switch included. A change is recorded with who made it.
1653
+ *
1654
+ * `PATCH /v1/{usage_settings.name=orgs/*\/projects/*\/envs/*\/usage_settings/*}` · permission `billing:write` · effect `write`
1655
+ *
1656
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1657
+ */
1658
+ async update(request) {
1659
+ return this.client.call({
1660
+ method: 'PATCH',
1661
+ path: `/v1/${runtime.pathParam(request.usageSettings?.name, 'orgs/*/projects/*/envs/*/usage_settings/*', 'usage_settings.name')}`,
1662
+ query: { update_mask: request.updateMask },
1663
+ body: request.usageSettings ?? {},
1664
+ bodyType: 'sylphx.money.v1.UsageSettings',
1665
+ responseType: 'sylphx.money.v1.UsageSettings',
1666
+ mutation: true,
1667
+ });
1668
+ }
1669
+ }
1670
+ /** `usage_tiers` of Sylphx Money: Resource type `money.sylphx.com/UsageTier`. */
1671
+ export class UsageTiersCollection {
1672
+ client;
1673
+ constructor(client) {
1674
+ this.client = client;
1675
+ }
1676
+ /**
1677
+ * Lists usage tiers.
1678
+ *
1679
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_tiers` · permission `billing:read` · effect `read`
1680
+ *
1681
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1682
+ */
1683
+ async list(request) {
1684
+ return this.client.call({
1685
+ method: 'GET',
1686
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_tiers`,
1687
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1688
+ responseType: 'sylphx.money.v1.ListUsageTiersResponse',
1689
+ mutation: false,
1690
+ });
1691
+ }
1692
+ /** Every item of every page of `list`. */
1693
+ async *listAll(request) {
1694
+ let next = request;
1695
+ for (;;) {
1696
+ const page = await this.list(next);
1697
+ yield* page.usageTiers ?? [];
1698
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1699
+ return;
1700
+ next = { ...request, pageToken: page.nextPageToken };
1701
+ }
1702
+ }
1703
+ /**
1704
+ * Creates or updates a usage tier.
1705
+ *
1706
+ * `PATCH /v1/{usage_tier.name=orgs/*\/projects/*\/envs/*\/usage_tiers/*}` · permission `billing:write` · effect `write`
1707
+ *
1708
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1709
+ */
1710
+ async update(request) {
1711
+ return this.client.call({
1712
+ method: 'PATCH',
1713
+ path: `/v1/${runtime.pathParam(request.usageTier?.name, 'orgs/*/projects/*/envs/*/usage_tiers/*', 'usage_tier.name')}`,
1714
+ query: { update_mask: request.updateMask },
1715
+ body: request.usageTier ?? {},
1716
+ bodyType: 'sylphx.money.v1.UsageTier',
1717
+ responseType: 'sylphx.money.v1.UsageTier',
1718
+ mutation: true,
1719
+ });
1720
+ }
1721
+ }
1722
+ /** `usage_reservations` of Sylphx Money: Resource type `money.sylphx.com/UsageReservation`. */
1723
+ export class UsageReservationsCollection {
1724
+ client;
1725
+ constructor(client) {
1726
+ this.client = client;
1727
+ }
1728
+ /**
1729
+ * Reserves usage before the work starts. Refused with PLAN_LIMIT_REACHED (spend limit, no payment method) or INVALID_STATE (suspended) only while enforcement is on; while it is dark the reservation is granted and the refusal is recorded.
1730
+ *
1731
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_reservations` · permission `billing:metering:write` · effect `write`
1732
+ *
1733
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `INVALID_STATE`, `PLAN_LIMIT_REACHED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `UNAVAILABLE`.
1734
+ */
1735
+ async create(request) {
1736
+ return this.client.call({
1737
+ method: 'POST',
1738
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_reservations`,
1739
+ body: request.usageReservation ?? {},
1740
+ bodyType: 'sylphx.money.v1.UsageReservation',
1741
+ responseType: 'sylphx.money.v1.UsageReservation',
1742
+ mutation: true,
1743
+ });
1744
+ }
1745
+ /**
1746
+ * Gets a usage reservation.
1747
+ *
1748
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/usage_reservations/*}` · permission `billing:read` · effect `read`
1749
+ *
1750
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1751
+ */
1752
+ async get(request) {
1753
+ return this.client.call({
1754
+ method: 'GET',
1755
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/usage_reservations/*', 'name')}`,
1756
+ responseType: 'sylphx.money.v1.UsageReservation',
1757
+ mutation: false,
1758
+ });
1759
+ }
1760
+ /**
1761
+ * Settles a reservation with what was used; the unused part returns to headroom. A settle after expiry still records the usage.
1762
+ *
1763
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/usage_reservations/*}:settle` · permission `billing:metering:write` · effect `write`
1764
+ *
1765
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1766
+ */
1767
+ async settle(request) {
1768
+ return this.client.call({
1769
+ method: 'POST',
1770
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/usage_reservations/*', 'name')}:settle`,
1771
+ body: runtime.omit(request, ['name']),
1772
+ bodyType: 'sylphx.money.v1.SettleUsageReservationRequest',
1773
+ responseType: 'sylphx.money.v1.UsageEvent',
1774
+ mutation: true,
1775
+ });
1776
+ }
1777
+ /**
1778
+ * Releases a reservation that used nothing.
1779
+ *
1780
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/usage_reservations/*}:release` · permission `billing:metering:write` · effect `write`
1781
+ *
1782
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1783
+ */
1784
+ async release(request) {
1785
+ return this.client.call({
1786
+ method: 'POST',
1787
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/usage_reservations/*', 'name')}:release`,
1788
+ body: runtime.omit(request, ['name']),
1789
+ bodyType: 'sylphx.money.v1.ReleaseUsageReservationRequest',
1790
+ responseType: 'sylphx.money.v1.UsageReservation',
1791
+ mutation: true,
1792
+ });
1793
+ }
1794
+ }
1795
+ /** `usage_events` of Sylphx Money: Resource type `money.sylphx.com/UsageEvent`. */
1796
+ export class UsageEventsCollection {
1797
+ client;
1798
+ constructor(client) {
1799
+ this.client = client;
1800
+ }
1801
+ /**
1802
+ * Records usage directly, only for a meter the merchant marked reservation-optional.
1803
+ *
1804
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_events` · permission `billing:metering:write` · effect `write`
1805
+ *
1806
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1807
+ */
1808
+ async create(request) {
1809
+ return this.client.call({
1810
+ method: 'POST',
1811
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_events`,
1812
+ body: request.usageEvent ?? {},
1813
+ bodyType: 'sylphx.money.v1.UsageEvent',
1814
+ responseType: 'sylphx.money.v1.UsageEvent',
1815
+ mutation: true,
1816
+ });
1817
+ }
1818
+ /**
1819
+ * Records a batch of already-incurred usage from the merchant's own servers
1820
+ * (Stripe's meter-event model): the caller is a key of the merchant's own org
1821
+ * holding the exact grant `billing:metering:ingest`, which no wildcard covers,
1822
+ * and each event names its subject with no subject proof. Each event is keyed
1823
+ * by its project, meter, meter version and event id: a replay is a no-op
1824
+ * (`duplicate`), and the same key with different content is a `conflict` and
1825
+ * never counted. One result per event, in request order.
1826
+ *
1827
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_events:batchIngest` · permission `billing:metering:ingest` · effect `write`
1828
+ *
1829
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `INVALID_STATE`.
1830
+ */
1831
+ async batchIngest(request) {
1832
+ return this.client.call({
1833
+ method: 'POST',
1834
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_events:batchIngest`,
1835
+ body: runtime.omit(request, ['parent']),
1836
+ bodyType: 'sylphx.money.v1.BatchIngestUsageEventsRequest',
1837
+ responseType: 'sylphx.money.v1.BatchIngestUsageEventsResponse',
1838
+ mutation: true,
1839
+ });
1840
+ }
1841
+ /**
1842
+ * Lists usage events, newest first.
1843
+ *
1844
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_events` · permission `billing:read` · effect `read`
1845
+ *
1846
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1847
+ */
1848
+ async list(request) {
1849
+ return this.client.call({
1850
+ method: 'GET',
1851
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_events`,
1852
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1853
+ responseType: 'sylphx.money.v1.ListUsageEventsResponse',
1854
+ mutation: false,
1855
+ });
1856
+ }
1857
+ /** Every item of every page of `list`. */
1858
+ async *listAll(request) {
1859
+ let next = request;
1860
+ for (;;) {
1861
+ const page = await this.list(next);
1862
+ yield* page.usageEvents ?? [];
1863
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1864
+ return;
1865
+ next = { ...request, pageToken: page.nextPageToken };
1866
+ }
1867
+ }
1868
+ /**
1869
+ * Reads a subject's standing: active, past due or suspended, whether a payment method is on file, headroom and the threshold.
1870
+ *
1871
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_events:checkStanding` · permission `billing:read` · effect `read`
1872
+ *
1873
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
1874
+ */
1875
+ async checkStanding(request) {
1876
+ return this.client.call({
1877
+ method: 'POST',
1878
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_events:checkStanding`,
1879
+ body: runtime.omit(request, ['parent']),
1880
+ bodyType: 'sylphx.money.v1.CheckUsageStandingRequest',
1881
+ responseType: 'sylphx.money.v1.UsageStanding',
1882
+ mutation: true,
1883
+ });
1884
+ }
1885
+ }
1886
+ /** `credit_grants` of Sylphx Money: Resource type `money.sylphx.com/CreditGrant`. */
1887
+ export class CreditGrantsCollection {
1888
+ client;
1889
+ constructor(client) {
1890
+ this.client = client;
1891
+ }
1892
+ /**
1893
+ * Gives a subject credit. Append-only: a change is a new grant that supersedes the old. Refused with INVALID_STATE (`tax_treatment_unsupported`) for `post_tax_settlement` while the merchant has automatic tax on.
1894
+ *
1895
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/credit_grants` · permission `billing:credits.approve` · effect `write`
1896
+ *
1897
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `UNKNOWN_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1898
+ */
1899
+ async create(request) {
1900
+ return this.client.call({
1901
+ method: 'POST',
1902
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/credit_grants`,
1903
+ body: request.creditGrant ?? {},
1904
+ bodyType: 'sylphx.money.v1.CreditGrant',
1905
+ responseType: 'sylphx.money.v1.CreditGrant',
1906
+ mutation: true,
1907
+ });
1908
+ }
1909
+ /**
1910
+ * Gets a credit grant.
1911
+ *
1912
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/credit_grants/*}` · permission `billing:read` · effect `read`
1913
+ *
1914
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1915
+ */
1916
+ async get(request) {
1917
+ return this.client.call({
1918
+ method: 'GET',
1919
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/credit_grants/*', 'name')}`,
1920
+ responseType: 'sylphx.money.v1.CreditGrant',
1921
+ mutation: false,
1922
+ });
1923
+ }
1924
+ /**
1925
+ * Lists credit grants.
1926
+ *
1927
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/credit_grants` · permission `billing:read` · effect `read`
1928
+ *
1929
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1930
+ */
1931
+ async list(request) {
1932
+ return this.client.call({
1933
+ method: 'GET',
1934
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/credit_grants`,
1935
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1936
+ responseType: 'sylphx.money.v1.ListCreditGrantsResponse',
1937
+ mutation: false,
1938
+ });
1939
+ }
1940
+ /** Every item of every page of `list`. */
1941
+ async *listAll(request) {
1942
+ let next = request;
1943
+ for (;;) {
1944
+ const page = await this.list(next);
1945
+ yield* page.creditGrants ?? [];
1946
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1947
+ return;
1948
+ next = { ...request, pageToken: page.nextPageToken };
1949
+ }
1950
+ }
1951
+ }
1952
+ /** `usage_invoices` of Sylphx Money: Resource type `money.sylphx.com/UsageInvoice`. */
1953
+ export class UsageInvoicesCollection {
1954
+ client;
1955
+ constructor(client) {
1956
+ this.client = client;
1957
+ }
1958
+ /**
1959
+ * Gets a usage invoice.
1960
+ *
1961
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/usage_invoices/*}` · permission `billing:read` · effect `read`
1962
+ *
1963
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
1964
+ */
1965
+ async get(request) {
1966
+ return this.client.call({
1967
+ method: 'GET',
1968
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/usage_invoices/*', 'name')}`,
1969
+ responseType: 'sylphx.money.v1.UsageInvoice',
1970
+ mutation: false,
1971
+ });
1972
+ }
1973
+ /**
1974
+ * Lists usage invoices, newest first.
1975
+ *
1976
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_invoices` · permission `billing:read` · effect `read`
1977
+ *
1978
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
1979
+ */
1980
+ async list(request) {
1981
+ return this.client.call({
1982
+ method: 'GET',
1983
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_invoices`,
1984
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
1985
+ responseType: 'sylphx.money.v1.ListUsageInvoicesResponse',
1986
+ mutation: false,
1987
+ });
1988
+ }
1989
+ /** Every item of every page of `list`. */
1990
+ async *listAll(request) {
1991
+ let next = request;
1992
+ for (;;) {
1993
+ const page = await this.list(next);
1994
+ yield* page.usageInvoices ?? [];
1995
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
1996
+ return;
1997
+ next = { ...request, pageToken: page.nextPageToken };
1998
+ }
1999
+ }
2000
+ /**
2001
+ * Releases a held invoice for collection, audited with who and why. Grant expiry or replacement never does.
2002
+ *
2003
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/usage_invoices/*}:releaseCollection` · permission `billing:credits.approve` · effect `write`
2004
+ *
2005
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `INVALID_FIELD`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2006
+ */
2007
+ async releaseCollection(request) {
2008
+ return this.client.call({
2009
+ method: 'POST',
2010
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/usage_invoices/*', 'name')}:releaseCollection`,
2011
+ body: runtime.omit(request, ['name']),
2012
+ bodyType: 'sylphx.money.v1.ReleaseUsageInvoiceCollectionRequest',
2013
+ responseType: 'sylphx.money.v1.UsageInvoice',
2014
+ mutation: true,
2015
+ });
2016
+ }
2017
+ }
2018
+ /** `usage_meters` of Sylphx Money: Resource type `money.sylphx.com/UsageMeter`. */
2019
+ export class UsageMetersCollection {
2020
+ client;
2021
+ constructor(client) {
2022
+ this.client = client;
2023
+ }
2024
+ /**
2025
+ * Gets a usage meter.
2026
+ *
2027
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/usage_meters/*}` · permission `billing:read` · effect `read`
2028
+ *
2029
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2030
+ */
2031
+ async get(request) {
2032
+ return this.client.call({
2033
+ method: 'GET',
2034
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/usage_meters/*', 'name')}`,
2035
+ responseType: 'sylphx.money.v1.UsageMeter',
2036
+ mutation: false,
2037
+ });
2038
+ }
2039
+ /**
2040
+ * Lists usage meters.
2041
+ *
2042
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_meters` · permission `billing:read` · effect `read`
2043
+ *
2044
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2045
+ */
2046
+ async list(request) {
2047
+ return this.client.call({
2048
+ method: 'GET',
2049
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_meters`,
2050
+ query: { page_size: request.pageSize, page_token: request.pageToken },
2051
+ responseType: 'sylphx.money.v1.ListUsageMetersResponse',
2052
+ mutation: false,
2053
+ });
2054
+ }
2055
+ /** Every item of every page of `list`. */
2056
+ async *listAll(request) {
2057
+ let next = request;
2058
+ for (;;) {
2059
+ const page = await this.list(next);
2060
+ yield* page.usageMeters ?? [];
2061
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
2062
+ return;
2063
+ next = { ...request, pageToken: page.nextPageToken };
2064
+ }
2065
+ }
2066
+ /**
2067
+ * Creates or updates a usage meter. The unit cannot change once it has recorded usage.
2068
+ *
2069
+ * `PATCH /v1/{usage_meter.name=orgs/*\/projects/*\/envs/*\/usage_meters/*}` · permission `billing:write` · effect `write`
2070
+ *
2071
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2072
+ */
2073
+ async update(request) {
2074
+ return this.client.call({
2075
+ method: 'PATCH',
2076
+ path: `/v1/${runtime.pathParam(request.usageMeter?.name, 'orgs/*/projects/*/envs/*/usage_meters/*', 'usage_meter.name')}`,
2077
+ query: { update_mask: request.updateMask },
2078
+ body: request.usageMeter ?? {},
2079
+ bodyType: 'sylphx.money.v1.UsageMeter',
2080
+ responseType: 'sylphx.money.v1.UsageMeter',
2081
+ mutation: true,
2082
+ });
2083
+ }
2084
+ }
2085
+ /** `usage_meter_prices` of Sylphx Money: Resource type `money.sylphx.com/UsageMeterPrice`. */
2086
+ export class UsageMeterPricesCollection {
2087
+ client;
2088
+ constructor(client) {
2089
+ this.client = client;
2090
+ }
2091
+ /**
2092
+ * Appends a price to a meter's history. It applies from its effective time on and never rewrites usage already rated.
2093
+ *
2094
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_meter_prices` · permission `billing:write` · effect `write`
2095
+ *
2096
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `RESOURCE_NOT_FOUND`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2097
+ */
2098
+ async create(request) {
2099
+ return this.client.call({
2100
+ method: 'POST',
2101
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_meter_prices`,
2102
+ body: request.usageMeterPrice ?? {},
2103
+ bodyType: 'sylphx.money.v1.UsageMeterPrice',
2104
+ responseType: 'sylphx.money.v1.UsageMeterPrice',
2105
+ mutation: true,
2106
+ });
2107
+ }
2108
+ /**
2109
+ * Lists meter prices, newest first; filter by `meter`.
2110
+ *
2111
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/usage_meter_prices` · permission `billing:read` · effect `read`
2112
+ *
2113
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2114
+ */
2115
+ async list(request) {
2116
+ return this.client.call({
2117
+ method: 'GET',
2118
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/usage_meter_prices`,
2119
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
2120
+ responseType: 'sylphx.money.v1.ListUsageMeterPricesResponse',
2121
+ mutation: false,
2122
+ });
2123
+ }
2124
+ /** Every item of every page of `list`. */
2125
+ async *listAll(request) {
2126
+ let next = request;
2127
+ for (;;) {
2128
+ const page = await this.list(next);
2129
+ yield* page.usageMeterPrices ?? [];
2130
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
2131
+ return;
2132
+ next = { ...request, pageToken: page.nextPageToken };
2133
+ }
2134
+ }
2135
+ }
2136
+ /** `revenue_sources` of Sylphx Money: Resource type `money.sylphx.com/RevenueSource`. */
2137
+ export class RevenueSourcesCollection {
2138
+ client;
2139
+ constructor(client) {
2140
+ this.client = client;
2141
+ }
2142
+ /**
2143
+ * Gets a revenue source, with its freshness. Revenue reporting
2144
+ * (docs/adr/ADR-01M40HRQT0VSXZ1WANP8M318F2) is org-wide: `revenue:read` or
2145
+ * `revenue:write`, held by an org-wide key or an org owner's or admin's
2146
+ * session only; a project or environment key is refused.
2147
+ *
2148
+ * `GET /v1/{name=orgs/*\/revenue_sources/*}` · permission `revenue:read` · effect `read`
2149
+ *
2150
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
2151
+ */
2152
+ async get(request) {
2153
+ return this.client.call({
2154
+ method: 'GET',
2155
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/revenue_sources/*', 'name')}`,
2156
+ responseType: 'sylphx.money.v1.RevenueSource',
2157
+ mutation: false,
2158
+ });
2159
+ }
2160
+ /**
2161
+ * Lists the org's revenue sources, with their freshness.
2162
+ *
2163
+ * `GET /v1/{parent=orgs/*}/revenue_sources` · permission `revenue:read` · effect `read`
2164
+ *
2165
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2166
+ */
2167
+ async list(request) {
2168
+ return this.client.call({
2169
+ method: 'GET',
2170
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*', 'parent')}/revenue_sources`,
2171
+ query: { page_size: request.pageSize, page_token: request.pageToken },
2172
+ responseType: 'sylphx.money.v1.ListRevenueSourcesResponse',
2173
+ mutation: false,
2174
+ });
2175
+ }
2176
+ /** Every item of every page of `list`. */
2177
+ async *listAll(request) {
2178
+ let next = request;
2179
+ for (;;) {
2180
+ const page = await this.list(next);
2181
+ yield* page.revenueSources ?? [];
2182
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
2183
+ return;
2184
+ next = { ...request, pageToken: page.nextPageToken };
2185
+ }
2186
+ }
2187
+ /**
2188
+ * Registers a revenue source. The `money` source is implicit and never
2189
+ * created here.
2190
+ *
2191
+ * `POST /v1/{parent=orgs/*}/revenue_sources` · permission `revenue:write` · effect `write`
2192
+ *
2193
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2194
+ */
2195
+ async create(request) {
2196
+ return this.client.call({
2197
+ method: 'POST',
2198
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*', 'parent')}/revenue_sources`,
2199
+ query: { revenue_source_id: request.revenueSourceId, validate_only: request.validateOnly },
2200
+ body: request.revenueSource ?? {},
2201
+ bodyType: 'sylphx.money.v1.RevenueSource',
2202
+ responseType: 'sylphx.money.v1.RevenueSource',
2203
+ mutation: true,
2204
+ });
2205
+ }
2206
+ /**
2207
+ * Renames, pauses or resumes a revenue source, or changes its settings.
2208
+ *
2209
+ * `PATCH /v1/{revenue_source.name=orgs/*\/revenue_sources/*}` · permission `revenue:write` · effect `write`
2210
+ *
2211
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2212
+ */
2213
+ async update(request) {
2214
+ return this.client.call({
2215
+ method: 'PATCH',
2216
+ path: `/v1/${runtime.pathParam(request.revenueSource?.name, 'orgs/*/revenue_sources/*', 'revenue_source.name')}`,
2217
+ query: { update_mask: request.updateMask, validate_only: request.validateOnly },
2218
+ body: request.revenueSource ?? {},
2219
+ bodyType: 'sylphx.money.v1.RevenueSource',
2220
+ responseType: 'sylphx.money.v1.RevenueSource',
2221
+ mutation: true,
2222
+ });
2223
+ }
2224
+ /**
2225
+ * Deletes a revenue source and the facts it reported. The `money` source
2226
+ * cannot be deleted; pause it instead.
2227
+ *
2228
+ * `DELETE /v1/{name=orgs/*\/revenue_sources/*}` · permission `revenue:write` · effect `destructive`
2229
+ *
2230
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2231
+ */
2232
+ async delete(request) {
2233
+ return this.client.call({
2234
+ method: 'DELETE',
2235
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/revenue_sources/*', 'name')}`,
2236
+ query: { etag: request.etag, validate_only: request.validateOnly },
2237
+ mutation: true,
2238
+ });
2239
+ }
2240
+ /**
2241
+ * Syncs a revenue source now, or backfills a period. A `money` source
2242
+ * fills any booked fact its environment's ledger holds and the facts lack;
2243
+ * a paused source, or one whose connector has not shipped yet, is refused
2244
+ * (`INVALID_STATE`).
2245
+ *
2246
+ * `POST /v1/{name=orgs/*\/revenue_sources/*}:run` · permission `revenue:write` · effect `write`
2247
+ *
2248
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
2249
+ */
2250
+ async run(request) {
2251
+ return this.client.call({
2252
+ method: 'POST',
2253
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/revenue_sources/*', 'name')}:run`,
2254
+ body: runtime.omit(request, ['name']),
2255
+ bodyType: 'sylphx.money.v1.RunRevenueSourceRequest',
2256
+ responseType: 'sylphx.money.v1.RunRevenueSourceResponse',
2257
+ mutation: true,
2258
+ });
2259
+ }
2260
+ }
2261
+ /** `revenue` of Sylphx Money: Resource type `money.sylphx.com/RevenueSummary`. */
2262
+ export class RevenueCollection {
2263
+ client;
2264
+ constructor(client) {
2265
+ this.client = client;
2266
+ }
2267
+ /**
2268
+ * Gets the org's revenue over a period: totals by day or month, split by
2269
+ * source or product, gross or net, in one reporting currency, with the
2270
+ * basis of each bucket, the sources that report late, and what has no
2271
+ * rate yet. Reads only the daily roll-up, bounded by a 5 second statement
2272
+ * timeout. For example `sylphx money revenue summary --period mtd
2273
+ * --split source`.
2274
+ *
2275
+ * `GET /v1/{name=orgs/*\/revenue}` · permission `revenue:read` · effect `read`
2276
+ *
2277
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `UNAVAILABLE`.
2278
+ */
2279
+ async get(request) {
2280
+ return this.client.call({
2281
+ method: 'GET',
2282
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/revenue', 'name')}`,
2283
+ query: { period: request.period, month: request.month, start_day: request.startDay, end_day: request.endDay, group_by: request.groupBy, split: request.split, amount: request.amount, currency_code: request.currencyCode },
2284
+ responseType: 'sylphx.money.v1.RevenueSummary',
2285
+ mutation: false,
2286
+ });
2287
+ }
2288
+ }
2289
+ /** `revenue_facts` of Sylphx Money: Resource type `money.sylphx.com/RevenueFact`. */
2290
+ export class RevenueFactsCollection {
2291
+ client;
2292
+ constructor(client) {
2293
+ this.client = client;
2294
+ }
2295
+ /**
2296
+ * Lists the org's revenue facts, newest day first, for audit and export.
2297
+ *
2298
+ * `GET /v1/{parent=orgs/*}/revenue_facts` · permission `revenue:read` · effect `read`
2299
+ *
2300
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`, `UNAVAILABLE`.
2301
+ */
2302
+ async list(request) {
2303
+ return this.client.call({
2304
+ method: 'GET',
2305
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*', 'parent')}/revenue_facts`,
2306
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
2307
+ responseType: 'sylphx.money.v1.ListRevenueFactsResponse',
2308
+ mutation: false,
2309
+ });
2310
+ }
2311
+ /** Every item of every page of `list`. */
2312
+ async *listAll(request) {
2313
+ let next = request;
2314
+ for (;;) {
2315
+ const page = await this.list(next);
2316
+ yield* page.revenueFacts ?? [];
2317
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
2318
+ return;
2319
+ next = { ...request, pageToken: page.nextPageToken };
2320
+ }
2321
+ }
2322
+ }
2323
+ /** `exchange_rates` of Sylphx Money: Resource type `money.sylphx.com/ExchangeRate`. */
2324
+ export class ExchangeRatesCollection {
2325
+ client;
2326
+ constructor(client) {
2327
+ this.client = client;
2328
+ }
2329
+ /**
2330
+ * Lists the exchange rates Money converts at (units per US dollar by day),
2331
+ * for any reader that converts revenue.
2332
+ *
2333
+ * `GET /v1/{parent=orgs/*}/exchange_rates` · permission `revenue:read` · effect `read`
2334
+ *
2335
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
2336
+ */
2337
+ async list(request) {
2338
+ return this.client.call({
2339
+ method: 'GET',
2340
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*', 'parent')}/exchange_rates`,
2341
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter },
2342
+ responseType: 'sylphx.money.v1.ListExchangeRatesResponse',
2343
+ mutation: false,
2344
+ });
2345
+ }
2346
+ /** Every item of every page of `list`. */
2347
+ async *listAll(request) {
2348
+ let next = request;
2349
+ for (;;) {
2350
+ const page = await this.list(next);
2351
+ yield* page.exchangeRates ?? [];
2352
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
2353
+ return;
2354
+ next = { ...request, pageToken: page.nextPageToken };
2355
+ }
2356
+ }
2357
+ }
2358
+ //# sourceMappingURL=money.js.map