lark-billing 0.0.6__py3-none-any.whl → 0.0.7__py3-none-any.whl
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.
Potentially problematic release.
This version of lark-billing might be problematic. Click here for more details.
- lark/__init__.py +69 -360
- lark/checkout/client.py +8 -85
- lark/checkout/raw_client.py +6 -102
- lark/client.py +93 -27
- lark/core/client_wrapper.py +2 -2
- lark/{feature_access → customer_access}/client.py +30 -24
- lark/{feature_access → customer_access}/raw_client.py +22 -17
- lark/{types/rate_card.py → customer_portal/__init__.py} +1 -2
- lark/customer_portal/client.py +115 -0
- lark/customer_portal/raw_client.py +134 -0
- lark/environment.py +7 -0
- lark/pricing_metrics/__init__.py +38 -0
- lark/pricing_metrics/client.py +219 -0
- lark/pricing_metrics/raw_client.py +268 -0
- lark/pricing_metrics/types/__init__.py +42 -0
- lark/{types/credit_grant_resource_input_schedule.py → pricing_metrics/types/pricing_metric_aggregation.py} +7 -8
- lark/rate_cards/__init__.py +3 -30
- lark/rate_cards/client.py +28 -540
- lark/rate_cards/raw_client.py +32 -368
- lark/rate_cards/types/__init__.py +2 -29
- lark/subjects/client.py +2 -36
- lark/subjects/raw_client.py +0 -16
- lark/subscriptions/client.py +24 -184
- lark/subscriptions/raw_client.py +18 -135
- lark/types/__init__.py +41 -356
- lark/types/amount.py +5 -1
- lark/types/{create_dimension_coordinate_interface.py → billing_state_response.py} +3 -3
- lark/types/{credit_grant_schedule_one_time_resource.py → count_aggregation_pricing_metric_resource.py} +1 -1
- lark/types/{create_dimension_interface.py → create_customer_portal_session_response.py} +3 -3
- lark/types/create_fixed_rate_interface.py +1 -7
- lark/types/{pricing_metric_interface.py → create_pricing_metric_response.py} +2 -5
- lark/types/create_simple_usage_based_rate_interface.py +3 -8
- lark/types/create_subject_response.py +2 -1
- lark/types/create_subscription_checkout_session_response.py +1 -2
- lark/types/create_usage_event_summary_response.py +1 -1
- lark/types/{credit_grant_schedule_rate_cycle_start_resource.py → custom_pricing_metric_resource.py} +3 -1
- lark/types/fixed_rate_interface.py +0 -6
- lark/types/{create_pricing_metric_interface.py → get_pricing_metric_response.py} +3 -5
- lark/types/{credit_grant_schedule_one_time_interface.py → last_aggregation_pricing_metric_resource.py} +2 -2
- lark/types/{credit_grant_date_time_expiration_resource.py → max_aggregation_pricing_metric_resource.py} +2 -2
- lark/types/package_price.py +2 -2
- lark/types/package_price_input_rounding_behavior.py +5 -0
- lark/types/package_price_output_rounding_behavior.py +5 -0
- lark/types/price.py +39 -1
- lark/types/rate_card_resource.py +0 -6
- lark/types/rate_card_resource_usage_based_rates_item.py +2 -28
- lark/types/simple_usage_based_rate_interface.py +1 -2
- lark/types/status.py +1 -1
- lark/types/subject_resource.py +2 -1
- lark/types/subscription_resource.py +0 -1
- lark/types/{credit_grant_date_time_expiration_interface.py → sum_aggregation_pricing_metric_resource.py} +2 -2
- lark/types/{subject.py → value.py} +1 -1
- lark/usage_events/client.py +8 -21
- lark/usage_events/raw_client.py +6 -6
- {lark_billing-0.0.6.dist-info → lark_billing-0.0.7.dist-info}/METADATA +3 -3
- lark_billing-0.0.7.dist-info/RECORD +94 -0
- lark/rate_cards/types/create_rate_card_request_usage_based_rates_item.py +0 -56
- lark/rate_cards/types/create_rate_card_version_request_usage_based_rates_item.py +0 -58
- lark/rate_cards/types/create_rate_card_version_request_version_type.py +0 -5
- lark/types/check_feature_access_request.py +0 -24
- lark/types/check_feature_access_response.py +0 -21
- lark/types/complete_subscription_checkout_response.py +0 -21
- lark/types/create_credit_grant_interface.py +0 -27
- lark/types/create_credit_grant_interface_expiration.py +0 -27
- lark/types/create_credit_pool_request.py +0 -5
- lark/types/create_dimensional_usage_based_rate_interface.py +0 -32
- lark/types/create_pricing_matrix_cell_interface.py +0 -22
- lark/types/create_pricing_matrix_interface.py +0 -20
- lark/types/create_pricing_plan_request.py +0 -5
- lark/types/create_rate_card_response.py +0 -36
- lark/types/create_rate_card_response_billing_interval.py +0 -5
- lark/types/create_rate_card_response_usage_based_rates_item.py +0 -58
- lark/types/create_rate_card_version_response.py +0 -36
- lark/types/create_rate_card_version_response_billing_interval.py +0 -5
- lark/types/create_rate_card_version_response_usage_based_rates_item.py +0 -59
- lark/types/credit_grant.py +0 -5
- lark/types/credit_grant_duration_expiration_interface.py +0 -21
- lark/types/credit_grant_duration_expiration_resource.py +0 -21
- lark/types/credit_grant_interface.py +0 -28
- lark/types/credit_grant_interface_input_expiration.py +0 -27
- lark/types/credit_grant_interface_output_expiration.py +0 -43
- lark/types/credit_grant_interface_output_schedule.py +0 -41
- lark/types/credit_grant_resource.py +0 -28
- lark/types/credit_grant_resource_input_expiration.py +0 -27
- lark/types/credit_grant_resource_output_expiration.py +0 -43
- lark/types/credit_grant_resource_output_schedule.py +0 -39
- lark/types/credit_grant_schedule.py +0 -5
- lark/types/credit_grant_schedule_rate_cycle_start_interface.py +0 -19
- lark/types/credit_grant_subject_granting_config_interface.py +0 -20
- lark/types/credit_pool.py +0 -5
- lark/types/credit_pool_rollover_config.py +0 -5
- lark/types/custom_aggregation_pricing_metric_interface.py +0 -22
- lark/types/custom_pricing_metric.py +0 -5
- lark/types/custom_unit.py +0 -5
- lark/types/custom_unit_amount.py +0 -5
- lark/types/dimension.py +0 -5
- lark/types/dimension_coordinate.py +0 -5
- lark/types/dimension_coordinate_interface.py +0 -20
- lark/types/dimension_coordinate_set.py +0 -5
- lark/types/dimension_interface.py +0 -20
- lark/types/dimensional_rate_matrix.py +0 -5
- lark/types/dimensional_rate_matrix_cell.py +0 -5
- lark/types/dimensional_usage_based_rate.py +0 -5
- lark/types/dimensional_usage_based_rate_input.py +0 -5
- lark/types/dimensional_usage_based_rate_interface.py +0 -33
- lark/types/feature_access_resource.py +0 -21
- lark/types/get_rate_card_response.py +0 -36
- lark/types/get_rate_card_response_billing_interval.py +0 -5
- lark/types/get_rate_card_response_usage_based_rates_item.py +0 -58
- lark/types/grant_credits_request.py +0 -5
- lark/types/last_aggregation_pricing_metric_interface.py +0 -22
- lark/types/license_based_rate.py +0 -5
- lark/types/license_based_rate_input.py +0 -5
- lark/types/max_aggregation_pricing_metric_interface.py +0 -22
- lark/types/monetary_amount.py +0 -5
- lark/types/package_price_rounding_behavior.py +0 -5
- lark/types/package_price_wrapper.py +0 -5
- lark/types/pricing_matrix_cell_interface.py +0 -22
- lark/types/pricing_matrix_interface.py +0 -20
- lark/types/pricing_metric.py +0 -5
- lark/types/pricing_plan.py +0 -5
- lark/types/pricing_plan_subscription.py +0 -5
- lark/types/pricing_tier.py +0 -5
- lark/types/rate_card_version.py +0 -5
- lark/types/rate_card_version_input.py +0 -5
- lark/types/simple_usage_based_rate.py +0 -5
- lark/types/simple_usage_based_rate_input.py +0 -5
- lark/types/subject_granting_config.py +0 -5
- lark/types/subject_granting_config_resource.py +0 -20
- lark/types/tiered_price.py +0 -5
- lark/types/tiered_price_wrapper.py +0 -5
- lark/types/unit.py +0 -5
- lark/types/update_pricing_plan_request.py +0 -5
- lark/types/update_rate_card_request.py +0 -5
- lark/types/update_subscription_request.py +0 -5
- lark/types/usage_based_rate.py +0 -5
- lark/types/usage_based_rate_input.py +0 -5
- lark/types/usage_unit.py +0 -5
- lark_billing-0.0.6.dist-info/RECORD +0 -167
- /lark/{feature_access → customer_access}/__init__.py +0 -0
- {lark_billing-0.0.6.dist-info → lark_billing-0.0.7.dist-info}/WHEEL +0 -0
lark/subscriptions/raw_client.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
import datetime as dt
|
|
4
3
|
import typing
|
|
5
4
|
from json.decoder import JSONDecodeError
|
|
6
5
|
|
|
@@ -27,7 +26,8 @@ class RawSubscriptionsClient:
|
|
|
27
26
|
self,
|
|
28
27
|
*,
|
|
29
28
|
limit: typing.Optional[int] = None,
|
|
30
|
-
|
|
29
|
+
subject_id: typing.Optional[str] = None,
|
|
30
|
+
rate_card_id: typing.Optional[str] = None,
|
|
31
31
|
request_options: typing.Optional[RequestOptions] = None,
|
|
32
32
|
) -> HttpResponse[ListSubscriptionsResponse]:
|
|
33
33
|
"""
|
|
@@ -35,7 +35,11 @@ class RawSubscriptionsClient:
|
|
|
35
35
|
----------
|
|
36
36
|
limit : typing.Optional[int]
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
subject_id : typing.Optional[str]
|
|
39
|
+
The ID of the subject to list subscriptions for. Cannot be used with rate_card_id.
|
|
40
|
+
|
|
41
|
+
rate_card_id : typing.Optional[str]
|
|
42
|
+
The ID of the rate card to list subscriptions for. Cannot be used with subject_id.
|
|
39
43
|
|
|
40
44
|
request_options : typing.Optional[RequestOptions]
|
|
41
45
|
Request-specific configuration.
|
|
@@ -50,7 +54,8 @@ class RawSubscriptionsClient:
|
|
|
50
54
|
method="GET",
|
|
51
55
|
params={
|
|
52
56
|
"limit": limit,
|
|
53
|
-
"
|
|
57
|
+
"subject_id": subject_id,
|
|
58
|
+
"rate_card_id": rate_card_id,
|
|
54
59
|
},
|
|
55
60
|
request_options=request_options,
|
|
56
61
|
)
|
|
@@ -85,8 +90,6 @@ class RawSubscriptionsClient:
|
|
|
85
90
|
*,
|
|
86
91
|
rate_card_id: str,
|
|
87
92
|
subject_id: str,
|
|
88
|
-
effective_at: dt.datetime,
|
|
89
|
-
variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
|
90
93
|
metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
|
91
94
|
request_options: typing.Optional[RequestOptions] = None,
|
|
92
95
|
) -> HttpResponse[SubscriptionResource]:
|
|
@@ -97,10 +100,6 @@ class RawSubscriptionsClient:
|
|
|
97
100
|
|
|
98
101
|
subject_id : str
|
|
99
102
|
|
|
100
|
-
effective_at : dt.datetime
|
|
101
|
-
|
|
102
|
-
variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
|
|
103
|
-
|
|
104
103
|
metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
|
|
105
104
|
|
|
106
105
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -117,8 +116,6 @@ class RawSubscriptionsClient:
|
|
|
117
116
|
json={
|
|
118
117
|
"rate_card_id": rate_card_id,
|
|
119
118
|
"subject_id": subject_id,
|
|
120
|
-
"effective_at": effective_at,
|
|
121
|
-
"variables": variables,
|
|
122
119
|
"metadata": metadata,
|
|
123
120
|
},
|
|
124
121
|
headers={
|
|
@@ -200,62 +197,6 @@ class RawSubscriptionsClient:
|
|
|
200
197
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
201
198
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
202
199
|
|
|
203
|
-
def cancel_subscription(
|
|
204
|
-
self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
205
|
-
) -> HttpResponse[None]:
|
|
206
|
-
"""
|
|
207
|
-
Parameters
|
|
208
|
-
----------
|
|
209
|
-
subscription_id : str
|
|
210
|
-
|
|
211
|
-
request_options : typing.Optional[RequestOptions]
|
|
212
|
-
Request-specific configuration.
|
|
213
|
-
|
|
214
|
-
Returns
|
|
215
|
-
-------
|
|
216
|
-
HttpResponse[None]
|
|
217
|
-
"""
|
|
218
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
219
|
-
f"subscriptions/{jsonable_encoder(subscription_id)}",
|
|
220
|
-
method="DELETE",
|
|
221
|
-
request_options=request_options,
|
|
222
|
-
)
|
|
223
|
-
try:
|
|
224
|
-
if 200 <= _response.status_code < 300:
|
|
225
|
-
return HttpResponse(response=_response, data=None)
|
|
226
|
-
_response_json = _response.json()
|
|
227
|
-
except JSONDecodeError:
|
|
228
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
229
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
230
|
-
|
|
231
|
-
def update_subscription(
|
|
232
|
-
self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
233
|
-
) -> HttpResponse[None]:
|
|
234
|
-
"""
|
|
235
|
-
Parameters
|
|
236
|
-
----------
|
|
237
|
-
subscription_id : str
|
|
238
|
-
|
|
239
|
-
request_options : typing.Optional[RequestOptions]
|
|
240
|
-
Request-specific configuration.
|
|
241
|
-
|
|
242
|
-
Returns
|
|
243
|
-
-------
|
|
244
|
-
HttpResponse[None]
|
|
245
|
-
"""
|
|
246
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
247
|
-
f"subscriptions/{jsonable_encoder(subscription_id)}",
|
|
248
|
-
method="PATCH",
|
|
249
|
-
request_options=request_options,
|
|
250
|
-
)
|
|
251
|
-
try:
|
|
252
|
-
if 200 <= _response.status_code < 300:
|
|
253
|
-
return HttpResponse(response=_response, data=None)
|
|
254
|
-
_response_json = _response.json()
|
|
255
|
-
except JSONDecodeError:
|
|
256
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
257
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
258
|
-
|
|
259
200
|
|
|
260
201
|
class AsyncRawSubscriptionsClient:
|
|
261
202
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -265,7 +206,8 @@ class AsyncRawSubscriptionsClient:
|
|
|
265
206
|
self,
|
|
266
207
|
*,
|
|
267
208
|
limit: typing.Optional[int] = None,
|
|
268
|
-
|
|
209
|
+
subject_id: typing.Optional[str] = None,
|
|
210
|
+
rate_card_id: typing.Optional[str] = None,
|
|
269
211
|
request_options: typing.Optional[RequestOptions] = None,
|
|
270
212
|
) -> AsyncHttpResponse[ListSubscriptionsResponse]:
|
|
271
213
|
"""
|
|
@@ -273,7 +215,11 @@ class AsyncRawSubscriptionsClient:
|
|
|
273
215
|
----------
|
|
274
216
|
limit : typing.Optional[int]
|
|
275
217
|
|
|
276
|
-
|
|
218
|
+
subject_id : typing.Optional[str]
|
|
219
|
+
The ID of the subject to list subscriptions for. Cannot be used with rate_card_id.
|
|
220
|
+
|
|
221
|
+
rate_card_id : typing.Optional[str]
|
|
222
|
+
The ID of the rate card to list subscriptions for. Cannot be used with subject_id.
|
|
277
223
|
|
|
278
224
|
request_options : typing.Optional[RequestOptions]
|
|
279
225
|
Request-specific configuration.
|
|
@@ -288,7 +234,8 @@ class AsyncRawSubscriptionsClient:
|
|
|
288
234
|
method="GET",
|
|
289
235
|
params={
|
|
290
236
|
"limit": limit,
|
|
291
|
-
"
|
|
237
|
+
"subject_id": subject_id,
|
|
238
|
+
"rate_card_id": rate_card_id,
|
|
292
239
|
},
|
|
293
240
|
request_options=request_options,
|
|
294
241
|
)
|
|
@@ -323,8 +270,6 @@ class AsyncRawSubscriptionsClient:
|
|
|
323
270
|
*,
|
|
324
271
|
rate_card_id: str,
|
|
325
272
|
subject_id: str,
|
|
326
|
-
effective_at: dt.datetime,
|
|
327
|
-
variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
|
328
273
|
metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
|
329
274
|
request_options: typing.Optional[RequestOptions] = None,
|
|
330
275
|
) -> AsyncHttpResponse[SubscriptionResource]:
|
|
@@ -335,10 +280,6 @@ class AsyncRawSubscriptionsClient:
|
|
|
335
280
|
|
|
336
281
|
subject_id : str
|
|
337
282
|
|
|
338
|
-
effective_at : dt.datetime
|
|
339
|
-
|
|
340
|
-
variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
|
|
341
|
-
|
|
342
283
|
metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
|
|
343
284
|
|
|
344
285
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -355,8 +296,6 @@ class AsyncRawSubscriptionsClient:
|
|
|
355
296
|
json={
|
|
356
297
|
"rate_card_id": rate_card_id,
|
|
357
298
|
"subject_id": subject_id,
|
|
358
|
-
"effective_at": effective_at,
|
|
359
|
-
"variables": variables,
|
|
360
299
|
"metadata": metadata,
|
|
361
300
|
},
|
|
362
301
|
headers={
|
|
@@ -437,59 +376,3 @@ class AsyncRawSubscriptionsClient:
|
|
|
437
376
|
except JSONDecodeError:
|
|
438
377
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
439
378
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
440
|
-
|
|
441
|
-
async def cancel_subscription(
|
|
442
|
-
self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
443
|
-
) -> AsyncHttpResponse[None]:
|
|
444
|
-
"""
|
|
445
|
-
Parameters
|
|
446
|
-
----------
|
|
447
|
-
subscription_id : str
|
|
448
|
-
|
|
449
|
-
request_options : typing.Optional[RequestOptions]
|
|
450
|
-
Request-specific configuration.
|
|
451
|
-
|
|
452
|
-
Returns
|
|
453
|
-
-------
|
|
454
|
-
AsyncHttpResponse[None]
|
|
455
|
-
"""
|
|
456
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
457
|
-
f"subscriptions/{jsonable_encoder(subscription_id)}",
|
|
458
|
-
method="DELETE",
|
|
459
|
-
request_options=request_options,
|
|
460
|
-
)
|
|
461
|
-
try:
|
|
462
|
-
if 200 <= _response.status_code < 300:
|
|
463
|
-
return AsyncHttpResponse(response=_response, data=None)
|
|
464
|
-
_response_json = _response.json()
|
|
465
|
-
except JSONDecodeError:
|
|
466
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
467
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
468
|
-
|
|
469
|
-
async def update_subscription(
|
|
470
|
-
self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
471
|
-
) -> AsyncHttpResponse[None]:
|
|
472
|
-
"""
|
|
473
|
-
Parameters
|
|
474
|
-
----------
|
|
475
|
-
subscription_id : str
|
|
476
|
-
|
|
477
|
-
request_options : typing.Optional[RequestOptions]
|
|
478
|
-
Request-specific configuration.
|
|
479
|
-
|
|
480
|
-
Returns
|
|
481
|
-
-------
|
|
482
|
-
AsyncHttpResponse[None]
|
|
483
|
-
"""
|
|
484
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
485
|
-
f"subscriptions/{jsonable_encoder(subscription_id)}",
|
|
486
|
-
method="PATCH",
|
|
487
|
-
request_options=request_options,
|
|
488
|
-
)
|
|
489
|
-
try:
|
|
490
|
-
if 200 <= _response.status_code < 300:
|
|
491
|
-
return AsyncHttpResponse(response=_response, data=None)
|
|
492
|
-
_response_json = _response.json()
|
|
493
|
-
except JSONDecodeError:
|
|
494
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
495
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|