lark-billing 0.0.6__py3-none-any.whl → 0.0.7__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.

Files changed (141) hide show
  1. lark/__init__.py +69 -360
  2. lark/checkout/client.py +8 -85
  3. lark/checkout/raw_client.py +6 -102
  4. lark/client.py +93 -27
  5. lark/core/client_wrapper.py +2 -2
  6. lark/{feature_access → customer_access}/client.py +30 -24
  7. lark/{feature_access → customer_access}/raw_client.py +22 -17
  8. lark/{types/rate_card.py → customer_portal/__init__.py} +1 -2
  9. lark/customer_portal/client.py +115 -0
  10. lark/customer_portal/raw_client.py +134 -0
  11. lark/environment.py +7 -0
  12. lark/pricing_metrics/__init__.py +38 -0
  13. lark/pricing_metrics/client.py +219 -0
  14. lark/pricing_metrics/raw_client.py +268 -0
  15. lark/pricing_metrics/types/__init__.py +42 -0
  16. lark/{types/credit_grant_resource_input_schedule.py → pricing_metrics/types/pricing_metric_aggregation.py} +7 -8
  17. lark/rate_cards/__init__.py +3 -30
  18. lark/rate_cards/client.py +28 -540
  19. lark/rate_cards/raw_client.py +32 -368
  20. lark/rate_cards/types/__init__.py +2 -29
  21. lark/subjects/client.py +2 -36
  22. lark/subjects/raw_client.py +0 -16
  23. lark/subscriptions/client.py +24 -184
  24. lark/subscriptions/raw_client.py +18 -135
  25. lark/types/__init__.py +41 -356
  26. lark/types/amount.py +5 -1
  27. lark/types/{create_dimension_coordinate_interface.py → billing_state_response.py} +3 -3
  28. lark/types/{credit_grant_schedule_one_time_resource.py → count_aggregation_pricing_metric_resource.py} +1 -1
  29. lark/types/{create_dimension_interface.py → create_customer_portal_session_response.py} +3 -3
  30. lark/types/create_fixed_rate_interface.py +1 -7
  31. lark/types/{pricing_metric_interface.py → create_pricing_metric_response.py} +2 -5
  32. lark/types/create_simple_usage_based_rate_interface.py +3 -8
  33. lark/types/create_subject_response.py +2 -1
  34. lark/types/create_subscription_checkout_session_response.py +1 -2
  35. lark/types/create_usage_event_summary_response.py +1 -1
  36. lark/types/{credit_grant_schedule_rate_cycle_start_resource.py → custom_pricing_metric_resource.py} +3 -1
  37. lark/types/fixed_rate_interface.py +0 -6
  38. lark/types/{create_pricing_metric_interface.py → get_pricing_metric_response.py} +3 -5
  39. lark/types/{credit_grant_schedule_one_time_interface.py → last_aggregation_pricing_metric_resource.py} +2 -2
  40. lark/types/{credit_grant_date_time_expiration_resource.py → max_aggregation_pricing_metric_resource.py} +2 -2
  41. lark/types/package_price.py +2 -2
  42. lark/types/package_price_input_rounding_behavior.py +5 -0
  43. lark/types/package_price_output_rounding_behavior.py +5 -0
  44. lark/types/price.py +39 -1
  45. lark/types/rate_card_resource.py +0 -6
  46. lark/types/rate_card_resource_usage_based_rates_item.py +2 -28
  47. lark/types/simple_usage_based_rate_interface.py +1 -2
  48. lark/types/status.py +1 -1
  49. lark/types/subject_resource.py +2 -1
  50. lark/types/subscription_resource.py +0 -1
  51. lark/types/{credit_grant_date_time_expiration_interface.py → sum_aggregation_pricing_metric_resource.py} +2 -2
  52. lark/types/{subject.py → value.py} +1 -1
  53. lark/usage_events/client.py +8 -21
  54. lark/usage_events/raw_client.py +6 -6
  55. {lark_billing-0.0.6.dist-info → lark_billing-0.0.7.dist-info}/METADATA +3 -3
  56. lark_billing-0.0.7.dist-info/RECORD +94 -0
  57. lark/rate_cards/types/create_rate_card_request_usage_based_rates_item.py +0 -56
  58. lark/rate_cards/types/create_rate_card_version_request_usage_based_rates_item.py +0 -58
  59. lark/rate_cards/types/create_rate_card_version_request_version_type.py +0 -5
  60. lark/types/check_feature_access_request.py +0 -24
  61. lark/types/check_feature_access_response.py +0 -21
  62. lark/types/complete_subscription_checkout_response.py +0 -21
  63. lark/types/create_credit_grant_interface.py +0 -27
  64. lark/types/create_credit_grant_interface_expiration.py +0 -27
  65. lark/types/create_credit_pool_request.py +0 -5
  66. lark/types/create_dimensional_usage_based_rate_interface.py +0 -32
  67. lark/types/create_pricing_matrix_cell_interface.py +0 -22
  68. lark/types/create_pricing_matrix_interface.py +0 -20
  69. lark/types/create_pricing_plan_request.py +0 -5
  70. lark/types/create_rate_card_response.py +0 -36
  71. lark/types/create_rate_card_response_billing_interval.py +0 -5
  72. lark/types/create_rate_card_response_usage_based_rates_item.py +0 -58
  73. lark/types/create_rate_card_version_response.py +0 -36
  74. lark/types/create_rate_card_version_response_billing_interval.py +0 -5
  75. lark/types/create_rate_card_version_response_usage_based_rates_item.py +0 -59
  76. lark/types/credit_grant.py +0 -5
  77. lark/types/credit_grant_duration_expiration_interface.py +0 -21
  78. lark/types/credit_grant_duration_expiration_resource.py +0 -21
  79. lark/types/credit_grant_interface.py +0 -28
  80. lark/types/credit_grant_interface_input_expiration.py +0 -27
  81. lark/types/credit_grant_interface_output_expiration.py +0 -43
  82. lark/types/credit_grant_interface_output_schedule.py +0 -41
  83. lark/types/credit_grant_resource.py +0 -28
  84. lark/types/credit_grant_resource_input_expiration.py +0 -27
  85. lark/types/credit_grant_resource_output_expiration.py +0 -43
  86. lark/types/credit_grant_resource_output_schedule.py +0 -39
  87. lark/types/credit_grant_schedule.py +0 -5
  88. lark/types/credit_grant_schedule_rate_cycle_start_interface.py +0 -19
  89. lark/types/credit_grant_subject_granting_config_interface.py +0 -20
  90. lark/types/credit_pool.py +0 -5
  91. lark/types/credit_pool_rollover_config.py +0 -5
  92. lark/types/custom_aggregation_pricing_metric_interface.py +0 -22
  93. lark/types/custom_pricing_metric.py +0 -5
  94. lark/types/custom_unit.py +0 -5
  95. lark/types/custom_unit_amount.py +0 -5
  96. lark/types/dimension.py +0 -5
  97. lark/types/dimension_coordinate.py +0 -5
  98. lark/types/dimension_coordinate_interface.py +0 -20
  99. lark/types/dimension_coordinate_set.py +0 -5
  100. lark/types/dimension_interface.py +0 -20
  101. lark/types/dimensional_rate_matrix.py +0 -5
  102. lark/types/dimensional_rate_matrix_cell.py +0 -5
  103. lark/types/dimensional_usage_based_rate.py +0 -5
  104. lark/types/dimensional_usage_based_rate_input.py +0 -5
  105. lark/types/dimensional_usage_based_rate_interface.py +0 -33
  106. lark/types/feature_access_resource.py +0 -21
  107. lark/types/get_rate_card_response.py +0 -36
  108. lark/types/get_rate_card_response_billing_interval.py +0 -5
  109. lark/types/get_rate_card_response_usage_based_rates_item.py +0 -58
  110. lark/types/grant_credits_request.py +0 -5
  111. lark/types/last_aggregation_pricing_metric_interface.py +0 -22
  112. lark/types/license_based_rate.py +0 -5
  113. lark/types/license_based_rate_input.py +0 -5
  114. lark/types/max_aggregation_pricing_metric_interface.py +0 -22
  115. lark/types/monetary_amount.py +0 -5
  116. lark/types/package_price_rounding_behavior.py +0 -5
  117. lark/types/package_price_wrapper.py +0 -5
  118. lark/types/pricing_matrix_cell_interface.py +0 -22
  119. lark/types/pricing_matrix_interface.py +0 -20
  120. lark/types/pricing_metric.py +0 -5
  121. lark/types/pricing_plan.py +0 -5
  122. lark/types/pricing_plan_subscription.py +0 -5
  123. lark/types/pricing_tier.py +0 -5
  124. lark/types/rate_card_version.py +0 -5
  125. lark/types/rate_card_version_input.py +0 -5
  126. lark/types/simple_usage_based_rate.py +0 -5
  127. lark/types/simple_usage_based_rate_input.py +0 -5
  128. lark/types/subject_granting_config.py +0 -5
  129. lark/types/subject_granting_config_resource.py +0 -20
  130. lark/types/tiered_price.py +0 -5
  131. lark/types/tiered_price_wrapper.py +0 -5
  132. lark/types/unit.py +0 -5
  133. lark/types/update_pricing_plan_request.py +0 -5
  134. lark/types/update_rate_card_request.py +0 -5
  135. lark/types/update_subscription_request.py +0 -5
  136. lark/types/usage_based_rate.py +0 -5
  137. lark/types/usage_based_rate_input.py +0 -5
  138. lark/types/usage_unit.py +0 -5
  139. lark_billing-0.0.6.dist-info/RECORD +0 -167
  140. /lark/{feature_access → customer_access}/__init__.py +0 -0
  141. {lark_billing-0.0.6.dist-info → lark_billing-0.0.7.dist-info}/WHEEL +0 -0
lark/subjects/client.py CHANGED
@@ -56,7 +56,6 @@ class SubjectsClient:
56
56
 
57
57
  client = Lark(
58
58
  api_key="YOUR_API_KEY",
59
- base_url="https://yourhost.com/path/to/api",
60
59
  )
61
60
  client.subjects.list_subjects(
62
61
  limit=1,
@@ -72,7 +71,6 @@ class SubjectsClient:
72
71
  external_id: typing.Optional[str] = OMIT,
73
72
  name: typing.Optional[str] = OMIT,
74
73
  email: typing.Optional[str] = OMIT,
75
- parent_subject_id: typing.Optional[str] = OMIT,
76
74
  metadata: typing.Optional[typing.Dict[str, str]] = OMIT,
77
75
  request_options: typing.Optional[RequestOptions] = None,
78
76
  ) -> CreateSubjectResponse:
@@ -85,8 +83,6 @@ class SubjectsClient:
85
83
 
86
84
  email : typing.Optional[str]
87
85
 
88
- parent_subject_id : typing.Optional[str]
89
-
90
86
  metadata : typing.Optional[typing.Dict[str, str]]
91
87
 
92
88
  request_options : typing.Optional[RequestOptions]
@@ -103,17 +99,11 @@ class SubjectsClient:
103
99
 
104
100
  client = Lark(
105
101
  api_key="YOUR_API_KEY",
106
- base_url="https://yourhost.com/path/to/api",
107
102
  )
108
103
  client.subjects.create_subject()
109
104
  """
110
105
  _response = self._raw_client.create_subject(
111
- external_id=external_id,
112
- name=name,
113
- email=email,
114
- parent_subject_id=parent_subject_id,
115
- metadata=metadata,
116
- request_options=request_options,
106
+ external_id=external_id, name=name, email=email, metadata=metadata, request_options=request_options
117
107
  )
118
108
  return _response.data
119
109
 
@@ -139,7 +129,6 @@ class SubjectsClient:
139
129
 
140
130
  client = Lark(
141
131
  api_key="YOUR_API_KEY",
142
- base_url="https://yourhost.com/path/to/api",
143
132
  )
144
133
  client.subjects.get_subject(
145
134
  subject_id="subject_id",
@@ -155,7 +144,6 @@ class SubjectsClient:
155
144
  external_id: typing.Optional[str] = OMIT,
156
145
  name: typing.Optional[str] = OMIT,
157
146
  email: typing.Optional[str] = OMIT,
158
- parent_subject_id: typing.Optional[str] = OMIT,
159
147
  metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
160
148
  request_options: typing.Optional[RequestOptions] = None,
161
149
  ) -> SubjectResource:
@@ -170,8 +158,6 @@ class SubjectsClient:
170
158
 
171
159
  email : typing.Optional[str]
172
160
 
173
- parent_subject_id : typing.Optional[str]
174
-
175
161
  metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
176
162
 
177
163
  request_options : typing.Optional[RequestOptions]
@@ -188,7 +174,6 @@ class SubjectsClient:
188
174
 
189
175
  client = Lark(
190
176
  api_key="YOUR_API_KEY",
191
- base_url="https://yourhost.com/path/to/api",
192
177
  )
193
178
  client.subjects.update_subject(
194
179
  subject_id="subject_id",
@@ -199,7 +184,6 @@ class SubjectsClient:
199
184
  external_id=external_id,
200
185
  name=name,
201
186
  email=email,
202
- parent_subject_id=parent_subject_id,
203
187
  metadata=metadata,
204
188
  request_options=request_options,
205
189
  )
@@ -227,7 +211,6 @@ class SubjectsClient:
227
211
 
228
212
  client = Lark(
229
213
  api_key="YOUR_API_KEY",
230
- base_url="https://yourhost.com/path/to/api",
231
214
  )
232
215
  client.subjects.delete_subject(
233
216
  subject_id="subject_id",
@@ -282,7 +265,6 @@ class AsyncSubjectsClient:
282
265
 
283
266
  client = AsyncLark(
284
267
  api_key="YOUR_API_KEY",
285
- base_url="https://yourhost.com/path/to/api",
286
268
  )
287
269
 
288
270
 
@@ -304,7 +286,6 @@ class AsyncSubjectsClient:
304
286
  external_id: typing.Optional[str] = OMIT,
305
287
  name: typing.Optional[str] = OMIT,
306
288
  email: typing.Optional[str] = OMIT,
307
- parent_subject_id: typing.Optional[str] = OMIT,
308
289
  metadata: typing.Optional[typing.Dict[str, str]] = OMIT,
309
290
  request_options: typing.Optional[RequestOptions] = None,
310
291
  ) -> CreateSubjectResponse:
@@ -317,8 +298,6 @@ class AsyncSubjectsClient:
317
298
 
318
299
  email : typing.Optional[str]
319
300
 
320
- parent_subject_id : typing.Optional[str]
321
-
322
301
  metadata : typing.Optional[typing.Dict[str, str]]
323
302
 
324
303
  request_options : typing.Optional[RequestOptions]
@@ -337,7 +316,6 @@ class AsyncSubjectsClient:
337
316
 
338
317
  client = AsyncLark(
339
318
  api_key="YOUR_API_KEY",
340
- base_url="https://yourhost.com/path/to/api",
341
319
  )
342
320
 
343
321
 
@@ -348,12 +326,7 @@ class AsyncSubjectsClient:
348
326
  asyncio.run(main())
349
327
  """
350
328
  _response = await self._raw_client.create_subject(
351
- external_id=external_id,
352
- name=name,
353
- email=email,
354
- parent_subject_id=parent_subject_id,
355
- metadata=metadata,
356
- request_options=request_options,
329
+ external_id=external_id, name=name, email=email, metadata=metadata, request_options=request_options
357
330
  )
358
331
  return _response.data
359
332
 
@@ -381,7 +354,6 @@ class AsyncSubjectsClient:
381
354
 
382
355
  client = AsyncLark(
383
356
  api_key="YOUR_API_KEY",
384
- base_url="https://yourhost.com/path/to/api",
385
357
  )
386
358
 
387
359
 
@@ -403,7 +375,6 @@ class AsyncSubjectsClient:
403
375
  external_id: typing.Optional[str] = OMIT,
404
376
  name: typing.Optional[str] = OMIT,
405
377
  email: typing.Optional[str] = OMIT,
406
- parent_subject_id: typing.Optional[str] = OMIT,
407
378
  metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
408
379
  request_options: typing.Optional[RequestOptions] = None,
409
380
  ) -> SubjectResource:
@@ -418,8 +389,6 @@ class AsyncSubjectsClient:
418
389
 
419
390
  email : typing.Optional[str]
420
391
 
421
- parent_subject_id : typing.Optional[str]
422
-
423
392
  metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
424
393
 
425
394
  request_options : typing.Optional[RequestOptions]
@@ -438,7 +407,6 @@ class AsyncSubjectsClient:
438
407
 
439
408
  client = AsyncLark(
440
409
  api_key="YOUR_API_KEY",
441
- base_url="https://yourhost.com/path/to/api",
442
410
  )
443
411
 
444
412
 
@@ -455,7 +423,6 @@ class AsyncSubjectsClient:
455
423
  external_id=external_id,
456
424
  name=name,
457
425
  email=email,
458
- parent_subject_id=parent_subject_id,
459
426
  metadata=metadata,
460
427
  request_options=request_options,
461
428
  )
@@ -485,7 +452,6 @@ class AsyncSubjectsClient:
485
452
 
486
453
  client = AsyncLark(
487
454
  api_key="YOUR_API_KEY",
488
- base_url="https://yourhost.com/path/to/api",
489
455
  )
490
456
 
491
457
 
@@ -86,7 +86,6 @@ class RawSubjectsClient:
86
86
  external_id: typing.Optional[str] = OMIT,
87
87
  name: typing.Optional[str] = OMIT,
88
88
  email: typing.Optional[str] = OMIT,
89
- parent_subject_id: typing.Optional[str] = OMIT,
90
89
  metadata: typing.Optional[typing.Dict[str, str]] = OMIT,
91
90
  request_options: typing.Optional[RequestOptions] = None,
92
91
  ) -> HttpResponse[CreateSubjectResponse]:
@@ -99,8 +98,6 @@ class RawSubjectsClient:
99
98
 
100
99
  email : typing.Optional[str]
101
100
 
102
- parent_subject_id : typing.Optional[str]
103
-
104
101
  metadata : typing.Optional[typing.Dict[str, str]]
105
102
 
106
103
  request_options : typing.Optional[RequestOptions]
@@ -118,7 +115,6 @@ class RawSubjectsClient:
118
115
  "external_id": external_id,
119
116
  "name": name,
120
117
  "email": email,
121
- "parent_subject_id": parent_subject_id,
122
118
  "metadata": metadata,
123
119
  },
124
120
  headers={
@@ -207,7 +203,6 @@ class RawSubjectsClient:
207
203
  external_id: typing.Optional[str] = OMIT,
208
204
  name: typing.Optional[str] = OMIT,
209
205
  email: typing.Optional[str] = OMIT,
210
- parent_subject_id: typing.Optional[str] = OMIT,
211
206
  metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
212
207
  request_options: typing.Optional[RequestOptions] = None,
213
208
  ) -> HttpResponse[SubjectResource]:
@@ -222,8 +217,6 @@ class RawSubjectsClient:
222
217
 
223
218
  email : typing.Optional[str]
224
219
 
225
- parent_subject_id : typing.Optional[str]
226
-
227
220
  metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
228
221
 
229
222
  request_options : typing.Optional[RequestOptions]
@@ -241,7 +234,6 @@ class RawSubjectsClient:
241
234
  "external_id": external_id,
242
235
  "name": name,
243
236
  "email": email,
244
- "parent_subject_id": parent_subject_id,
245
237
  "metadata": metadata,
246
238
  },
247
239
  headers={
@@ -393,7 +385,6 @@ class AsyncRawSubjectsClient:
393
385
  external_id: typing.Optional[str] = OMIT,
394
386
  name: typing.Optional[str] = OMIT,
395
387
  email: typing.Optional[str] = OMIT,
396
- parent_subject_id: typing.Optional[str] = OMIT,
397
388
  metadata: typing.Optional[typing.Dict[str, str]] = OMIT,
398
389
  request_options: typing.Optional[RequestOptions] = None,
399
390
  ) -> AsyncHttpResponse[CreateSubjectResponse]:
@@ -406,8 +397,6 @@ class AsyncRawSubjectsClient:
406
397
 
407
398
  email : typing.Optional[str]
408
399
 
409
- parent_subject_id : typing.Optional[str]
410
-
411
400
  metadata : typing.Optional[typing.Dict[str, str]]
412
401
 
413
402
  request_options : typing.Optional[RequestOptions]
@@ -425,7 +414,6 @@ class AsyncRawSubjectsClient:
425
414
  "external_id": external_id,
426
415
  "name": name,
427
416
  "email": email,
428
- "parent_subject_id": parent_subject_id,
429
417
  "metadata": metadata,
430
418
  },
431
419
  headers={
@@ -514,7 +502,6 @@ class AsyncRawSubjectsClient:
514
502
  external_id: typing.Optional[str] = OMIT,
515
503
  name: typing.Optional[str] = OMIT,
516
504
  email: typing.Optional[str] = OMIT,
517
- parent_subject_id: typing.Optional[str] = OMIT,
518
505
  metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
519
506
  request_options: typing.Optional[RequestOptions] = None,
520
507
  ) -> AsyncHttpResponse[SubjectResource]:
@@ -529,8 +516,6 @@ class AsyncRawSubjectsClient:
529
516
 
530
517
  email : typing.Optional[str]
531
518
 
532
- parent_subject_id : typing.Optional[str]
533
-
534
519
  metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
535
520
 
536
521
  request_options : typing.Optional[RequestOptions]
@@ -548,7 +533,6 @@ class AsyncRawSubjectsClient:
548
533
  "external_id": external_id,
549
534
  "name": name,
550
535
  "email": email,
551
- "parent_subject_id": parent_subject_id,
552
536
  "metadata": metadata,
553
537
  },
554
538
  headers={
@@ -1,6 +1,5 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import datetime as dt
4
3
  import typing
5
4
 
6
5
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
@@ -32,7 +31,8 @@ class SubscriptionsClient:
32
31
  self,
33
32
  *,
34
33
  limit: typing.Optional[int] = None,
35
- offset: typing.Optional[int] = None,
34
+ subject_id: typing.Optional[str] = None,
35
+ rate_card_id: typing.Optional[str] = None,
36
36
  request_options: typing.Optional[RequestOptions] = None,
37
37
  ) -> ListSubscriptionsResponse:
38
38
  """
@@ -40,7 +40,11 @@ class SubscriptionsClient:
40
40
  ----------
41
41
  limit : typing.Optional[int]
42
42
 
43
- offset : typing.Optional[int]
43
+ subject_id : typing.Optional[str]
44
+ The ID of the subject to list subscriptions for. Cannot be used with rate_card_id.
45
+
46
+ rate_card_id : typing.Optional[str]
47
+ The ID of the rate card to list subscriptions for. Cannot be used with subject_id.
44
48
 
45
49
  request_options : typing.Optional[RequestOptions]
46
50
  Request-specific configuration.
@@ -56,14 +60,16 @@ class SubscriptionsClient:
56
60
 
57
61
  client = Lark(
58
62
  api_key="YOUR_API_KEY",
59
- base_url="https://yourhost.com/path/to/api",
60
63
  )
61
64
  client.subscriptions.list_subscriptions(
62
65
  limit=1,
63
- offset=1,
66
+ subject_id="subject_id",
67
+ rate_card_id="rate_card_id",
64
68
  )
65
69
  """
66
- _response = self._raw_client.list_subscriptions(limit=limit, offset=offset, request_options=request_options)
70
+ _response = self._raw_client.list_subscriptions(
71
+ limit=limit, subject_id=subject_id, rate_card_id=rate_card_id, request_options=request_options
72
+ )
67
73
  return _response.data
68
74
 
69
75
  def create_subscription(
@@ -71,8 +77,6 @@ class SubscriptionsClient:
71
77
  *,
72
78
  rate_card_id: str,
73
79
  subject_id: str,
74
- effective_at: dt.datetime,
75
- variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
76
80
  metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
77
81
  request_options: typing.Optional[RequestOptions] = None,
78
82
  ) -> SubscriptionResource:
@@ -83,10 +87,6 @@ class SubscriptionsClient:
83
87
 
84
88
  subject_id : str
85
89
 
86
- effective_at : dt.datetime
87
-
88
- variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
89
-
90
90
  metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
91
91
 
92
92
  request_options : typing.Optional[RequestOptions]
@@ -99,29 +99,18 @@ class SubscriptionsClient:
99
99
 
100
100
  Examples
101
101
  --------
102
- import datetime
103
-
104
102
  from lark import Lark
105
103
 
106
104
  client = Lark(
107
105
  api_key="YOUR_API_KEY",
108
- base_url="https://yourhost.com/path/to/api",
109
106
  )
110
107
  client.subscriptions.create_subscription(
111
108
  rate_card_id="rate_card_id",
112
109
  subject_id="subject_id",
113
- effective_at=datetime.datetime.fromisoformat(
114
- "2024-01-15 09:30:00+00:00",
115
- ),
116
110
  )
117
111
  """
118
112
  _response = self._raw_client.create_subscription(
119
- rate_card_id=rate_card_id,
120
- subject_id=subject_id,
121
- effective_at=effective_at,
122
- variables=variables,
123
- metadata=metadata,
124
- request_options=request_options,
113
+ rate_card_id=rate_card_id, subject_id=subject_id, metadata=metadata, request_options=request_options
125
114
  )
126
115
  return _response.data
127
116
 
@@ -147,7 +136,6 @@ class SubscriptionsClient:
147
136
 
148
137
  client = Lark(
149
138
  api_key="YOUR_API_KEY",
150
- base_url="https://yourhost.com/path/to/api",
151
139
  )
152
140
  client.subscriptions.get_subscription(
153
141
  subscription_id="subscription_id",
@@ -156,66 +144,6 @@ class SubscriptionsClient:
156
144
  _response = self._raw_client.get_subscription(subscription_id, request_options=request_options)
157
145
  return _response.data
158
146
 
159
- def cancel_subscription(
160
- self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
161
- ) -> None:
162
- """
163
- Parameters
164
- ----------
165
- subscription_id : str
166
-
167
- request_options : typing.Optional[RequestOptions]
168
- Request-specific configuration.
169
-
170
- Returns
171
- -------
172
- None
173
-
174
- Examples
175
- --------
176
- from lark import Lark
177
-
178
- client = Lark(
179
- api_key="YOUR_API_KEY",
180
- base_url="https://yourhost.com/path/to/api",
181
- )
182
- client.subscriptions.cancel_subscription(
183
- subscription_id="subscription_id",
184
- )
185
- """
186
- _response = self._raw_client.cancel_subscription(subscription_id, request_options=request_options)
187
- return _response.data
188
-
189
- def update_subscription(
190
- self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
191
- ) -> None:
192
- """
193
- Parameters
194
- ----------
195
- subscription_id : str
196
-
197
- request_options : typing.Optional[RequestOptions]
198
- Request-specific configuration.
199
-
200
- Returns
201
- -------
202
- None
203
-
204
- Examples
205
- --------
206
- from lark import Lark
207
-
208
- client = Lark(
209
- api_key="YOUR_API_KEY",
210
- base_url="https://yourhost.com/path/to/api",
211
- )
212
- client.subscriptions.update_subscription(
213
- subscription_id="subscription_id",
214
- )
215
- """
216
- _response = self._raw_client.update_subscription(subscription_id, request_options=request_options)
217
- return _response.data
218
-
219
147
 
220
148
  class AsyncSubscriptionsClient:
221
149
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -236,7 +164,8 @@ class AsyncSubscriptionsClient:
236
164
  self,
237
165
  *,
238
166
  limit: typing.Optional[int] = None,
239
- offset: typing.Optional[int] = None,
167
+ subject_id: typing.Optional[str] = None,
168
+ rate_card_id: typing.Optional[str] = None,
240
169
  request_options: typing.Optional[RequestOptions] = None,
241
170
  ) -> ListSubscriptionsResponse:
242
171
  """
@@ -244,7 +173,11 @@ class AsyncSubscriptionsClient:
244
173
  ----------
245
174
  limit : typing.Optional[int]
246
175
 
247
- offset : typing.Optional[int]
176
+ subject_id : typing.Optional[str]
177
+ The ID of the subject to list subscriptions for. Cannot be used with rate_card_id.
178
+
179
+ rate_card_id : typing.Optional[str]
180
+ The ID of the rate card to list subscriptions for. Cannot be used with subject_id.
248
181
 
249
182
  request_options : typing.Optional[RequestOptions]
250
183
  Request-specific configuration.
@@ -262,21 +195,21 @@ class AsyncSubscriptionsClient:
262
195
 
263
196
  client = AsyncLark(
264
197
  api_key="YOUR_API_KEY",
265
- base_url="https://yourhost.com/path/to/api",
266
198
  )
267
199
 
268
200
 
269
201
  async def main() -> None:
270
202
  await client.subscriptions.list_subscriptions(
271
203
  limit=1,
272
- offset=1,
204
+ subject_id="subject_id",
205
+ rate_card_id="rate_card_id",
273
206
  )
274
207
 
275
208
 
276
209
  asyncio.run(main())
277
210
  """
278
211
  _response = await self._raw_client.list_subscriptions(
279
- limit=limit, offset=offset, request_options=request_options
212
+ limit=limit, subject_id=subject_id, rate_card_id=rate_card_id, request_options=request_options
280
213
  )
281
214
  return _response.data
282
215
 
@@ -285,8 +218,6 @@ class AsyncSubscriptionsClient:
285
218
  *,
286
219
  rate_card_id: str,
287
220
  subject_id: str,
288
- effective_at: dt.datetime,
289
- variables: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
290
221
  metadata: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
291
222
  request_options: typing.Optional[RequestOptions] = None,
292
223
  ) -> SubscriptionResource:
@@ -297,10 +228,6 @@ class AsyncSubscriptionsClient:
297
228
 
298
229
  subject_id : str
299
230
 
300
- effective_at : dt.datetime
301
-
302
- variables : typing.Optional[typing.Dict[str, typing.Optional[str]]]
303
-
304
231
  metadata : typing.Optional[typing.Dict[str, typing.Optional[str]]]
305
232
 
306
233
  request_options : typing.Optional[RequestOptions]
@@ -314,13 +241,11 @@ class AsyncSubscriptionsClient:
314
241
  Examples
315
242
  --------
316
243
  import asyncio
317
- import datetime
318
244
 
319
245
  from lark import AsyncLark
320
246
 
321
247
  client = AsyncLark(
322
248
  api_key="YOUR_API_KEY",
323
- base_url="https://yourhost.com/path/to/api",
324
249
  )
325
250
 
326
251
 
@@ -328,21 +253,13 @@ class AsyncSubscriptionsClient:
328
253
  await client.subscriptions.create_subscription(
329
254
  rate_card_id="rate_card_id",
330
255
  subject_id="subject_id",
331
- effective_at=datetime.datetime.fromisoformat(
332
- "2024-01-15 09:30:00+00:00",
333
- ),
334
256
  )
335
257
 
336
258
 
337
259
  asyncio.run(main())
338
260
  """
339
261
  _response = await self._raw_client.create_subscription(
340
- rate_card_id=rate_card_id,
341
- subject_id=subject_id,
342
- effective_at=effective_at,
343
- variables=variables,
344
- metadata=metadata,
345
- request_options=request_options,
262
+ rate_card_id=rate_card_id, subject_id=subject_id, metadata=metadata, request_options=request_options
346
263
  )
347
264
  return _response.data
348
265
 
@@ -370,7 +287,6 @@ class AsyncSubscriptionsClient:
370
287
 
371
288
  client = AsyncLark(
372
289
  api_key="YOUR_API_KEY",
373
- base_url="https://yourhost.com/path/to/api",
374
290
  )
375
291
 
376
292
 
@@ -384,79 +300,3 @@ class AsyncSubscriptionsClient:
384
300
  """
385
301
  _response = await self._raw_client.get_subscription(subscription_id, request_options=request_options)
386
302
  return _response.data
387
-
388
- async def cancel_subscription(
389
- self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
390
- ) -> None:
391
- """
392
- Parameters
393
- ----------
394
- subscription_id : str
395
-
396
- request_options : typing.Optional[RequestOptions]
397
- Request-specific configuration.
398
-
399
- Returns
400
- -------
401
- None
402
-
403
- Examples
404
- --------
405
- import asyncio
406
-
407
- from lark import AsyncLark
408
-
409
- client = AsyncLark(
410
- api_key="YOUR_API_KEY",
411
- base_url="https://yourhost.com/path/to/api",
412
- )
413
-
414
-
415
- async def main() -> None:
416
- await client.subscriptions.cancel_subscription(
417
- subscription_id="subscription_id",
418
- )
419
-
420
-
421
- asyncio.run(main())
422
- """
423
- _response = await self._raw_client.cancel_subscription(subscription_id, request_options=request_options)
424
- return _response.data
425
-
426
- async def update_subscription(
427
- self, subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
428
- ) -> None:
429
- """
430
- Parameters
431
- ----------
432
- subscription_id : str
433
-
434
- request_options : typing.Optional[RequestOptions]
435
- Request-specific configuration.
436
-
437
- Returns
438
- -------
439
- None
440
-
441
- Examples
442
- --------
443
- import asyncio
444
-
445
- from lark import AsyncLark
446
-
447
- client = AsyncLark(
448
- api_key="YOUR_API_KEY",
449
- base_url="https://yourhost.com/path/to/api",
450
- )
451
-
452
-
453
- async def main() -> None:
454
- await client.subscriptions.update_subscription(
455
- subscription_id="subscription_id",
456
- )
457
-
458
-
459
- asyncio.run(main())
460
- """
461
- _response = await self._raw_client.update_subscription(subscription_id, request_options=request_options)
462
- return _response.data