lark-billing 0.0.6__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.

Files changed (167) hide show
  1. lark_billing-0.0.6/PKG-INFO +188 -0
  2. lark_billing-0.0.6/README.md +161 -0
  3. lark_billing-0.0.6/pyproject.toml +84 -0
  4. lark_billing-0.0.6/src/lark/__init__.py +522 -0
  5. lark_billing-0.0.6/src/lark/checkout/__init__.py +4 -0
  6. lark_billing-0.0.6/src/lark/checkout/client.py +214 -0
  7. lark_billing-0.0.6/src/lark/checkout/raw_client.py +252 -0
  8. lark_billing-0.0.6/src/lark/client.py +240 -0
  9. lark_billing-0.0.6/src/lark/core/__init__.py +105 -0
  10. lark_billing-0.0.6/src/lark/core/api_error.py +23 -0
  11. lark_billing-0.0.6/src/lark/core/client_wrapper.py +79 -0
  12. lark_billing-0.0.6/src/lark/core/datetime_utils.py +28 -0
  13. lark_billing-0.0.6/src/lark/core/file.py +67 -0
  14. lark_billing-0.0.6/src/lark/core/force_multipart.py +18 -0
  15. lark_billing-0.0.6/src/lark/core/http_client.py +543 -0
  16. lark_billing-0.0.6/src/lark/core/http_response.py +55 -0
  17. lark_billing-0.0.6/src/lark/core/jsonable_encoder.py +100 -0
  18. lark_billing-0.0.6/src/lark/core/pydantic_utilities.py +258 -0
  19. lark_billing-0.0.6/src/lark/core/query_encoder.py +58 -0
  20. lark_billing-0.0.6/src/lark/core/remove_none_from_dict.py +11 -0
  21. lark_billing-0.0.6/src/lark/core/request_options.py +35 -0
  22. lark_billing-0.0.6/src/lark/core/serialization.py +276 -0
  23. lark_billing-0.0.6/src/lark/errors/__init__.py +34 -0
  24. lark_billing-0.0.6/src/lark/errors/unprocessable_entity_error.py +11 -0
  25. lark_billing-0.0.6/src/lark/feature_access/__init__.py +4 -0
  26. lark_billing-0.0.6/src/lark/feature_access/client.py +102 -0
  27. lark_billing-0.0.6/src/lark/feature_access/raw_client.py +113 -0
  28. lark_billing-0.0.6/src/lark/py.typed +0 -0
  29. lark_billing-0.0.6/src/lark/rate_cards/__init__.py +61 -0
  30. lark_billing-0.0.6/src/lark/rate_cards/client.py +817 -0
  31. lark_billing-0.0.6/src/lark/rate_cards/raw_client.py +728 -0
  32. lark_billing-0.0.6/src/lark/rate_cards/types/__init__.py +63 -0
  33. lark_billing-0.0.6/src/lark/rate_cards/types/create_rate_card_request_billing_interval.py +5 -0
  34. lark_billing-0.0.6/src/lark/rate_cards/types/create_rate_card_request_usage_based_rates_item.py +56 -0
  35. lark_billing-0.0.6/src/lark/rate_cards/types/create_rate_card_version_request_usage_based_rates_item.py +58 -0
  36. lark_billing-0.0.6/src/lark/rate_cards/types/create_rate_card_version_request_version_type.py +5 -0
  37. lark_billing-0.0.6/src/lark/subjects/__init__.py +4 -0
  38. lark_billing-0.0.6/src/lark/subjects/client.py +501 -0
  39. lark_billing-0.0.6/src/lark/subjects/raw_client.py +633 -0
  40. lark_billing-0.0.6/src/lark/subscriptions/__init__.py +4 -0
  41. lark_billing-0.0.6/src/lark/subscriptions/client.py +462 -0
  42. lark_billing-0.0.6/src/lark/subscriptions/raw_client.py +495 -0
  43. lark_billing-0.0.6/src/lark/types/__init__.py +493 -0
  44. lark_billing-0.0.6/src/lark/types/aggregation.py +80 -0
  45. lark_billing-0.0.6/src/lark/types/amount.py +20 -0
  46. lark_billing-0.0.6/src/lark/types/check_feature_access_request.py +24 -0
  47. lark_billing-0.0.6/src/lark/types/check_feature_access_response.py +21 -0
  48. lark_billing-0.0.6/src/lark/types/complete_subscription_checkout_response.py +21 -0
  49. lark_billing-0.0.6/src/lark/types/count_aggregation_pricing_metric_interface.py +17 -0
  50. lark_billing-0.0.6/src/lark/types/create_credit_grant_interface.py +27 -0
  51. lark_billing-0.0.6/src/lark/types/create_credit_grant_interface_expiration.py +27 -0
  52. lark_billing-0.0.6/src/lark/types/create_credit_pool_request.py +5 -0
  53. lark_billing-0.0.6/src/lark/types/create_dimension_coordinate_interface.py +20 -0
  54. lark_billing-0.0.6/src/lark/types/create_dimension_interface.py +20 -0
  55. lark_billing-0.0.6/src/lark/types/create_dimensional_usage_based_rate_interface.py +32 -0
  56. lark_billing-0.0.6/src/lark/types/create_fixed_rate_interface.py +28 -0
  57. lark_billing-0.0.6/src/lark/types/create_pricing_matrix_cell_interface.py +22 -0
  58. lark_billing-0.0.6/src/lark/types/create_pricing_matrix_interface.py +20 -0
  59. lark_billing-0.0.6/src/lark/types/create_pricing_metric_interface.py +26 -0
  60. lark_billing-0.0.6/src/lark/types/create_pricing_plan_request.py +5 -0
  61. lark_billing-0.0.6/src/lark/types/create_rate_card_response.py +36 -0
  62. lark_billing-0.0.6/src/lark/types/create_rate_card_response_billing_interval.py +5 -0
  63. lark_billing-0.0.6/src/lark/types/create_rate_card_response_usage_based_rates_item.py +58 -0
  64. lark_billing-0.0.6/src/lark/types/create_rate_card_version_response.py +36 -0
  65. lark_billing-0.0.6/src/lark/types/create_rate_card_version_response_billing_interval.py +5 -0
  66. lark_billing-0.0.6/src/lark/types/create_rate_card_version_response_usage_based_rates_item.py +59 -0
  67. lark_billing-0.0.6/src/lark/types/create_simple_usage_based_rate_interface.py +30 -0
  68. lark_billing-0.0.6/src/lark/types/create_subject_response.py +24 -0
  69. lark_billing-0.0.6/src/lark/types/create_subscription_checkout_session_response.py +23 -0
  70. lark_billing-0.0.6/src/lark/types/create_usage_event_summary_response.py +23 -0
  71. lark_billing-0.0.6/src/lark/types/credit_grant.py +5 -0
  72. lark_billing-0.0.6/src/lark/types/credit_grant_date_time_expiration_interface.py +19 -0
  73. lark_billing-0.0.6/src/lark/types/credit_grant_date_time_expiration_resource.py +19 -0
  74. lark_billing-0.0.6/src/lark/types/credit_grant_duration_expiration_interface.py +21 -0
  75. lark_billing-0.0.6/src/lark/types/credit_grant_duration_expiration_resource.py +21 -0
  76. lark_billing-0.0.6/src/lark/types/credit_grant_interface.py +28 -0
  77. lark_billing-0.0.6/src/lark/types/credit_grant_interface_input_expiration.py +27 -0
  78. lark_billing-0.0.6/src/lark/types/credit_grant_interface_output_expiration.py +43 -0
  79. lark_billing-0.0.6/src/lark/types/credit_grant_interface_output_schedule.py +41 -0
  80. lark_billing-0.0.6/src/lark/types/credit_grant_resource.py +28 -0
  81. lark_billing-0.0.6/src/lark/types/credit_grant_resource_input_expiration.py +27 -0
  82. lark_billing-0.0.6/src/lark/types/credit_grant_resource_input_schedule.py +39 -0
  83. lark_billing-0.0.6/src/lark/types/credit_grant_resource_output_expiration.py +43 -0
  84. lark_billing-0.0.6/src/lark/types/credit_grant_resource_output_schedule.py +39 -0
  85. lark_billing-0.0.6/src/lark/types/credit_grant_schedule.py +5 -0
  86. lark_billing-0.0.6/src/lark/types/credit_grant_schedule_one_time_interface.py +19 -0
  87. lark_billing-0.0.6/src/lark/types/credit_grant_schedule_one_time_resource.py +17 -0
  88. lark_billing-0.0.6/src/lark/types/credit_grant_schedule_rate_cycle_start_interface.py +19 -0
  89. lark_billing-0.0.6/src/lark/types/credit_grant_schedule_rate_cycle_start_resource.py +17 -0
  90. lark_billing-0.0.6/src/lark/types/credit_grant_subject_granting_config_interface.py +20 -0
  91. lark_billing-0.0.6/src/lark/types/credit_pool.py +5 -0
  92. lark_billing-0.0.6/src/lark/types/credit_pool_rollover_config.py +5 -0
  93. lark_billing-0.0.6/src/lark/types/custom_aggregation_pricing_metric_interface.py +22 -0
  94. lark_billing-0.0.6/src/lark/types/custom_pricing_metric.py +5 -0
  95. lark_billing-0.0.6/src/lark/types/custom_unit.py +5 -0
  96. lark_billing-0.0.6/src/lark/types/custom_unit_amount.py +5 -0
  97. lark_billing-0.0.6/src/lark/types/dimension.py +5 -0
  98. lark_billing-0.0.6/src/lark/types/dimension_coordinate.py +5 -0
  99. lark_billing-0.0.6/src/lark/types/dimension_coordinate_interface.py +20 -0
  100. lark_billing-0.0.6/src/lark/types/dimension_coordinate_set.py +5 -0
  101. lark_billing-0.0.6/src/lark/types/dimension_interface.py +20 -0
  102. lark_billing-0.0.6/src/lark/types/dimensional_rate_matrix.py +5 -0
  103. lark_billing-0.0.6/src/lark/types/dimensional_rate_matrix_cell.py +5 -0
  104. lark_billing-0.0.6/src/lark/types/dimensional_usage_based_rate.py +5 -0
  105. lark_billing-0.0.6/src/lark/types/dimensional_usage_based_rate_input.py +5 -0
  106. lark_billing-0.0.6/src/lark/types/dimensional_usage_based_rate_interface.py +33 -0
  107. lark_billing-0.0.6/src/lark/types/feature_access_resource.py +21 -0
  108. lark_billing-0.0.6/src/lark/types/fixed_rate_interface.py +29 -0
  109. lark_billing-0.0.6/src/lark/types/flat_price.py +24 -0
  110. lark_billing-0.0.6/src/lark/types/get_rate_card_response.py +36 -0
  111. lark_billing-0.0.6/src/lark/types/get_rate_card_response_billing_interval.py +5 -0
  112. lark_billing-0.0.6/src/lark/types/get_rate_card_response_usage_based_rates_item.py +58 -0
  113. lark_billing-0.0.6/src/lark/types/grant_credits_request.py +5 -0
  114. lark_billing-0.0.6/src/lark/types/http_validation_error.py +20 -0
  115. lark_billing-0.0.6/src/lark/types/last_aggregation_pricing_metric_interface.py +22 -0
  116. lark_billing-0.0.6/src/lark/types/license_based_rate.py +5 -0
  117. lark_billing-0.0.6/src/lark/types/license_based_rate_input.py +5 -0
  118. lark_billing-0.0.6/src/lark/types/list_rate_cards_response.py +21 -0
  119. lark_billing-0.0.6/src/lark/types/list_subjects_response.py +21 -0
  120. lark_billing-0.0.6/src/lark/types/list_subscriptions_response.py +21 -0
  121. lark_billing-0.0.6/src/lark/types/max_aggregation_pricing_metric_interface.py +22 -0
  122. lark_billing-0.0.6/src/lark/types/monetary_amount.py +5 -0
  123. lark_billing-0.0.6/src/lark/types/package_price.py +27 -0
  124. lark_billing-0.0.6/src/lark/types/package_price_rounding_behavior.py +5 -0
  125. lark_billing-0.0.6/src/lark/types/package_price_wrapper.py +5 -0
  126. lark_billing-0.0.6/src/lark/types/period.py +22 -0
  127. lark_billing-0.0.6/src/lark/types/price.py +5 -0
  128. lark_billing-0.0.6/src/lark/types/pricing_matrix_cell_interface.py +22 -0
  129. lark_billing-0.0.6/src/lark/types/pricing_matrix_interface.py +20 -0
  130. lark_billing-0.0.6/src/lark/types/pricing_metric.py +5 -0
  131. lark_billing-0.0.6/src/lark/types/pricing_metric_interface.py +27 -0
  132. lark_billing-0.0.6/src/lark/types/pricing_plan.py +5 -0
  133. lark_billing-0.0.6/src/lark/types/pricing_plan_subscription.py +5 -0
  134. lark_billing-0.0.6/src/lark/types/pricing_tier.py +5 -0
  135. lark_billing-0.0.6/src/lark/types/rate_card.py +5 -0
  136. lark_billing-0.0.6/src/lark/types/rate_card_resource.py +36 -0
  137. lark_billing-0.0.6/src/lark/types/rate_card_resource_billing_interval.py +5 -0
  138. lark_billing-0.0.6/src/lark/types/rate_card_resource_usage_based_rates_item.py +58 -0
  139. lark_billing-0.0.6/src/lark/types/rate_card_version.py +5 -0
  140. lark_billing-0.0.6/src/lark/types/rate_card_version_input.py +5 -0
  141. lark_billing-0.0.6/src/lark/types/simple_usage_based_rate.py +5 -0
  142. lark_billing-0.0.6/src/lark/types/simple_usage_based_rate_input.py +5 -0
  143. lark_billing-0.0.6/src/lark/types/simple_usage_based_rate_interface.py +31 -0
  144. lark_billing-0.0.6/src/lark/types/status.py +5 -0
  145. lark_billing-0.0.6/src/lark/types/subject.py +5 -0
  146. lark_billing-0.0.6/src/lark/types/subject_granting_config.py +5 -0
  147. lark_billing-0.0.6/src/lark/types/subject_granting_config_resource.py +20 -0
  148. lark_billing-0.0.6/src/lark/types/subject_resource.py +24 -0
  149. lark_billing-0.0.6/src/lark/types/subscription_resource.py +28 -0
  150. lark_billing-0.0.6/src/lark/types/sum_aggregation_pricing_metric_interface.py +22 -0
  151. lark_billing-0.0.6/src/lark/types/tiered_price.py +5 -0
  152. lark_billing-0.0.6/src/lark/types/tiered_price_wrapper.py +5 -0
  153. lark_billing-0.0.6/src/lark/types/unit.py +5 -0
  154. lark_billing-0.0.6/src/lark/types/update_pricing_plan_request.py +5 -0
  155. lark_billing-0.0.6/src/lark/types/update_rate_card_request.py +5 -0
  156. lark_billing-0.0.6/src/lark/types/update_subscription_request.py +5 -0
  157. lark_billing-0.0.6/src/lark/types/usage_based_rate.py +5 -0
  158. lark_billing-0.0.6/src/lark/types/usage_based_rate_input.py +5 -0
  159. lark_billing-0.0.6/src/lark/types/usage_unit.py +5 -0
  160. lark_billing-0.0.6/src/lark/types/validation_error.py +22 -0
  161. lark_billing-0.0.6/src/lark/types/validation_error_loc_item.py +5 -0
  162. lark_billing-0.0.6/src/lark/usage_events/__init__.py +34 -0
  163. lark_billing-0.0.6/src/lark/usage_events/client.py +293 -0
  164. lark_billing-0.0.6/src/lark/usage_events/raw_client.py +318 -0
  165. lark_billing-0.0.6/src/lark/usage_events/types/__init__.py +36 -0
  166. lark_billing-0.0.6/src/lark/usage_events/types/create_usage_event_summary_request_aggregation_type.py +5 -0
  167. lark_billing-0.0.6/src/lark/version.py +3 -0
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.1
2
+ Name: lark-billing
3
+ Version: 0.0.6
4
+ Summary:
5
+ Requires-Python: >=3.8,<4.0
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: httpx (>=0.21.2)
22
+ Requires-Dist: pydantic (>=1.9.2)
23
+ Requires-Dist: pydantic-core (>=2.18.2)
24
+ Requires-Dist: typing_extensions (>=4.0.0)
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Lark Python Library
28
+
29
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Ffern-demo%2Flark-python-sdk)
30
+ [![pypi](https://img.shields.io/pypi/v/lark-billing)](https://pypi.python.org/pypi/lark-billing)
31
+
32
+ The Lark Python library provides convenient access to the Lark APIs from Python.
33
+
34
+ ## Installation
35
+
36
+ ```sh
37
+ pip install lark-billing
38
+ ```
39
+
40
+ ## Reference
41
+
42
+ A full reference for this library is available [here](https://github.com/fern-demo/lark-python-sdk/blob/HEAD/./reference.md).
43
+
44
+ ## Usage
45
+
46
+ Instantiate and use the client with the following:
47
+
48
+ ```python
49
+ from lark import Lark
50
+
51
+ client = Lark(
52
+ api_key="YOUR_API_KEY",
53
+ base_url="https://yourhost.com/path/to/api",
54
+ )
55
+ client.checkout.create_subscription_checkout_session(
56
+ subject_id="subject_id",
57
+ rate_card_id="rate_card_id",
58
+ )
59
+ ```
60
+
61
+ ## Async Client
62
+
63
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
64
+
65
+ ```python
66
+ import asyncio
67
+
68
+ from lark import AsyncLark
69
+
70
+ client = AsyncLark(
71
+ api_key="YOUR_API_KEY",
72
+ base_url="https://yourhost.com/path/to/api",
73
+ )
74
+
75
+
76
+ async def main() -> None:
77
+ await client.checkout.create_subscription_checkout_session(
78
+ subject_id="subject_id",
79
+ rate_card_id="rate_card_id",
80
+ )
81
+
82
+
83
+ asyncio.run(main())
84
+ ```
85
+
86
+ ## Exception Handling
87
+
88
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
89
+ will be thrown.
90
+
91
+ ```python
92
+ from lark.core.api_error import ApiError
93
+
94
+ try:
95
+ client.checkout.create_subscription_checkout_session(...)
96
+ except ApiError as e:
97
+ print(e.status_code)
98
+ print(e.body)
99
+ ```
100
+
101
+ ## Advanced
102
+
103
+ ### Access Raw Response Data
104
+
105
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
106
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
107
+
108
+ ```python
109
+ from lark import Lark
110
+
111
+ client = Lark(
112
+ ...,
113
+ )
114
+ response = (
115
+ client.checkout.with_raw_response.create_subscription_checkout_session(...)
116
+ )
117
+ print(response.headers) # access the response headers
118
+ print(response.data) # access the underlying object
119
+ ```
120
+
121
+ ### Retries
122
+
123
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
124
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
125
+ retry limit (default: 2).
126
+
127
+ A request is deemed retryable when any of the following HTTP status codes is returned:
128
+
129
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
130
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
131
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
132
+
133
+ Use the `max_retries` request option to configure this behavior.
134
+
135
+ ```python
136
+ client.checkout.create_subscription_checkout_session(..., request_options={
137
+ "max_retries": 1
138
+ })
139
+ ```
140
+
141
+ ### Timeouts
142
+
143
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
144
+
145
+ ```python
146
+
147
+ from lark import Lark
148
+
149
+ client = Lark(
150
+ ...,
151
+ timeout=20.0,
152
+ )
153
+
154
+
155
+ # Override timeout for a specific method
156
+ client.checkout.create_subscription_checkout_session(..., request_options={
157
+ "timeout_in_seconds": 1
158
+ })
159
+ ```
160
+
161
+ ### Custom Client
162
+
163
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
164
+ and transports.
165
+
166
+ ```python
167
+ import httpx
168
+ from lark import Lark
169
+
170
+ client = Lark(
171
+ ...,
172
+ httpx_client=httpx.Client(
173
+ proxy="http://my.test.proxy.example.com",
174
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
175
+ ),
176
+ )
177
+ ```
178
+
179
+ ## Contributing
180
+
181
+ While we value open-source contributions to this SDK, this library is generated programmatically.
182
+ Additions made directly to this library would have to be moved over to our generation code,
183
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
184
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
185
+ an issue first to discuss with us!
186
+
187
+ On the other hand, contributions to the README are always very welcome!
188
+
@@ -0,0 +1,161 @@
1
+ # Lark Python Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Ffern-demo%2Flark-python-sdk)
4
+ [![pypi](https://img.shields.io/pypi/v/lark-billing)](https://pypi.python.org/pypi/lark-billing)
5
+
6
+ The Lark Python library provides convenient access to the Lark APIs from Python.
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ pip install lark-billing
12
+ ```
13
+
14
+ ## Reference
15
+
16
+ A full reference for this library is available [here](https://github.com/fern-demo/lark-python-sdk/blob/HEAD/./reference.md).
17
+
18
+ ## Usage
19
+
20
+ Instantiate and use the client with the following:
21
+
22
+ ```python
23
+ from lark import Lark
24
+
25
+ client = Lark(
26
+ api_key="YOUR_API_KEY",
27
+ base_url="https://yourhost.com/path/to/api",
28
+ )
29
+ client.checkout.create_subscription_checkout_session(
30
+ subject_id="subject_id",
31
+ rate_card_id="rate_card_id",
32
+ )
33
+ ```
34
+
35
+ ## Async Client
36
+
37
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
38
+
39
+ ```python
40
+ import asyncio
41
+
42
+ from lark import AsyncLark
43
+
44
+ client = AsyncLark(
45
+ api_key="YOUR_API_KEY",
46
+ base_url="https://yourhost.com/path/to/api",
47
+ )
48
+
49
+
50
+ async def main() -> None:
51
+ await client.checkout.create_subscription_checkout_session(
52
+ subject_id="subject_id",
53
+ rate_card_id="rate_card_id",
54
+ )
55
+
56
+
57
+ asyncio.run(main())
58
+ ```
59
+
60
+ ## Exception Handling
61
+
62
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
63
+ will be thrown.
64
+
65
+ ```python
66
+ from lark.core.api_error import ApiError
67
+
68
+ try:
69
+ client.checkout.create_subscription_checkout_session(...)
70
+ except ApiError as e:
71
+ print(e.status_code)
72
+ print(e.body)
73
+ ```
74
+
75
+ ## Advanced
76
+
77
+ ### Access Raw Response Data
78
+
79
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
80
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
81
+
82
+ ```python
83
+ from lark import Lark
84
+
85
+ client = Lark(
86
+ ...,
87
+ )
88
+ response = (
89
+ client.checkout.with_raw_response.create_subscription_checkout_session(...)
90
+ )
91
+ print(response.headers) # access the response headers
92
+ print(response.data) # access the underlying object
93
+ ```
94
+
95
+ ### Retries
96
+
97
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
98
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
99
+ retry limit (default: 2).
100
+
101
+ A request is deemed retryable when any of the following HTTP status codes is returned:
102
+
103
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
104
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
105
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
106
+
107
+ Use the `max_retries` request option to configure this behavior.
108
+
109
+ ```python
110
+ client.checkout.create_subscription_checkout_session(..., request_options={
111
+ "max_retries": 1
112
+ })
113
+ ```
114
+
115
+ ### Timeouts
116
+
117
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
118
+
119
+ ```python
120
+
121
+ from lark import Lark
122
+
123
+ client = Lark(
124
+ ...,
125
+ timeout=20.0,
126
+ )
127
+
128
+
129
+ # Override timeout for a specific method
130
+ client.checkout.create_subscription_checkout_session(..., request_options={
131
+ "timeout_in_seconds": 1
132
+ })
133
+ ```
134
+
135
+ ### Custom Client
136
+
137
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
138
+ and transports.
139
+
140
+ ```python
141
+ import httpx
142
+ from lark import Lark
143
+
144
+ client = Lark(
145
+ ...,
146
+ httpx_client=httpx.Client(
147
+ proxy="http://my.test.proxy.example.com",
148
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
149
+ ),
150
+ )
151
+ ```
152
+
153
+ ## Contributing
154
+
155
+ While we value open-source contributions to this SDK, this library is generated programmatically.
156
+ Additions made directly to this library would have to be moved over to our generation code,
157
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
158
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
159
+ an issue first to discuss with us!
160
+
161
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,84 @@
1
+ [project]
2
+ name = "lark-billing"
3
+
4
+ [tool.poetry]
5
+ name = "lark-billing"
6
+ version = "0.0.6"
7
+ description = ""
8
+ readme = "README.md"
9
+ authors = []
10
+ keywords = []
11
+
12
+ classifiers = [
13
+ "Intended Audience :: Developers",
14
+ "Programming Language :: Python",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.8",
17
+ "Programming Language :: Python :: 3.9",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Operating System :: OS Independent",
22
+ "Operating System :: POSIX",
23
+ "Operating System :: MacOS",
24
+ "Operating System :: POSIX :: Linux",
25
+ "Operating System :: Microsoft :: Windows",
26
+ "Topic :: Software Development :: Libraries :: Python Modules",
27
+ "Typing :: Typed"
28
+ ]
29
+ packages = [
30
+ { include = "lark", from = "src"}
31
+ ]
32
+
33
+ [project.urls]
34
+ Repository = 'https://github.com/fern-demo/lark-python-sdk'
35
+
36
+ [tool.poetry.dependencies]
37
+ python = "^3.8"
38
+ httpx = ">=0.21.2"
39
+ pydantic = ">= 1.9.2"
40
+ pydantic-core = ">=2.18.2"
41
+ typing_extensions = ">= 4.0.0"
42
+
43
+ [tool.poetry.group.dev.dependencies]
44
+ mypy = "==1.13.0"
45
+ pytest = "^7.4.0"
46
+ pytest-asyncio = "^0.23.5"
47
+ python-dateutil = "^2.9.0"
48
+ types-python-dateutil = "^2.9.0.20240316"
49
+ ruff = "==0.11.5"
50
+
51
+ [tool.pytest.ini_options]
52
+ testpaths = [ "tests" ]
53
+ asyncio_mode = "auto"
54
+
55
+ [tool.mypy]
56
+ plugins = ["pydantic.mypy"]
57
+
58
+ [tool.ruff]
59
+ line-length = 120
60
+
61
+ [tool.ruff.lint]
62
+ select = [
63
+ "E", # pycodestyle errors
64
+ "F", # pyflakes
65
+ "I", # isort
66
+ ]
67
+ ignore = [
68
+ "E402", # Module level import not at top of file
69
+ "E501", # Line too long
70
+ "E711", # Comparison to `None` should be `cond is not None`
71
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
72
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
73
+ "E722", # Do not use bare `except`
74
+ "E731", # Do not assign a `lambda` expression, use a `def`
75
+ "F821", # Undefined name
76
+ "F841" # Local variable ... is assigned to but never used
77
+ ]
78
+
79
+ [tool.ruff.lint.isort]
80
+ section-order = ["future", "standard-library", "third-party", "first-party"]
81
+
82
+ [build-system]
83
+ requires = ["poetry-core"]
84
+ build-backend = "poetry.core.masonry.api"