payi 0.1.0a59__py3-none-any.whl → 0.1.0a61__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/_version.py +1 -1
  2. payi/lib/AnthropicInstrumentor.py +11 -11
  3. payi/lib/BedrockInstrumentor.py +15 -15
  4. payi/lib/OpenAIInstrumentor.py +16 -16
  5. payi/lib/helpers.py +16 -12
  6. payi/lib/instrument.py +180 -39
  7. payi/pagination.py +50 -0
  8. payi/resources/categories/categories.py +108 -23
  9. payi/resources/categories/resources.py +42 -12
  10. payi/resources/experiences/types/types.py +37 -17
  11. payi/resources/limits/limits.py +21 -30
  12. payi/resources/use_cases/__init__.py +14 -0
  13. payi/resources/use_cases/definitions/__init__.py +14 -0
  14. payi/resources/use_cases/definitions/definitions.py +68 -18
  15. payi/resources/use_cases/definitions/kpis.py +584 -0
  16. payi/resources/use_cases/kpis.py +469 -0
  17. payi/resources/use_cases/use_cases.py +32 -0
  18. payi/types/__init__.py +3 -3
  19. payi/types/categories/__init__.py +1 -1
  20. payi/types/categories/resource_list_params.py +17 -0
  21. payi/types/category_list_params.py +15 -0
  22. payi/types/category_list_resources_params.py +15 -0
  23. payi/types/category_response.py +0 -5
  24. payi/types/experiences/__init__.py +0 -1
  25. payi/types/experiences/type_list_params.py +6 -1
  26. payi/types/limit_list_params.py +4 -13
  27. payi/types/limit_list_response.py +30 -0
  28. payi/types/use_cases/__init__.py +4 -1
  29. payi/types/use_cases/definition_list_params.py +6 -1
  30. payi/types/use_cases/definitions/__init__.py +8 -0
  31. payi/types/use_cases/definitions/kpi_create_params.py +17 -0
  32. payi/types/use_cases/definitions/kpi_create_response.py +20 -0
  33. payi/types/use_cases/definitions/kpi_delete_response.py +20 -0
  34. payi/types/use_cases/definitions/kpi_list_params.py +17 -0
  35. payi/types/use_cases/definitions/kpi_list_response.py +20 -0
  36. payi/types/use_cases/definitions/kpi_retrieve_response.py +20 -0
  37. payi/types/use_cases/definitions/kpi_update_params.py +16 -0
  38. payi/types/use_cases/definitions/kpi_update_response.py +20 -0
  39. payi/types/use_cases/kpi_create_params.py +13 -0
  40. payi/types/use_cases/kpi_list_params.py +17 -0
  41. payi/types/use_cases/kpi_list_response.py +21 -0
  42. payi/types/use_cases/kpi_update_params.py +13 -0
  43. {payi-0.1.0a59.dist-info → payi-0.1.0a61.dist-info}/METADATA +91 -28
  44. {payi-0.1.0a59.dist-info → payi-0.1.0a61.dist-info}/RECORD +46 -33
  45. payi/types/categories/resource_list_response.py +0 -10
  46. payi/types/category_list_resources_response.py +0 -10
  47. payi/types/category_list_response.py +0 -10
  48. payi/types/experiences/type_list_response.py +0 -10
  49. payi/types/paged_limit_list.py +0 -52
  50. payi/types/use_cases/definition_list_response.py +0 -10
  51. {payi-0.1.0a59.dist-info → payi-0.1.0a61.dist-info}/WHEEL +0 -0
  52. {payi-0.1.0a59.dist-info → payi-0.1.0a61.dist-info}/licenses/LICENSE +0 -0
@@ -4,7 +4,9 @@ from __future__ import annotations
4
4
 
5
5
  import httpx
6
6
 
7
+ from ...types import category_list_params, category_list_resources_params
7
8
  from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from ..._utils import maybe_transform
8
10
  from ..._compat import cached_property
9
11
  from .resources import (
10
12
  ResourcesResource,
@@ -21,10 +23,11 @@ from ..._response import (
21
23
  async_to_raw_response_wrapper,
22
24
  async_to_streamed_response_wrapper,
23
25
  )
24
- from ..._base_client import make_request_options
25
- from ...types.category_list_response import CategoryListResponse
26
+ from ...pagination import SyncCursorPage, AsyncCursorPage
27
+ from ..._base_client import AsyncPaginator, make_request_options
28
+ from ...types.category_response import CategoryResponse
26
29
  from ...types.category_delete_response import CategoryDeleteResponse
27
- from ...types.category_list_resources_response import CategoryListResourcesResponse
30
+ from ...types.category_resource_response import CategoryResourceResponse
28
31
  from ...types.category_delete_resource_response import CategoryDeleteResourceResponse
29
32
 
30
33
  __all__ = ["CategoriesResource", "AsyncCategoriesResource"]
@@ -57,20 +60,46 @@ class CategoriesResource(SyncAPIResource):
57
60
  def list(
58
61
  self,
59
62
  *,
63
+ cursor: str | NotGiven = NOT_GIVEN,
64
+ limit: int | NotGiven = NOT_GIVEN,
65
+ sort_ascending: bool | NotGiven = NOT_GIVEN,
60
66
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
61
67
  # The extra values given here take precedence over values defined on the client or passed to this method.
62
68
  extra_headers: Headers | None = None,
63
69
  extra_query: Query | None = None,
64
70
  extra_body: Body | None = None,
65
71
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
66
- ) -> CategoryListResponse:
67
- """Get all Categories"""
68
- return self._get(
72
+ ) -> SyncCursorPage[CategoryResponse]:
73
+ """
74
+ Get all Categories
75
+
76
+ Args:
77
+ extra_headers: Send extra headers
78
+
79
+ extra_query: Add additional query parameters to the request
80
+
81
+ extra_body: Add additional JSON properties to the request
82
+
83
+ timeout: Override the client-level default timeout for this request, in seconds
84
+ """
85
+ return self._get_api_list(
69
86
  "/api/v1/categories",
87
+ page=SyncCursorPage[CategoryResponse],
70
88
  options=make_request_options(
71
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
89
+ extra_headers=extra_headers,
90
+ extra_query=extra_query,
91
+ extra_body=extra_body,
92
+ timeout=timeout,
93
+ query=maybe_transform(
94
+ {
95
+ "cursor": cursor,
96
+ "limit": limit,
97
+ "sort_ascending": sort_ascending,
98
+ },
99
+ category_list_params.CategoryListParams,
100
+ ),
72
101
  ),
73
- cast_to=CategoryListResponse,
102
+ model=CategoryResponse,
74
103
  )
75
104
 
76
105
  def delete(
@@ -146,13 +175,16 @@ class CategoriesResource(SyncAPIResource):
146
175
  self,
147
176
  category: str,
148
177
  *,
178
+ cursor: str | NotGiven = NOT_GIVEN,
179
+ limit: int | NotGiven = NOT_GIVEN,
180
+ sort_ascending: bool | NotGiven = NOT_GIVEN,
149
181
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
150
182
  # The extra values given here take precedence over values defined on the client or passed to this method.
151
183
  extra_headers: Headers | None = None,
152
184
  extra_query: Query | None = None,
153
185
  extra_body: Body | None = None,
154
186
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
155
- ) -> CategoryListResourcesResponse:
187
+ ) -> SyncCursorPage[CategoryResourceResponse]:
156
188
  """
157
189
  Get all Resources for a Category
158
190
 
@@ -167,12 +199,24 @@ class CategoriesResource(SyncAPIResource):
167
199
  """
168
200
  if not category:
169
201
  raise ValueError(f"Expected a non-empty value for `category` but received {category!r}")
170
- return self._get(
202
+ return self._get_api_list(
171
203
  f"/api/v1/categories/{category}/resources",
204
+ page=SyncCursorPage[CategoryResourceResponse],
172
205
  options=make_request_options(
173
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
206
+ extra_headers=extra_headers,
207
+ extra_query=extra_query,
208
+ extra_body=extra_body,
209
+ timeout=timeout,
210
+ query=maybe_transform(
211
+ {
212
+ "cursor": cursor,
213
+ "limit": limit,
214
+ "sort_ascending": sort_ascending,
215
+ },
216
+ category_list_resources_params.CategoryListResourcesParams,
217
+ ),
174
218
  ),
175
- cast_to=CategoryListResourcesResponse,
219
+ model=CategoryResourceResponse,
176
220
  )
177
221
 
178
222
 
@@ -200,23 +244,49 @@ class AsyncCategoriesResource(AsyncAPIResource):
200
244
  """
201
245
  return AsyncCategoriesResourceWithStreamingResponse(self)
202
246
 
203
- async def list(
247
+ def list(
204
248
  self,
205
249
  *,
250
+ cursor: str | NotGiven = NOT_GIVEN,
251
+ limit: int | NotGiven = NOT_GIVEN,
252
+ sort_ascending: bool | NotGiven = NOT_GIVEN,
206
253
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
207
254
  # The extra values given here take precedence over values defined on the client or passed to this method.
208
255
  extra_headers: Headers | None = None,
209
256
  extra_query: Query | None = None,
210
257
  extra_body: Body | None = None,
211
258
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
212
- ) -> CategoryListResponse:
213
- """Get all Categories"""
214
- return await self._get(
259
+ ) -> AsyncPaginator[CategoryResponse, AsyncCursorPage[CategoryResponse]]:
260
+ """
261
+ Get all Categories
262
+
263
+ Args:
264
+ extra_headers: Send extra headers
265
+
266
+ extra_query: Add additional query parameters to the request
267
+
268
+ extra_body: Add additional JSON properties to the request
269
+
270
+ timeout: Override the client-level default timeout for this request, in seconds
271
+ """
272
+ return self._get_api_list(
215
273
  "/api/v1/categories",
274
+ page=AsyncCursorPage[CategoryResponse],
216
275
  options=make_request_options(
217
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
276
+ extra_headers=extra_headers,
277
+ extra_query=extra_query,
278
+ extra_body=extra_body,
279
+ timeout=timeout,
280
+ query=maybe_transform(
281
+ {
282
+ "cursor": cursor,
283
+ "limit": limit,
284
+ "sort_ascending": sort_ascending,
285
+ },
286
+ category_list_params.CategoryListParams,
287
+ ),
218
288
  ),
219
- cast_to=CategoryListResponse,
289
+ model=CategoryResponse,
220
290
  )
221
291
 
222
292
  async def delete(
@@ -288,17 +358,20 @@ class AsyncCategoriesResource(AsyncAPIResource):
288
358
  cast_to=CategoryDeleteResourceResponse,
289
359
  )
290
360
 
291
- async def list_resources(
361
+ def list_resources(
292
362
  self,
293
363
  category: str,
294
364
  *,
365
+ cursor: str | NotGiven = NOT_GIVEN,
366
+ limit: int | NotGiven = NOT_GIVEN,
367
+ sort_ascending: bool | NotGiven = NOT_GIVEN,
295
368
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
296
369
  # The extra values given here take precedence over values defined on the client or passed to this method.
297
370
  extra_headers: Headers | None = None,
298
371
  extra_query: Query | None = None,
299
372
  extra_body: Body | None = None,
300
373
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
301
- ) -> CategoryListResourcesResponse:
374
+ ) -> AsyncPaginator[CategoryResourceResponse, AsyncCursorPage[CategoryResourceResponse]]:
302
375
  """
303
376
  Get all Resources for a Category
304
377
 
@@ -313,12 +386,24 @@ class AsyncCategoriesResource(AsyncAPIResource):
313
386
  """
314
387
  if not category:
315
388
  raise ValueError(f"Expected a non-empty value for `category` but received {category!r}")
316
- return await self._get(
389
+ return self._get_api_list(
317
390
  f"/api/v1/categories/{category}/resources",
391
+ page=AsyncCursorPage[CategoryResourceResponse],
318
392
  options=make_request_options(
319
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
393
+ extra_headers=extra_headers,
394
+ extra_query=extra_query,
395
+ extra_body=extra_body,
396
+ timeout=timeout,
397
+ query=maybe_transform(
398
+ {
399
+ "cursor": cursor,
400
+ "limit": limit,
401
+ "sort_ascending": sort_ascending,
402
+ },
403
+ category_list_resources_params.CategoryListResourcesParams,
404
+ ),
320
405
  ),
321
- cast_to=CategoryListResourcesResponse,
406
+ model=CategoryResourceResponse,
322
407
  )
323
408
 
324
409
 
@@ -20,10 +20,10 @@ from ..._response import (
20
20
  async_to_raw_response_wrapper,
21
21
  async_to_streamed_response_wrapper,
22
22
  )
23
- from ..._base_client import make_request_options
24
- from ...types.categories import resource_create_params
23
+ from ...pagination import SyncCursorPage, AsyncCursorPage
24
+ from ..._base_client import AsyncPaginator, make_request_options
25
+ from ...types.categories import resource_list_params, resource_create_params
25
26
  from ...types.category_resource_response import CategoryResourceResponse
26
- from ...types.categories.resource_list_response import ResourceListResponse
27
27
 
28
28
  __all__ = ["ResourcesResource", "AsyncResourcesResource"]
29
29
 
@@ -143,13 +143,16 @@ class ResourcesResource(SyncAPIResource):
143
143
  resource: str,
144
144
  *,
145
145
  category: str,
146
+ cursor: str | NotGiven = NOT_GIVEN,
147
+ limit: int | NotGiven = NOT_GIVEN,
148
+ sort_ascending: bool | NotGiven = NOT_GIVEN,
146
149
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
147
150
  # The extra values given here take precedence over values defined on the client or passed to this method.
148
151
  extra_headers: Headers | None = None,
149
152
  extra_query: Query | None = None,
150
153
  extra_body: Body | None = None,
151
154
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
152
- ) -> ResourceListResponse:
155
+ ) -> SyncCursorPage[CategoryResourceResponse]:
153
156
  """
154
157
  Get a list of versions of a Resource
155
158
 
@@ -166,12 +169,24 @@ class ResourcesResource(SyncAPIResource):
166
169
  raise ValueError(f"Expected a non-empty value for `category` but received {category!r}")
167
170
  if not resource:
168
171
  raise ValueError(f"Expected a non-empty value for `resource` but received {resource!r}")
169
- return self._get(
172
+ return self._get_api_list(
170
173
  f"/api/v1/categories/{category}/resources/{resource}",
174
+ page=SyncCursorPage[CategoryResourceResponse],
171
175
  options=make_request_options(
172
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
176
+ extra_headers=extra_headers,
177
+ extra_query=extra_query,
178
+ extra_body=extra_body,
179
+ timeout=timeout,
180
+ query=maybe_transform(
181
+ {
182
+ "cursor": cursor,
183
+ "limit": limit,
184
+ "sort_ascending": sort_ascending,
185
+ },
186
+ resource_list_params.ResourceListParams,
187
+ ),
173
188
  ),
174
- cast_to=ResourceListResponse,
189
+ model=CategoryResourceResponse,
175
190
  )
176
191
 
177
192
  def delete(
@@ -324,18 +339,21 @@ class AsyncResourcesResource(AsyncAPIResource):
324
339
  cast_to=CategoryResourceResponse,
325
340
  )
326
341
 
327
- async def list(
342
+ def list(
328
343
  self,
329
344
  resource: str,
330
345
  *,
331
346
  category: str,
347
+ cursor: str | NotGiven = NOT_GIVEN,
348
+ limit: int | NotGiven = NOT_GIVEN,
349
+ sort_ascending: bool | NotGiven = NOT_GIVEN,
332
350
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
333
351
  # The extra values given here take precedence over values defined on the client or passed to this method.
334
352
  extra_headers: Headers | None = None,
335
353
  extra_query: Query | None = None,
336
354
  extra_body: Body | None = None,
337
355
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
338
- ) -> ResourceListResponse:
356
+ ) -> AsyncPaginator[CategoryResourceResponse, AsyncCursorPage[CategoryResourceResponse]]:
339
357
  """
340
358
  Get a list of versions of a Resource
341
359
 
@@ -352,12 +370,24 @@ class AsyncResourcesResource(AsyncAPIResource):
352
370
  raise ValueError(f"Expected a non-empty value for `category` but received {category!r}")
353
371
  if not resource:
354
372
  raise ValueError(f"Expected a non-empty value for `resource` but received {resource!r}")
355
- return await self._get(
373
+ return self._get_api_list(
356
374
  f"/api/v1/categories/{category}/resources/{resource}",
375
+ page=AsyncCursorPage[CategoryResourceResponse],
357
376
  options=make_request_options(
358
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
377
+ extra_headers=extra_headers,
378
+ extra_query=extra_query,
379
+ extra_body=extra_body,
380
+ timeout=timeout,
381
+ query=maybe_transform(
382
+ {
383
+ "cursor": cursor,
384
+ "limit": limit,
385
+ "sort_ascending": sort_ascending,
386
+ },
387
+ resource_list_params.ResourceListParams,
388
+ ),
359
389
  ),
360
- cast_to=ResourceListResponse,
390
+ model=CategoryResourceResponse,
361
391
  )
362
392
 
363
393
  async def delete(
@@ -27,10 +27,10 @@ from .limit_config import (
27
27
  LimitConfigResourceWithStreamingResponse,
28
28
  AsyncLimitConfigResourceWithStreamingResponse,
29
29
  )
30
- from ...._base_client import make_request_options
30
+ from ....pagination import SyncCursorPage, AsyncCursorPage
31
+ from ...._base_client import AsyncPaginator, make_request_options
31
32
  from ....types.experiences import type_list_params, type_create_params, type_update_params
32
33
  from ....types.experiences.experience_type import ExperienceType
33
- from ....types.experiences.type_list_response import TypeListResponse
34
34
  from ....types.shared_params.pay_i_common_models_budget_management_create_limit_base import (
35
35
  PayICommonModelsBudgetManagementCreateLimitBase,
36
36
  )
@@ -165,7 +165,7 @@ class TypesResource(SyncAPIResource):
165
165
  """
166
166
  if not experience_name:
167
167
  raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
168
- return self._patch(
168
+ return self._put(
169
169
  f"/api/v1/experiences/types/{experience_name}",
170
170
  body=maybe_transform(
171
171
  {
@@ -183,20 +183,21 @@ class TypesResource(SyncAPIResource):
183
183
  def list(
184
184
  self,
185
185
  *,
186
+ cursor: str | NotGiven = NOT_GIVEN,
187
+ limit: int | NotGiven = NOT_GIVEN,
186
188
  name: str | NotGiven = NOT_GIVEN,
189
+ sort_ascending: bool | NotGiven = NOT_GIVEN,
187
190
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
188
191
  # The extra values given here take precedence over values defined on the client or passed to this method.
189
192
  extra_headers: Headers | None = None,
190
193
  extra_query: Query | None = None,
191
194
  extra_body: Body | None = None,
192
195
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
193
- ) -> TypeListResponse:
196
+ ) -> SyncCursorPage[ExperienceType]:
194
197
  """
195
198
  Get all Experience Types
196
199
 
197
200
  Args:
198
- name: Experience Type Name
199
-
200
201
  extra_headers: Send extra headers
201
202
 
202
203
  extra_query: Add additional query parameters to the request
@@ -205,16 +206,25 @@ class TypesResource(SyncAPIResource):
205
206
 
206
207
  timeout: Override the client-level default timeout for this request, in seconds
207
208
  """
208
- return self._get(
209
+ return self._get_api_list(
209
210
  "/api/v1/experiences/types",
211
+ page=SyncCursorPage[ExperienceType],
210
212
  options=make_request_options(
211
213
  extra_headers=extra_headers,
212
214
  extra_query=extra_query,
213
215
  extra_body=extra_body,
214
216
  timeout=timeout,
215
- query=maybe_transform({"name": name}, type_list_params.TypeListParams),
217
+ query=maybe_transform(
218
+ {
219
+ "cursor": cursor,
220
+ "limit": limit,
221
+ "name": name,
222
+ "sort_ascending": sort_ascending,
223
+ },
224
+ type_list_params.TypeListParams,
225
+ ),
216
226
  ),
217
- cast_to=TypeListResponse,
227
+ model=ExperienceType,
218
228
  )
219
229
 
220
230
  def delete(
@@ -378,7 +388,7 @@ class AsyncTypesResource(AsyncAPIResource):
378
388
  """
379
389
  if not experience_name:
380
390
  raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
381
- return await self._patch(
391
+ return await self._put(
382
392
  f"/api/v1/experiences/types/{experience_name}",
383
393
  body=await async_maybe_transform(
384
394
  {
@@ -393,23 +403,24 @@ class AsyncTypesResource(AsyncAPIResource):
393
403
  cast_to=ExperienceType,
394
404
  )
395
405
 
396
- async def list(
406
+ def list(
397
407
  self,
398
408
  *,
409
+ cursor: str | NotGiven = NOT_GIVEN,
410
+ limit: int | NotGiven = NOT_GIVEN,
399
411
  name: str | NotGiven = NOT_GIVEN,
412
+ sort_ascending: bool | NotGiven = NOT_GIVEN,
400
413
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
401
414
  # The extra values given here take precedence over values defined on the client or passed to this method.
402
415
  extra_headers: Headers | None = None,
403
416
  extra_query: Query | None = None,
404
417
  extra_body: Body | None = None,
405
418
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
406
- ) -> TypeListResponse:
419
+ ) -> AsyncPaginator[ExperienceType, AsyncCursorPage[ExperienceType]]:
407
420
  """
408
421
  Get all Experience Types
409
422
 
410
423
  Args:
411
- name: Experience Type Name
412
-
413
424
  extra_headers: Send extra headers
414
425
 
415
426
  extra_query: Add additional query parameters to the request
@@ -418,16 +429,25 @@ class AsyncTypesResource(AsyncAPIResource):
418
429
 
419
430
  timeout: Override the client-level default timeout for this request, in seconds
420
431
  """
421
- return await self._get(
432
+ return self._get_api_list(
422
433
  "/api/v1/experiences/types",
434
+ page=AsyncCursorPage[ExperienceType],
423
435
  options=make_request_options(
424
436
  extra_headers=extra_headers,
425
437
  extra_query=extra_query,
426
438
  extra_body=extra_body,
427
439
  timeout=timeout,
428
- query=await async_maybe_transform({"name": name}, type_list_params.TypeListParams),
440
+ query=maybe_transform(
441
+ {
442
+ "cursor": cursor,
443
+ "limit": limit,
444
+ "name": name,
445
+ "sort_ascending": sort_ascending,
446
+ },
447
+ type_list_params.TypeListParams,
448
+ ),
429
449
  ),
430
- cast_to=TypeListResponse,
450
+ model=ExperienceType,
431
451
  )
432
452
 
433
453
  async def delete(
@@ -30,10 +30,11 @@ from ..._response import (
30
30
  async_to_raw_response_wrapper,
31
31
  async_to_streamed_response_wrapper,
32
32
  )
33
- from ..._base_client import make_request_options
33
+ from ...pagination import SyncCursorPage, AsyncCursorPage
34
+ from ..._base_client import AsyncPaginator, make_request_options
34
35
  from ...types.limit_response import LimitResponse
35
36
  from ...types.default_response import DefaultResponse
36
- from ...types.paged_limit_list import PagedLimitList
37
+ from ...types.limit_list_response import LimitListResponse
37
38
  from ...types.limit_history_response import LimitHistoryResponse
38
39
 
39
40
  __all__ = ["LimitsResource", "AsyncLimitsResource"]
@@ -190,20 +191,17 @@ class LimitsResource(SyncAPIResource):
190
191
  def list(
191
192
  self,
192
193
  *,
194
+ cursor: str | NotGiven = NOT_GIVEN,
195
+ limit: int | NotGiven = NOT_GIVEN,
193
196
  limit_name: str | NotGiven = NOT_GIVEN,
194
- page_number: int | NotGiven = NOT_GIVEN,
195
- page_size: int | NotGiven = NOT_GIVEN,
196
197
  sort_ascending: bool | NotGiven = NOT_GIVEN,
197
- sort_by: str | NotGiven = NOT_GIVEN,
198
- tag_list: List[str] | NotGiven = NOT_GIVEN,
199
- tags: str | NotGiven = NOT_GIVEN,
200
198
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
201
199
  # The extra values given here take precedence over values defined on the client or passed to this method.
202
200
  extra_headers: Headers | None = None,
203
201
  extra_query: Query | None = None,
204
202
  extra_body: Body | None = None,
205
203
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
206
- ) -> PagedLimitList:
204
+ ) -> SyncCursorPage[LimitListResponse]:
207
205
  """
208
206
  Get all Limits
209
207
 
@@ -216,8 +214,9 @@ class LimitsResource(SyncAPIResource):
216
214
 
217
215
  timeout: Override the client-level default timeout for this request, in seconds
218
216
  """
219
- return self._get(
217
+ return self._get_api_list(
220
218
  "/api/v1/limits",
219
+ page=SyncCursorPage[LimitListResponse],
221
220
  options=make_request_options(
222
221
  extra_headers=extra_headers,
223
222
  extra_query=extra_query,
@@ -225,18 +224,15 @@ class LimitsResource(SyncAPIResource):
225
224
  timeout=timeout,
226
225
  query=maybe_transform(
227
226
  {
227
+ "cursor": cursor,
228
+ "limit": limit,
228
229
  "limit_name": limit_name,
229
- "page_number": page_number,
230
- "page_size": page_size,
231
230
  "sort_ascending": sort_ascending,
232
- "sort_by": sort_by,
233
- "tag_list": tag_list,
234
- "tags": tags,
235
231
  },
236
232
  limit_list_params.LimitListParams,
237
233
  ),
238
234
  ),
239
- cast_to=PagedLimitList,
235
+ model=LimitListResponse,
240
236
  )
241
237
 
242
238
  def delete(
@@ -461,23 +457,20 @@ class AsyncLimitsResource(AsyncAPIResource):
461
457
  cast_to=LimitResponse,
462
458
  )
463
459
 
464
- async def list(
460
+ def list(
465
461
  self,
466
462
  *,
463
+ cursor: str | NotGiven = NOT_GIVEN,
464
+ limit: int | NotGiven = NOT_GIVEN,
467
465
  limit_name: str | NotGiven = NOT_GIVEN,
468
- page_number: int | NotGiven = NOT_GIVEN,
469
- page_size: int | NotGiven = NOT_GIVEN,
470
466
  sort_ascending: bool | NotGiven = NOT_GIVEN,
471
- sort_by: str | NotGiven = NOT_GIVEN,
472
- tag_list: List[str] | NotGiven = NOT_GIVEN,
473
- tags: str | NotGiven = NOT_GIVEN,
474
467
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
475
468
  # The extra values given here take precedence over values defined on the client or passed to this method.
476
469
  extra_headers: Headers | None = None,
477
470
  extra_query: Query | None = None,
478
471
  extra_body: Body | None = None,
479
472
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
480
- ) -> PagedLimitList:
473
+ ) -> AsyncPaginator[LimitListResponse, AsyncCursorPage[LimitListResponse]]:
481
474
  """
482
475
  Get all Limits
483
476
 
@@ -490,27 +483,25 @@ class AsyncLimitsResource(AsyncAPIResource):
490
483
 
491
484
  timeout: Override the client-level default timeout for this request, in seconds
492
485
  """
493
- return await self._get(
486
+ return self._get_api_list(
494
487
  "/api/v1/limits",
488
+ page=AsyncCursorPage[LimitListResponse],
495
489
  options=make_request_options(
496
490
  extra_headers=extra_headers,
497
491
  extra_query=extra_query,
498
492
  extra_body=extra_body,
499
493
  timeout=timeout,
500
- query=await async_maybe_transform(
494
+ query=maybe_transform(
501
495
  {
496
+ "cursor": cursor,
497
+ "limit": limit,
502
498
  "limit_name": limit_name,
503
- "page_number": page_number,
504
- "page_size": page_size,
505
499
  "sort_ascending": sort_ascending,
506
- "sort_by": sort_by,
507
- "tag_list": tag_list,
508
- "tags": tags,
509
500
  },
510
501
  limit_list_params.LimitListParams,
511
502
  ),
512
503
  ),
513
- cast_to=PagedLimitList,
504
+ model=LimitListResponse,
514
505
  )
515
506
 
516
507
  async def delete(
@@ -1,5 +1,13 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ from .kpis import (
4
+ KpisResource,
5
+ AsyncKpisResource,
6
+ KpisResourceWithRawResponse,
7
+ AsyncKpisResourceWithRawResponse,
8
+ KpisResourceWithStreamingResponse,
9
+ AsyncKpisResourceWithStreamingResponse,
10
+ )
3
11
  from .use_cases import (
4
12
  UseCasesResource,
5
13
  AsyncUseCasesResource,
@@ -26,6 +34,12 @@ from .definitions import (
26
34
  )
27
35
 
28
36
  __all__ = [
37
+ "KpisResource",
38
+ "AsyncKpisResource",
39
+ "KpisResourceWithRawResponse",
40
+ "AsyncKpisResourceWithRawResponse",
41
+ "KpisResourceWithStreamingResponse",
42
+ "AsyncKpisResourceWithStreamingResponse",
29
43
  "DefinitionsResource",
30
44
  "AsyncDefinitionsResource",
31
45
  "DefinitionsResourceWithRawResponse",
@@ -1,5 +1,13 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ from .kpis import (
4
+ KpisResource,
5
+ AsyncKpisResource,
6
+ KpisResourceWithRawResponse,
7
+ AsyncKpisResourceWithRawResponse,
8
+ KpisResourceWithStreamingResponse,
9
+ AsyncKpisResourceWithStreamingResponse,
10
+ )
3
11
  from .version import (
4
12
  VersionResource,
5
13
  AsyncVersionResource,
@@ -26,6 +34,12 @@ from .limit_config import (
26
34
  )
27
35
 
28
36
  __all__ = [
37
+ "KpisResource",
38
+ "AsyncKpisResource",
39
+ "KpisResourceWithRawResponse",
40
+ "AsyncKpisResourceWithRawResponse",
41
+ "KpisResourceWithStreamingResponse",
42
+ "AsyncKpisResourceWithStreamingResponse",
29
43
  "LimitConfigResource",
30
44
  "AsyncLimitConfigResource",
31
45
  "LimitConfigResourceWithRawResponse",