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,98 @@
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, Optional
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
+
8
+ from .._types import SequenceNotStr
9
+
10
+ __all__ = [
11
+ "PricingMetricCreateParams",
12
+ "Aggregation",
13
+ "AggregationSumAggregationPricingMetricInterface",
14
+ "AggregationCountAggregationPricingMetricInterface",
15
+ "AggregationMaxAggregationPricingMetricInterface",
16
+ "AggregationLastAggregationPricingMetricInterface",
17
+ "AggregationCustomAggregationPricingMetricInterface",
18
+ ]
19
+
20
+
21
+ class PricingMetricCreateParams(TypedDict, total=False):
22
+ aggregation: Required[Aggregation]
23
+ """The aggregation function used to compute the value of the pricing metric."""
24
+
25
+ event_name: Required[str]
26
+ """The name of the event that the pricing metric is computed on."""
27
+
28
+ name: Required[str]
29
+ """The name of the pricing metric."""
30
+
31
+ unit: Required[str]
32
+ """Unit of measurement for the pricing metric."""
33
+
34
+ dimensions: Optional[SequenceNotStr[str]]
35
+ """The dimensions by which the events are grouped to compute the pricing metric."""
36
+
37
+
38
+ class AggregationSumAggregationPricingMetricInterface(TypedDict, total=False):
39
+ """
40
+ Computes the sum of the `value_field` over all usage events with the specified `event_name`.
41
+ """
42
+
43
+ aggregation_type: Required[Literal["sum"]]
44
+
45
+ value_field: Required[str]
46
+ """Field to sum over."""
47
+
48
+
49
+ class AggregationCountAggregationPricingMetricInterface(TypedDict, total=False):
50
+ """Computes the number of usage events with the specified `event_name`."""
51
+
52
+ aggregation_type: Required[Literal["count"]]
53
+
54
+
55
+ class AggregationMaxAggregationPricingMetricInterface(TypedDict, total=False):
56
+ """
57
+ Computes the max value of the `value_field` over all usage events with the specified `event_name`.
58
+ """
59
+
60
+ aggregation_type: Required[Literal["max"]]
61
+
62
+ value_field: Required[str]
63
+ """Field to get the max value of."""
64
+
65
+
66
+ class AggregationLastAggregationPricingMetricInterface(TypedDict, total=False):
67
+ """
68
+ Computes the last value of the `value_field` over all usage events with the specified `event_name`.
69
+ """
70
+
71
+ aggregation_type: Required[Literal["last"]]
72
+
73
+ value_field: Required[str]
74
+ """Field to get the last value of."""
75
+
76
+
77
+ class AggregationCustomAggregationPricingMetricInterface(TypedDict, total=False):
78
+ """Custom aggregation for use cases not supported by the other aggregation types.
79
+
80
+ Please email team@uselark.ai to enable this feature.
81
+ """
82
+
83
+ aggregation_type: Required[Literal["custom"]]
84
+
85
+ custom_expression: Required[str]
86
+ """Custom expression to compute the pricing metric.
87
+
88
+ Please email team@uselark.ai to enable this feature.
89
+ """
90
+
91
+
92
+ Aggregation: TypeAlias = Union[
93
+ AggregationSumAggregationPricingMetricInterface,
94
+ AggregationCountAggregationPricingMetricInterface,
95
+ AggregationMaxAggregationPricingMetricInterface,
96
+ AggregationLastAggregationPricingMetricInterface,
97
+ AggregationCustomAggregationPricingMetricInterface,
98
+ ]
@@ -0,0 +1,25 @@
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 Optional
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ from .._types import SequenceNotStr
9
+ from .period_param import PeriodParam
10
+
11
+ __all__ = ["PricingMetricCreateSummaryParams"]
12
+
13
+
14
+ class PricingMetricCreateSummaryParams(TypedDict, total=False):
15
+ period: Required[PeriodParam]
16
+ """The period that the summary should be computed over."""
17
+
18
+ subject_id: Required[str]
19
+ """The ID or external ID of the subject that the summary should be computed for."""
20
+
21
+ dimensions: Optional[SequenceNotStr[str]]
22
+ """The dimensions by which the events are grouped to compute the pricing metric."""
23
+
24
+ period_granularity: Optional[Literal["hour", "day", "week"]]
25
+ """The granularity of the period that the summary should be computed over."""
@@ -0,0 +1,36 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Optional
4
+ from typing_extensions import TypeAlias
5
+
6
+ from .period import Period
7
+ from .._models import BaseModel
8
+
9
+ __all__ = ["PricingMetricCreateSummaryResponse", "PricingMetricCreateSummaryResponseItem"]
10
+
11
+
12
+ class PricingMetricCreateSummaryResponseItem(BaseModel):
13
+ id: str
14
+ """The ID of the pricing metric summary."""
15
+
16
+ dimension_coordinates: Optional[Dict[str, str]] = None
17
+ """The dimension coordinates that the summary is for."""
18
+
19
+ period: Period
20
+ """The period that the summary is computed over."""
21
+
22
+ pricing_metric_id: str
23
+ """The ID of the pricing metric that the summary is for."""
24
+
25
+ subject_id: str
26
+ """The ID of the subject that the summary is for."""
27
+
28
+ value: Optional[str] = None
29
+ """The computed value of the pricing metric for the period.
30
+
31
+ If the pricing metric does not have any usage events for the period, this will
32
+ be `null`.
33
+ """
34
+
35
+
36
+ PricingMetricCreateSummaryResponse: TypeAlias = List[PricingMetricCreateSummaryResponseItem]
@@ -0,0 +1,11 @@
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 TypedDict
6
+
7
+ __all__ = ["PricingMetricListParams"]
8
+
9
+
10
+ class PricingMetricListParams(TypedDict, total=False):
11
+ limit: int
@@ -0,0 +1,14 @@
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
+ from .pricing_metric_resource import PricingMetricResource
7
+
8
+ __all__ = ["PricingMetricListResponse"]
9
+
10
+
11
+ class PricingMetricListResponse(BaseModel):
12
+ has_more: bool
13
+
14
+ pricing_metrics: List[PricingMetricResource]
@@ -0,0 +1,72 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Union, Optional
4
+ from typing_extensions import Literal, Annotated, TypeAlias
5
+
6
+ from .._utils import PropertyInfo
7
+ from .._models import BaseModel
8
+
9
+ __all__ = [
10
+ "PricingMetricResource",
11
+ "Aggregation",
12
+ "AggregationSumAggregationPricingMetricResource",
13
+ "AggregationCountAggregationPricingMetricResource",
14
+ "AggregationMaxAggregationPricingMetricResource",
15
+ "AggregationLastAggregationPricingMetricResource",
16
+ ]
17
+
18
+
19
+ class AggregationSumAggregationPricingMetricResource(BaseModel):
20
+ aggregation_type: Literal["sum"]
21
+
22
+ value_field: str
23
+ """The field to sum over."""
24
+
25
+
26
+ class AggregationCountAggregationPricingMetricResource(BaseModel):
27
+ aggregation_type: Literal["count"]
28
+
29
+
30
+ class AggregationMaxAggregationPricingMetricResource(BaseModel):
31
+ aggregation_type: Literal["max"]
32
+
33
+ value_field: str
34
+ """The field to get the max value of."""
35
+
36
+
37
+ class AggregationLastAggregationPricingMetricResource(BaseModel):
38
+ aggregation_type: Literal["last"]
39
+
40
+ value_field: str
41
+ """The field to get the last value of."""
42
+
43
+
44
+ Aggregation: TypeAlias = Annotated[
45
+ Union[
46
+ AggregationSumAggregationPricingMetricResource,
47
+ AggregationCountAggregationPricingMetricResource,
48
+ AggregationMaxAggregationPricingMetricResource,
49
+ AggregationLastAggregationPricingMetricResource,
50
+ ],
51
+ PropertyInfo(discriminator="aggregation_type"),
52
+ ]
53
+
54
+
55
+ class PricingMetricResource(BaseModel):
56
+ id: str
57
+ """The ID of the pricing metric."""
58
+
59
+ aggregation: Aggregation
60
+ """The aggregation function used to compute the value of the pricing metric."""
61
+
62
+ event_name: str
63
+ """The event name that the pricing metric is computed on."""
64
+
65
+ name: str
66
+ """The name of the pricing metric."""
67
+
68
+ unit: str
69
+ """The unit of the value computed by the pricing metric."""
70
+
71
+ dimensions: Optional[List[str]] = None
72
+ """The dimensions by which the events are grouped to compute the pricing metric."""
@@ -0,0 +1,148 @@
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, Iterable, Optional
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
+
8
+ from .._types import SequenceNotStr
9
+ from .flat_price_input_param import FlatPriceInputParam
10
+ from .package_price_input_param import PackagePriceInputParam
11
+
12
+ __all__ = [
13
+ "RateCardCreateParams",
14
+ "FixedRate",
15
+ "FixedRatePrice",
16
+ "UsageBasedRate",
17
+ "UsageBasedRateCreateSimpleUsageBasedRateRequest",
18
+ "UsageBasedRateCreateSimpleUsageBasedRateRequestPrice",
19
+ "UsageBasedRateCreateDimensionalUsageBasedRateRequest",
20
+ "UsageBasedRateCreateDimensionalUsageBasedRateRequestDimension",
21
+ "UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrix",
22
+ "UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrixCell",
23
+ "UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrixCellPrice",
24
+ ]
25
+
26
+
27
+ class RateCardCreateParams(TypedDict, total=False):
28
+ billing_interval: Required[Literal["monthly", "yearly"]]
29
+ """How often the customer will be billed for this rate card."""
30
+
31
+ name: Required[str]
32
+ """The name of the rate card displayed to the customer."""
33
+
34
+ description: Optional[str]
35
+ """The description of the rate card displayed to the customer."""
36
+
37
+ fixed_rates: Iterable[FixedRate]
38
+ """The fixed rates of the rate card.
39
+
40
+ These are billed at the start of each billing cycle.
41
+ """
42
+
43
+ metadata: Dict[str, str]
44
+
45
+ usage_based_rates: Iterable[UsageBasedRate]
46
+ """The usage based rates of the rate card.
47
+
48
+ These are billed at the end of each billing cycle.
49
+ """
50
+
51
+
52
+ FixedRatePrice: TypeAlias = Union[FlatPriceInputParam, PackagePriceInputParam]
53
+
54
+
55
+ class FixedRate(TypedDict, total=False):
56
+ name: Required[str]
57
+ """The name of the rate displayed to the customer."""
58
+
59
+ price: Required[FixedRatePrice]
60
+ """Flat price is a price that linearly scales with the quantity."""
61
+
62
+ description: Optional[str]
63
+ """The description of the rate displayed to the customer."""
64
+
65
+
66
+ UsageBasedRateCreateSimpleUsageBasedRateRequestPrice: TypeAlias = Union[FlatPriceInputParam, PackagePriceInputParam]
67
+
68
+
69
+ class UsageBasedRateCreateSimpleUsageBasedRateRequest(TypedDict, total=False):
70
+ name: Required[str]
71
+ """The name of the rate displayed to the customer."""
72
+
73
+ price: Required[UsageBasedRateCreateSimpleUsageBasedRateRequestPrice]
74
+ """Flat price is a price that linearly scales with the quantity."""
75
+
76
+ pricing_metric_id: Required[str]
77
+ """The ID of the pricing metric to use for this rate."""
78
+
79
+ usage_based_rate_type: Required[Literal["simple"]]
80
+
81
+ description: Optional[str]
82
+ """The description of the rate displayed to the customer."""
83
+
84
+ included_units: int
85
+ """The number of units included in the rate before the price is applied."""
86
+
87
+
88
+ class UsageBasedRateCreateDimensionalUsageBasedRateRequestDimension(TypedDict, total=False):
89
+ key: Required[str]
90
+ """The name of the dimension.
91
+
92
+ This is used to identify the dimension in the pricing matrix.
93
+ """
94
+
95
+ values: Required[SequenceNotStr[str]]
96
+ """A list of possible values for the dimension."""
97
+
98
+ description: Optional[str]
99
+ """The description of the dimension."""
100
+
101
+
102
+ UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrixCellPrice: TypeAlias = Union[
103
+ FlatPriceInputParam, PackagePriceInputParam
104
+ ]
105
+
106
+
107
+ class UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrixCell(TypedDict, total=False):
108
+ dimension_coordinates: Required[Dict[str, str]]
109
+ """
110
+ A key-value mapping of dimension keys and values to identify the price for a
111
+ given set of dimension values.
112
+ """
113
+
114
+ price: Required[UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrixCellPrice]
115
+ """The price for the cell."""
116
+
117
+
118
+ class UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrix(TypedDict, total=False):
119
+ """The pricing matrix of the rate."""
120
+
121
+ cells: Required[Iterable[UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrixCell]]
122
+
123
+
124
+ class UsageBasedRateCreateDimensionalUsageBasedRateRequest(TypedDict, total=False):
125
+ dimensions: Required[Iterable[UsageBasedRateCreateDimensionalUsageBasedRateRequestDimension]]
126
+ """The dimensions of the rate."""
127
+
128
+ name: Required[str]
129
+ """The name of the rate displayed to the customer."""
130
+
131
+ pricing_matrix: Required[UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrix]
132
+ """The pricing matrix of the rate."""
133
+
134
+ pricing_metric_id: Required[str]
135
+ """The ID of the pricing metric to use for this rate."""
136
+
137
+ usage_based_rate_type: Required[Literal["dimensional"]]
138
+
139
+ description: Optional[str]
140
+ """The description of the rate displayed to the customer."""
141
+
142
+ included_units: int
143
+ """The number of units included in the rate before the price is applied."""
144
+
145
+
146
+ UsageBasedRate: TypeAlias = Union[
147
+ UsageBasedRateCreateSimpleUsageBasedRateRequest, UsageBasedRateCreateDimensionalUsageBasedRateRequest
148
+ ]
@@ -0,0 +1,13 @@
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 TypedDict
6
+
7
+ __all__ = ["RateCardListParams"]
8
+
9
+
10
+ class RateCardListParams(TypedDict, total=False):
11
+ limit: int
12
+
13
+ offset: int
@@ -0,0 +1,14 @@
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
+ from .rate_card_resource import RateCardResource
7
+
8
+ __all__ = ["RateCardListResponse"]
9
+
10
+
11
+ class RateCardListResponse(BaseModel):
12
+ has_more: bool
13
+
14
+ rate_cards: List[RateCardResource]
@@ -0,0 +1,141 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Union, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal, Annotated, TypeAlias
6
+
7
+ from .._utils import PropertyInfo
8
+ from .._models import BaseModel
9
+ from .flat_price_output import FlatPriceOutput
10
+ from .package_price_output import PackagePriceOutput
11
+
12
+ __all__ = [
13
+ "RateCardResource",
14
+ "FixedRate",
15
+ "FixedRatePrice",
16
+ "UsageBasedRate",
17
+ "UsageBasedRateSimpleUsageBasedRateInterface",
18
+ "UsageBasedRateSimpleUsageBasedRateInterfacePrice",
19
+ "UsageBasedRateDimensionalUsageBasedRateInterface",
20
+ "UsageBasedRateDimensionalUsageBasedRateInterfaceDimension",
21
+ "UsageBasedRateDimensionalUsageBasedRateInterfacePricingMatrix",
22
+ "UsageBasedRateDimensionalUsageBasedRateInterfacePricingMatrixCell",
23
+ "UsageBasedRateDimensionalUsageBasedRateInterfacePricingMatrixCellPrice",
24
+ ]
25
+
26
+ FixedRatePrice: TypeAlias = Annotated[
27
+ Union[FlatPriceOutput, PackagePriceOutput], PropertyInfo(discriminator="price_type")
28
+ ]
29
+
30
+
31
+ class FixedRate(BaseModel):
32
+ id: str
33
+
34
+ description: Optional[str] = None
35
+
36
+ name: str
37
+
38
+ price: FixedRatePrice
39
+ """Flat price is a price that linearly scales with the quantity."""
40
+
41
+
42
+ UsageBasedRateSimpleUsageBasedRateInterfacePrice: TypeAlias = Annotated[
43
+ Union[FlatPriceOutput, PackagePriceOutput], PropertyInfo(discriminator="price_type")
44
+ ]
45
+
46
+
47
+ class UsageBasedRateSimpleUsageBasedRateInterface(BaseModel):
48
+ id: str
49
+
50
+ description: Optional[str] = None
51
+
52
+ included_units: int
53
+
54
+ name: str
55
+
56
+ price: UsageBasedRateSimpleUsageBasedRateInterfacePrice
57
+ """Flat price is a price that linearly scales with the quantity."""
58
+
59
+ pricing_metric_id: str
60
+
61
+ usage_based_rate_type: Optional[Literal["simple"]] = None
62
+
63
+
64
+ class UsageBasedRateDimensionalUsageBasedRateInterfaceDimension(BaseModel):
65
+ description: Optional[str] = None
66
+
67
+ key: str
68
+
69
+ values: List[str]
70
+
71
+
72
+ UsageBasedRateDimensionalUsageBasedRateInterfacePricingMatrixCellPrice: TypeAlias = Annotated[
73
+ Union[FlatPriceOutput, PackagePriceOutput], PropertyInfo(discriminator="price_type")
74
+ ]
75
+
76
+
77
+ class UsageBasedRateDimensionalUsageBasedRateInterfacePricingMatrixCell(BaseModel):
78
+ dimension_coordinates: Dict[str, str]
79
+
80
+ price: UsageBasedRateDimensionalUsageBasedRateInterfacePricingMatrixCellPrice
81
+ """Flat price is a price that linearly scales with the quantity."""
82
+
83
+
84
+ class UsageBasedRateDimensionalUsageBasedRateInterfacePricingMatrix(BaseModel):
85
+ cells: List[UsageBasedRateDimensionalUsageBasedRateInterfacePricingMatrixCell]
86
+
87
+
88
+ class UsageBasedRateDimensionalUsageBasedRateInterface(BaseModel):
89
+ id: str
90
+
91
+ description: Optional[str] = None
92
+
93
+ dimensions: List[UsageBasedRateDimensionalUsageBasedRateInterfaceDimension]
94
+
95
+ included_units: int
96
+
97
+ name: str
98
+
99
+ pricing_matrix: UsageBasedRateDimensionalUsageBasedRateInterfacePricingMatrix
100
+
101
+ pricing_metric_id: str
102
+
103
+ usage_based_rate_type: Optional[Literal["dimensional"]] = None
104
+
105
+
106
+ UsageBasedRate: TypeAlias = Annotated[
107
+ Union[UsageBasedRateSimpleUsageBasedRateInterface, UsageBasedRateDimensionalUsageBasedRateInterface],
108
+ PropertyInfo(discriminator="usage_based_rate_type"),
109
+ ]
110
+
111
+
112
+ class RateCardResource(BaseModel):
113
+ id: str
114
+ """The ID of the rate card."""
115
+
116
+ billing_interval: Literal["monthly", "yearly"]
117
+ """How often the customer will be billed for this rate card."""
118
+
119
+ created_at: datetime
120
+ """The date and time the rate card was created."""
121
+
122
+ fixed_rates: List[FixedRate]
123
+ """The fixed rates of the rate card."""
124
+
125
+ metadata: Dict[str, str]
126
+ """Additional metadata about the rate card.
127
+
128
+ You may use this to store any custom data about the rate card.
129
+ """
130
+
131
+ name: str
132
+ """The name of the rate card."""
133
+
134
+ updated_at: datetime
135
+ """The date and time the rate card was last updated."""
136
+
137
+ usage_based_rates: List[UsageBasedRate]
138
+ """The usage based rates of the rate card."""
139
+
140
+ description: Optional[str] = None
141
+ """The description of the rate card."""
@@ -0,0 +1,29 @@
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, Optional
6
+ from typing_extensions import TypedDict
7
+
8
+ __all__ = ["SubjectCreateParams"]
9
+
10
+
11
+ class SubjectCreateParams(TypedDict, total=False):
12
+ email: Optional[str]
13
+ """The email of the subject. Must be a valid email address."""
14
+
15
+ external_id: Optional[str]
16
+ """The ID of the subject in your system.
17
+
18
+ If provided, you may use pass it to the API in place of the subject ID. Must be
19
+ unique.
20
+ """
21
+
22
+ metadata: Dict[str, str]
23
+ """Additional metadata about the subject.
24
+
25
+ You may use this to store any custom data about the subject.
26
+ """
27
+
28
+ name: Optional[str]
29
+ """The name of the subject. Used for display in the dashboard."""
@@ -0,0 +1,34 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, Optional
4
+ from datetime import datetime
5
+
6
+ from .._models import BaseModel
7
+
8
+ __all__ = ["SubjectCreateResponse"]
9
+
10
+
11
+ class SubjectCreateResponse(BaseModel):
12
+ id: str
13
+ """The ID of the subject."""
14
+
15
+ created_at: datetime
16
+ """The date and time the subject was created."""
17
+
18
+ email: Optional[str] = None
19
+ """The email of the subject."""
20
+
21
+ external_id: Optional[str] = None
22
+ """The ID of the subject in your system.
23
+
24
+ You may pass it to the API in place of the subject ID.
25
+ """
26
+
27
+ metadata: Dict[str, str]
28
+ """Additional metadata about the subject.
29
+
30
+ You may use this to store any custom data about the subject.
31
+ """
32
+
33
+ name: Optional[str] = None
34
+ """The name of the subject. Used for display in the dashboard."""
@@ -0,0 +1,13 @@
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 TypedDict
6
+
7
+ __all__ = ["SubjectListParams"]
8
+
9
+
10
+ class SubjectListParams(TypedDict, total=False):
11
+ limit: int
12
+
13
+ offset: int
@@ -0,0 +1,14 @@
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
+ from .subject_resource import SubjectResource
7
+
8
+ __all__ = ["SubjectListResponse"]
9
+
10
+
11
+ class SubjectListResponse(BaseModel):
12
+ has_more: bool
13
+
14
+ subjects: List[SubjectResource]