lark-billing 0.0.6__py3-none-any.whl → 0.0.8__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 +92 -369
- lark/checkout/client.py +20 -79
- lark/checkout/raw_client.py +18 -102
- lark/client.py +112 -27
- lark/core/client_wrapper.py +2 -2
- lark/core/http_sse/__init__.py +42 -0
- lark/core/http_sse/_api.py +112 -0
- lark/core/http_sse/_decoders.py +61 -0
- lark/{types/credit_grant.py → core/http_sse/_exceptions.py} +4 -2
- lark/core/http_sse/_models.py +17 -0
- lark/core/pydantic_utilities.py +3 -1
- 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/{types/dimension.py → invoices/__init__.py} +1 -2
- lark/invoices/client.py +136 -0
- lark/invoices/raw_client.py +147 -0
- lark/pricing_metrics/__init__.py +38 -0
- lark/pricing_metrics/client.py +288 -0
- lark/pricing_metrics/raw_client.py +369 -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 +0 -15
- lark/rate_cards/client.py +30 -542
- lark/rate_cards/raw_client.py +34 -370
- lark/rate_cards/types/__init__.py +0 -17
- lark/rate_cards/types/create_rate_card_request_usage_based_rates_item.py +3 -29
- lark/subjects/client.py +18 -54
- lark/subjects/raw_client.py +14 -24
- lark/subscriptions/client.py +104 -80
- lark/subscriptions/raw_client.py +186 -53
- lark/types/__init__.py +63 -379
- lark/types/aggregation.py +1 -43
- lark/types/amount.py +5 -1
- lark/types/{credit_grant_date_time_expiration_interface.py → billing_state_response.py} +3 -2
- 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_dimension_coordinate_interface.py → create_fixed_rate_request.py} +5 -3
- lark/types/{pricing_metric_interface.py → create_pricing_metric_response.py} +2 -5
- lark/types/{create_simple_usage_based_rate_interface.py → create_simple_usage_based_rate_request.py} +6 -9
- lark/types/create_subject_response.py +30 -6
- lark/types/create_subscription_checkout_session_response.py +1 -2
- lark/types/create_usage_event_summary_response.py +1 -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/{complete_subscription_checkout_response.py → invoice_line_item_resource.py} +4 -2
- lark/types/invoice_resource.py +31 -0
- lark/types/invoice_status.py +5 -0
- lark/types/{check_feature_access_response.py → list_invoices_response.py} +4 -4
- lark/types/{check_feature_access_request.py → list_pricing_metrics_response.py} +4 -7
- 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/period_resource.py +23 -0
- lark/types/price.py +39 -1
- lark/types/pricing_metric_resource.py +24 -0
- lark/types/rate_card_resource.py +0 -6
- lark/types/rate_card_resource_usage_based_rates_item.py +2 -29
- lark/types/simple_usage_based_rate_interface.py +1 -7
- lark/types/subject_resource.py +30 -6
- lark/types/subscription_resource.py +6 -4
- lark/types/subscription_status.py +5 -0
- lark/types/{credit_grant_date_time_expiration_resource.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.8.dist-info}/METADATA +4 -3
- lark_billing-0.0.8.dist-info/RECORD +107 -0
- 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/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_fixed_rate_interface.py +0 -28
- 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_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_one_time_interface.py +0 -19
- lark/types/credit_grant_schedule_rate_cycle_start_interface.py +0 -19
- lark/types/credit_grant_schedule_rate_cycle_start_resource.py +0 -17
- 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_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/status.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.8.dist-info}/WHEEL +0 -0
|
@@ -7,15 +7,12 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
7
|
from .aggregation import Aggregation
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class CreatePricingMetricResponse(UniversalBaseModel):
|
|
11
11
|
id: str
|
|
12
12
|
name: str
|
|
13
13
|
event_name: str
|
|
14
14
|
aggregation: Aggregation
|
|
15
|
-
unit: str
|
|
16
|
-
"""
|
|
17
|
-
Unit of the value computed by the pricing metric.
|
|
18
|
-
"""
|
|
15
|
+
unit: str
|
|
19
16
|
|
|
20
17
|
if IS_PYDANTIC_V2:
|
|
21
18
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
lark/types/{create_simple_usage_based_rate_interface.py → create_simple_usage_based_rate_request.py}
RENAMED
|
@@ -4,21 +4,18 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
-
from .create_pricing_metric_interface import CreatePricingMetricInterface
|
|
8
7
|
from .price import Price
|
|
9
8
|
|
|
10
9
|
|
|
11
|
-
class
|
|
12
|
-
|
|
13
|
-
"""
|
|
14
|
-
Code of this rate to be used for overrides and external reference.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
name: str
|
|
10
|
+
class CreateSimpleUsageBasedRateRequest(UniversalBaseModel):
|
|
11
|
+
name: typing.Optional[str] = None
|
|
18
12
|
description: typing.Optional[str] = None
|
|
19
13
|
price: Price
|
|
20
14
|
included_units: typing.Optional[int] = None
|
|
21
|
-
|
|
15
|
+
pricing_metric_id: str = pydantic.Field()
|
|
16
|
+
"""
|
|
17
|
+
The ID of the pricing metric to use for this rate.
|
|
18
|
+
"""
|
|
22
19
|
|
|
23
20
|
if IS_PYDANTIC_V2:
|
|
24
21
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
import datetime as dt
|
|
3
4
|
import typing
|
|
4
5
|
|
|
5
6
|
import pydantic
|
|
@@ -7,12 +8,35 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class CreateSubjectResponse(UniversalBaseModel):
|
|
10
|
-
id: str
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
id: str = pydantic.Field()
|
|
12
|
+
"""
|
|
13
|
+
The ID of the subject.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
external_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
The ID of the subject in your system. You may pass it to the API in place of the subject ID.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: typing.Optional[str] = pydantic.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
The name of the subject. Used for display in the dashboard.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
email: typing.Optional[str] = pydantic.Field(default=None)
|
|
27
|
+
"""
|
|
28
|
+
The email of the subject.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
metadata: typing.Dict[str, str] = pydantic.Field()
|
|
32
|
+
"""
|
|
33
|
+
Additional metadata about the subject. You may use this to store any custom data about the subject.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
created_at: dt.datetime = pydantic.Field()
|
|
37
|
+
"""
|
|
38
|
+
The date and time the subject was created.
|
|
39
|
+
"""
|
|
16
40
|
|
|
17
41
|
if IS_PYDANTIC_V2:
|
|
18
42
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -10,8 +10,7 @@ from .amount import Amount
|
|
|
10
10
|
class CreateSubscriptionCheckoutSessionResponse(UniversalBaseModel):
|
|
11
11
|
id: str
|
|
12
12
|
amount: Amount
|
|
13
|
-
|
|
14
|
-
setup_intent_client_secret: typing.Optional[str] = None
|
|
13
|
+
url: str
|
|
15
14
|
|
|
16
15
|
if IS_PYDANTIC_V2:
|
|
17
16
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -4,7 +4,6 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
-
from .credit_grant_interface import CreditGrantInterface
|
|
8
7
|
from .price import Price
|
|
9
8
|
|
|
10
9
|
|
|
@@ -13,11 +12,6 @@ class FixedRateInterface(UniversalBaseModel):
|
|
|
13
12
|
name: str
|
|
14
13
|
description: str
|
|
15
14
|
price: Price
|
|
16
|
-
credit_grants: typing.List[CreditGrantInterface]
|
|
17
|
-
quantity_code: typing.Optional[str] = pydantic.Field(default=None)
|
|
18
|
-
"""
|
|
19
|
-
Code of this rate to be used for setting quantity.
|
|
20
|
-
"""
|
|
21
15
|
|
|
22
16
|
if IS_PYDANTIC_V2:
|
|
23
17
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -7,14 +7,12 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
7
|
from .aggregation import Aggregation
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class GetPricingMetricResponse(UniversalBaseModel):
|
|
11
|
+
id: str
|
|
11
12
|
name: str
|
|
12
13
|
event_name: str
|
|
13
14
|
aggregation: Aggregation
|
|
14
|
-
unit: str
|
|
15
|
-
"""
|
|
16
|
-
Unit of the value computed by the pricing metric.
|
|
17
|
-
"""
|
|
15
|
+
unit: str
|
|
18
16
|
|
|
19
17
|
if IS_PYDANTIC_V2:
|
|
20
18
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -7,9 +7,11 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
7
|
from .amount import Amount
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class
|
|
11
|
-
id: str
|
|
10
|
+
class InvoiceLineItemResource(UniversalBaseModel):
|
|
12
11
|
amount: Amount
|
|
12
|
+
description: str
|
|
13
|
+
quantity: int
|
|
14
|
+
price_in_unit_amount: Amount
|
|
13
15
|
|
|
14
16
|
if IS_PYDANTIC_V2:
|
|
15
17
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from .amount import Amount
|
|
9
|
+
from .invoice_line_item_resource import InvoiceLineItemResource
|
|
10
|
+
from .invoice_status import InvoiceStatus
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class InvoiceResource(UniversalBaseModel):
|
|
14
|
+
id: str
|
|
15
|
+
merchant_id: str
|
|
16
|
+
bill_id: typing.Optional[str] = None
|
|
17
|
+
total_amount: Amount
|
|
18
|
+
subject_id: str
|
|
19
|
+
created_at: dt.datetime
|
|
20
|
+
status: InvoiceStatus
|
|
21
|
+
hosted_url: typing.Optional[str] = None
|
|
22
|
+
line_items: typing.List[InvoiceLineItemResource]
|
|
23
|
+
|
|
24
|
+
if IS_PYDANTIC_V2:
|
|
25
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
26
|
+
else:
|
|
27
|
+
|
|
28
|
+
class Config:
|
|
29
|
+
frozen = True
|
|
30
|
+
smart_union = True
|
|
31
|
+
extra = pydantic.Extra.allow
|
|
@@ -4,12 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .invoice_resource import InvoiceResource
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
class
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
feature_access: bool
|
|
10
|
+
class ListInvoicesResponse(UniversalBaseModel):
|
|
11
|
+
invoices: typing.List[InvoiceResource]
|
|
12
|
+
has_more: bool
|
|
13
13
|
|
|
14
14
|
if IS_PYDANTIC_V2:
|
|
15
15
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -4,15 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .pricing_metric_resource import PricingMetricResource
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
class
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
References `feature_code` from a usage-based rate.
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
subject_id: str
|
|
10
|
+
class ListPricingMetricsResponse(UniversalBaseModel):
|
|
11
|
+
pricing_metrics: typing.List[PricingMetricResource]
|
|
12
|
+
has_more: bool
|
|
16
13
|
|
|
17
14
|
if IS_PYDANTIC_V2:
|
|
18
15
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
lark/types/package_price.py
CHANGED
|
@@ -5,7 +5,7 @@ import typing
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
from .amount import Amount
|
|
8
|
-
from .
|
|
8
|
+
from .package_price_output_rounding_behavior import PackagePriceOutputRoundingBehavior
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class PackagePrice(UniversalBaseModel):
|
|
@@ -15,7 +15,7 @@ class PackagePrice(UniversalBaseModel):
|
|
|
15
15
|
|
|
16
16
|
amount: Amount
|
|
17
17
|
package_units: int
|
|
18
|
-
rounding_behavior:
|
|
18
|
+
rounding_behavior: PackagePriceOutputRoundingBehavior
|
|
19
19
|
|
|
20
20
|
if IS_PYDANTIC_V2:
|
|
21
21
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PeriodResource(UniversalBaseModel):
|
|
11
|
+
inclusive_start: typing.Optional[bool] = None
|
|
12
|
+
inclusive_end: typing.Optional[bool] = None
|
|
13
|
+
start: dt.datetime
|
|
14
|
+
end: dt.datetime
|
|
15
|
+
|
|
16
|
+
if IS_PYDANTIC_V2:
|
|
17
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
lark/types/price.py
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
3
5
|
import typing
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
import pydantic
|
|
8
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
+
from .amount import Amount
|
|
10
|
+
from .package_price_output_rounding_behavior import PackagePriceOutputRoundingBehavior
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Price_Flat(UniversalBaseModel):
|
|
14
|
+
price_type: typing.Literal["flat"] = "flat"
|
|
15
|
+
amount: Amount
|
|
16
|
+
|
|
17
|
+
if IS_PYDANTIC_V2:
|
|
18
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class Config:
|
|
22
|
+
frozen = True
|
|
23
|
+
smart_union = True
|
|
24
|
+
extra = pydantic.Extra.allow
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Price_Package(UniversalBaseModel):
|
|
28
|
+
price_type: typing.Literal["package"] = "package"
|
|
29
|
+
amount: Amount
|
|
30
|
+
package_units: int
|
|
31
|
+
rounding_behavior: PackagePriceOutputRoundingBehavior
|
|
32
|
+
|
|
33
|
+
if IS_PYDANTIC_V2:
|
|
34
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
35
|
+
else:
|
|
36
|
+
|
|
37
|
+
class Config:
|
|
38
|
+
frozen = True
|
|
39
|
+
smart_union = True
|
|
40
|
+
extra = pydantic.Extra.allow
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
Price = typing.Union[Price_Flat, Price_Package]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .aggregation import Aggregation
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PricingMetricResource(UniversalBaseModel):
|
|
11
|
+
id: str
|
|
12
|
+
name: str
|
|
13
|
+
event_name: str
|
|
14
|
+
aggregation: Aggregation
|
|
15
|
+
unit: str
|
|
16
|
+
|
|
17
|
+
if IS_PYDANTIC_V2:
|
|
18
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class Config:
|
|
22
|
+
frozen = True
|
|
23
|
+
smart_union = True
|
|
24
|
+
extra = pydantic.Extra.allow
|
lark/types/rate_card_resource.py
CHANGED
|
@@ -4,8 +4,6 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
-
from .credit_grant_resource import CreditGrantResource
|
|
8
|
-
from .feature_access_resource import FeatureAccessResource
|
|
9
7
|
from .fixed_rate_interface import FixedRateInterface
|
|
10
8
|
from .rate_card_resource_billing_interval import RateCardResourceBillingInterval
|
|
11
9
|
from .rate_card_resource_usage_based_rates_item import RateCardResourceUsageBasedRatesItem
|
|
@@ -18,12 +16,8 @@ class RateCardResource(UniversalBaseModel):
|
|
|
18
16
|
usage_based_rates: typing.List[RateCardResourceUsageBasedRatesItem]
|
|
19
17
|
fixed_rates: typing.List[FixedRateInterface]
|
|
20
18
|
billing_interval: RateCardResourceBillingInterval
|
|
21
|
-
credit_grants: typing.List[CreditGrantResource]
|
|
22
19
|
created_at: str
|
|
23
20
|
updated_at: str
|
|
24
|
-
major_version: int
|
|
25
|
-
minor_version: int
|
|
26
|
-
feature_access: typing.List[FeatureAccessResource]
|
|
27
21
|
metadata: typing.Dict[str, str]
|
|
28
22
|
|
|
29
23
|
if IS_PYDANTIC_V2:
|
|
@@ -6,42 +6,17 @@ import typing
|
|
|
6
6
|
|
|
7
7
|
import pydantic
|
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
-
from .dimension_interface import DimensionInterface
|
|
10
9
|
from .price import Price
|
|
11
|
-
from .pricing_matrix_interface import PricingMatrixInterface
|
|
12
|
-
from .pricing_metric_interface import PricingMetricInterface
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class RateCardResourceUsageBasedRatesItem_Dimensional(UniversalBaseModel):
|
|
16
|
-
usage_based_rate_type: typing.Literal["dimensional"] = "dimensional"
|
|
17
|
-
id: str
|
|
18
|
-
code: str
|
|
19
|
-
name: str
|
|
20
|
-
description: str
|
|
21
|
-
included_units: int
|
|
22
|
-
pricing_metric: PricingMetricInterface
|
|
23
|
-
dimensions: typing.List[DimensionInterface]
|
|
24
|
-
pricing_matrix: PricingMatrixInterface
|
|
25
|
-
|
|
26
|
-
if IS_PYDANTIC_V2:
|
|
27
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
28
|
-
else:
|
|
29
|
-
|
|
30
|
-
class Config:
|
|
31
|
-
frozen = True
|
|
32
|
-
smart_union = True
|
|
33
|
-
extra = pydantic.Extra.allow
|
|
34
10
|
|
|
35
11
|
|
|
36
12
|
class RateCardResourceUsageBasedRatesItem_Simple(UniversalBaseModel):
|
|
37
13
|
usage_based_rate_type: typing.Literal["simple"] = "simple"
|
|
38
14
|
id: str
|
|
39
|
-
code: str
|
|
40
15
|
name: str
|
|
41
16
|
description: str
|
|
42
17
|
price: Price
|
|
43
18
|
included_units: int
|
|
44
|
-
|
|
19
|
+
pricing_metric_id: str
|
|
45
20
|
|
|
46
21
|
if IS_PYDANTIC_V2:
|
|
47
22
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -53,6 +28,4 @@ class RateCardResourceUsageBasedRatesItem_Simple(UniversalBaseModel):
|
|
|
53
28
|
extra = pydantic.Extra.allow
|
|
54
29
|
|
|
55
30
|
|
|
56
|
-
RateCardResourceUsageBasedRatesItem =
|
|
57
|
-
RateCardResourceUsageBasedRatesItem_Dimensional, RateCardResourceUsageBasedRatesItem_Simple
|
|
58
|
-
]
|
|
31
|
+
RateCardResourceUsageBasedRatesItem = RateCardResourceUsageBasedRatesItem_Simple
|
|
@@ -5,21 +5,15 @@ import typing
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
from .price import Price
|
|
8
|
-
from .pricing_metric_interface import PricingMetricInterface
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class SimpleUsageBasedRateInterface(UniversalBaseModel):
|
|
12
11
|
id: str
|
|
13
|
-
code: str = pydantic.Field()
|
|
14
|
-
"""
|
|
15
|
-
Code of this rate to be used for overrides and external reference.
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
12
|
name: str
|
|
19
13
|
description: str
|
|
20
14
|
price: Price
|
|
21
15
|
included_units: int
|
|
22
|
-
|
|
16
|
+
pricing_metric_id: str
|
|
23
17
|
|
|
24
18
|
if IS_PYDANTIC_V2:
|
|
25
19
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
lark/types/subject_resource.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
import datetime as dt
|
|
3
4
|
import typing
|
|
4
5
|
|
|
5
6
|
import pydantic
|
|
@@ -7,12 +8,35 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class SubjectResource(UniversalBaseModel):
|
|
10
|
-
id: str
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
id: str = pydantic.Field()
|
|
12
|
+
"""
|
|
13
|
+
The ID of the subject.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
external_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
The ID of the subject in your system. You may pass it to the API in place of the subject ID.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: typing.Optional[str] = pydantic.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
The name of the subject. Used for display in the dashboard.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
email: typing.Optional[str] = pydantic.Field(default=None)
|
|
27
|
+
"""
|
|
28
|
+
The email of the subject.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
metadata: typing.Dict[str, str] = pydantic.Field()
|
|
32
|
+
"""
|
|
33
|
+
Additional metadata about the subject. You may use this to store any custom data about the subject.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
created_at: dt.datetime = pydantic.Field()
|
|
37
|
+
"""
|
|
38
|
+
The date and time the subject was created.
|
|
39
|
+
"""
|
|
16
40
|
|
|
17
41
|
if IS_PYDANTIC_V2:
|
|
18
42
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -5,7 +5,8 @@ import typing
|
|
|
5
5
|
|
|
6
6
|
import pydantic
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
-
from .
|
|
8
|
+
from .period_resource import PeriodResource
|
|
9
|
+
from .subscription_status import SubscriptionStatus
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class SubscriptionResource(UniversalBaseModel):
|
|
@@ -14,9 +15,10 @@ class SubscriptionResource(UniversalBaseModel):
|
|
|
14
15
|
rate_card_id: str
|
|
15
16
|
effective_at: dt.datetime
|
|
16
17
|
cycles_next_at: typing.Optional[dt.datetime] = None
|
|
17
|
-
|
|
18
|
-
metadata: typing.
|
|
19
|
-
status:
|
|
18
|
+
current_period: typing.Optional[PeriodResource] = None
|
|
19
|
+
metadata: typing.Dict[str, str]
|
|
20
|
+
status: SubscriptionStatus
|
|
21
|
+
cancels_at_end_of_cycle: bool
|
|
20
22
|
|
|
21
23
|
if IS_PYDANTIC_V2:
|
|
22
24
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -6,8 +6,8 @@ import pydantic
|
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
10
|
-
|
|
9
|
+
class SumAggregationPricingMetricResource(UniversalBaseModel):
|
|
10
|
+
value_field: str
|
|
11
11
|
|
|
12
12
|
if IS_PYDANTIC_V2:
|
|
13
13
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|