lark-billing 0.5.0__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.
Files changed (81) hide show
  1. lark/__init__.py +92 -0
  2. lark/_base_client.py +1995 -0
  3. lark/_client.py +459 -0
  4. lark/_compat.py +219 -0
  5. lark/_constants.py +14 -0
  6. lark/_exceptions.py +108 -0
  7. lark/_files.py +123 -0
  8. lark/_models.py +857 -0
  9. lark/_qs.py +150 -0
  10. lark/_resource.py +43 -0
  11. lark/_response.py +830 -0
  12. lark/_streaming.py +333 -0
  13. lark/_types.py +261 -0
  14. lark/_utils/__init__.py +64 -0
  15. lark/_utils/_compat.py +45 -0
  16. lark/_utils/_datetime_parse.py +136 -0
  17. lark/_utils/_logs.py +25 -0
  18. lark/_utils/_proxy.py +65 -0
  19. lark/_utils/_reflection.py +42 -0
  20. lark/_utils/_resources_proxy.py +24 -0
  21. lark/_utils/_streams.py +12 -0
  22. lark/_utils/_sync.py +58 -0
  23. lark/_utils/_transform.py +457 -0
  24. lark/_utils/_typing.py +156 -0
  25. lark/_utils/_utils.py +421 -0
  26. lark/_version.py +4 -0
  27. lark/lib/.keep +4 -0
  28. lark/py.typed +0 -0
  29. lark/resources/__init__.py +117 -0
  30. lark/resources/customer_access.py +167 -0
  31. lark/resources/customer_portal.py +187 -0
  32. lark/resources/invoices.py +191 -0
  33. lark/resources/pricing_metrics.py +499 -0
  34. lark/resources/rate_cards.py +395 -0
  35. lark/resources/subjects.py +579 -0
  36. lark/resources/subscriptions.py +647 -0
  37. lark/resources/usage_events.py +221 -0
  38. lark/types/__init__.py +53 -0
  39. lark/types/amount_input_param.py +16 -0
  40. lark/types/amount_output.py +13 -0
  41. lark/types/checkout_callback_param.py +15 -0
  42. lark/types/customer_access_retrieve_billing_state_response.py +40 -0
  43. lark/types/customer_portal_create_session_params.py +18 -0
  44. lark/types/customer_portal_create_session_response.py +18 -0
  45. lark/types/flat_price_input_param.py +17 -0
  46. lark/types/flat_price_output.py +17 -0
  47. lark/types/invoice_list_params.py +16 -0
  48. lark/types/invoice_list_response.py +49 -0
  49. lark/types/package_price_input_param.py +24 -0
  50. lark/types/package_price_output.py +24 -0
  51. lark/types/period.py +18 -0
  52. lark/types/period_param.py +21 -0
  53. lark/types/pricing_metric_create_params.py +98 -0
  54. lark/types/pricing_metric_create_summary_params.py +25 -0
  55. lark/types/pricing_metric_create_summary_response.py +36 -0
  56. lark/types/pricing_metric_list_params.py +11 -0
  57. lark/types/pricing_metric_list_response.py +14 -0
  58. lark/types/pricing_metric_resource.py +72 -0
  59. lark/types/rate_card_create_params.py +148 -0
  60. lark/types/rate_card_list_params.py +13 -0
  61. lark/types/rate_card_list_response.py +14 -0
  62. lark/types/rate_card_resource.py +141 -0
  63. lark/types/subject_create_params.py +29 -0
  64. lark/types/subject_create_response.py +34 -0
  65. lark/types/subject_list_params.py +13 -0
  66. lark/types/subject_list_response.py +14 -0
  67. lark/types/subject_resource.py +34 -0
  68. lark/types/subject_update_params.py +22 -0
  69. lark/types/subscription_cancel_params.py +16 -0
  70. lark/types/subscription_change_rate_card_params.py +29 -0
  71. lark/types/subscription_change_rate_card_response.py +55 -0
  72. lark/types/subscription_create_params.py +38 -0
  73. lark/types/subscription_create_response.py +55 -0
  74. lark/types/subscription_list_params.py +26 -0
  75. lark/types/subscription_list_response.py +14 -0
  76. lark/types/subscription_resource.py +49 -0
  77. lark/types/usage_event_create_params.py +41 -0
  78. lark_billing-0.5.0.dist-info/METADATA +431 -0
  79. lark_billing-0.5.0.dist-info/RECORD +81 -0
  80. lark_billing-0.5.0.dist-info/WHEEL +4 -0
  81. lark_billing-0.5.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,221 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Union
6
+ from datetime import datetime
7
+
8
+ import httpx
9
+
10
+ from ..types import usage_event_create_params
11
+ from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
12
+ from .._utils import maybe_transform, async_maybe_transform
13
+ from .._compat import cached_property
14
+ from .._resource import SyncAPIResource, AsyncAPIResource
15
+ from .._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from .._base_client import make_request_options
22
+
23
+ __all__ = ["UsageEventsResource", "AsyncUsageEventsResource"]
24
+
25
+
26
+ class UsageEventsResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> UsageEventsResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/uselark/lark-billing-python#accessing-raw-response-data-eg-headers
34
+ """
35
+ return UsageEventsResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> UsageEventsResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/uselark/lark-billing-python#with_streaming_response
43
+ """
44
+ return UsageEventsResourceWithStreamingResponse(self)
45
+
46
+ def create(
47
+ self,
48
+ *,
49
+ data: Dict[str, Union[str, int]],
50
+ event_name: str,
51
+ idempotency_key: str,
52
+ subject_id: str,
53
+ timestamp: Union[str, datetime, None] | Omit = omit,
54
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
55
+ # The extra values given here take precedence over values defined on the client or passed to this method.
56
+ extra_headers: Headers | None = None,
57
+ extra_query: Query | None = None,
58
+ extra_body: Body | None = None,
59
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
60
+ ) -> object:
61
+ """Create Usage Event
62
+
63
+ Args:
64
+ data: The data of the usage event.
65
+
66
+ This should contain any data that is needed to
67
+ aggregate the usage event.
68
+
69
+ event_name: The name of the event. This is used by pricing metrics to aggregate usage
70
+ events.
71
+
72
+ idempotency_key: The idempotency key for the usage event. This ensures that the same event is not
73
+ processed multiple times.
74
+
75
+ subject_id: The ID or external ID of the subject that the usage event is for.
76
+
77
+ timestamp: The timestamp of the usage event. It is highly recommended to provide a
78
+ timestamp. If not provided, the current timestamp will be used.
79
+
80
+ extra_headers: Send extra headers
81
+
82
+ extra_query: Add additional query parameters to the request
83
+
84
+ extra_body: Add additional JSON properties to the request
85
+
86
+ timeout: Override the client-level default timeout for this request, in seconds
87
+ """
88
+ return self._post(
89
+ "/usage-events",
90
+ body=maybe_transform(
91
+ {
92
+ "data": data,
93
+ "event_name": event_name,
94
+ "idempotency_key": idempotency_key,
95
+ "subject_id": subject_id,
96
+ "timestamp": timestamp,
97
+ },
98
+ usage_event_create_params.UsageEventCreateParams,
99
+ ),
100
+ options=make_request_options(
101
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
102
+ ),
103
+ cast_to=object,
104
+ )
105
+
106
+
107
+ class AsyncUsageEventsResource(AsyncAPIResource):
108
+ @cached_property
109
+ def with_raw_response(self) -> AsyncUsageEventsResourceWithRawResponse:
110
+ """
111
+ This property can be used as a prefix for any HTTP method call to return
112
+ the raw response object instead of the parsed content.
113
+
114
+ For more information, see https://www.github.com/uselark/lark-billing-python#accessing-raw-response-data-eg-headers
115
+ """
116
+ return AsyncUsageEventsResourceWithRawResponse(self)
117
+
118
+ @cached_property
119
+ def with_streaming_response(self) -> AsyncUsageEventsResourceWithStreamingResponse:
120
+ """
121
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
122
+
123
+ For more information, see https://www.github.com/uselark/lark-billing-python#with_streaming_response
124
+ """
125
+ return AsyncUsageEventsResourceWithStreamingResponse(self)
126
+
127
+ async def create(
128
+ self,
129
+ *,
130
+ data: Dict[str, Union[str, int]],
131
+ event_name: str,
132
+ idempotency_key: str,
133
+ subject_id: str,
134
+ timestamp: Union[str, datetime, None] | Omit = omit,
135
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
136
+ # The extra values given here take precedence over values defined on the client or passed to this method.
137
+ extra_headers: Headers | None = None,
138
+ extra_query: Query | None = None,
139
+ extra_body: Body | None = None,
140
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
141
+ ) -> object:
142
+ """Create Usage Event
143
+
144
+ Args:
145
+ data: The data of the usage event.
146
+
147
+ This should contain any data that is needed to
148
+ aggregate the usage event.
149
+
150
+ event_name: The name of the event. This is used by pricing metrics to aggregate usage
151
+ events.
152
+
153
+ idempotency_key: The idempotency key for the usage event. This ensures that the same event is not
154
+ processed multiple times.
155
+
156
+ subject_id: The ID or external ID of the subject that the usage event is for.
157
+
158
+ timestamp: The timestamp of the usage event. It is highly recommended to provide a
159
+ timestamp. If not provided, the current timestamp will be used.
160
+
161
+ extra_headers: Send extra headers
162
+
163
+ extra_query: Add additional query parameters to the request
164
+
165
+ extra_body: Add additional JSON properties to the request
166
+
167
+ timeout: Override the client-level default timeout for this request, in seconds
168
+ """
169
+ return await self._post(
170
+ "/usage-events",
171
+ body=await async_maybe_transform(
172
+ {
173
+ "data": data,
174
+ "event_name": event_name,
175
+ "idempotency_key": idempotency_key,
176
+ "subject_id": subject_id,
177
+ "timestamp": timestamp,
178
+ },
179
+ usage_event_create_params.UsageEventCreateParams,
180
+ ),
181
+ options=make_request_options(
182
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
183
+ ),
184
+ cast_to=object,
185
+ )
186
+
187
+
188
+ class UsageEventsResourceWithRawResponse:
189
+ def __init__(self, usage_events: UsageEventsResource) -> None:
190
+ self._usage_events = usage_events
191
+
192
+ self.create = to_raw_response_wrapper(
193
+ usage_events.create,
194
+ )
195
+
196
+
197
+ class AsyncUsageEventsResourceWithRawResponse:
198
+ def __init__(self, usage_events: AsyncUsageEventsResource) -> None:
199
+ self._usage_events = usage_events
200
+
201
+ self.create = async_to_raw_response_wrapper(
202
+ usage_events.create,
203
+ )
204
+
205
+
206
+ class UsageEventsResourceWithStreamingResponse:
207
+ def __init__(self, usage_events: UsageEventsResource) -> None:
208
+ self._usage_events = usage_events
209
+
210
+ self.create = to_streamed_response_wrapper(
211
+ usage_events.create,
212
+ )
213
+
214
+
215
+ class AsyncUsageEventsResourceWithStreamingResponse:
216
+ def __init__(self, usage_events: AsyncUsageEventsResource) -> None:
217
+ self._usage_events = usage_events
218
+
219
+ self.create = async_to_streamed_response_wrapper(
220
+ usage_events.create,
221
+ )
lark/types/__init__.py ADDED
@@ -0,0 +1,53 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .period import Period as Period
6
+ from .period_param import PeriodParam as PeriodParam
7
+ from .amount_output import AmountOutput as AmountOutput
8
+ from .subject_resource import SubjectResource as SubjectResource
9
+ from .flat_price_output import FlatPriceOutput as FlatPriceOutput
10
+ from .amount_input_param import AmountInputParam as AmountInputParam
11
+ from .rate_card_resource import RateCardResource as RateCardResource
12
+ from .invoice_list_params import InvoiceListParams as InvoiceListParams
13
+ from .subject_list_params import SubjectListParams as SubjectListParams
14
+ from .package_price_output import PackagePriceOutput as PackagePriceOutput
15
+ from .invoice_list_response import InvoiceListResponse as InvoiceListResponse
16
+ from .rate_card_list_params import RateCardListParams as RateCardListParams
17
+ from .subject_create_params import SubjectCreateParams as SubjectCreateParams
18
+ from .subject_list_response import SubjectListResponse as SubjectListResponse
19
+ from .subject_update_params import SubjectUpdateParams as SubjectUpdateParams
20
+ from .subscription_resource import SubscriptionResource as SubscriptionResource
21
+ from .flat_price_input_param import FlatPriceInputParam as FlatPriceInputParam
22
+ from .checkout_callback_param import CheckoutCallbackParam as CheckoutCallbackParam
23
+ from .pricing_metric_resource import PricingMetricResource as PricingMetricResource
24
+ from .rate_card_create_params import RateCardCreateParams as RateCardCreateParams
25
+ from .rate_card_list_response import RateCardListResponse as RateCardListResponse
26
+ from .subject_create_response import SubjectCreateResponse as SubjectCreateResponse
27
+ from .subscription_list_params import SubscriptionListParams as SubscriptionListParams
28
+ from .package_price_input_param import PackagePriceInputParam as PackagePriceInputParam
29
+ from .usage_event_create_params import UsageEventCreateParams as UsageEventCreateParams
30
+ from .pricing_metric_list_params import PricingMetricListParams as PricingMetricListParams
31
+ from .subscription_cancel_params import SubscriptionCancelParams as SubscriptionCancelParams
32
+ from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams
33
+ from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse
34
+ from .pricing_metric_create_params import PricingMetricCreateParams as PricingMetricCreateParams
35
+ from .pricing_metric_list_response import PricingMetricListResponse as PricingMetricListResponse
36
+ from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse
37
+ from .pricing_metric_create_summary_params import PricingMetricCreateSummaryParams as PricingMetricCreateSummaryParams
38
+ from .subscription_change_rate_card_params import SubscriptionChangeRateCardParams as SubscriptionChangeRateCardParams
39
+ from .customer_portal_create_session_params import (
40
+ CustomerPortalCreateSessionParams as CustomerPortalCreateSessionParams,
41
+ )
42
+ from .pricing_metric_create_summary_response import (
43
+ PricingMetricCreateSummaryResponse as PricingMetricCreateSummaryResponse,
44
+ )
45
+ from .subscription_change_rate_card_response import (
46
+ SubscriptionChangeRateCardResponse as SubscriptionChangeRateCardResponse,
47
+ )
48
+ from .customer_portal_create_session_response import (
49
+ CustomerPortalCreateSessionResponse as CustomerPortalCreateSessionResponse,
50
+ )
51
+ from .customer_access_retrieve_billing_state_response import (
52
+ CustomerAccessRetrieveBillingStateResponse as CustomerAccessRetrieveBillingStateResponse,
53
+ )
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+ from typing_extensions import Required, TypedDict
7
+
8
+ __all__ = ["AmountInputParam"]
9
+
10
+
11
+ class AmountInputParam(TypedDict, total=False):
12
+ currency_code: Required[str]
13
+ """The currency code of the amount."""
14
+
15
+ value: Required[Union[float, str]]
16
+ """The value of the amount in the smallest unit of the currency."""
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .._models import BaseModel
4
+
5
+ __all__ = ["AmountOutput"]
6
+
7
+
8
+ class AmountOutput(BaseModel):
9
+ currency_code: str
10
+ """The currency code of the amount."""
11
+
12
+ value: str
13
+ """The value of the amount in the smallest unit of the currency."""
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ __all__ = ["CheckoutCallbackParam"]
8
+
9
+
10
+ class CheckoutCallbackParam(TypedDict, total=False):
11
+ cancelled_url: Required[str]
12
+ """The URL to redirect to after the checkout is cancelled."""
13
+
14
+ success_url: Required[str]
15
+ """The URL to redirect to after the checkout is successful."""
@@ -0,0 +1,40 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["CustomerAccessRetrieveBillingStateResponse", "ActiveSubscription", "UsageData"]
8
+
9
+
10
+ class ActiveSubscription(BaseModel):
11
+ rate_card_id: str
12
+
13
+ subscription_id: str
14
+
15
+
16
+ class UsageData(BaseModel):
17
+ included_units: int
18
+
19
+ pricing_metric_id: str
20
+
21
+ rate_name: str
22
+
23
+ used_units: str
24
+
25
+
26
+ class CustomerAccessRetrieveBillingStateResponse(BaseModel):
27
+ active_subscriptions: List[ActiveSubscription]
28
+ """List of active subscriptions the subject is subscribed to."""
29
+
30
+ has_active_subscription: bool
31
+ """Whether the subject has an active subscription."""
32
+
33
+ has_overage_for_usage: bool
34
+ """
35
+ Whether the subject has exceeded the included usage (if any) on a usage-based
36
+ rate they are subscribed to.
37
+ """
38
+
39
+ usage_data: List[UsageData]
40
+ """The usage data for the usage-based rates the subject is subscribed to."""
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ __all__ = ["CustomerPortalCreateSessionParams"]
8
+
9
+
10
+ class CustomerPortalCreateSessionParams(TypedDict, total=False):
11
+ return_url: Required[str]
12
+ """
13
+ The URL to redirect customers to if they click the back button on the customer
14
+ portal.
15
+ """
16
+
17
+ subject_id: Required[str]
18
+ """The ID or external ID of the subject to create the customer portal session for."""
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from datetime import datetime
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["CustomerPortalCreateSessionResponse"]
8
+
9
+
10
+ class CustomerPortalCreateSessionResponse(BaseModel):
11
+ expires_at: datetime
12
+ """The date and time the customer portal session expires."""
13
+
14
+ subject_id: str
15
+ """The ID of the subject for the customer portal session."""
16
+
17
+ url: str
18
+ """The URL to redirect to the customer portal session."""
@@ -0,0 +1,17 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal, Required, TypedDict
6
+
7
+ from .amount_input_param import AmountInputParam
8
+
9
+ __all__ = ["FlatPriceInputParam"]
10
+
11
+
12
+ class FlatPriceInputParam(TypedDict, total=False):
13
+ """Flat price is a price that linearly scales with the quantity."""
14
+
15
+ amount: Required[AmountInputParam]
16
+
17
+ price_type: Literal["flat"]
@@ -0,0 +1,17 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+ from .amount_output import AmountOutput
8
+
9
+ __all__ = ["FlatPriceOutput"]
10
+
11
+
12
+ class FlatPriceOutput(BaseModel):
13
+ """Flat price is a price that linearly scales with the quantity."""
14
+
15
+ amount: AmountOutput
16
+
17
+ price_type: Optional[Literal["flat"]] = None
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ __all__ = ["InvoiceListParams"]
8
+
9
+
10
+ class InvoiceListParams(TypedDict, total=False):
11
+ subject_id: Required[str]
12
+ """The ID or external ID of the subject to list invoices for."""
13
+
14
+ limit: int
15
+
16
+ offset: int
@@ -0,0 +1,49 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from .._models import BaseModel
8
+ from .amount_output import AmountOutput
9
+
10
+ __all__ = ["InvoiceListResponse", "Invoice", "InvoiceLineItem"]
11
+
12
+
13
+ class InvoiceLineItem(BaseModel):
14
+ amount: AmountOutput
15
+
16
+ description: str
17
+
18
+ price_in_unit_amount: AmountOutput
19
+
20
+ quantity: int
21
+
22
+
23
+ class Invoice(BaseModel):
24
+ id: str
25
+ """The ID of the invoice."""
26
+
27
+ created_at: datetime
28
+ """The date and time the invoice was created."""
29
+
30
+ hosted_url: Optional[str] = None
31
+ """The URL of the hosted invoice."""
32
+
33
+ line_items: List[InvoiceLineItem]
34
+ """The line items of the invoice."""
35
+
36
+ status: Literal["draft", "open", "paid", "uncollectible", "void"]
37
+ """The status of the invoice."""
38
+
39
+ subject_id: str
40
+ """The ID of the subject for the invoice."""
41
+
42
+ total_amount: AmountOutput
43
+ """The total amount of the invoice."""
44
+
45
+
46
+ class InvoiceListResponse(BaseModel):
47
+ has_more: bool
48
+
49
+ invoices: List[Invoice]
@@ -0,0 +1,24 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal, Required, TypedDict
6
+
7
+ from .amount_input_param import AmountInputParam
8
+
9
+ __all__ = ["PackagePriceInputParam"]
10
+
11
+
12
+ class PackagePriceInputParam(TypedDict, total=False):
13
+ """Package price is a price that is charged for a fixed number of units.
14
+
15
+ For example, $10 per 1000 units. If the quantity is not a multiple of the package units, the rounding behavior will be applied.
16
+ """
17
+
18
+ amount: Required[AmountInputParam]
19
+
20
+ package_units: Required[int]
21
+
22
+ rounding_behavior: Required[Literal["round_up", "round_down"]]
23
+
24
+ price_type: Literal["package"]
@@ -0,0 +1,24 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+ from .amount_output import AmountOutput
8
+
9
+ __all__ = ["PackagePriceOutput"]
10
+
11
+
12
+ class PackagePriceOutput(BaseModel):
13
+ """Package price is a price that is charged for a fixed number of units.
14
+
15
+ For example, $10 per 1000 units. If the quantity is not a multiple of the package units, the rounding behavior will be applied.
16
+ """
17
+
18
+ amount: AmountOutput
19
+
20
+ package_units: int
21
+
22
+ rounding_behavior: Literal["round_up", "round_down"]
23
+
24
+ price_type: Optional[Literal["package"]] = None
lark/types/period.py ADDED
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from datetime import datetime
5
+
6
+ from .._models import BaseModel
7
+
8
+ __all__ = ["Period"]
9
+
10
+
11
+ class Period(BaseModel):
12
+ end: datetime
13
+
14
+ start: datetime
15
+
16
+ inclusive_end: Optional[bool] = None
17
+
18
+ inclusive_start: Optional[bool] = None
@@ -0,0 +1,21 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+ from datetime import datetime
7
+ from typing_extensions import Required, Annotated, TypedDict
8
+
9
+ from .._utils import PropertyInfo
10
+
11
+ __all__ = ["PeriodParam"]
12
+
13
+
14
+ class PeriodParam(TypedDict, total=False):
15
+ end: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
16
+
17
+ start: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
18
+
19
+ inclusive_end: bool
20
+
21
+ inclusive_start: bool