lark-billing 0.0.6__tar.gz → 0.0.7__tar.gz
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_billing-0.0.6 → lark_billing-0.0.7}/PKG-INFO +3 -3
- {lark_billing-0.0.6 → lark_billing-0.0.7}/README.md +2 -2
- {lark_billing-0.0.6 → lark_billing-0.0.7}/pyproject.toml +1 -1
- lark_billing-0.0.7/src/lark/__init__.py +231 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/checkout/client.py +8 -85
- lark_billing-0.0.7/src/lark/checkout/raw_client.py +156 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/client.py +93 -27
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/client_wrapper.py +2 -2
- {lark_billing-0.0.6/src/lark/feature_access → lark_billing-0.0.7/src/lark/customer_access}/client.py +30 -24
- {lark_billing-0.0.6/src/lark/feature_access → lark_billing-0.0.7/src/lark/customer_access}/raw_client.py +22 -17
- lark_billing-0.0.7/src/lark/customer_portal/client.py +115 -0
- lark_billing-0.0.7/src/lark/customer_portal/raw_client.py +134 -0
- lark_billing-0.0.7/src/lark/environment.py +7 -0
- lark_billing-0.0.7/src/lark/pricing_metrics/__init__.py +38 -0
- lark_billing-0.0.7/src/lark/pricing_metrics/client.py +219 -0
- {lark_billing-0.0.6/src/lark/checkout → lark_billing-0.0.7/src/lark/pricing_metrics}/raw_client.py +68 -52
- lark_billing-0.0.7/src/lark/pricing_metrics/types/__init__.py +42 -0
- lark_billing-0.0.6/src/lark/types/credit_grant_resource_input_schedule.py → lark_billing-0.0.7/src/lark/pricing_metrics/types/pricing_metric_aggregation.py +7 -8
- lark_billing-0.0.7/src/lark/rate_cards/__init__.py +34 -0
- lark_billing-0.0.7/src/lark/rate_cards/client.py +305 -0
- lark_billing-0.0.7/src/lark/rate_cards/raw_client.py +392 -0
- lark_billing-0.0.7/src/lark/rate_cards/types/__init__.py +36 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/subjects/client.py +2 -36
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/subjects/raw_client.py +0 -16
- lark_billing-0.0.7/src/lark/subscriptions/__init__.py +4 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/subscriptions/client.py +24 -184
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/subscriptions/raw_client.py +18 -135
- lark_billing-0.0.7/src/lark/types/__init__.py +178 -0
- lark_billing-0.0.6/src/lark/types/last_aggregation_pricing_metric_interface.py → lark_billing-0.0.7/src/lark/types/amount.py +5 -3
- lark_billing-0.0.6/src/lark/types/create_dimension_coordinate_interface.py → lark_billing-0.0.7/src/lark/types/billing_state_response.py +3 -3
- lark_billing-0.0.6/src/lark/types/credit_grant_schedule_one_time_resource.py → lark_billing-0.0.7/src/lark/types/count_aggregation_pricing_metric_resource.py +1 -1
- lark_billing-0.0.6/src/lark/types/create_dimension_interface.py → lark_billing-0.0.7/src/lark/types/create_customer_portal_session_response.py +3 -3
- lark_billing-0.0.7/src/lark/types/create_fixed_rate_interface.py +22 -0
- lark_billing-0.0.6/src/lark/types/pricing_metric_interface.py → lark_billing-0.0.7/src/lark/types/create_pricing_metric_response.py +2 -5
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/create_simple_usage_based_rate_interface.py +3 -8
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/create_subject_response.py +2 -1
- lark_billing-0.0.6/src/lark/types/complete_subscription_checkout_response.py → lark_billing-0.0.7/src/lark/types/create_subscription_checkout_session_response.py +2 -1
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/create_usage_event_summary_response.py +1 -1
- lark_billing-0.0.6/src/lark/types/credit_grant_schedule_rate_cycle_start_resource.py → lark_billing-0.0.7/src/lark/types/custom_pricing_metric_resource.py +3 -1
- lark_billing-0.0.6/src/lark/types/check_feature_access_response.py → lark_billing-0.0.7/src/lark/types/fixed_rate_interface.py +6 -4
- lark_billing-0.0.6/src/lark/types/create_pricing_metric_interface.py → lark_billing-0.0.7/src/lark/types/get_pricing_metric_response.py +3 -5
- lark_billing-0.0.6/src/lark/types/credit_grant_date_time_expiration_resource.py → lark_billing-0.0.7/src/lark/types/last_aggregation_pricing_metric_resource.py +2 -2
- lark_billing-0.0.6/src/lark/types/amount.py → lark_billing-0.0.7/src/lark/types/max_aggregation_pricing_metric_resource.py +2 -3
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/package_price.py +2 -2
- lark_billing-0.0.7/src/lark/types/package_price_input_rounding_behavior.py +5 -0
- lark_billing-0.0.7/src/lark/types/package_price_output_rounding_behavior.py +5 -0
- lark_billing-0.0.6/src/lark/types/credit_grant_resource_output_schedule.py → lark_billing-0.0.7/src/lark/types/price.py +11 -7
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/rate_card_resource.py +0 -6
- lark_billing-0.0.6/src/lark/types/fixed_rate_interface.py → lark_billing-0.0.7/src/lark/types/rate_card_resource_usage_based_rates_item.py +10 -7
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/simple_usage_based_rate_interface.py +1 -2
- lark_billing-0.0.6/src/lark/types/create_credit_pool_request.py → lark_billing-0.0.7/src/lark/types/status.py +1 -1
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/subject_resource.py +2 -1
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/subscription_resource.py +0 -1
- lark_billing-0.0.6/src/lark/types/credit_grant_date_time_expiration_interface.py → lark_billing-0.0.7/src/lark/types/sum_aggregation_pricing_metric_resource.py +2 -2
- lark_billing-0.0.6/src/lark/types/price.py → lark_billing-0.0.7/src/lark/types/value.py +1 -1
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/usage_events/client.py +8 -21
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/usage_events/raw_client.py +6 -6
- lark_billing-0.0.6/src/lark/__init__.py +0 -522
- lark_billing-0.0.6/src/lark/rate_cards/__init__.py +0 -61
- lark_billing-0.0.6/src/lark/rate_cards/client.py +0 -817
- lark_billing-0.0.6/src/lark/rate_cards/raw_client.py +0 -728
- lark_billing-0.0.6/src/lark/rate_cards/types/__init__.py +0 -63
- lark_billing-0.0.6/src/lark/rate_cards/types/create_rate_card_request_usage_based_rates_item.py +0 -56
- lark_billing-0.0.6/src/lark/rate_cards/types/create_rate_card_version_request_usage_based_rates_item.py +0 -58
- lark_billing-0.0.6/src/lark/rate_cards/types/create_rate_card_version_request_version_type.py +0 -5
- lark_billing-0.0.6/src/lark/types/__init__.py +0 -493
- lark_billing-0.0.6/src/lark/types/check_feature_access_request.py +0 -24
- lark_billing-0.0.6/src/lark/types/create_credit_grant_interface.py +0 -27
- lark_billing-0.0.6/src/lark/types/create_credit_grant_interface_expiration.py +0 -27
- lark_billing-0.0.6/src/lark/types/create_dimensional_usage_based_rate_interface.py +0 -32
- lark_billing-0.0.6/src/lark/types/create_fixed_rate_interface.py +0 -28
- lark_billing-0.0.6/src/lark/types/create_pricing_matrix_cell_interface.py +0 -22
- lark_billing-0.0.6/src/lark/types/create_pricing_matrix_interface.py +0 -20
- lark_billing-0.0.6/src/lark/types/create_pricing_plan_request.py +0 -5
- lark_billing-0.0.6/src/lark/types/create_rate_card_response.py +0 -36
- lark_billing-0.0.6/src/lark/types/create_rate_card_response_billing_interval.py +0 -5
- lark_billing-0.0.6/src/lark/types/create_rate_card_response_usage_based_rates_item.py +0 -58
- lark_billing-0.0.6/src/lark/types/create_rate_card_version_response.py +0 -36
- lark_billing-0.0.6/src/lark/types/create_rate_card_version_response_billing_interval.py +0 -5
- lark_billing-0.0.6/src/lark/types/create_rate_card_version_response_usage_based_rates_item.py +0 -59
- lark_billing-0.0.6/src/lark/types/create_subscription_checkout_session_response.py +0 -23
- lark_billing-0.0.6/src/lark/types/credit_grant.py +0 -5
- lark_billing-0.0.6/src/lark/types/credit_grant_duration_expiration_interface.py +0 -21
- lark_billing-0.0.6/src/lark/types/credit_grant_duration_expiration_resource.py +0 -21
- lark_billing-0.0.6/src/lark/types/credit_grant_interface.py +0 -28
- lark_billing-0.0.6/src/lark/types/credit_grant_interface_input_expiration.py +0 -27
- lark_billing-0.0.6/src/lark/types/credit_grant_interface_output_expiration.py +0 -43
- lark_billing-0.0.6/src/lark/types/credit_grant_interface_output_schedule.py +0 -41
- lark_billing-0.0.6/src/lark/types/credit_grant_resource.py +0 -28
- lark_billing-0.0.6/src/lark/types/credit_grant_resource_input_expiration.py +0 -27
- lark_billing-0.0.6/src/lark/types/credit_grant_resource_output_expiration.py +0 -43
- lark_billing-0.0.6/src/lark/types/credit_grant_schedule.py +0 -5
- lark_billing-0.0.6/src/lark/types/credit_grant_schedule_one_time_interface.py +0 -19
- lark_billing-0.0.6/src/lark/types/credit_grant_schedule_rate_cycle_start_interface.py +0 -19
- lark_billing-0.0.6/src/lark/types/credit_grant_subject_granting_config_interface.py +0 -20
- lark_billing-0.0.6/src/lark/types/credit_pool.py +0 -5
- lark_billing-0.0.6/src/lark/types/credit_pool_rollover_config.py +0 -5
- lark_billing-0.0.6/src/lark/types/custom_aggregation_pricing_metric_interface.py +0 -22
- lark_billing-0.0.6/src/lark/types/custom_pricing_metric.py +0 -5
- lark_billing-0.0.6/src/lark/types/custom_unit.py +0 -5
- lark_billing-0.0.6/src/lark/types/custom_unit_amount.py +0 -5
- lark_billing-0.0.6/src/lark/types/dimension.py +0 -5
- lark_billing-0.0.6/src/lark/types/dimension_coordinate.py +0 -5
- lark_billing-0.0.6/src/lark/types/dimension_coordinate_interface.py +0 -20
- lark_billing-0.0.6/src/lark/types/dimension_coordinate_set.py +0 -5
- lark_billing-0.0.6/src/lark/types/dimension_interface.py +0 -20
- lark_billing-0.0.6/src/lark/types/dimensional_rate_matrix.py +0 -5
- lark_billing-0.0.6/src/lark/types/dimensional_rate_matrix_cell.py +0 -5
- lark_billing-0.0.6/src/lark/types/dimensional_usage_based_rate.py +0 -5
- lark_billing-0.0.6/src/lark/types/dimensional_usage_based_rate_input.py +0 -5
- lark_billing-0.0.6/src/lark/types/dimensional_usage_based_rate_interface.py +0 -33
- lark_billing-0.0.6/src/lark/types/feature_access_resource.py +0 -21
- lark_billing-0.0.6/src/lark/types/get_rate_card_response.py +0 -36
- lark_billing-0.0.6/src/lark/types/get_rate_card_response_billing_interval.py +0 -5
- lark_billing-0.0.6/src/lark/types/get_rate_card_response_usage_based_rates_item.py +0 -58
- lark_billing-0.0.6/src/lark/types/grant_credits_request.py +0 -5
- lark_billing-0.0.6/src/lark/types/license_based_rate.py +0 -5
- lark_billing-0.0.6/src/lark/types/license_based_rate_input.py +0 -5
- lark_billing-0.0.6/src/lark/types/max_aggregation_pricing_metric_interface.py +0 -22
- lark_billing-0.0.6/src/lark/types/monetary_amount.py +0 -5
- lark_billing-0.0.6/src/lark/types/package_price_rounding_behavior.py +0 -5
- lark_billing-0.0.6/src/lark/types/package_price_wrapper.py +0 -5
- lark_billing-0.0.6/src/lark/types/pricing_matrix_cell_interface.py +0 -22
- lark_billing-0.0.6/src/lark/types/pricing_matrix_interface.py +0 -20
- lark_billing-0.0.6/src/lark/types/pricing_metric.py +0 -5
- lark_billing-0.0.6/src/lark/types/pricing_plan.py +0 -5
- lark_billing-0.0.6/src/lark/types/pricing_plan_subscription.py +0 -5
- lark_billing-0.0.6/src/lark/types/pricing_tier.py +0 -5
- lark_billing-0.0.6/src/lark/types/rate_card.py +0 -5
- lark_billing-0.0.6/src/lark/types/rate_card_resource_usage_based_rates_item.py +0 -58
- lark_billing-0.0.6/src/lark/types/rate_card_version.py +0 -5
- lark_billing-0.0.6/src/lark/types/rate_card_version_input.py +0 -5
- lark_billing-0.0.6/src/lark/types/simple_usage_based_rate.py +0 -5
- lark_billing-0.0.6/src/lark/types/simple_usage_based_rate_input.py +0 -5
- lark_billing-0.0.6/src/lark/types/status.py +0 -5
- lark_billing-0.0.6/src/lark/types/subject.py +0 -5
- lark_billing-0.0.6/src/lark/types/subject_granting_config.py +0 -5
- lark_billing-0.0.6/src/lark/types/subject_granting_config_resource.py +0 -20
- lark_billing-0.0.6/src/lark/types/tiered_price.py +0 -5
- lark_billing-0.0.6/src/lark/types/tiered_price_wrapper.py +0 -5
- lark_billing-0.0.6/src/lark/types/unit.py +0 -5
- lark_billing-0.0.6/src/lark/types/update_pricing_plan_request.py +0 -5
- lark_billing-0.0.6/src/lark/types/update_rate_card_request.py +0 -5
- lark_billing-0.0.6/src/lark/types/update_subscription_request.py +0 -5
- lark_billing-0.0.6/src/lark/types/usage_based_rate.py +0 -5
- lark_billing-0.0.6/src/lark/types/usage_based_rate_input.py +0 -5
- lark_billing-0.0.6/src/lark/types/usage_unit.py +0 -5
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/checkout/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/api_error.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/datetime_utils.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/file.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/force_multipart.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/http_client.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/http_response.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/jsonable_encoder.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/pydantic_utilities.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/query_encoder.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/remove_none_from_dict.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/request_options.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/core/serialization.py +0 -0
- {lark_billing-0.0.6/src/lark/feature_access → lark_billing-0.0.7/src/lark/customer_access}/__init__.py +0 -0
- {lark_billing-0.0.6/src/lark/subjects → lark_billing-0.0.7/src/lark/customer_portal}/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/errors/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/errors/unprocessable_entity_error.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/py.typed +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/rate_cards/types/create_rate_card_request_billing_interval.py +0 -0
- {lark_billing-0.0.6/src/lark/subscriptions → lark_billing-0.0.7/src/lark/subjects}/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/aggregation.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/count_aggregation_pricing_metric_interface.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/flat_price.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/http_validation_error.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/list_rate_cards_response.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/list_subjects_response.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/list_subscriptions_response.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/period.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/rate_card_resource_billing_interval.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/sum_aggregation_pricing_metric_interface.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/validation_error.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/types/validation_error_loc_item.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/usage_events/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/usage_events/types/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/usage_events/types/create_usage_event_summary_request_aggregation_type.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.7}/src/lark/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lark-billing
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary:
|
|
5
5
|
Requires-Python: >=3.8,<4.0
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -50,11 +50,11 @@ from lark import Lark
|
|
|
50
50
|
|
|
51
51
|
client = Lark(
|
|
52
52
|
api_key="YOUR_API_KEY",
|
|
53
|
-
base_url="https://yourhost.com/path/to/api",
|
|
54
53
|
)
|
|
55
54
|
client.checkout.create_subscription_checkout_session(
|
|
56
55
|
subject_id="subject_id",
|
|
57
56
|
rate_card_id="rate_card_id",
|
|
57
|
+
callback_url="callback_url",
|
|
58
58
|
)
|
|
59
59
|
```
|
|
60
60
|
|
|
@@ -69,7 +69,6 @@ from lark import AsyncLark
|
|
|
69
69
|
|
|
70
70
|
client = AsyncLark(
|
|
71
71
|
api_key="YOUR_API_KEY",
|
|
72
|
-
base_url="https://yourhost.com/path/to/api",
|
|
73
72
|
)
|
|
74
73
|
|
|
75
74
|
|
|
@@ -77,6 +76,7 @@ async def main() -> None:
|
|
|
77
76
|
await client.checkout.create_subscription_checkout_session(
|
|
78
77
|
subject_id="subject_id",
|
|
79
78
|
rate_card_id="rate_card_id",
|
|
79
|
+
callback_url="callback_url",
|
|
80
80
|
)
|
|
81
81
|
|
|
82
82
|
|
|
@@ -24,11 +24,11 @@ from lark import Lark
|
|
|
24
24
|
|
|
25
25
|
client = Lark(
|
|
26
26
|
api_key="YOUR_API_KEY",
|
|
27
|
-
base_url="https://yourhost.com/path/to/api",
|
|
28
27
|
)
|
|
29
28
|
client.checkout.create_subscription_checkout_session(
|
|
30
29
|
subject_id="subject_id",
|
|
31
30
|
rate_card_id="rate_card_id",
|
|
31
|
+
callback_url="callback_url",
|
|
32
32
|
)
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -43,7 +43,6 @@ from lark import AsyncLark
|
|
|
43
43
|
|
|
44
44
|
client = AsyncLark(
|
|
45
45
|
api_key="YOUR_API_KEY",
|
|
46
|
-
base_url="https://yourhost.com/path/to/api",
|
|
47
46
|
)
|
|
48
47
|
|
|
49
48
|
|
|
@@ -51,6 +50,7 @@ async def main() -> None:
|
|
|
51
50
|
await client.checkout.create_subscription_checkout_session(
|
|
52
51
|
subject_id="subject_id",
|
|
53
52
|
rate_card_id="rate_card_id",
|
|
53
|
+
callback_url="callback_url",
|
|
54
54
|
)
|
|
55
55
|
|
|
56
56
|
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
Aggregation,
|
|
11
|
+
Aggregation_Count,
|
|
12
|
+
Aggregation_Custom,
|
|
13
|
+
Aggregation_Last,
|
|
14
|
+
Aggregation_Max,
|
|
15
|
+
Aggregation_Sum,
|
|
16
|
+
Amount,
|
|
17
|
+
BillingStateResponse,
|
|
18
|
+
CountAggregationPricingMetricInterface,
|
|
19
|
+
CountAggregationPricingMetricResource,
|
|
20
|
+
CreateCustomerPortalSessionResponse,
|
|
21
|
+
CreateFixedRateInterface,
|
|
22
|
+
CreatePricingMetricResponse,
|
|
23
|
+
CreateSimpleUsageBasedRateInterface,
|
|
24
|
+
CreateSubjectResponse,
|
|
25
|
+
CreateSubscriptionCheckoutSessionResponse,
|
|
26
|
+
CreateUsageEventSummaryResponse,
|
|
27
|
+
CustomPricingMetricResource,
|
|
28
|
+
FixedRateInterface,
|
|
29
|
+
FlatPrice,
|
|
30
|
+
GetPricingMetricResponse,
|
|
31
|
+
HttpValidationError,
|
|
32
|
+
LastAggregationPricingMetricResource,
|
|
33
|
+
ListRateCardsResponse,
|
|
34
|
+
ListSubjectsResponse,
|
|
35
|
+
ListSubscriptionsResponse,
|
|
36
|
+
MaxAggregationPricingMetricResource,
|
|
37
|
+
PackagePrice,
|
|
38
|
+
PackagePriceInputRoundingBehavior,
|
|
39
|
+
PackagePriceOutputRoundingBehavior,
|
|
40
|
+
Period,
|
|
41
|
+
Price,
|
|
42
|
+
Price_Flat,
|
|
43
|
+
Price_Package,
|
|
44
|
+
RateCardResource,
|
|
45
|
+
RateCardResourceBillingInterval,
|
|
46
|
+
RateCardResourceUsageBasedRatesItem,
|
|
47
|
+
RateCardResourceUsageBasedRatesItem_Simple,
|
|
48
|
+
SimpleUsageBasedRateInterface,
|
|
49
|
+
Status,
|
|
50
|
+
SubjectResource,
|
|
51
|
+
SubscriptionResource,
|
|
52
|
+
SumAggregationPricingMetricInterface,
|
|
53
|
+
SumAggregationPricingMetricResource,
|
|
54
|
+
ValidationError,
|
|
55
|
+
ValidationErrorLocItem,
|
|
56
|
+
Value,
|
|
57
|
+
)
|
|
58
|
+
from .errors import UnprocessableEntityError
|
|
59
|
+
from . import (
|
|
60
|
+
checkout,
|
|
61
|
+
customer_access,
|
|
62
|
+
customer_portal,
|
|
63
|
+
pricing_metrics,
|
|
64
|
+
rate_cards,
|
|
65
|
+
subjects,
|
|
66
|
+
subscriptions,
|
|
67
|
+
usage_events,
|
|
68
|
+
)
|
|
69
|
+
from .client import AsyncLark, Lark
|
|
70
|
+
from .environment import LarkEnvironment
|
|
71
|
+
from .pricing_metrics import PricingMetricAggregation, PricingMetricAggregation_Count, PricingMetricAggregation_Sum
|
|
72
|
+
from .rate_cards import CreateRateCardRequestBillingInterval
|
|
73
|
+
from .usage_events import CreateUsageEventSummaryRequestAggregationType
|
|
74
|
+
from .version import __version__
|
|
75
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
76
|
+
"Aggregation": ".types",
|
|
77
|
+
"Aggregation_Count": ".types",
|
|
78
|
+
"Aggregation_Custom": ".types",
|
|
79
|
+
"Aggregation_Last": ".types",
|
|
80
|
+
"Aggregation_Max": ".types",
|
|
81
|
+
"Aggregation_Sum": ".types",
|
|
82
|
+
"Amount": ".types",
|
|
83
|
+
"AsyncLark": ".client",
|
|
84
|
+
"BillingStateResponse": ".types",
|
|
85
|
+
"CountAggregationPricingMetricInterface": ".types",
|
|
86
|
+
"CountAggregationPricingMetricResource": ".types",
|
|
87
|
+
"CreateCustomerPortalSessionResponse": ".types",
|
|
88
|
+
"CreateFixedRateInterface": ".types",
|
|
89
|
+
"CreatePricingMetricResponse": ".types",
|
|
90
|
+
"CreateRateCardRequestBillingInterval": ".rate_cards",
|
|
91
|
+
"CreateSimpleUsageBasedRateInterface": ".types",
|
|
92
|
+
"CreateSubjectResponse": ".types",
|
|
93
|
+
"CreateSubscriptionCheckoutSessionResponse": ".types",
|
|
94
|
+
"CreateUsageEventSummaryRequestAggregationType": ".usage_events",
|
|
95
|
+
"CreateUsageEventSummaryResponse": ".types",
|
|
96
|
+
"CustomPricingMetricResource": ".types",
|
|
97
|
+
"FixedRateInterface": ".types",
|
|
98
|
+
"FlatPrice": ".types",
|
|
99
|
+
"GetPricingMetricResponse": ".types",
|
|
100
|
+
"HttpValidationError": ".types",
|
|
101
|
+
"Lark": ".client",
|
|
102
|
+
"LarkEnvironment": ".environment",
|
|
103
|
+
"LastAggregationPricingMetricResource": ".types",
|
|
104
|
+
"ListRateCardsResponse": ".types",
|
|
105
|
+
"ListSubjectsResponse": ".types",
|
|
106
|
+
"ListSubscriptionsResponse": ".types",
|
|
107
|
+
"MaxAggregationPricingMetricResource": ".types",
|
|
108
|
+
"PackagePrice": ".types",
|
|
109
|
+
"PackagePriceInputRoundingBehavior": ".types",
|
|
110
|
+
"PackagePriceOutputRoundingBehavior": ".types",
|
|
111
|
+
"Period": ".types",
|
|
112
|
+
"Price": ".types",
|
|
113
|
+
"Price_Flat": ".types",
|
|
114
|
+
"Price_Package": ".types",
|
|
115
|
+
"PricingMetricAggregation": ".pricing_metrics",
|
|
116
|
+
"PricingMetricAggregation_Count": ".pricing_metrics",
|
|
117
|
+
"PricingMetricAggregation_Sum": ".pricing_metrics",
|
|
118
|
+
"RateCardResource": ".types",
|
|
119
|
+
"RateCardResourceBillingInterval": ".types",
|
|
120
|
+
"RateCardResourceUsageBasedRatesItem": ".types",
|
|
121
|
+
"RateCardResourceUsageBasedRatesItem_Simple": ".types",
|
|
122
|
+
"SimpleUsageBasedRateInterface": ".types",
|
|
123
|
+
"Status": ".types",
|
|
124
|
+
"SubjectResource": ".types",
|
|
125
|
+
"SubscriptionResource": ".types",
|
|
126
|
+
"SumAggregationPricingMetricInterface": ".types",
|
|
127
|
+
"SumAggregationPricingMetricResource": ".types",
|
|
128
|
+
"UnprocessableEntityError": ".errors",
|
|
129
|
+
"ValidationError": ".types",
|
|
130
|
+
"ValidationErrorLocItem": ".types",
|
|
131
|
+
"Value": ".types",
|
|
132
|
+
"__version__": ".version",
|
|
133
|
+
"checkout": ".checkout",
|
|
134
|
+
"customer_access": ".customer_access",
|
|
135
|
+
"customer_portal": ".customer_portal",
|
|
136
|
+
"pricing_metrics": ".pricing_metrics",
|
|
137
|
+
"rate_cards": ".rate_cards",
|
|
138
|
+
"subjects": ".subjects",
|
|
139
|
+
"subscriptions": ".subscriptions",
|
|
140
|
+
"usage_events": ".usage_events",
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
145
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
146
|
+
if module_name is None:
|
|
147
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
148
|
+
try:
|
|
149
|
+
module = import_module(module_name, __package__)
|
|
150
|
+
if module_name == f".{attr_name}":
|
|
151
|
+
return module
|
|
152
|
+
else:
|
|
153
|
+
return getattr(module, attr_name)
|
|
154
|
+
except ImportError as e:
|
|
155
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
156
|
+
except AttributeError as e:
|
|
157
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def __dir__():
|
|
161
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
162
|
+
return sorted(lazy_attrs)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
__all__ = [
|
|
166
|
+
"Aggregation",
|
|
167
|
+
"Aggregation_Count",
|
|
168
|
+
"Aggregation_Custom",
|
|
169
|
+
"Aggregation_Last",
|
|
170
|
+
"Aggregation_Max",
|
|
171
|
+
"Aggregation_Sum",
|
|
172
|
+
"Amount",
|
|
173
|
+
"AsyncLark",
|
|
174
|
+
"BillingStateResponse",
|
|
175
|
+
"CountAggregationPricingMetricInterface",
|
|
176
|
+
"CountAggregationPricingMetricResource",
|
|
177
|
+
"CreateCustomerPortalSessionResponse",
|
|
178
|
+
"CreateFixedRateInterface",
|
|
179
|
+
"CreatePricingMetricResponse",
|
|
180
|
+
"CreateRateCardRequestBillingInterval",
|
|
181
|
+
"CreateSimpleUsageBasedRateInterface",
|
|
182
|
+
"CreateSubjectResponse",
|
|
183
|
+
"CreateSubscriptionCheckoutSessionResponse",
|
|
184
|
+
"CreateUsageEventSummaryRequestAggregationType",
|
|
185
|
+
"CreateUsageEventSummaryResponse",
|
|
186
|
+
"CustomPricingMetricResource",
|
|
187
|
+
"FixedRateInterface",
|
|
188
|
+
"FlatPrice",
|
|
189
|
+
"GetPricingMetricResponse",
|
|
190
|
+
"HttpValidationError",
|
|
191
|
+
"Lark",
|
|
192
|
+
"LarkEnvironment",
|
|
193
|
+
"LastAggregationPricingMetricResource",
|
|
194
|
+
"ListRateCardsResponse",
|
|
195
|
+
"ListSubjectsResponse",
|
|
196
|
+
"ListSubscriptionsResponse",
|
|
197
|
+
"MaxAggregationPricingMetricResource",
|
|
198
|
+
"PackagePrice",
|
|
199
|
+
"PackagePriceInputRoundingBehavior",
|
|
200
|
+
"PackagePriceOutputRoundingBehavior",
|
|
201
|
+
"Period",
|
|
202
|
+
"Price",
|
|
203
|
+
"Price_Flat",
|
|
204
|
+
"Price_Package",
|
|
205
|
+
"PricingMetricAggregation",
|
|
206
|
+
"PricingMetricAggregation_Count",
|
|
207
|
+
"PricingMetricAggregation_Sum",
|
|
208
|
+
"RateCardResource",
|
|
209
|
+
"RateCardResourceBillingInterval",
|
|
210
|
+
"RateCardResourceUsageBasedRatesItem",
|
|
211
|
+
"RateCardResourceUsageBasedRatesItem_Simple",
|
|
212
|
+
"SimpleUsageBasedRateInterface",
|
|
213
|
+
"Status",
|
|
214
|
+
"SubjectResource",
|
|
215
|
+
"SubscriptionResource",
|
|
216
|
+
"SumAggregationPricingMetricInterface",
|
|
217
|
+
"SumAggregationPricingMetricResource",
|
|
218
|
+
"UnprocessableEntityError",
|
|
219
|
+
"ValidationError",
|
|
220
|
+
"ValidationErrorLocItem",
|
|
221
|
+
"Value",
|
|
222
|
+
"__version__",
|
|
223
|
+
"checkout",
|
|
224
|
+
"customer_access",
|
|
225
|
+
"customer_portal",
|
|
226
|
+
"pricing_metrics",
|
|
227
|
+
"rate_cards",
|
|
228
|
+
"subjects",
|
|
229
|
+
"subscriptions",
|
|
230
|
+
"usage_events",
|
|
231
|
+
]
|
|
@@ -4,7 +4,6 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
6
|
from ..core.request_options import RequestOptions
|
|
7
|
-
from ..types.complete_subscription_checkout_response import CompleteSubscriptionCheckoutResponse
|
|
8
7
|
from ..types.create_subscription_checkout_session_response import CreateSubscriptionCheckoutSessionResponse
|
|
9
8
|
from .raw_client import AsyncRawCheckoutClient, RawCheckoutClient
|
|
10
9
|
|
|
@@ -32,7 +31,7 @@ class CheckoutClient:
|
|
|
32
31
|
*,
|
|
33
32
|
subject_id: str,
|
|
34
33
|
rate_card_id: str,
|
|
35
|
-
|
|
34
|
+
callback_url: str,
|
|
36
35
|
request_options: typing.Optional[RequestOptions] = None,
|
|
37
36
|
) -> CreateSubscriptionCheckoutSessionResponse:
|
|
38
37
|
"""
|
|
@@ -42,7 +41,7 @@ class CheckoutClient:
|
|
|
42
41
|
|
|
43
42
|
rate_card_id : str
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
callback_url : str
|
|
46
45
|
|
|
47
46
|
request_options : typing.Optional[RequestOptions]
|
|
48
47
|
Request-specific configuration.
|
|
@@ -58,52 +57,18 @@ class CheckoutClient:
|
|
|
58
57
|
|
|
59
58
|
client = Lark(
|
|
60
59
|
api_key="YOUR_API_KEY",
|
|
61
|
-
base_url="https://yourhost.com/path/to/api",
|
|
62
60
|
)
|
|
63
61
|
client.checkout.create_subscription_checkout_session(
|
|
64
62
|
subject_id="subject_id",
|
|
65
63
|
rate_card_id="rate_card_id",
|
|
64
|
+
callback_url="callback_url",
|
|
66
65
|
)
|
|
67
66
|
"""
|
|
68
67
|
_response = self._raw_client.create_subscription_checkout_session(
|
|
69
|
-
subject_id=subject_id,
|
|
70
|
-
rate_card_id=rate_card_id,
|
|
71
|
-
rate_card_overrides=rate_card_overrides,
|
|
72
|
-
request_options=request_options,
|
|
68
|
+
subject_id=subject_id, rate_card_id=rate_card_id, callback_url=callback_url, request_options=request_options
|
|
73
69
|
)
|
|
74
70
|
return _response.data
|
|
75
71
|
|
|
76
|
-
def complete_subscription_checkout(
|
|
77
|
-
self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
78
|
-
) -> CompleteSubscriptionCheckoutResponse:
|
|
79
|
-
"""
|
|
80
|
-
Parameters
|
|
81
|
-
----------
|
|
82
|
-
checkout_id : str
|
|
83
|
-
|
|
84
|
-
request_options : typing.Optional[RequestOptions]
|
|
85
|
-
Request-specific configuration.
|
|
86
|
-
|
|
87
|
-
Returns
|
|
88
|
-
-------
|
|
89
|
-
CompleteSubscriptionCheckoutResponse
|
|
90
|
-
Successful Response
|
|
91
|
-
|
|
92
|
-
Examples
|
|
93
|
-
--------
|
|
94
|
-
from lark import Lark
|
|
95
|
-
|
|
96
|
-
client = Lark(
|
|
97
|
-
api_key="YOUR_API_KEY",
|
|
98
|
-
base_url="https://yourhost.com/path/to/api",
|
|
99
|
-
)
|
|
100
|
-
client.checkout.complete_subscription_checkout(
|
|
101
|
-
checkout_id="checkout_id",
|
|
102
|
-
)
|
|
103
|
-
"""
|
|
104
|
-
_response = self._raw_client.complete_subscription_checkout(checkout_id, request_options=request_options)
|
|
105
|
-
return _response.data
|
|
106
|
-
|
|
107
72
|
|
|
108
73
|
class AsyncCheckoutClient:
|
|
109
74
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -125,7 +90,7 @@ class AsyncCheckoutClient:
|
|
|
125
90
|
*,
|
|
126
91
|
subject_id: str,
|
|
127
92
|
rate_card_id: str,
|
|
128
|
-
|
|
93
|
+
callback_url: str,
|
|
129
94
|
request_options: typing.Optional[RequestOptions] = None,
|
|
130
95
|
) -> CreateSubscriptionCheckoutSessionResponse:
|
|
131
96
|
"""
|
|
@@ -135,7 +100,7 @@ class AsyncCheckoutClient:
|
|
|
135
100
|
|
|
136
101
|
rate_card_id : str
|
|
137
102
|
|
|
138
|
-
|
|
103
|
+
callback_url : str
|
|
139
104
|
|
|
140
105
|
request_options : typing.Optional[RequestOptions]
|
|
141
106
|
Request-specific configuration.
|
|
@@ -153,7 +118,6 @@ class AsyncCheckoutClient:
|
|
|
153
118
|
|
|
154
119
|
client = AsyncLark(
|
|
155
120
|
api_key="YOUR_API_KEY",
|
|
156
|
-
base_url="https://yourhost.com/path/to/api",
|
|
157
121
|
)
|
|
158
122
|
|
|
159
123
|
|
|
@@ -161,54 +125,13 @@ class AsyncCheckoutClient:
|
|
|
161
125
|
await client.checkout.create_subscription_checkout_session(
|
|
162
126
|
subject_id="subject_id",
|
|
163
127
|
rate_card_id="rate_card_id",
|
|
128
|
+
callback_url="callback_url",
|
|
164
129
|
)
|
|
165
130
|
|
|
166
131
|
|
|
167
132
|
asyncio.run(main())
|
|
168
133
|
"""
|
|
169
134
|
_response = await self._raw_client.create_subscription_checkout_session(
|
|
170
|
-
subject_id=subject_id,
|
|
171
|
-
rate_card_id=rate_card_id,
|
|
172
|
-
rate_card_overrides=rate_card_overrides,
|
|
173
|
-
request_options=request_options,
|
|
174
|
-
)
|
|
175
|
-
return _response.data
|
|
176
|
-
|
|
177
|
-
async def complete_subscription_checkout(
|
|
178
|
-
self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
179
|
-
) -> CompleteSubscriptionCheckoutResponse:
|
|
180
|
-
"""
|
|
181
|
-
Parameters
|
|
182
|
-
----------
|
|
183
|
-
checkout_id : str
|
|
184
|
-
|
|
185
|
-
request_options : typing.Optional[RequestOptions]
|
|
186
|
-
Request-specific configuration.
|
|
187
|
-
|
|
188
|
-
Returns
|
|
189
|
-
-------
|
|
190
|
-
CompleteSubscriptionCheckoutResponse
|
|
191
|
-
Successful Response
|
|
192
|
-
|
|
193
|
-
Examples
|
|
194
|
-
--------
|
|
195
|
-
import asyncio
|
|
196
|
-
|
|
197
|
-
from lark import AsyncLark
|
|
198
|
-
|
|
199
|
-
client = AsyncLark(
|
|
200
|
-
api_key="YOUR_API_KEY",
|
|
201
|
-
base_url="https://yourhost.com/path/to/api",
|
|
135
|
+
subject_id=subject_id, rate_card_id=rate_card_id, callback_url=callback_url, request_options=request_options
|
|
202
136
|
)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
async def main() -> None:
|
|
206
|
-
await client.checkout.complete_subscription_checkout(
|
|
207
|
-
checkout_id="checkout_id",
|
|
208
|
-
)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
asyncio.run(main())
|
|
212
|
-
"""
|
|
213
|
-
_response = await self._raw_client.complete_subscription_checkout(checkout_id, request_options=request_options)
|
|
214
137
|
return _response.data
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
10
|
+
from ..core.request_options import RequestOptions
|
|
11
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
12
|
+
from ..types.create_subscription_checkout_session_response import CreateSubscriptionCheckoutSessionResponse
|
|
13
|
+
from ..types.http_validation_error import HttpValidationError
|
|
14
|
+
|
|
15
|
+
# this is used as the default value for optional parameters
|
|
16
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class RawCheckoutClient:
|
|
20
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
21
|
+
self._client_wrapper = client_wrapper
|
|
22
|
+
|
|
23
|
+
def create_subscription_checkout_session(
|
|
24
|
+
self,
|
|
25
|
+
*,
|
|
26
|
+
subject_id: str,
|
|
27
|
+
rate_card_id: str,
|
|
28
|
+
callback_url: str,
|
|
29
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
30
|
+
) -> HttpResponse[CreateSubscriptionCheckoutSessionResponse]:
|
|
31
|
+
"""
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
subject_id : str
|
|
35
|
+
|
|
36
|
+
rate_card_id : str
|
|
37
|
+
|
|
38
|
+
callback_url : str
|
|
39
|
+
|
|
40
|
+
request_options : typing.Optional[RequestOptions]
|
|
41
|
+
Request-specific configuration.
|
|
42
|
+
|
|
43
|
+
Returns
|
|
44
|
+
-------
|
|
45
|
+
HttpResponse[CreateSubscriptionCheckoutSessionResponse]
|
|
46
|
+
Successful Response
|
|
47
|
+
"""
|
|
48
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
49
|
+
"checkout",
|
|
50
|
+
method="POST",
|
|
51
|
+
json={
|
|
52
|
+
"subject_id": subject_id,
|
|
53
|
+
"rate_card_id": rate_card_id,
|
|
54
|
+
"callback_url": callback_url,
|
|
55
|
+
},
|
|
56
|
+
headers={
|
|
57
|
+
"content-type": "application/json",
|
|
58
|
+
},
|
|
59
|
+
request_options=request_options,
|
|
60
|
+
omit=OMIT,
|
|
61
|
+
)
|
|
62
|
+
try:
|
|
63
|
+
if 200 <= _response.status_code < 300:
|
|
64
|
+
_data = typing.cast(
|
|
65
|
+
CreateSubscriptionCheckoutSessionResponse,
|
|
66
|
+
parse_obj_as(
|
|
67
|
+
type_=CreateSubscriptionCheckoutSessionResponse, # type: ignore
|
|
68
|
+
object_=_response.json(),
|
|
69
|
+
),
|
|
70
|
+
)
|
|
71
|
+
return HttpResponse(response=_response, data=_data)
|
|
72
|
+
if _response.status_code == 422:
|
|
73
|
+
raise UnprocessableEntityError(
|
|
74
|
+
headers=dict(_response.headers),
|
|
75
|
+
body=typing.cast(
|
|
76
|
+
HttpValidationError,
|
|
77
|
+
parse_obj_as(
|
|
78
|
+
type_=HttpValidationError, # type: ignore
|
|
79
|
+
object_=_response.json(),
|
|
80
|
+
),
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
_response_json = _response.json()
|
|
84
|
+
except JSONDecodeError:
|
|
85
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
86
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class AsyncRawCheckoutClient:
|
|
90
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
91
|
+
self._client_wrapper = client_wrapper
|
|
92
|
+
|
|
93
|
+
async def create_subscription_checkout_session(
|
|
94
|
+
self,
|
|
95
|
+
*,
|
|
96
|
+
subject_id: str,
|
|
97
|
+
rate_card_id: str,
|
|
98
|
+
callback_url: str,
|
|
99
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
100
|
+
) -> AsyncHttpResponse[CreateSubscriptionCheckoutSessionResponse]:
|
|
101
|
+
"""
|
|
102
|
+
Parameters
|
|
103
|
+
----------
|
|
104
|
+
subject_id : str
|
|
105
|
+
|
|
106
|
+
rate_card_id : str
|
|
107
|
+
|
|
108
|
+
callback_url : str
|
|
109
|
+
|
|
110
|
+
request_options : typing.Optional[RequestOptions]
|
|
111
|
+
Request-specific configuration.
|
|
112
|
+
|
|
113
|
+
Returns
|
|
114
|
+
-------
|
|
115
|
+
AsyncHttpResponse[CreateSubscriptionCheckoutSessionResponse]
|
|
116
|
+
Successful Response
|
|
117
|
+
"""
|
|
118
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
119
|
+
"checkout",
|
|
120
|
+
method="POST",
|
|
121
|
+
json={
|
|
122
|
+
"subject_id": subject_id,
|
|
123
|
+
"rate_card_id": rate_card_id,
|
|
124
|
+
"callback_url": callback_url,
|
|
125
|
+
},
|
|
126
|
+
headers={
|
|
127
|
+
"content-type": "application/json",
|
|
128
|
+
},
|
|
129
|
+
request_options=request_options,
|
|
130
|
+
omit=OMIT,
|
|
131
|
+
)
|
|
132
|
+
try:
|
|
133
|
+
if 200 <= _response.status_code < 300:
|
|
134
|
+
_data = typing.cast(
|
|
135
|
+
CreateSubscriptionCheckoutSessionResponse,
|
|
136
|
+
parse_obj_as(
|
|
137
|
+
type_=CreateSubscriptionCheckoutSessionResponse, # type: ignore
|
|
138
|
+
object_=_response.json(),
|
|
139
|
+
),
|
|
140
|
+
)
|
|
141
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
142
|
+
if _response.status_code == 422:
|
|
143
|
+
raise UnprocessableEntityError(
|
|
144
|
+
headers=dict(_response.headers),
|
|
145
|
+
body=typing.cast(
|
|
146
|
+
HttpValidationError,
|
|
147
|
+
parse_obj_as(
|
|
148
|
+
type_=HttpValidationError, # type: ignore
|
|
149
|
+
object_=_response.json(),
|
|
150
|
+
),
|
|
151
|
+
),
|
|
152
|
+
)
|
|
153
|
+
_response_json = _response.json()
|
|
154
|
+
except JSONDecodeError:
|
|
155
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
156
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|