lark-billing 0.0.6__tar.gz → 0.0.8__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.8}/PKG-INFO +4 -3
- {lark_billing-0.0.6 → lark_billing-0.0.8}/README.md +2 -2
- {lark_billing-0.0.6 → lark_billing-0.0.8}/pyproject.toml +2 -2
- lark_billing-0.0.8/src/lark/__init__.py +245 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/checkout/client.py +20 -79
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/checkout/raw_client.py +18 -102
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/client.py +112 -27
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/client_wrapper.py +2 -2
- lark_billing-0.0.8/src/lark/core/http_sse/__init__.py +42 -0
- lark_billing-0.0.8/src/lark/core/http_sse/_api.py +112 -0
- lark_billing-0.0.8/src/lark/core/http_sse/_decoders.py +61 -0
- lark_billing-0.0.8/src/lark/core/http_sse/_exceptions.py +7 -0
- lark_billing-0.0.8/src/lark/core/http_sse/_models.py +17 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/pydantic_utilities.py +3 -1
- {lark_billing-0.0.6/src/lark/feature_access → lark_billing-0.0.8/src/lark/customer_access}/client.py +30 -24
- {lark_billing-0.0.6/src/lark/feature_access → lark_billing-0.0.8/src/lark/customer_access}/raw_client.py +22 -17
- lark_billing-0.0.8/src/lark/customer_portal/client.py +115 -0
- lark_billing-0.0.8/src/lark/customer_portal/raw_client.py +134 -0
- lark_billing-0.0.8/src/lark/environment.py +7 -0
- lark_billing-0.0.8/src/lark/invoices/client.py +136 -0
- lark_billing-0.0.8/src/lark/invoices/raw_client.py +147 -0
- lark_billing-0.0.8/src/lark/pricing_metrics/__init__.py +38 -0
- lark_billing-0.0.8/src/lark/pricing_metrics/client.py +288 -0
- lark_billing-0.0.8/src/lark/pricing_metrics/raw_client.py +369 -0
- lark_billing-0.0.8/src/lark/pricing_metrics/types/__init__.py +42 -0
- lark_billing-0.0.6/src/lark/types/credit_grant_resource_output_expiration.py → lark_billing-0.0.8/src/lark/pricing_metrics/types/pricing_metric_aggregation.py +7 -12
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/rate_cards/__init__.py +0 -15
- lark_billing-0.0.8/src/lark/rate_cards/client.py +305 -0
- lark_billing-0.0.8/src/lark/rate_cards/raw_client.py +392 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/rate_cards/types/__init__.py +0 -17
- lark_billing-0.0.8/src/lark/rate_cards/types/create_rate_card_request_usage_based_rates_item.py +30 -0
- lark_billing-0.0.8/src/lark/subjects/__init__.py +4 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/subjects/client.py +18 -54
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/subjects/raw_client.py +14 -24
- lark_billing-0.0.8/src/lark/subscriptions/__init__.py +4 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/subscriptions/client.py +104 -80
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/subscriptions/raw_client.py +186 -53
- lark_billing-0.0.8/src/lark/types/__init__.py +177 -0
- lark_billing-0.0.6/src/lark/types/credit_grant_resource_input_schedule.py → lark_billing-0.0.8/src/lark/types/aggregation.py +6 -7
- lark_billing-0.0.6/src/lark/types/last_aggregation_pricing_metric_interface.py → lark_billing-0.0.8/src/lark/types/amount.py +5 -3
- lark_billing-0.0.6/src/lark/types/create_dimension_coordinate_interface.py → lark_billing-0.0.8/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.8/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.8/src/lark/types/create_customer_portal_session_response.py +3 -3
- lark_billing-0.0.8/src/lark/types/create_fixed_rate_request.py +22 -0
- lark_billing-0.0.6/src/lark/types/pricing_metric_interface.py → lark_billing-0.0.8/src/lark/types/create_pricing_metric_response.py +2 -5
- lark_billing-0.0.6/src/lark/types/create_simple_usage_based_rate_interface.py → lark_billing-0.0.8/src/lark/types/create_simple_usage_based_rate_request.py +6 -9
- lark_billing-0.0.8/src/lark/types/create_subject_response.py +48 -0
- lark_billing-0.0.6/src/lark/types/complete_subscription_checkout_response.py → lark_billing-0.0.8/src/lark/types/create_subscription_checkout_session_response.py +2 -1
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/create_usage_event_summary_response.py +1 -1
- lark_billing-0.0.6/src/lark/types/check_feature_access_response.py → lark_billing-0.0.8/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.8/src/lark/types/get_pricing_metric_response.py +3 -5
- lark_billing-0.0.8/src/lark/types/invoice_line_item_resource.py +23 -0
- lark_billing-0.0.6/src/lark/types/create_subscription_checkout_session_response.py → lark_billing-0.0.8/src/lark/types/invoice_resource.py +12 -4
- lark_billing-0.0.8/src/lark/types/invoice_status.py +5 -0
- lark_billing-0.0.8/src/lark/types/list_invoices_response.py +21 -0
- lark_billing-0.0.8/src/lark/types/list_pricing_metrics_response.py +21 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/package_price.py +2 -2
- lark_billing-0.0.8/src/lark/types/package_price_input_rounding_behavior.py +5 -0
- lark_billing-0.0.8/src/lark/types/package_price_output_rounding_behavior.py +5 -0
- lark_billing-0.0.8/src/lark/types/period_resource.py +23 -0
- lark_billing-0.0.6/src/lark/types/credit_grant_resource_output_schedule.py → lark_billing-0.0.8/src/lark/types/price.py +11 -7
- lark_billing-0.0.8/src/lark/types/pricing_metric_resource.py +24 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/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.8/src/lark/types/rate_card_resource_usage_based_rates_item.py +9 -7
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/simple_usage_based_rate_interface.py +1 -7
- lark_billing-0.0.8/src/lark/types/subject_resource.py +48 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/subscription_resource.py +6 -4
- lark_billing-0.0.8/src/lark/types/subscription_status.py +5 -0
- lark_billing-0.0.6/src/lark/types/amount.py → lark_billing-0.0.8/src/lark/types/sum_aggregation_pricing_metric_resource.py +2 -3
- lark_billing-0.0.6/src/lark/types/price.py → lark_billing-0.0.8/src/lark/types/value.py +1 -1
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/usage_events/client.py +8 -21
- {lark_billing-0.0.6 → lark_billing-0.0.8}/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/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/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/aggregation.py +0 -80
- 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_credit_pool_request.py +0 -5
- 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_subject_response.py +0 -24
- lark_billing-0.0.6/src/lark/types/credit_grant.py +0 -5
- lark_billing-0.0.6/src/lark/types/credit_grant_date_time_expiration_interface.py +0 -19
- lark_billing-0.0.6/src/lark/types/credit_grant_date_time_expiration_resource.py +0 -19
- 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_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_schedule_rate_cycle_start_resource.py +0 -17
- 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/subject_resource.py +0 -24
- 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.8}/src/lark/checkout/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/api_error.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/datetime_utils.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/file.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/force_multipart.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/http_client.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/http_response.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/jsonable_encoder.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/query_encoder.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/remove_none_from_dict.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/request_options.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/core/serialization.py +0 -0
- {lark_billing-0.0.6/src/lark/feature_access → lark_billing-0.0.8/src/lark/customer_access}/__init__.py +0 -0
- {lark_billing-0.0.6/src/lark/subjects → lark_billing-0.0.8/src/lark/customer_portal}/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/errors/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/errors/unprocessable_entity_error.py +0 -0
- {lark_billing-0.0.6/src/lark/subscriptions → lark_billing-0.0.8/src/lark/invoices}/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/py.typed +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/rate_cards/types/create_rate_card_request_billing_interval.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/count_aggregation_pricing_metric_interface.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/flat_price.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/http_validation_error.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/list_rate_cards_response.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/list_subjects_response.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/list_subscriptions_response.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/period.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/rate_card_resource_billing_interval.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/sum_aggregation_pricing_metric_interface.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/validation_error.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/types/validation_error_loc_item.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/usage_events/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/usage_events/types/__init__.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/src/lark/usage_events/types/create_usage_event_summary_request_aggregation_type.py +0 -0
- {lark_billing-0.0.6 → lark_billing-0.0.8}/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.8
|
|
4
4
|
Summary:
|
|
5
5
|
Requires-Python: >=3.8,<4.0
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -22,6 +22,7 @@ Requires-Dist: httpx (>=0.21.2)
|
|
|
22
22
|
Requires-Dist: pydantic (>=1.9.2)
|
|
23
23
|
Requires-Dist: pydantic-core (>=2.18.2)
|
|
24
24
|
Requires-Dist: typing_extensions (>=4.0.0)
|
|
25
|
+
Project-URL: Repository, https://github.com/fern-demo/lark-python-sdk
|
|
25
26
|
Description-Content-Type: text/markdown
|
|
26
27
|
|
|
27
28
|
# Lark Python Library
|
|
@@ -50,11 +51,11 @@ from lark import Lark
|
|
|
50
51
|
|
|
51
52
|
client = Lark(
|
|
52
53
|
api_key="YOUR_API_KEY",
|
|
53
|
-
base_url="https://yourhost.com/path/to/api",
|
|
54
54
|
)
|
|
55
55
|
client.checkout.create_subscription_checkout_session(
|
|
56
56
|
subject_id="subject_id",
|
|
57
57
|
rate_card_id="rate_card_id",
|
|
58
|
+
success_callback_url="https://example.com/callback",
|
|
58
59
|
)
|
|
59
60
|
```
|
|
60
61
|
|
|
@@ -69,7 +70,6 @@ from lark import AsyncLark
|
|
|
69
70
|
|
|
70
71
|
client = AsyncLark(
|
|
71
72
|
api_key="YOUR_API_KEY",
|
|
72
|
-
base_url="https://yourhost.com/path/to/api",
|
|
73
73
|
)
|
|
74
74
|
|
|
75
75
|
|
|
@@ -77,6 +77,7 @@ async def main() -> None:
|
|
|
77
77
|
await client.checkout.create_subscription_checkout_session(
|
|
78
78
|
subject_id="subject_id",
|
|
79
79
|
rate_card_id="rate_card_id",
|
|
80
|
+
success_callback_url="https://example.com/callback",
|
|
80
81
|
)
|
|
81
82
|
|
|
82
83
|
|
|
@@ -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
|
+
success_callback_url="https://example.com/callback",
|
|
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
|
+
success_callback_url="https://example.com/callback",
|
|
54
54
|
)
|
|
55
55
|
|
|
56
56
|
|
|
@@ -3,7 +3,7 @@ name = "lark-billing"
|
|
|
3
3
|
|
|
4
4
|
[tool.poetry]
|
|
5
5
|
name = "lark-billing"
|
|
6
|
-
version = "0.0.
|
|
6
|
+
version = "0.0.8"
|
|
7
7
|
description = ""
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
authors = []
|
|
@@ -30,7 +30,7 @@ packages = [
|
|
|
30
30
|
{ include = "lark", from = "src"}
|
|
31
31
|
]
|
|
32
32
|
|
|
33
|
-
[
|
|
33
|
+
[tool.poetry.urls]
|
|
34
34
|
Repository = 'https://github.com/fern-demo/lark-python-sdk'
|
|
35
35
|
|
|
36
36
|
[tool.poetry.dependencies]
|
|
@@ -0,0 +1,245 @@
|
|
|
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_Sum,
|
|
13
|
+
Amount,
|
|
14
|
+
BillingStateResponse,
|
|
15
|
+
CountAggregationPricingMetricInterface,
|
|
16
|
+
CountAggregationPricingMetricResource,
|
|
17
|
+
CreateCustomerPortalSessionResponse,
|
|
18
|
+
CreateFixedRateRequest,
|
|
19
|
+
CreatePricingMetricResponse,
|
|
20
|
+
CreateSimpleUsageBasedRateRequest,
|
|
21
|
+
CreateSubjectResponse,
|
|
22
|
+
CreateSubscriptionCheckoutSessionResponse,
|
|
23
|
+
CreateUsageEventSummaryResponse,
|
|
24
|
+
FixedRateInterface,
|
|
25
|
+
FlatPrice,
|
|
26
|
+
GetPricingMetricResponse,
|
|
27
|
+
HttpValidationError,
|
|
28
|
+
InvoiceLineItemResource,
|
|
29
|
+
InvoiceResource,
|
|
30
|
+
InvoiceStatus,
|
|
31
|
+
ListInvoicesResponse,
|
|
32
|
+
ListPricingMetricsResponse,
|
|
33
|
+
ListRateCardsResponse,
|
|
34
|
+
ListSubjectsResponse,
|
|
35
|
+
ListSubscriptionsResponse,
|
|
36
|
+
PackagePrice,
|
|
37
|
+
PackagePriceInputRoundingBehavior,
|
|
38
|
+
PackagePriceOutputRoundingBehavior,
|
|
39
|
+
Period,
|
|
40
|
+
PeriodResource,
|
|
41
|
+
Price,
|
|
42
|
+
Price_Flat,
|
|
43
|
+
Price_Package,
|
|
44
|
+
PricingMetricResource,
|
|
45
|
+
RateCardResource,
|
|
46
|
+
RateCardResourceBillingInterval,
|
|
47
|
+
RateCardResourceUsageBasedRatesItem,
|
|
48
|
+
RateCardResourceUsageBasedRatesItem_Simple,
|
|
49
|
+
SimpleUsageBasedRateInterface,
|
|
50
|
+
SubjectResource,
|
|
51
|
+
SubscriptionResource,
|
|
52
|
+
SubscriptionStatus,
|
|
53
|
+
SumAggregationPricingMetricInterface,
|
|
54
|
+
SumAggregationPricingMetricResource,
|
|
55
|
+
ValidationError,
|
|
56
|
+
ValidationErrorLocItem,
|
|
57
|
+
Value,
|
|
58
|
+
)
|
|
59
|
+
from .errors import UnprocessableEntityError
|
|
60
|
+
from . import (
|
|
61
|
+
checkout,
|
|
62
|
+
customer_access,
|
|
63
|
+
customer_portal,
|
|
64
|
+
invoices,
|
|
65
|
+
pricing_metrics,
|
|
66
|
+
rate_cards,
|
|
67
|
+
subjects,
|
|
68
|
+
subscriptions,
|
|
69
|
+
usage_events,
|
|
70
|
+
)
|
|
71
|
+
from .client import AsyncLark, Lark
|
|
72
|
+
from .environment import LarkEnvironment
|
|
73
|
+
from .pricing_metrics import PricingMetricAggregation, PricingMetricAggregation_Count, PricingMetricAggregation_Sum
|
|
74
|
+
from .rate_cards import (
|
|
75
|
+
CreateRateCardRequestBillingInterval,
|
|
76
|
+
CreateRateCardRequestUsageBasedRatesItem,
|
|
77
|
+
CreateRateCardRequestUsageBasedRatesItem_Simple,
|
|
78
|
+
)
|
|
79
|
+
from .usage_events import CreateUsageEventSummaryRequestAggregationType
|
|
80
|
+
from .version import __version__
|
|
81
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
82
|
+
"Aggregation": ".types",
|
|
83
|
+
"Aggregation_Count": ".types",
|
|
84
|
+
"Aggregation_Sum": ".types",
|
|
85
|
+
"Amount": ".types",
|
|
86
|
+
"AsyncLark": ".client",
|
|
87
|
+
"BillingStateResponse": ".types",
|
|
88
|
+
"CountAggregationPricingMetricInterface": ".types",
|
|
89
|
+
"CountAggregationPricingMetricResource": ".types",
|
|
90
|
+
"CreateCustomerPortalSessionResponse": ".types",
|
|
91
|
+
"CreateFixedRateRequest": ".types",
|
|
92
|
+
"CreatePricingMetricResponse": ".types",
|
|
93
|
+
"CreateRateCardRequestBillingInterval": ".rate_cards",
|
|
94
|
+
"CreateRateCardRequestUsageBasedRatesItem": ".rate_cards",
|
|
95
|
+
"CreateRateCardRequestUsageBasedRatesItem_Simple": ".rate_cards",
|
|
96
|
+
"CreateSimpleUsageBasedRateRequest": ".types",
|
|
97
|
+
"CreateSubjectResponse": ".types",
|
|
98
|
+
"CreateSubscriptionCheckoutSessionResponse": ".types",
|
|
99
|
+
"CreateUsageEventSummaryRequestAggregationType": ".usage_events",
|
|
100
|
+
"CreateUsageEventSummaryResponse": ".types",
|
|
101
|
+
"FixedRateInterface": ".types",
|
|
102
|
+
"FlatPrice": ".types",
|
|
103
|
+
"GetPricingMetricResponse": ".types",
|
|
104
|
+
"HttpValidationError": ".types",
|
|
105
|
+
"InvoiceLineItemResource": ".types",
|
|
106
|
+
"InvoiceResource": ".types",
|
|
107
|
+
"InvoiceStatus": ".types",
|
|
108
|
+
"Lark": ".client",
|
|
109
|
+
"LarkEnvironment": ".environment",
|
|
110
|
+
"ListInvoicesResponse": ".types",
|
|
111
|
+
"ListPricingMetricsResponse": ".types",
|
|
112
|
+
"ListRateCardsResponse": ".types",
|
|
113
|
+
"ListSubjectsResponse": ".types",
|
|
114
|
+
"ListSubscriptionsResponse": ".types",
|
|
115
|
+
"PackagePrice": ".types",
|
|
116
|
+
"PackagePriceInputRoundingBehavior": ".types",
|
|
117
|
+
"PackagePriceOutputRoundingBehavior": ".types",
|
|
118
|
+
"Period": ".types",
|
|
119
|
+
"PeriodResource": ".types",
|
|
120
|
+
"Price": ".types",
|
|
121
|
+
"Price_Flat": ".types",
|
|
122
|
+
"Price_Package": ".types",
|
|
123
|
+
"PricingMetricAggregation": ".pricing_metrics",
|
|
124
|
+
"PricingMetricAggregation_Count": ".pricing_metrics",
|
|
125
|
+
"PricingMetricAggregation_Sum": ".pricing_metrics",
|
|
126
|
+
"PricingMetricResource": ".types",
|
|
127
|
+
"RateCardResource": ".types",
|
|
128
|
+
"RateCardResourceBillingInterval": ".types",
|
|
129
|
+
"RateCardResourceUsageBasedRatesItem": ".types",
|
|
130
|
+
"RateCardResourceUsageBasedRatesItem_Simple": ".types",
|
|
131
|
+
"SimpleUsageBasedRateInterface": ".types",
|
|
132
|
+
"SubjectResource": ".types",
|
|
133
|
+
"SubscriptionResource": ".types",
|
|
134
|
+
"SubscriptionStatus": ".types",
|
|
135
|
+
"SumAggregationPricingMetricInterface": ".types",
|
|
136
|
+
"SumAggregationPricingMetricResource": ".types",
|
|
137
|
+
"UnprocessableEntityError": ".errors",
|
|
138
|
+
"ValidationError": ".types",
|
|
139
|
+
"ValidationErrorLocItem": ".types",
|
|
140
|
+
"Value": ".types",
|
|
141
|
+
"__version__": ".version",
|
|
142
|
+
"checkout": ".checkout",
|
|
143
|
+
"customer_access": ".customer_access",
|
|
144
|
+
"customer_portal": ".customer_portal",
|
|
145
|
+
"invoices": ".invoices",
|
|
146
|
+
"pricing_metrics": ".pricing_metrics",
|
|
147
|
+
"rate_cards": ".rate_cards",
|
|
148
|
+
"subjects": ".subjects",
|
|
149
|
+
"subscriptions": ".subscriptions",
|
|
150
|
+
"usage_events": ".usage_events",
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
155
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
156
|
+
if module_name is None:
|
|
157
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
158
|
+
try:
|
|
159
|
+
module = import_module(module_name, __package__)
|
|
160
|
+
if module_name == f".{attr_name}":
|
|
161
|
+
return module
|
|
162
|
+
else:
|
|
163
|
+
return getattr(module, attr_name)
|
|
164
|
+
except ImportError as e:
|
|
165
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
166
|
+
except AttributeError as e:
|
|
167
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def __dir__():
|
|
171
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
172
|
+
return sorted(lazy_attrs)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
__all__ = [
|
|
176
|
+
"Aggregation",
|
|
177
|
+
"Aggregation_Count",
|
|
178
|
+
"Aggregation_Sum",
|
|
179
|
+
"Amount",
|
|
180
|
+
"AsyncLark",
|
|
181
|
+
"BillingStateResponse",
|
|
182
|
+
"CountAggregationPricingMetricInterface",
|
|
183
|
+
"CountAggregationPricingMetricResource",
|
|
184
|
+
"CreateCustomerPortalSessionResponse",
|
|
185
|
+
"CreateFixedRateRequest",
|
|
186
|
+
"CreatePricingMetricResponse",
|
|
187
|
+
"CreateRateCardRequestBillingInterval",
|
|
188
|
+
"CreateRateCardRequestUsageBasedRatesItem",
|
|
189
|
+
"CreateRateCardRequestUsageBasedRatesItem_Simple",
|
|
190
|
+
"CreateSimpleUsageBasedRateRequest",
|
|
191
|
+
"CreateSubjectResponse",
|
|
192
|
+
"CreateSubscriptionCheckoutSessionResponse",
|
|
193
|
+
"CreateUsageEventSummaryRequestAggregationType",
|
|
194
|
+
"CreateUsageEventSummaryResponse",
|
|
195
|
+
"FixedRateInterface",
|
|
196
|
+
"FlatPrice",
|
|
197
|
+
"GetPricingMetricResponse",
|
|
198
|
+
"HttpValidationError",
|
|
199
|
+
"InvoiceLineItemResource",
|
|
200
|
+
"InvoiceResource",
|
|
201
|
+
"InvoiceStatus",
|
|
202
|
+
"Lark",
|
|
203
|
+
"LarkEnvironment",
|
|
204
|
+
"ListInvoicesResponse",
|
|
205
|
+
"ListPricingMetricsResponse",
|
|
206
|
+
"ListRateCardsResponse",
|
|
207
|
+
"ListSubjectsResponse",
|
|
208
|
+
"ListSubscriptionsResponse",
|
|
209
|
+
"PackagePrice",
|
|
210
|
+
"PackagePriceInputRoundingBehavior",
|
|
211
|
+
"PackagePriceOutputRoundingBehavior",
|
|
212
|
+
"Period",
|
|
213
|
+
"PeriodResource",
|
|
214
|
+
"Price",
|
|
215
|
+
"Price_Flat",
|
|
216
|
+
"Price_Package",
|
|
217
|
+
"PricingMetricAggregation",
|
|
218
|
+
"PricingMetricAggregation_Count",
|
|
219
|
+
"PricingMetricAggregation_Sum",
|
|
220
|
+
"PricingMetricResource",
|
|
221
|
+
"RateCardResource",
|
|
222
|
+
"RateCardResourceBillingInterval",
|
|
223
|
+
"RateCardResourceUsageBasedRatesItem",
|
|
224
|
+
"RateCardResourceUsageBasedRatesItem_Simple",
|
|
225
|
+
"SimpleUsageBasedRateInterface",
|
|
226
|
+
"SubjectResource",
|
|
227
|
+
"SubscriptionResource",
|
|
228
|
+
"SubscriptionStatus",
|
|
229
|
+
"SumAggregationPricingMetricInterface",
|
|
230
|
+
"SumAggregationPricingMetricResource",
|
|
231
|
+
"UnprocessableEntityError",
|
|
232
|
+
"ValidationError",
|
|
233
|
+
"ValidationErrorLocItem",
|
|
234
|
+
"Value",
|
|
235
|
+
"__version__",
|
|
236
|
+
"checkout",
|
|
237
|
+
"customer_access",
|
|
238
|
+
"customer_portal",
|
|
239
|
+
"invoices",
|
|
240
|
+
"pricing_metrics",
|
|
241
|
+
"rate_cards",
|
|
242
|
+
"subjects",
|
|
243
|
+
"subscriptions",
|
|
244
|
+
"usage_events",
|
|
245
|
+
]
|
|
@@ -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,8 @@ class CheckoutClient:
|
|
|
32
31
|
*,
|
|
33
32
|
subject_id: str,
|
|
34
33
|
rate_card_id: str,
|
|
35
|
-
|
|
34
|
+
success_callback_url: str,
|
|
35
|
+
cancel_url: typing.Optional[str] = OMIT,
|
|
36
36
|
request_options: typing.Optional[RequestOptions] = None,
|
|
37
37
|
) -> CreateSubscriptionCheckoutSessionResponse:
|
|
38
38
|
"""
|
|
@@ -42,7 +42,11 @@ class CheckoutClient:
|
|
|
42
42
|
|
|
43
43
|
rate_card_id : str
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
success_callback_url : str
|
|
46
|
+
The URL to redirect to after the checkout is successful.
|
|
47
|
+
|
|
48
|
+
cancel_url : typing.Optional[str]
|
|
49
|
+
The URL to redirect to after the checkout is cancelled.
|
|
46
50
|
|
|
47
51
|
request_options : typing.Optional[RequestOptions]
|
|
48
52
|
Request-specific configuration.
|
|
@@ -58,52 +62,22 @@ class CheckoutClient:
|
|
|
58
62
|
|
|
59
63
|
client = Lark(
|
|
60
64
|
api_key="YOUR_API_KEY",
|
|
61
|
-
base_url="https://yourhost.com/path/to/api",
|
|
62
65
|
)
|
|
63
66
|
client.checkout.create_subscription_checkout_session(
|
|
64
67
|
subject_id="subject_id",
|
|
65
68
|
rate_card_id="rate_card_id",
|
|
69
|
+
success_callback_url="https://example.com/callback",
|
|
66
70
|
)
|
|
67
71
|
"""
|
|
68
72
|
_response = self._raw_client.create_subscription_checkout_session(
|
|
69
73
|
subject_id=subject_id,
|
|
70
74
|
rate_card_id=rate_card_id,
|
|
71
|
-
|
|
75
|
+
success_callback_url=success_callback_url,
|
|
76
|
+
cancel_url=cancel_url,
|
|
72
77
|
request_options=request_options,
|
|
73
78
|
)
|
|
74
79
|
return _response.data
|
|
75
80
|
|
|
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
81
|
|
|
108
82
|
class AsyncCheckoutClient:
|
|
109
83
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -125,7 +99,8 @@ class AsyncCheckoutClient:
|
|
|
125
99
|
*,
|
|
126
100
|
subject_id: str,
|
|
127
101
|
rate_card_id: str,
|
|
128
|
-
|
|
102
|
+
success_callback_url: str,
|
|
103
|
+
cancel_url: typing.Optional[str] = OMIT,
|
|
129
104
|
request_options: typing.Optional[RequestOptions] = None,
|
|
130
105
|
) -> CreateSubscriptionCheckoutSessionResponse:
|
|
131
106
|
"""
|
|
@@ -135,7 +110,11 @@ class AsyncCheckoutClient:
|
|
|
135
110
|
|
|
136
111
|
rate_card_id : str
|
|
137
112
|
|
|
138
|
-
|
|
113
|
+
success_callback_url : str
|
|
114
|
+
The URL to redirect to after the checkout is successful.
|
|
115
|
+
|
|
116
|
+
cancel_url : typing.Optional[str]
|
|
117
|
+
The URL to redirect to after the checkout is cancelled.
|
|
139
118
|
|
|
140
119
|
request_options : typing.Optional[RequestOptions]
|
|
141
120
|
Request-specific configuration.
|
|
@@ -153,7 +132,6 @@ class AsyncCheckoutClient:
|
|
|
153
132
|
|
|
154
133
|
client = AsyncLark(
|
|
155
134
|
api_key="YOUR_API_KEY",
|
|
156
|
-
base_url="https://yourhost.com/path/to/api",
|
|
157
135
|
)
|
|
158
136
|
|
|
159
137
|
|
|
@@ -161,6 +139,7 @@ class AsyncCheckoutClient:
|
|
|
161
139
|
await client.checkout.create_subscription_checkout_session(
|
|
162
140
|
subject_id="subject_id",
|
|
163
141
|
rate_card_id="rate_card_id",
|
|
142
|
+
success_callback_url="https://example.com/callback",
|
|
164
143
|
)
|
|
165
144
|
|
|
166
145
|
|
|
@@ -169,46 +148,8 @@ class AsyncCheckoutClient:
|
|
|
169
148
|
_response = await self._raw_client.create_subscription_checkout_session(
|
|
170
149
|
subject_id=subject_id,
|
|
171
150
|
rate_card_id=rate_card_id,
|
|
172
|
-
|
|
151
|
+
success_callback_url=success_callback_url,
|
|
152
|
+
cancel_url=cancel_url,
|
|
173
153
|
request_options=request_options,
|
|
174
154
|
)
|
|
175
155
|
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",
|
|
202
|
-
)
|
|
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
|
-
return _response.data
|
|
@@ -6,11 +6,9 @@ from json.decoder import JSONDecodeError
|
|
|
6
6
|
from ..core.api_error import ApiError
|
|
7
7
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
8
|
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
-
from ..core.jsonable_encoder import jsonable_encoder
|
|
10
9
|
from ..core.pydantic_utilities import parse_obj_as
|
|
11
10
|
from ..core.request_options import RequestOptions
|
|
12
11
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
13
|
-
from ..types.complete_subscription_checkout_response import CompleteSubscriptionCheckoutResponse
|
|
14
12
|
from ..types.create_subscription_checkout_session_response import CreateSubscriptionCheckoutSessionResponse
|
|
15
13
|
from ..types.http_validation_error import HttpValidationError
|
|
16
14
|
|
|
@@ -27,7 +25,8 @@ class RawCheckoutClient:
|
|
|
27
25
|
*,
|
|
28
26
|
subject_id: str,
|
|
29
27
|
rate_card_id: str,
|
|
30
|
-
|
|
28
|
+
success_callback_url: str,
|
|
29
|
+
cancel_url: typing.Optional[str] = OMIT,
|
|
31
30
|
request_options: typing.Optional[RequestOptions] = None,
|
|
32
31
|
) -> HttpResponse[CreateSubscriptionCheckoutSessionResponse]:
|
|
33
32
|
"""
|
|
@@ -37,7 +36,11 @@ class RawCheckoutClient:
|
|
|
37
36
|
|
|
38
37
|
rate_card_id : str
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
success_callback_url : str
|
|
40
|
+
The URL to redirect to after the checkout is successful.
|
|
41
|
+
|
|
42
|
+
cancel_url : typing.Optional[str]
|
|
43
|
+
The URL to redirect to after the checkout is cancelled.
|
|
41
44
|
|
|
42
45
|
request_options : typing.Optional[RequestOptions]
|
|
43
46
|
Request-specific configuration.
|
|
@@ -53,7 +56,8 @@ class RawCheckoutClient:
|
|
|
53
56
|
json={
|
|
54
57
|
"subject_id": subject_id,
|
|
55
58
|
"rate_card_id": rate_card_id,
|
|
56
|
-
"
|
|
59
|
+
"success_callback_url": success_callback_url,
|
|
60
|
+
"cancel_url": cancel_url,
|
|
57
61
|
},
|
|
58
62
|
headers={
|
|
59
63
|
"content-type": "application/json",
|
|
@@ -87,53 +91,6 @@ class RawCheckoutClient:
|
|
|
87
91
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
88
92
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
89
93
|
|
|
90
|
-
def complete_subscription_checkout(
|
|
91
|
-
self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
92
|
-
) -> HttpResponse[CompleteSubscriptionCheckoutResponse]:
|
|
93
|
-
"""
|
|
94
|
-
Parameters
|
|
95
|
-
----------
|
|
96
|
-
checkout_id : str
|
|
97
|
-
|
|
98
|
-
request_options : typing.Optional[RequestOptions]
|
|
99
|
-
Request-specific configuration.
|
|
100
|
-
|
|
101
|
-
Returns
|
|
102
|
-
-------
|
|
103
|
-
HttpResponse[CompleteSubscriptionCheckoutResponse]
|
|
104
|
-
Successful Response
|
|
105
|
-
"""
|
|
106
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
107
|
-
f"checkout/{jsonable_encoder(checkout_id)}/complete",
|
|
108
|
-
method="POST",
|
|
109
|
-
request_options=request_options,
|
|
110
|
-
)
|
|
111
|
-
try:
|
|
112
|
-
if 200 <= _response.status_code < 300:
|
|
113
|
-
_data = typing.cast(
|
|
114
|
-
CompleteSubscriptionCheckoutResponse,
|
|
115
|
-
parse_obj_as(
|
|
116
|
-
type_=CompleteSubscriptionCheckoutResponse, # type: ignore
|
|
117
|
-
object_=_response.json(),
|
|
118
|
-
),
|
|
119
|
-
)
|
|
120
|
-
return HttpResponse(response=_response, data=_data)
|
|
121
|
-
if _response.status_code == 422:
|
|
122
|
-
raise UnprocessableEntityError(
|
|
123
|
-
headers=dict(_response.headers),
|
|
124
|
-
body=typing.cast(
|
|
125
|
-
HttpValidationError,
|
|
126
|
-
parse_obj_as(
|
|
127
|
-
type_=HttpValidationError, # type: ignore
|
|
128
|
-
object_=_response.json(),
|
|
129
|
-
),
|
|
130
|
-
),
|
|
131
|
-
)
|
|
132
|
-
_response_json = _response.json()
|
|
133
|
-
except JSONDecodeError:
|
|
134
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
135
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
136
|
-
|
|
137
94
|
|
|
138
95
|
class AsyncRawCheckoutClient:
|
|
139
96
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -144,7 +101,8 @@ class AsyncRawCheckoutClient:
|
|
|
144
101
|
*,
|
|
145
102
|
subject_id: str,
|
|
146
103
|
rate_card_id: str,
|
|
147
|
-
|
|
104
|
+
success_callback_url: str,
|
|
105
|
+
cancel_url: typing.Optional[str] = OMIT,
|
|
148
106
|
request_options: typing.Optional[RequestOptions] = None,
|
|
149
107
|
) -> AsyncHttpResponse[CreateSubscriptionCheckoutSessionResponse]:
|
|
150
108
|
"""
|
|
@@ -154,7 +112,11 @@ class AsyncRawCheckoutClient:
|
|
|
154
112
|
|
|
155
113
|
rate_card_id : str
|
|
156
114
|
|
|
157
|
-
|
|
115
|
+
success_callback_url : str
|
|
116
|
+
The URL to redirect to after the checkout is successful.
|
|
117
|
+
|
|
118
|
+
cancel_url : typing.Optional[str]
|
|
119
|
+
The URL to redirect to after the checkout is cancelled.
|
|
158
120
|
|
|
159
121
|
request_options : typing.Optional[RequestOptions]
|
|
160
122
|
Request-specific configuration.
|
|
@@ -170,7 +132,8 @@ class AsyncRawCheckoutClient:
|
|
|
170
132
|
json={
|
|
171
133
|
"subject_id": subject_id,
|
|
172
134
|
"rate_card_id": rate_card_id,
|
|
173
|
-
"
|
|
135
|
+
"success_callback_url": success_callback_url,
|
|
136
|
+
"cancel_url": cancel_url,
|
|
174
137
|
},
|
|
175
138
|
headers={
|
|
176
139
|
"content-type": "application/json",
|
|
@@ -203,50 +166,3 @@ class AsyncRawCheckoutClient:
|
|
|
203
166
|
except JSONDecodeError:
|
|
204
167
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
205
168
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
206
|
-
|
|
207
|
-
async def complete_subscription_checkout(
|
|
208
|
-
self, checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
209
|
-
) -> AsyncHttpResponse[CompleteSubscriptionCheckoutResponse]:
|
|
210
|
-
"""
|
|
211
|
-
Parameters
|
|
212
|
-
----------
|
|
213
|
-
checkout_id : str
|
|
214
|
-
|
|
215
|
-
request_options : typing.Optional[RequestOptions]
|
|
216
|
-
Request-specific configuration.
|
|
217
|
-
|
|
218
|
-
Returns
|
|
219
|
-
-------
|
|
220
|
-
AsyncHttpResponse[CompleteSubscriptionCheckoutResponse]
|
|
221
|
-
Successful Response
|
|
222
|
-
"""
|
|
223
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
224
|
-
f"checkout/{jsonable_encoder(checkout_id)}/complete",
|
|
225
|
-
method="POST",
|
|
226
|
-
request_options=request_options,
|
|
227
|
-
)
|
|
228
|
-
try:
|
|
229
|
-
if 200 <= _response.status_code < 300:
|
|
230
|
-
_data = typing.cast(
|
|
231
|
-
CompleteSubscriptionCheckoutResponse,
|
|
232
|
-
parse_obj_as(
|
|
233
|
-
type_=CompleteSubscriptionCheckoutResponse, # type: ignore
|
|
234
|
-
object_=_response.json(),
|
|
235
|
-
),
|
|
236
|
-
)
|
|
237
|
-
return AsyncHttpResponse(response=_response, data=_data)
|
|
238
|
-
if _response.status_code == 422:
|
|
239
|
-
raise UnprocessableEntityError(
|
|
240
|
-
headers=dict(_response.headers),
|
|
241
|
-
body=typing.cast(
|
|
242
|
-
HttpValidationError,
|
|
243
|
-
parse_obj_as(
|
|
244
|
-
type_=HttpValidationError, # type: ignore
|
|
245
|
-
object_=_response.json(),
|
|
246
|
-
),
|
|
247
|
-
),
|
|
248
|
-
)
|
|
249
|
-
_response_json = _response.json()
|
|
250
|
-
except JSONDecodeError:
|
|
251
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
252
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|