payi 0.1.0a33__py3-none-any.whl → 0.1.0a35__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 (52) hide show
  1. payi/_base_client.py +6 -0
  2. payi/_client.py +9 -9
  3. payi/_models.py +5 -1
  4. payi/_version.py +1 -1
  5. payi/lib/helpers.py +11 -8
  6. payi/resources/__init__.py +13 -13
  7. payi/resources/billing_models.py +4 -4
  8. payi/resources/experiences/__init__.py +0 -14
  9. payi/resources/experiences/experiences.py +0 -32
  10. payi/resources/experiences/properties.py +5 -5
  11. payi/resources/ingest.py +49 -23
  12. payi/resources/{budgets → limits}/__init__.py +13 -13
  13. payi/resources/{budgets/budgets.py → limits/limits.py} +213 -196
  14. payi/resources/{budgets → limits}/tags.py +68 -68
  15. payi/resources/requests/properties.py +5 -5
  16. payi/types/__init__.py +8 -6
  17. payi/types/billing_model.py +1 -1
  18. payi/types/billing_model_create_params.py +1 -1
  19. payi/types/billing_model_update_params.py +1 -1
  20. payi/types/category_resource_response.py +4 -0
  21. payi/types/experiences/__init__.py +0 -2
  22. payi/types/experiences/property_create_params.py +2 -2
  23. payi/types/ingest_event_param.py +29 -5
  24. payi/types/ingest_response.py +7 -7
  25. payi/types/ingest_units_params.py +28 -4
  26. payi/types/{budget_create_params.py → limit_create_params.py} +7 -9
  27. payi/types/limit_history_response.py +34 -0
  28. payi/types/{budget_list_params.py → limit_list_params.py} +3 -3
  29. payi/types/limit_reset_params.py +16 -0
  30. payi/types/{budget_response.py → limit_response.py} +11 -13
  31. payi/types/{budget_update_params.py → limit_update_params.py} +3 -3
  32. payi/types/{budgets → limits}/__init__.py +1 -1
  33. payi/types/{budgets/budget_tags.py → limits/limit_tags.py} +2 -2
  34. payi/types/{budgets → limits}/tag_create_params.py +1 -1
  35. payi/types/{budgets → limits}/tag_create_response.py +2 -2
  36. payi/types/{budgets → limits}/tag_delete_response.py +2 -2
  37. payi/types/{budgets → limits}/tag_list_response.py +2 -2
  38. payi/types/{budgets → limits}/tag_remove_params.py +1 -1
  39. payi/types/{budgets → limits}/tag_remove_response.py +2 -2
  40. payi/types/{budgets → limits}/tag_update_params.py +1 -1
  41. payi/types/{budgets → limits}/tag_update_response.py +2 -2
  42. payi/types/{paged_budget_list.py → paged_limit_list.py} +9 -11
  43. payi/types/requests/property_create_params.py +2 -2
  44. payi/types/shared/__init__.py +3 -0
  45. payi/types/{experiences/csat_response.py → shared/evaluation_response.py} +3 -2
  46. {payi-0.1.0a33.dist-info → payi-0.1.0a35.dist-info}/METADATA +22 -23
  47. {payi-0.1.0a33.dist-info → payi-0.1.0a35.dist-info}/RECORD +49 -49
  48. {payi-0.1.0a33.dist-info → payi-0.1.0a35.dist-info}/licenses/LICENSE +1 -1
  49. payi/resources/experiences/csat.py +0 -188
  50. payi/types/budget_history_response.py +0 -38
  51. payi/types/experiences/csat_create_params.py +0 -14
  52. {payi-0.1.0a33.dist-info → payi-0.1.0a35.dist-info}/WHEEL +0 -0
@@ -2,7 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Optional
5
+ from typing import List, Union, Optional
6
+ from datetime import datetime
6
7
  from typing_extensions import Literal
7
8
 
8
9
  import httpx
@@ -15,7 +16,7 @@ from .tags import (
15
16
  TagsResourceWithStreamingResponse,
16
17
  AsyncTagsResourceWithStreamingResponse,
17
18
  )
18
- from ...types import budget_list_params, budget_create_params, budget_update_params
19
+ from ...types import limit_list_params, limit_reset_params, limit_create_params, limit_update_params
19
20
  from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
20
21
  from ..._utils import (
21
22
  maybe_transform,
@@ -30,49 +31,48 @@ from ..._response import (
30
31
  async_to_streamed_response_wrapper,
31
32
  )
32
33
  from ..._base_client import make_request_options
33
- from ...types.budget_response import BudgetResponse
34
+ from ...types.limit_response import LimitResponse
34
35
  from ...types.default_response import DefaultResponse
35
- from ...types.paged_budget_list import PagedBudgetList
36
- from ...types.budget_history_response import BudgetHistoryResponse
36
+ from ...types.paged_limit_list import PagedLimitList
37
+ from ...types.limit_history_response import LimitHistoryResponse
37
38
 
38
- __all__ = ["BudgetsResource", "AsyncBudgetsResource"]
39
+ __all__ = ["LimitsResource", "AsyncLimitsResource"]
39
40
 
40
41
 
41
- class BudgetsResource(SyncAPIResource):
42
+ class LimitsResource(SyncAPIResource):
42
43
  @cached_property
43
44
  def tags(self) -> TagsResource:
44
45
  return TagsResource(self._client)
45
46
 
46
47
  @cached_property
47
- def with_raw_response(self) -> BudgetsResourceWithRawResponse:
48
+ def with_raw_response(self) -> LimitsResourceWithRawResponse:
48
49
  """
49
50
  This property can be used as a prefix for any HTTP method call to return the
50
51
  the raw response object instead of the parsed content.
51
52
 
52
53
  For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
53
54
  """
54
- return BudgetsResourceWithRawResponse(self)
55
+ return LimitsResourceWithRawResponse(self)
55
56
 
56
57
  @cached_property
57
- def with_streaming_response(self) -> BudgetsResourceWithStreamingResponse:
58
+ def with_streaming_response(self) -> LimitsResourceWithStreamingResponse:
58
59
  """
59
60
  An alternative to `.with_raw_response` that doesn't eagerly read the response body.
60
61
 
61
62
  For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
62
63
  """
63
- return BudgetsResourceWithStreamingResponse(self)
64
+ return LimitsResourceWithStreamingResponse(self)
64
65
 
65
66
  def create(
66
67
  self,
67
68
  *,
68
- budget_name: str,
69
+ limit_name: str,
69
70
  max: float,
70
- base_cost_estimate: Literal["max"] | NotGiven = NOT_GIVEN,
71
71
  billing_model_id: Optional[str] | NotGiven = NOT_GIVEN,
72
- budget_response_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
73
- budget_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
74
72
  cost_basis: Literal["base", "billed"] | NotGiven = NOT_GIVEN,
75
73
  currency: Literal["usd"] | NotGiven = NOT_GIVEN,
74
+ limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
75
+ limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
76
76
  threshold: Optional[float] | NotGiven = NOT_GIVEN,
77
77
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
78
78
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -80,47 +80,43 @@ class BudgetsResource(SyncAPIResource):
80
80
  extra_query: Query | None = None,
81
81
  extra_body: Body | None = None,
82
82
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
83
- ) -> BudgetResponse:
83
+ ) -> LimitResponse:
84
84
  """
85
- Create a Budget
85
+ Create a Limit
86
86
 
87
87
  Args:
88
- budget_name (str): The name of the budget.
89
- max (float): The maximum budget amount.
90
- base_cost_estimate (Union[float, Literal['max']], optional): The base cost estimate. Defaults to 'max'.
91
- budget_response_type (Literal['block', 'allow'], optional): The budget response type. Defaults to 'block'.
92
- budget_tags (Union[List[str], None], optional): List of budget tags. Defaults to None.
93
- budget_type (Literal['conservative', 'liberal'], optional): The budget type. Defaults to 'conservative'.
94
- extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
95
- extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
96
- extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
97
- timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
88
+ extra_headers: Send extra headers
89
+
90
+ extra_query: Add additional query parameters to the request
91
+
92
+ extra_body: Add additional JSON properties to the request
93
+
94
+ timeout: Override the client-level default timeout for this request, in seconds
98
95
  """
99
96
  return self._post(
100
- "/api/v1/budgets",
97
+ "/api/v1/limits",
101
98
  body=maybe_transform(
102
99
  {
103
- "budget_name": budget_name,
100
+ "limit_name": limit_name,
104
101
  "max": max,
105
- "base_cost_estimate": base_cost_estimate,
106
102
  "billing_model_id": billing_model_id,
107
- "budget_response_type": budget_response_type,
108
- "budget_tags": budget_tags,
109
103
  "cost_basis": cost_basis,
110
104
  "currency": currency,
105
+ "limit_tags": limit_tags,
106
+ "limit_type": limit_type,
111
107
  "threshold": threshold,
112
108
  },
113
- budget_create_params.BudgetCreateParams,
109
+ limit_create_params.LimitCreateParams,
114
110
  ),
115
111
  options=make_request_options(
116
112
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
117
113
  ),
118
- cast_to=BudgetResponse,
114
+ cast_to=LimitResponse,
119
115
  )
120
116
 
121
117
  def retrieve(
122
118
  self,
123
- budget_id: str,
119
+ limit_id: str,
124
120
  *,
125
121
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
126
122
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -128,32 +124,34 @@ class BudgetsResource(SyncAPIResource):
128
124
  extra_query: Query | None = None,
129
125
  extra_body: Body | None = None,
130
126
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
131
- ) -> BudgetResponse:
127
+ ) -> LimitResponse:
132
128
  """
133
- Get Budget details
129
+ Get Limit details
134
130
 
135
131
  Args:
136
- budget_id (str): The ID of the budget.
137
- extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
138
- extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
139
- extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
140
- timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
141
- """
142
- if not budget_id:
143
- raise ValueError(f"Expected a non-empty value for `budget_id` but received {budget_id!r}")
132
+ extra_headers: Send extra headers
133
+
134
+ extra_query: Add additional query parameters to the request
135
+
136
+ extra_body: Add additional JSON properties to the request
137
+
138
+ timeout: Override the client-level default timeout for this request, in seconds
139
+ """
140
+ if not limit_id:
141
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
144
142
  return self._get(
145
- f"/api/v1/budgets/{budget_id}",
143
+ f"/api/v1/limits/{limit_id}",
146
144
  options=make_request_options(
147
145
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
148
146
  ),
149
- cast_to=BudgetResponse,
147
+ cast_to=LimitResponse,
150
148
  )
151
149
 
152
150
  def update(
153
151
  self,
154
- budget_id: str,
152
+ limit_id: str,
155
153
  *,
156
- budget_name: Optional[str] | NotGiven = NOT_GIVEN,
154
+ limit_name: Optional[str] | NotGiven = NOT_GIVEN,
157
155
  max: Optional[float] | NotGiven = NOT_GIVEN,
158
156
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
159
157
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -161,40 +159,40 @@ class BudgetsResource(SyncAPIResource):
161
159
  extra_query: Query | None = None,
162
160
  extra_body: Body | None = None,
163
161
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
164
- ) -> BudgetResponse:
162
+ ) -> LimitResponse:
165
163
  """
166
- Update a Budget
164
+ Update a Limit
167
165
 
168
166
  Args:
169
- budget_id (str): The ID of the budget.
170
- budget_name (Union[str, optional]): The updated name of the budget. Defaults to None.
171
- max (Union[float, optional])): The maximum budget amount. Defaults to None.
172
- extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
173
- extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
174
- extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
175
- timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
176
- """
177
- if not budget_id:
178
- raise ValueError(f"Expected a non-empty value for `budget_id` but received {budget_id!r}")
167
+ extra_headers: Send extra headers
168
+
169
+ extra_query: Add additional query parameters to the request
170
+
171
+ extra_body: Add additional JSON properties to the request
172
+
173
+ timeout: Override the client-level default timeout for this request, in seconds
174
+ """
175
+ if not limit_id:
176
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
179
177
  return self._put(
180
- f"/api/v1/budgets/{budget_id}",
178
+ f"/api/v1/limits/{limit_id}",
181
179
  body=maybe_transform(
182
180
  {
183
- "budget_name": budget_name,
181
+ "limit_name": limit_name,
184
182
  "max": max,
185
183
  },
186
- budget_update_params.BudgetUpdateParams,
184
+ limit_update_params.LimitUpdateParams,
187
185
  ),
188
186
  options=make_request_options(
189
187
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
190
188
  ),
191
- cast_to=BudgetResponse,
189
+ cast_to=LimitResponse,
192
190
  )
193
191
 
194
192
  def list(
195
193
  self,
196
194
  *,
197
- budget_name: str | NotGiven = NOT_GIVEN,
195
+ limit_name: str | NotGiven = NOT_GIVEN,
198
196
  page_number: int | NotGiven = NOT_GIVEN,
199
197
  page_size: int | NotGiven = NOT_GIVEN,
200
198
  sort_ascending: bool | NotGiven = NOT_GIVEN,
@@ -206,18 +204,21 @@ class BudgetsResource(SyncAPIResource):
206
204
  extra_query: Query | None = None,
207
205
  extra_body: Body | None = None,
208
206
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
209
- ) -> PagedBudgetList:
207
+ ) -> PagedLimitList:
210
208
  """
211
- Get all Budgets
209
+ Get all Limits
212
210
 
213
211
  Args:
214
- extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
215
- extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
216
- extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
217
- timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
212
+ extra_headers: Send extra headers
213
+
214
+ extra_query: Add additional query parameters to the request
215
+
216
+ extra_body: Add additional JSON properties to the request
217
+
218
+ timeout: Override the client-level default timeout for this request, in seconds
218
219
  """
219
220
  return self._get(
220
- "/api/v1/budgets",
221
+ "/api/v1/limits",
221
222
  options=make_request_options(
222
223
  extra_headers=extra_headers,
223
224
  extra_query=extra_query,
@@ -225,22 +226,22 @@ class BudgetsResource(SyncAPIResource):
225
226
  timeout=timeout,
226
227
  query=maybe_transform(
227
228
  {
228
- "budget_name": budget_name,
229
+ "limit_name": limit_name,
229
230
  "page_number": page_number,
230
231
  "page_size": page_size,
231
232
  "sort_ascending": sort_ascending,
232
233
  "sort_by": sort_by,
233
234
  "tags": tags,
234
235
  },
235
- budget_list_params.BudgetListParams,
236
+ limit_list_params.LimitListParams,
236
237
  ),
237
238
  ),
238
- cast_to=PagedBudgetList,
239
+ cast_to=PagedLimitList,
239
240
  )
240
241
 
241
242
  def delete(
242
243
  self,
243
- budget_id: str,
244
+ limit_id: str,
244
245
  *,
245
246
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
246
247
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -250,19 +251,21 @@ class BudgetsResource(SyncAPIResource):
250
251
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
251
252
  ) -> DefaultResponse:
252
253
  """
253
- Delete a Budget
254
+ Delete a Limit
254
255
 
255
256
  Args:
256
- budget_id (str): The ID of the budget.
257
- extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
258
- extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
259
- extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
260
- timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
261
- """
262
- if not budget_id:
263
- raise ValueError(f"Expected a non-empty value for `budget_id` but received {budget_id!r}")
257
+ extra_headers: Send extra headers
258
+
259
+ extra_query: Add additional query parameters to the request
260
+
261
+ extra_body: Add additional JSON properties to the request
262
+
263
+ timeout: Override the client-level default timeout for this request, in seconds
264
+ """
265
+ if not limit_id:
266
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
264
267
  return self._delete(
265
- f"/api/v1/budgets/{budget_id}",
268
+ f"/api/v1/limits/{limit_id}",
266
269
  options=make_request_options(
267
270
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
268
271
  ),
@@ -271,71 +274,79 @@ class BudgetsResource(SyncAPIResource):
271
274
 
272
275
  def reset(
273
276
  self,
274
- budget_id: str,
277
+ limit_id: str,
275
278
  *,
279
+ reset_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
276
280
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
277
281
  # The extra values given here take precedence over values defined on the client or passed to this method.
278
282
  extra_headers: Headers | None = None,
279
283
  extra_query: Query | None = None,
280
284
  extra_body: Body | None = None,
281
285
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
282
- ) -> BudgetHistoryResponse:
286
+ ) -> LimitHistoryResponse:
283
287
  """
284
- Reset a Budget
288
+ Reset a Limit
285
289
 
286
290
  Args:
287
- budget_id (str): The ID of the budget.
288
- extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
289
- extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
290
- extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
291
- timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
292
- """
293
- if not budget_id:
294
- raise ValueError(f"Expected a non-empty value for `budget_id` but received {budget_id!r}")
291
+ reset_date: Effective reset date
292
+
293
+ extra_headers: Send extra headers
294
+
295
+ extra_query: Add additional query parameters to the request
296
+
297
+ extra_body: Add additional JSON properties to the request
298
+
299
+ timeout: Override the client-level default timeout for this request, in seconds
300
+ """
301
+ if not limit_id:
302
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
295
303
  return self._post(
296
- f"/api/v1/budgets/{budget_id}/reset",
304
+ f"/api/v1/limits/{limit_id}/reset",
297
305
  options=make_request_options(
298
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
306
+ extra_headers=extra_headers,
307
+ extra_query=extra_query,
308
+ extra_body=extra_body,
309
+ timeout=timeout,
310
+ query=maybe_transform({"reset_date": reset_date}, limit_reset_params.LimitResetParams),
299
311
  ),
300
- cast_to=BudgetHistoryResponse,
312
+ cast_to=LimitHistoryResponse,
301
313
  )
302
314
 
303
315
 
304
- class AsyncBudgetsResource(AsyncAPIResource):
316
+ class AsyncLimitsResource(AsyncAPIResource):
305
317
  @cached_property
306
318
  def tags(self) -> AsyncTagsResource:
307
319
  return AsyncTagsResource(self._client)
308
320
 
309
321
  @cached_property
310
- def with_raw_response(self) -> AsyncBudgetsResourceWithRawResponse:
322
+ def with_raw_response(self) -> AsyncLimitsResourceWithRawResponse:
311
323
  """
312
324
  This property can be used as a prefix for any HTTP method call to return the
313
325
  the raw response object instead of the parsed content.
314
326
 
315
327
  For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
316
328
  """
317
- return AsyncBudgetsResourceWithRawResponse(self)
329
+ return AsyncLimitsResourceWithRawResponse(self)
318
330
 
319
331
  @cached_property
320
- def with_streaming_response(self) -> AsyncBudgetsResourceWithStreamingResponse:
332
+ def with_streaming_response(self) -> AsyncLimitsResourceWithStreamingResponse:
321
333
  """
322
334
  An alternative to `.with_raw_response` that doesn't eagerly read the response body.
323
335
 
324
336
  For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
325
337
  """
326
- return AsyncBudgetsResourceWithStreamingResponse(self)
338
+ return AsyncLimitsResourceWithStreamingResponse(self)
327
339
 
328
340
  async def create(
329
341
  self,
330
342
  *,
331
- budget_name: str,
343
+ limit_name: str,
332
344
  max: float,
333
- base_cost_estimate: Literal["max"] | NotGiven = NOT_GIVEN,
334
345
  billing_model_id: Optional[str] | NotGiven = NOT_GIVEN,
335
- budget_response_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
336
- budget_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
337
346
  cost_basis: Literal["base", "billed"] | NotGiven = NOT_GIVEN,
338
347
  currency: Literal["usd"] | NotGiven = NOT_GIVEN,
348
+ limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
349
+ limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
339
350
  threshold: Optional[float] | NotGiven = NOT_GIVEN,
340
351
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
341
352
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -343,9 +354,9 @@ class AsyncBudgetsResource(AsyncAPIResource):
343
354
  extra_query: Query | None = None,
344
355
  extra_body: Body | None = None,
345
356
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
346
- ) -> BudgetResponse:
357
+ ) -> LimitResponse:
347
358
  """
348
- Create a Budget
359
+ Create a Limit
349
360
 
350
361
  Args:
351
362
  extra_headers: Send extra headers
@@ -357,30 +368,29 @@ class AsyncBudgetsResource(AsyncAPIResource):
357
368
  timeout: Override the client-level default timeout for this request, in seconds
358
369
  """
359
370
  return await self._post(
360
- "/api/v1/budgets",
371
+ "/api/v1/limits",
361
372
  body=await async_maybe_transform(
362
373
  {
363
- "budget_name": budget_name,
374
+ "limit_name": limit_name,
364
375
  "max": max,
365
- "base_cost_estimate": base_cost_estimate,
366
376
  "billing_model_id": billing_model_id,
367
- "budget_response_type": budget_response_type,
368
- "budget_tags": budget_tags,
369
377
  "cost_basis": cost_basis,
370
378
  "currency": currency,
379
+ "limit_tags": limit_tags,
380
+ "limit_type": limit_type,
371
381
  "threshold": threshold,
372
382
  },
373
- budget_create_params.BudgetCreateParams,
383
+ limit_create_params.LimitCreateParams,
374
384
  ),
375
385
  options=make_request_options(
376
386
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
377
387
  ),
378
- cast_to=BudgetResponse,
388
+ cast_to=LimitResponse,
379
389
  )
380
390
 
381
391
  async def retrieve(
382
392
  self,
383
- budget_id: str,
393
+ limit_id: str,
384
394
  *,
385
395
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
386
396
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -388,9 +398,9 @@ class AsyncBudgetsResource(AsyncAPIResource):
388
398
  extra_query: Query | None = None,
389
399
  extra_body: Body | None = None,
390
400
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
391
- ) -> BudgetResponse:
401
+ ) -> LimitResponse:
392
402
  """
393
- Get Budget details
403
+ Get Limit details
394
404
 
395
405
  Args:
396
406
  extra_headers: Send extra headers
@@ -401,21 +411,21 @@ class AsyncBudgetsResource(AsyncAPIResource):
401
411
 
402
412
  timeout: Override the client-level default timeout for this request, in seconds
403
413
  """
404
- if not budget_id:
405
- raise ValueError(f"Expected a non-empty value for `budget_id` but received {budget_id!r}")
414
+ if not limit_id:
415
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
406
416
  return await self._get(
407
- f"/api/v1/budgets/{budget_id}",
417
+ f"/api/v1/limits/{limit_id}",
408
418
  options=make_request_options(
409
419
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
410
420
  ),
411
- cast_to=BudgetResponse,
421
+ cast_to=LimitResponse,
412
422
  )
413
423
 
414
424
  async def update(
415
425
  self,
416
- budget_id: str,
426
+ limit_id: str,
417
427
  *,
418
- budget_name: Optional[str] | NotGiven = NOT_GIVEN,
428
+ limit_name: Optional[str] | NotGiven = NOT_GIVEN,
419
429
  max: Optional[float] | NotGiven = NOT_GIVEN,
420
430
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
421
431
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -423,9 +433,9 @@ class AsyncBudgetsResource(AsyncAPIResource):
423
433
  extra_query: Query | None = None,
424
434
  extra_body: Body | None = None,
425
435
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
426
- ) -> BudgetResponse:
436
+ ) -> LimitResponse:
427
437
  """
428
- Update a Budget
438
+ Update a Limit
429
439
 
430
440
  Args:
431
441
  extra_headers: Send extra headers
@@ -436,27 +446,27 @@ class AsyncBudgetsResource(AsyncAPIResource):
436
446
 
437
447
  timeout: Override the client-level default timeout for this request, in seconds
438
448
  """
439
- if not budget_id:
440
- raise ValueError(f"Expected a non-empty value for `budget_id` but received {budget_id!r}")
449
+ if not limit_id:
450
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
441
451
  return await self._put(
442
- f"/api/v1/budgets/{budget_id}",
452
+ f"/api/v1/limits/{limit_id}",
443
453
  body=await async_maybe_transform(
444
454
  {
445
- "budget_name": budget_name,
455
+ "limit_name": limit_name,
446
456
  "max": max,
447
457
  },
448
- budget_update_params.BudgetUpdateParams,
458
+ limit_update_params.LimitUpdateParams,
449
459
  ),
450
460
  options=make_request_options(
451
461
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
452
462
  ),
453
- cast_to=BudgetResponse,
463
+ cast_to=LimitResponse,
454
464
  )
455
465
 
456
466
  async def list(
457
467
  self,
458
468
  *,
459
- budget_name: str | NotGiven = NOT_GIVEN,
469
+ limit_name: str | NotGiven = NOT_GIVEN,
460
470
  page_number: int | NotGiven = NOT_GIVEN,
461
471
  page_size: int | NotGiven = NOT_GIVEN,
462
472
  sort_ascending: bool | NotGiven = NOT_GIVEN,
@@ -468,9 +478,9 @@ class AsyncBudgetsResource(AsyncAPIResource):
468
478
  extra_query: Query | None = None,
469
479
  extra_body: Body | None = None,
470
480
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
471
- ) -> PagedBudgetList:
481
+ ) -> PagedLimitList:
472
482
  """
473
- Get all Budgets
483
+ Get all Limits
474
484
 
475
485
  Args:
476
486
  extra_headers: Send extra headers
@@ -482,7 +492,7 @@ class AsyncBudgetsResource(AsyncAPIResource):
482
492
  timeout: Override the client-level default timeout for this request, in seconds
483
493
  """
484
494
  return await self._get(
485
- "/api/v1/budgets",
495
+ "/api/v1/limits",
486
496
  options=make_request_options(
487
497
  extra_headers=extra_headers,
488
498
  extra_query=extra_query,
@@ -490,22 +500,22 @@ class AsyncBudgetsResource(AsyncAPIResource):
490
500
  timeout=timeout,
491
501
  query=await async_maybe_transform(
492
502
  {
493
- "budget_name": budget_name,
503
+ "limit_name": limit_name,
494
504
  "page_number": page_number,
495
505
  "page_size": page_size,
496
506
  "sort_ascending": sort_ascending,
497
507
  "sort_by": sort_by,
498
508
  "tags": tags,
499
509
  },
500
- budget_list_params.BudgetListParams,
510
+ limit_list_params.LimitListParams,
501
511
  ),
502
512
  ),
503
- cast_to=PagedBudgetList,
513
+ cast_to=PagedLimitList,
504
514
  )
505
515
 
506
516
  async def delete(
507
517
  self,
508
- budget_id: str,
518
+ limit_id: str,
509
519
  *,
510
520
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
511
521
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -515,7 +525,7 @@ class AsyncBudgetsResource(AsyncAPIResource):
515
525
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
516
526
  ) -> DefaultResponse:
517
527
  """
518
- Delete a Budget
528
+ Delete a Limit
519
529
 
520
530
  Args:
521
531
  extra_headers: Send extra headers
@@ -526,10 +536,10 @@ class AsyncBudgetsResource(AsyncAPIResource):
526
536
 
527
537
  timeout: Override the client-level default timeout for this request, in seconds
528
538
  """
529
- if not budget_id:
530
- raise ValueError(f"Expected a non-empty value for `budget_id` but received {budget_id!r}")
539
+ if not limit_id:
540
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
531
541
  return await self._delete(
532
- f"/api/v1/budgets/{budget_id}",
542
+ f"/api/v1/limits/{limit_id}",
533
543
  options=make_request_options(
534
544
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
535
545
  ),
@@ -538,19 +548,22 @@ class AsyncBudgetsResource(AsyncAPIResource):
538
548
 
539
549
  async def reset(
540
550
  self,
541
- budget_id: str,
551
+ limit_id: str,
542
552
  *,
553
+ reset_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
543
554
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
544
555
  # The extra values given here take precedence over values defined on the client or passed to this method.
545
556
  extra_headers: Headers | None = None,
546
557
  extra_query: Query | None = None,
547
558
  extra_body: Body | None = None,
548
559
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
549
- ) -> BudgetHistoryResponse:
560
+ ) -> LimitHistoryResponse:
550
561
  """
551
- Reset a Budget
562
+ Reset a Limit
552
563
 
553
564
  Args:
565
+ reset_date: Effective reset date
566
+
554
567
  extra_headers: Send extra headers
555
568
 
556
569
  extra_query: Add additional query parameters to the request
@@ -559,124 +572,128 @@ class AsyncBudgetsResource(AsyncAPIResource):
559
572
 
560
573
  timeout: Override the client-level default timeout for this request, in seconds
561
574
  """
562
- if not budget_id:
563
- raise ValueError(f"Expected a non-empty value for `budget_id` but received {budget_id!r}")
575
+ if not limit_id:
576
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
564
577
  return await self._post(
565
- f"/api/v1/budgets/{budget_id}/reset",
578
+ f"/api/v1/limits/{limit_id}/reset",
566
579
  options=make_request_options(
567
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
580
+ extra_headers=extra_headers,
581
+ extra_query=extra_query,
582
+ extra_body=extra_body,
583
+ timeout=timeout,
584
+ query=await async_maybe_transform({"reset_date": reset_date}, limit_reset_params.LimitResetParams),
568
585
  ),
569
- cast_to=BudgetHistoryResponse,
586
+ cast_to=LimitHistoryResponse,
570
587
  )
571
588
 
572
589
 
573
- class BudgetsResourceWithRawResponse:
574
- def __init__(self, budgets: BudgetsResource) -> None:
575
- self._budgets = budgets
590
+ class LimitsResourceWithRawResponse:
591
+ def __init__(self, limits: LimitsResource) -> None:
592
+ self._limits = limits
576
593
 
577
594
  self.create = to_raw_response_wrapper(
578
- budgets.create,
595
+ limits.create,
579
596
  )
580
597
  self.retrieve = to_raw_response_wrapper(
581
- budgets.retrieve,
598
+ limits.retrieve,
582
599
  )
583
600
  self.update = to_raw_response_wrapper(
584
- budgets.update,
601
+ limits.update,
585
602
  )
586
603
  self.list = to_raw_response_wrapper(
587
- budgets.list,
604
+ limits.list,
588
605
  )
589
606
  self.delete = to_raw_response_wrapper(
590
- budgets.delete,
607
+ limits.delete,
591
608
  )
592
609
  self.reset = to_raw_response_wrapper(
593
- budgets.reset,
610
+ limits.reset,
594
611
  )
595
612
 
596
613
  @cached_property
597
614
  def tags(self) -> TagsResourceWithRawResponse:
598
- return TagsResourceWithRawResponse(self._budgets.tags)
615
+ return TagsResourceWithRawResponse(self._limits.tags)
599
616
 
600
617
 
601
- class AsyncBudgetsResourceWithRawResponse:
602
- def __init__(self, budgets: AsyncBudgetsResource) -> None:
603
- self._budgets = budgets
618
+ class AsyncLimitsResourceWithRawResponse:
619
+ def __init__(self, limits: AsyncLimitsResource) -> None:
620
+ self._limits = limits
604
621
 
605
622
  self.create = async_to_raw_response_wrapper(
606
- budgets.create,
623
+ limits.create,
607
624
  )
608
625
  self.retrieve = async_to_raw_response_wrapper(
609
- budgets.retrieve,
626
+ limits.retrieve,
610
627
  )
611
628
  self.update = async_to_raw_response_wrapper(
612
- budgets.update,
629
+ limits.update,
613
630
  )
614
631
  self.list = async_to_raw_response_wrapper(
615
- budgets.list,
632
+ limits.list,
616
633
  )
617
634
  self.delete = async_to_raw_response_wrapper(
618
- budgets.delete,
635
+ limits.delete,
619
636
  )
620
637
  self.reset = async_to_raw_response_wrapper(
621
- budgets.reset,
638
+ limits.reset,
622
639
  )
623
640
 
624
641
  @cached_property
625
642
  def tags(self) -> AsyncTagsResourceWithRawResponse:
626
- return AsyncTagsResourceWithRawResponse(self._budgets.tags)
643
+ return AsyncTagsResourceWithRawResponse(self._limits.tags)
627
644
 
628
645
 
629
- class BudgetsResourceWithStreamingResponse:
630
- def __init__(self, budgets: BudgetsResource) -> None:
631
- self._budgets = budgets
646
+ class LimitsResourceWithStreamingResponse:
647
+ def __init__(self, limits: LimitsResource) -> None:
648
+ self._limits = limits
632
649
 
633
650
  self.create = to_streamed_response_wrapper(
634
- budgets.create,
651
+ limits.create,
635
652
  )
636
653
  self.retrieve = to_streamed_response_wrapper(
637
- budgets.retrieve,
654
+ limits.retrieve,
638
655
  )
639
656
  self.update = to_streamed_response_wrapper(
640
- budgets.update,
657
+ limits.update,
641
658
  )
642
659
  self.list = to_streamed_response_wrapper(
643
- budgets.list,
660
+ limits.list,
644
661
  )
645
662
  self.delete = to_streamed_response_wrapper(
646
- budgets.delete,
663
+ limits.delete,
647
664
  )
648
665
  self.reset = to_streamed_response_wrapper(
649
- budgets.reset,
666
+ limits.reset,
650
667
  )
651
668
 
652
669
  @cached_property
653
670
  def tags(self) -> TagsResourceWithStreamingResponse:
654
- return TagsResourceWithStreamingResponse(self._budgets.tags)
671
+ return TagsResourceWithStreamingResponse(self._limits.tags)
655
672
 
656
673
 
657
- class AsyncBudgetsResourceWithStreamingResponse:
658
- def __init__(self, budgets: AsyncBudgetsResource) -> None:
659
- self._budgets = budgets
674
+ class AsyncLimitsResourceWithStreamingResponse:
675
+ def __init__(self, limits: AsyncLimitsResource) -> None:
676
+ self._limits = limits
660
677
 
661
678
  self.create = async_to_streamed_response_wrapper(
662
- budgets.create,
679
+ limits.create,
663
680
  )
664
681
  self.retrieve = async_to_streamed_response_wrapper(
665
- budgets.retrieve,
682
+ limits.retrieve,
666
683
  )
667
684
  self.update = async_to_streamed_response_wrapper(
668
- budgets.update,
685
+ limits.update,
669
686
  )
670
687
  self.list = async_to_streamed_response_wrapper(
671
- budgets.list,
688
+ limits.list,
672
689
  )
673
690
  self.delete = async_to_streamed_response_wrapper(
674
- budgets.delete,
691
+ limits.delete,
675
692
  )
676
693
  self.reset = async_to_streamed_response_wrapper(
677
- budgets.reset,
694
+ limits.reset,
678
695
  )
679
696
 
680
697
  @cached_property
681
698
  def tags(self) -> AsyncTagsResourceWithStreamingResponse:
682
- return AsyncTagsResourceWithStreamingResponse(self._budgets.tags)
699
+ return AsyncTagsResourceWithStreamingResponse(self._limits.tags)