payi 0.1.0a55__py3-none-any.whl → 0.1.0a56__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 payi might be problematic. Click here for more details.

Files changed (57) hide show
  1. payi/_client.py +10 -17
  2. payi/_version.py +1 -1
  3. payi/lib/helpers.py +2 -2
  4. payi/resources/__init__.py +14 -28
  5. payi/resources/categories/resources.py +7 -7
  6. payi/resources/experiences/types/types.py +5 -2
  7. payi/resources/ingest.py +22 -12
  8. payi/resources/limits/limits.py +4 -0
  9. payi/resources/limits/tags.py +12 -0
  10. payi/resources/requests/properties.py +1 -1
  11. payi/resources/use_cases/__init__.py +47 -0
  12. payi/resources/use_cases/properties.py +174 -0
  13. payi/resources/use_cases/types/__init__.py +33 -0
  14. payi/resources/use_cases/types/limit_config.py +275 -0
  15. payi/resources/{billing_models.py → use_cases/types/types.py} +225 -161
  16. payi/resources/{price_modifiers.py → use_cases/use_cases.py} +160 -130
  17. payi/types/__init__.py +6 -9
  18. payi/types/categories/resource_create_params.py +6 -6
  19. payi/types/category_resource_response.py +2 -2
  20. payi/types/experience_instance_response.py +2 -0
  21. payi/types/experiences/__init__.py +0 -1
  22. payi/types/experiences/experience_type.py +8 -14
  23. payi/types/experiences/type_create_params.py +8 -14
  24. payi/types/ingest_event_param.py +10 -0
  25. payi/types/ingest_response.py +2 -0
  26. payi/types/ingest_units_params.py +9 -1
  27. payi/types/limit_list_params.py +6 -1
  28. payi/types/limits/tag_create_params.py +1 -0
  29. payi/types/limits/tag_remove_params.py +1 -0
  30. payi/types/limits/tag_update_params.py +1 -0
  31. payi/types/requests/request_result.py +2 -0
  32. payi/types/shared/__init__.py +4 -0
  33. payi/types/shared/pay_i_common_models_budget_management_create_limit_base.py +18 -0
  34. payi/types/shared_params/__init__.py +5 -0
  35. payi/types/shared_params/pay_i_common_models_budget_management_create_limit_base.py +18 -0
  36. payi/types/use_case_instance_response.py +15 -0
  37. payi/types/use_cases/__init__.py +10 -0
  38. payi/types/use_cases/property_create_params.py +12 -0
  39. payi/types/use_cases/type_create_params.py +22 -0
  40. payi/types/use_cases/type_list_params.py +12 -0
  41. payi/types/{billing_model_list_response.py → use_cases/type_list_response.py} +3 -3
  42. payi/types/use_cases/type_update_params.py +14 -0
  43. payi/types/use_cases/types/__init__.py +5 -0
  44. payi/types/use_cases/types/limit_config_create_params.py +18 -0
  45. payi/types/use_cases/use_case_type.py +24 -0
  46. {payi-0.1.0a55.dist-info → payi-0.1.0a56.dist-info}/METADATA +1 -1
  47. {payi-0.1.0a55.dist-info → payi-0.1.0a56.dist-info}/RECORD +50 -41
  48. payi/types/billing_model.py +0 -31
  49. payi/types/billing_model_create_params.py +0 -22
  50. payi/types/billing_model_update_params.py +0 -22
  51. payi/types/price_modifier.py +0 -26
  52. payi/types/price_modifier_create_params.py +0 -17
  53. payi/types/price_modifier_retrieve_response.py +0 -10
  54. payi/types/price_modifier_update_params.py +0 -17
  55. /payi/types/{experiences → shared}/properties_response.py +0 -0
  56. {payi-0.1.0a55.dist-info → payi-0.1.0a56.dist-info}/WHEEL +0 -0
  57. {payi-0.1.0a55.dist-info → payi-0.1.0a56.dist-info}/licenses/LICENSE +0 -0
@@ -4,62 +4,79 @@ from __future__ import annotations
4
4
 
5
5
  import httpx
6
6
 
7
- from ..types import price_modifier_create_params, price_modifier_update_params
8
- from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
- from .._utils import (
10
- maybe_transform,
11
- async_maybe_transform,
7
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8
+ from ..._compat import cached_property
9
+ from .properties import (
10
+ PropertiesResource,
11
+ AsyncPropertiesResource,
12
+ PropertiesResourceWithRawResponse,
13
+ AsyncPropertiesResourceWithRawResponse,
14
+ PropertiesResourceWithStreamingResponse,
15
+ AsyncPropertiesResourceWithStreamingResponse,
12
16
  )
13
- from .._compat import cached_property
14
- from .._resource import SyncAPIResource, AsyncAPIResource
15
- from .._response import (
17
+ from ..._resource import SyncAPIResource, AsyncAPIResource
18
+ from ..._response import (
16
19
  to_raw_response_wrapper,
17
20
  to_streamed_response_wrapper,
18
21
  async_to_raw_response_wrapper,
19
22
  async_to_streamed_response_wrapper,
20
23
  )
21
- from .._base_client import make_request_options
22
- from ..types.price_modifier import PriceModifier
23
- from ..types.price_modifier_retrieve_response import PriceModifierRetrieveResponse
24
+ from .types.types import (
25
+ TypesResource,
26
+ AsyncTypesResource,
27
+ TypesResourceWithRawResponse,
28
+ AsyncTypesResourceWithRawResponse,
29
+ TypesResourceWithStreamingResponse,
30
+ AsyncTypesResourceWithStreamingResponse,
31
+ )
32
+ from ..._base_client import make_request_options
33
+ from ...types.use_case_instance_response import UseCaseInstanceResponse
34
+
35
+ __all__ = ["UseCasesResource", "AsyncUseCasesResource"]
24
36
 
25
- __all__ = ["PriceModifiersResource", "AsyncPriceModifiersResource"]
26
37
 
38
+ class UseCasesResource(SyncAPIResource):
39
+ @cached_property
40
+ def types(self) -> TypesResource:
41
+ return TypesResource(self._client)
42
+
43
+ @cached_property
44
+ def properties(self) -> PropertiesResource:
45
+ return PropertiesResource(self._client)
27
46
 
28
- class PriceModifiersResource(SyncAPIResource):
29
47
  @cached_property
30
- def with_raw_response(self) -> PriceModifiersResourceWithRawResponse:
48
+ def with_raw_response(self) -> UseCasesResourceWithRawResponse:
31
49
  """
32
50
  This property can be used as a prefix for any HTTP method call to return
33
51
  the raw response object instead of the parsed content.
34
52
 
35
53
  For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
36
54
  """
37
- return PriceModifiersResourceWithRawResponse(self)
55
+ return UseCasesResourceWithRawResponse(self)
38
56
 
39
57
  @cached_property
40
- def with_streaming_response(self) -> PriceModifiersResourceWithStreamingResponse:
58
+ def with_streaming_response(self) -> UseCasesResourceWithStreamingResponse:
41
59
  """
42
60
  An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43
61
 
44
62
  For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
45
63
  """
46
- return PriceModifiersResourceWithStreamingResponse(self)
64
+ return UseCasesResourceWithStreamingResponse(self)
47
65
 
48
66
  def create(
49
67
  self,
68
+ use_case_name: str,
50
69
  *,
51
- billing_model_id: str,
52
- category: str,
53
- price_modifier: float,
54
- resource: str,
55
70
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56
71
  # The extra values given here take precedence over values defined on the client or passed to this method.
57
72
  extra_headers: Headers | None = None,
58
73
  extra_query: Query | None = None,
59
74
  extra_body: Body | None = None,
60
75
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61
- ) -> PriceModifier:
76
+ ) -> UseCaseInstanceResponse:
62
77
  """
78
+ Create a Use Case instance
79
+
63
80
  Args:
64
81
  extra_headers: Send extra headers
65
82
 
@@ -69,26 +86,19 @@ class PriceModifiersResource(SyncAPIResource):
69
86
 
70
87
  timeout: Override the client-level default timeout for this request, in seconds
71
88
  """
89
+ if not use_case_name:
90
+ raise ValueError(f"Expected a non-empty value for `use_case_name` but received {use_case_name!r}")
72
91
  return self._post(
73
- "/api/v1/price-modifier",
74
- body=maybe_transform(
75
- {
76
- "billing_model_id": billing_model_id,
77
- "category": category,
78
- "price_modifier": price_modifier,
79
- "resource": resource,
80
- },
81
- price_modifier_create_params.PriceModifierCreateParams,
82
- ),
92
+ f"/api/v1/use_cases/instances/{use_case_name}",
83
93
  options=make_request_options(
84
94
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
85
95
  ),
86
- cast_to=PriceModifier,
96
+ cast_to=UseCaseInstanceResponse,
87
97
  )
88
98
 
89
99
  def retrieve(
90
100
  self,
91
- billing_model_id: str,
101
+ use_case_id: str,
92
102
  *,
93
103
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
94
104
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -96,8 +106,10 @@ class PriceModifiersResource(SyncAPIResource):
96
106
  extra_query: Query | None = None,
97
107
  extra_body: Body | None = None,
98
108
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
99
- ) -> PriceModifierRetrieveResponse:
109
+ ) -> UseCaseInstanceResponse:
100
110
  """
111
+ Get a Use Case instance details
112
+
101
113
  Args:
102
114
  extra_headers: Send extra headers
103
115
 
@@ -107,31 +119,30 @@ class PriceModifiersResource(SyncAPIResource):
107
119
 
108
120
  timeout: Override the client-level default timeout for this request, in seconds
109
121
  """
110
- if not billing_model_id:
111
- raise ValueError(f"Expected a non-empty value for `billing_model_id` but received {billing_model_id!r}")
122
+ if not use_case_id:
123
+ raise ValueError(f"Expected a non-empty value for `use_case_id` but received {use_case_id!r}")
112
124
  return self._get(
113
- f"/api/v1/price-modifier/{billing_model_id}",
125
+ f"/api/v1/use_cases/instances/{use_case_id}",
114
126
  options=make_request_options(
115
127
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
116
128
  ),
117
- cast_to=PriceModifierRetrieveResponse,
129
+ cast_to=UseCaseInstanceResponse,
118
130
  )
119
131
 
120
- def update(
132
+ def delete(
121
133
  self,
134
+ use_case_id: str,
122
135
  *,
123
- billing_model_id: str,
124
- category: str,
125
- price_modifier: float,
126
- resource: str,
127
136
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
128
137
  # The extra values given here take precedence over values defined on the client or passed to this method.
129
138
  extra_headers: Headers | None = None,
130
139
  extra_query: Query | None = None,
131
140
  extra_body: Body | None = None,
132
141
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
133
- ) -> PriceModifier:
142
+ ) -> UseCaseInstanceResponse:
134
143
  """
144
+ Delete a Use Case instance
145
+
135
146
  Args:
136
147
  extra_headers: Send extra headers
137
148
 
@@ -141,59 +152,59 @@ class PriceModifiersResource(SyncAPIResource):
141
152
 
142
153
  timeout: Override the client-level default timeout for this request, in seconds
143
154
  """
144
- return self._put(
145
- "/api/v1/price-modifier",
146
- body=maybe_transform(
147
- {
148
- "billing_model_id": billing_model_id,
149
- "category": category,
150
- "price_modifier": price_modifier,
151
- "resource": resource,
152
- },
153
- price_modifier_update_params.PriceModifierUpdateParams,
154
- ),
155
+ if not use_case_id:
156
+ raise ValueError(f"Expected a non-empty value for `use_case_id` but received {use_case_id!r}")
157
+ return self._delete(
158
+ f"/api/v1/use_cases/instances/{use_case_id}",
155
159
  options=make_request_options(
156
160
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
157
161
  ),
158
- cast_to=PriceModifier,
162
+ cast_to=UseCaseInstanceResponse,
159
163
  )
160
164
 
161
165
 
162
- class AsyncPriceModifiersResource(AsyncAPIResource):
166
+ class AsyncUseCasesResource(AsyncAPIResource):
167
+ @cached_property
168
+ def types(self) -> AsyncTypesResource:
169
+ return AsyncTypesResource(self._client)
170
+
171
+ @cached_property
172
+ def properties(self) -> AsyncPropertiesResource:
173
+ return AsyncPropertiesResource(self._client)
174
+
163
175
  @cached_property
164
- def with_raw_response(self) -> AsyncPriceModifiersResourceWithRawResponse:
176
+ def with_raw_response(self) -> AsyncUseCasesResourceWithRawResponse:
165
177
  """
166
178
  This property can be used as a prefix for any HTTP method call to return
167
179
  the raw response object instead of the parsed content.
168
180
 
169
181
  For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
170
182
  """
171
- return AsyncPriceModifiersResourceWithRawResponse(self)
183
+ return AsyncUseCasesResourceWithRawResponse(self)
172
184
 
173
185
  @cached_property
174
- def with_streaming_response(self) -> AsyncPriceModifiersResourceWithStreamingResponse:
186
+ def with_streaming_response(self) -> AsyncUseCasesResourceWithStreamingResponse:
175
187
  """
176
188
  An alternative to `.with_raw_response` that doesn't eagerly read the response body.
177
189
 
178
190
  For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
179
191
  """
180
- return AsyncPriceModifiersResourceWithStreamingResponse(self)
192
+ return AsyncUseCasesResourceWithStreamingResponse(self)
181
193
 
182
194
  async def create(
183
195
  self,
196
+ use_case_name: str,
184
197
  *,
185
- billing_model_id: str,
186
- category: str,
187
- price_modifier: float,
188
- resource: str,
189
198
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
190
199
  # The extra values given here take precedence over values defined on the client or passed to this method.
191
200
  extra_headers: Headers | None = None,
192
201
  extra_query: Query | None = None,
193
202
  extra_body: Body | None = None,
194
203
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
195
- ) -> PriceModifier:
204
+ ) -> UseCaseInstanceResponse:
196
205
  """
206
+ Create a Use Case instance
207
+
197
208
  Args:
198
209
  extra_headers: Send extra headers
199
210
 
@@ -203,26 +214,19 @@ class AsyncPriceModifiersResource(AsyncAPIResource):
203
214
 
204
215
  timeout: Override the client-level default timeout for this request, in seconds
205
216
  """
217
+ if not use_case_name:
218
+ raise ValueError(f"Expected a non-empty value for `use_case_name` but received {use_case_name!r}")
206
219
  return await self._post(
207
- "/api/v1/price-modifier",
208
- body=await async_maybe_transform(
209
- {
210
- "billing_model_id": billing_model_id,
211
- "category": category,
212
- "price_modifier": price_modifier,
213
- "resource": resource,
214
- },
215
- price_modifier_create_params.PriceModifierCreateParams,
216
- ),
220
+ f"/api/v1/use_cases/instances/{use_case_name}",
217
221
  options=make_request_options(
218
222
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
219
223
  ),
220
- cast_to=PriceModifier,
224
+ cast_to=UseCaseInstanceResponse,
221
225
  )
222
226
 
223
227
  async def retrieve(
224
228
  self,
225
- billing_model_id: str,
229
+ use_case_id: str,
226
230
  *,
227
231
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
228
232
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -230,8 +234,10 @@ class AsyncPriceModifiersResource(AsyncAPIResource):
230
234
  extra_query: Query | None = None,
231
235
  extra_body: Body | None = None,
232
236
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
233
- ) -> PriceModifierRetrieveResponse:
237
+ ) -> UseCaseInstanceResponse:
234
238
  """
239
+ Get a Use Case instance details
240
+
235
241
  Args:
236
242
  extra_headers: Send extra headers
237
243
 
@@ -241,31 +247,30 @@ class AsyncPriceModifiersResource(AsyncAPIResource):
241
247
 
242
248
  timeout: Override the client-level default timeout for this request, in seconds
243
249
  """
244
- if not billing_model_id:
245
- raise ValueError(f"Expected a non-empty value for `billing_model_id` but received {billing_model_id!r}")
250
+ if not use_case_id:
251
+ raise ValueError(f"Expected a non-empty value for `use_case_id` but received {use_case_id!r}")
246
252
  return await self._get(
247
- f"/api/v1/price-modifier/{billing_model_id}",
253
+ f"/api/v1/use_cases/instances/{use_case_id}",
248
254
  options=make_request_options(
249
255
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
250
256
  ),
251
- cast_to=PriceModifierRetrieveResponse,
257
+ cast_to=UseCaseInstanceResponse,
252
258
  )
253
259
 
254
- async def update(
260
+ async def delete(
255
261
  self,
262
+ use_case_id: str,
256
263
  *,
257
- billing_model_id: str,
258
- category: str,
259
- price_modifier: float,
260
- resource: str,
261
264
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
262
265
  # The extra values given here take precedence over values defined on the client or passed to this method.
263
266
  extra_headers: Headers | None = None,
264
267
  extra_query: Query | None = None,
265
268
  extra_body: Body | None = None,
266
269
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
267
- ) -> PriceModifier:
270
+ ) -> UseCaseInstanceResponse:
268
271
  """
272
+ Delete a Use Case instance
273
+
269
274
  Args:
270
275
  extra_headers: Send extra headers
271
276
 
@@ -275,79 +280,104 @@ class AsyncPriceModifiersResource(AsyncAPIResource):
275
280
 
276
281
  timeout: Override the client-level default timeout for this request, in seconds
277
282
  """
278
- return await self._put(
279
- "/api/v1/price-modifier",
280
- body=await async_maybe_transform(
281
- {
282
- "billing_model_id": billing_model_id,
283
- "category": category,
284
- "price_modifier": price_modifier,
285
- "resource": resource,
286
- },
287
- price_modifier_update_params.PriceModifierUpdateParams,
288
- ),
283
+ if not use_case_id:
284
+ raise ValueError(f"Expected a non-empty value for `use_case_id` but received {use_case_id!r}")
285
+ return await self._delete(
286
+ f"/api/v1/use_cases/instances/{use_case_id}",
289
287
  options=make_request_options(
290
288
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
291
289
  ),
292
- cast_to=PriceModifier,
290
+ cast_to=UseCaseInstanceResponse,
293
291
  )
294
292
 
295
293
 
296
- class PriceModifiersResourceWithRawResponse:
297
- def __init__(self, price_modifiers: PriceModifiersResource) -> None:
298
- self._price_modifiers = price_modifiers
294
+ class UseCasesResourceWithRawResponse:
295
+ def __init__(self, use_cases: UseCasesResource) -> None:
296
+ self._use_cases = use_cases
299
297
 
300
298
  self.create = to_raw_response_wrapper(
301
- price_modifiers.create,
299
+ use_cases.create,
302
300
  )
303
301
  self.retrieve = to_raw_response_wrapper(
304
- price_modifiers.retrieve,
302
+ use_cases.retrieve,
305
303
  )
306
- self.update = to_raw_response_wrapper(
307
- price_modifiers.update,
304
+ self.delete = to_raw_response_wrapper(
305
+ use_cases.delete,
308
306
  )
309
307
 
308
+ @cached_property
309
+ def types(self) -> TypesResourceWithRawResponse:
310
+ return TypesResourceWithRawResponse(self._use_cases.types)
311
+
312
+ @cached_property
313
+ def properties(self) -> PropertiesResourceWithRawResponse:
314
+ return PropertiesResourceWithRawResponse(self._use_cases.properties)
315
+
310
316
 
311
- class AsyncPriceModifiersResourceWithRawResponse:
312
- def __init__(self, price_modifiers: AsyncPriceModifiersResource) -> None:
313
- self._price_modifiers = price_modifiers
317
+ class AsyncUseCasesResourceWithRawResponse:
318
+ def __init__(self, use_cases: AsyncUseCasesResource) -> None:
319
+ self._use_cases = use_cases
314
320
 
315
321
  self.create = async_to_raw_response_wrapper(
316
- price_modifiers.create,
322
+ use_cases.create,
317
323
  )
318
324
  self.retrieve = async_to_raw_response_wrapper(
319
- price_modifiers.retrieve,
325
+ use_cases.retrieve,
320
326
  )
321
- self.update = async_to_raw_response_wrapper(
322
- price_modifiers.update,
327
+ self.delete = async_to_raw_response_wrapper(
328
+ use_cases.delete,
323
329
  )
324
330
 
331
+ @cached_property
332
+ def types(self) -> AsyncTypesResourceWithRawResponse:
333
+ return AsyncTypesResourceWithRawResponse(self._use_cases.types)
334
+
335
+ @cached_property
336
+ def properties(self) -> AsyncPropertiesResourceWithRawResponse:
337
+ return AsyncPropertiesResourceWithRawResponse(self._use_cases.properties)
338
+
325
339
 
326
- class PriceModifiersResourceWithStreamingResponse:
327
- def __init__(self, price_modifiers: PriceModifiersResource) -> None:
328
- self._price_modifiers = price_modifiers
340
+ class UseCasesResourceWithStreamingResponse:
341
+ def __init__(self, use_cases: UseCasesResource) -> None:
342
+ self._use_cases = use_cases
329
343
 
330
344
  self.create = to_streamed_response_wrapper(
331
- price_modifiers.create,
345
+ use_cases.create,
332
346
  )
333
347
  self.retrieve = to_streamed_response_wrapper(
334
- price_modifiers.retrieve,
348
+ use_cases.retrieve,
335
349
  )
336
- self.update = to_streamed_response_wrapper(
337
- price_modifiers.update,
350
+ self.delete = to_streamed_response_wrapper(
351
+ use_cases.delete,
338
352
  )
339
353
 
354
+ @cached_property
355
+ def types(self) -> TypesResourceWithStreamingResponse:
356
+ return TypesResourceWithStreamingResponse(self._use_cases.types)
357
+
358
+ @cached_property
359
+ def properties(self) -> PropertiesResourceWithStreamingResponse:
360
+ return PropertiesResourceWithStreamingResponse(self._use_cases.properties)
361
+
340
362
 
341
- class AsyncPriceModifiersResourceWithStreamingResponse:
342
- def __init__(self, price_modifiers: AsyncPriceModifiersResource) -> None:
343
- self._price_modifiers = price_modifiers
363
+ class AsyncUseCasesResourceWithStreamingResponse:
364
+ def __init__(self, use_cases: AsyncUseCasesResource) -> None:
365
+ self._use_cases = use_cases
344
366
 
345
367
  self.create = async_to_streamed_response_wrapper(
346
- price_modifiers.create,
368
+ use_cases.create,
347
369
  )
348
370
  self.retrieve = async_to_streamed_response_wrapper(
349
- price_modifiers.retrieve,
371
+ use_cases.retrieve,
350
372
  )
351
- self.update = async_to_streamed_response_wrapper(
352
- price_modifiers.update,
373
+ self.delete = async_to_streamed_response_wrapper(
374
+ use_cases.delete,
353
375
  )
376
+
377
+ @cached_property
378
+ def types(self) -> AsyncTypesResourceWithStreamingResponse:
379
+ return AsyncTypesResourceWithStreamingResponse(self._use_cases.types)
380
+
381
+ @cached_property
382
+ def properties(self) -> AsyncPropertiesResourceWithStreamingResponse:
383
+ return AsyncPropertiesResourceWithStreamingResponse(self._use_cases.properties)
payi/types/__init__.py CHANGED
@@ -2,13 +2,15 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from .shared import PayICommonModelsBudgetManagementCostDetailsBase as PayICommonModelsBudgetManagementCostDetailsBase
5
+ from .shared import (
6
+ PropertiesResponse as PropertiesResponse,
7
+ PayICommonModelsBudgetManagementCostDetailsBase as PayICommonModelsBudgetManagementCostDetailsBase,
8
+ PayICommonModelsBudgetManagementCreateLimitBase as PayICommonModelsBudgetManagementCreateLimitBase,
9
+ )
6
10
  from .cost_data import CostData as CostData
7
11
  from .cost_details import CostDetails as CostDetails
8
- from .billing_model import BillingModel as BillingModel
9
12
  from .requests_data import RequestsData as RequestsData
10
13
  from .limit_response import LimitResponse as LimitResponse
11
- from .price_modifier import PriceModifier as PriceModifier
12
14
  from .ingest_response import IngestResponse as IngestResponse
13
15
  from .total_cost_data import TotalCostData as TotalCostData
14
16
  from .default_response import DefaultResponse as DefaultResponse
@@ -26,14 +28,9 @@ from .category_list_response import CategoryListResponse as CategoryListResponse
26
28
  from .limit_history_response import LimitHistoryResponse as LimitHistoryResponse
27
29
  from .category_delete_response import CategoryDeleteResponse as CategoryDeleteResponse
28
30
  from .category_resource_response import CategoryResourceResponse as CategoryResourceResponse
29
- from .billing_model_create_params import BillingModelCreateParams as BillingModelCreateParams
30
- from .billing_model_list_response import BillingModelListResponse as BillingModelListResponse
31
- from .billing_model_update_params import BillingModelUpdateParams as BillingModelUpdateParams
31
+ from .use_case_instance_response import UseCaseInstanceResponse as UseCaseInstanceResponse
32
32
  from .experience_instance_response import ExperienceInstanceResponse as ExperienceInstanceResponse
33
- from .price_modifier_create_params import PriceModifierCreateParams as PriceModifierCreateParams
34
- from .price_modifier_update_params import PriceModifierUpdateParams as PriceModifierUpdateParams
35
33
  from .category_list_resources_response import CategoryListResourcesResponse as CategoryListResourcesResponse
36
- from .price_modifier_retrieve_response import PriceModifierRetrieveResponse as PriceModifierRetrieveResponse
37
34
  from .category_delete_resource_response import CategoryDeleteResourceResponse as CategoryDeleteResourceResponse
38
35
  from .pay_i_common_models_api_router_header_info_param import (
39
36
  PayICommonModelsAPIRouterHeaderInfoParam as PayICommonModelsAPIRouterHeaderInfoParam,
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, Union
5
+ from typing import Dict, Union, Optional
6
6
  from datetime import datetime
7
7
  from typing_extensions import Required, Annotated, TypedDict
8
8
 
@@ -16,16 +16,16 @@ class ResourceCreateParams(TypedDict, total=False):
16
16
 
17
17
  units: Required[Dict[str, Units]]
18
18
 
19
- max_input_units: int
19
+ max_input_units: Optional[int]
20
20
 
21
- max_output_units: int
21
+ max_output_units: Optional[int]
22
22
 
23
- max_total_units: int
23
+ max_total_units: Optional[int]
24
24
 
25
25
  start_timestamp: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
26
26
 
27
27
 
28
28
  class Units(TypedDict, total=False):
29
- input_price: Required[float]
29
+ input_price: float
30
30
 
31
- output_price: Required[float]
31
+ output_price: float
@@ -9,9 +9,9 @@ __all__ = ["CategoryResourceResponse", "Units"]
9
9
 
10
10
 
11
11
  class Units(BaseModel):
12
- input_price: float
12
+ input_price: Optional[float] = None
13
13
 
14
- output_price: float
14
+ output_price: Optional[float] = None
15
15
 
16
16
 
17
17
  class CategoryResourceResponse(BaseModel):
@@ -11,3 +11,5 @@ class ExperienceInstanceResponse(BaseModel):
11
11
  experience_id: str
12
12
 
13
13
  limit_id: Optional[str] = None
14
+
15
+ type_version: Optional[int] = None
@@ -7,5 +7,4 @@ from .type_list_params import TypeListParams as TypeListParams
7
7
  from .type_create_params import TypeCreateParams as TypeCreateParams
8
8
  from .type_list_response import TypeListResponse as TypeListResponse
9
9
  from .type_update_params import TypeUpdateParams as TypeUpdateParams
10
- from .properties_response import PropertiesResponse as PropertiesResponse
11
10
  from .property_create_params import PropertyCreateParams as PropertyCreateParams
@@ -1,21 +1,13 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- from typing import List, Optional
4
- from typing_extensions import Literal
3
+ from typing import Optional
5
4
 
6
5
  from ..._models import BaseModel
6
+ from ..shared.pay_i_common_models_budget_management_create_limit_base import (
7
+ PayICommonModelsBudgetManagementCreateLimitBase,
8
+ )
7
9
 
8
- __all__ = ["ExperienceType", "LimitConfig"]
9
-
10
-
11
- class LimitConfig(BaseModel):
12
- max: float
13
-
14
- limit_tags: Optional[List[str]] = None
15
-
16
- limit_type: Optional[Literal["block", "allow"]] = None
17
-
18
- threshold: Optional[float] = None
10
+ __all__ = ["ExperienceType"]
19
11
 
20
12
 
21
13
  class ExperienceType(BaseModel):
@@ -25,6 +17,8 @@ class ExperienceType(BaseModel):
25
17
 
26
18
  request_id: str
27
19
 
28
- limit_config: Optional[LimitConfig] = None
20
+ limit_config: Optional[PayICommonModelsBudgetManagementCreateLimitBase] = None
29
21
 
30
22
  logging_enabled: Optional[bool] = None
23
+
24
+ type_version: Optional[int] = None
@@ -2,10 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Optional
6
- from typing_extensions import Literal, Required, TypedDict
5
+ from typing import Optional
6
+ from typing_extensions import Required, TypedDict
7
7
 
8
- __all__ = ["TypeCreateParams", "LimitConfig"]
8
+ from ..shared_params.pay_i_common_models_budget_management_create_limit_base import (
9
+ PayICommonModelsBudgetManagementCreateLimitBase,
10
+ )
11
+
12
+ __all__ = ["TypeCreateParams"]
9
13
 
10
14
 
11
15
  class TypeCreateParams(TypedDict, total=False):
@@ -13,16 +17,6 @@ class TypeCreateParams(TypedDict, total=False):
13
17
 
14
18
  name: Required[str]
15
19
 
16
- limit_config: LimitConfig
20
+ limit_config: PayICommonModelsBudgetManagementCreateLimitBase
17
21
 
18
22
  logging_enabled: Optional[bool]
19
-
20
-
21
- class LimitConfig(TypedDict, total=False):
22
- max: Required[float]
23
-
24
- limit_tags: Optional[List[str]]
25
-
26
- limit_type: Literal["block", "allow"]
27
-
28
- threshold: Optional[float]