payi 0.1.0a110__py3-none-any.whl → 0.1.0a137__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.
Files changed (83) hide show
  1. payi/__init__.py +3 -1
  2. payi/_base_client.py +12 -12
  3. payi/_client.py +8 -8
  4. payi/_compat.py +48 -48
  5. payi/_models.py +87 -59
  6. payi/_qs.py +7 -7
  7. payi/_streaming.py +4 -6
  8. payi/_types.py +53 -12
  9. payi/_utils/__init__.py +9 -2
  10. payi/_utils/_compat.py +45 -0
  11. payi/_utils/_datetime_parse.py +136 -0
  12. payi/_utils/_sync.py +3 -31
  13. payi/_utils/_transform.py +13 -3
  14. payi/_utils/_typing.py +6 -1
  15. payi/_utils/_utils.py +5 -6
  16. payi/_version.py +1 -1
  17. payi/lib/AnthropicInstrumentor.py +83 -57
  18. payi/lib/BedrockInstrumentor.py +292 -57
  19. payi/lib/GoogleGenAiInstrumentor.py +18 -31
  20. payi/lib/OpenAIInstrumentor.py +56 -72
  21. payi/lib/ProviderRequest.py +216 -0
  22. payi/lib/StreamWrappers.py +379 -0
  23. payi/lib/VertexInstrumentor.py +18 -37
  24. payi/lib/VertexRequest.py +16 -2
  25. payi/lib/data/cohere_embed_english_v3.json +30706 -0
  26. payi/lib/helpers.py +53 -1
  27. payi/lib/instrument.py +404 -668
  28. payi/resources/categories/__init__.py +0 -14
  29. payi/resources/categories/categories.py +25 -53
  30. payi/resources/categories/resources.py +27 -23
  31. payi/resources/ingest.py +126 -132
  32. payi/resources/limits/__init__.py +14 -14
  33. payi/resources/limits/limits.py +58 -58
  34. payi/resources/limits/properties.py +171 -0
  35. payi/resources/requests/request_id/properties.py +8 -8
  36. payi/resources/requests/request_id/result.py +3 -3
  37. payi/resources/requests/response_id/properties.py +8 -8
  38. payi/resources/requests/response_id/result.py +3 -3
  39. payi/resources/use_cases/definitions/definitions.py +27 -27
  40. payi/resources/use_cases/definitions/kpis.py +23 -23
  41. payi/resources/use_cases/definitions/limit_config.py +14 -14
  42. payi/resources/use_cases/definitions/version.py +3 -3
  43. payi/resources/use_cases/kpis.py +15 -15
  44. payi/resources/use_cases/properties.py +6 -6
  45. payi/resources/use_cases/use_cases.py +7 -7
  46. payi/types/__init__.py +2 -0
  47. payi/types/bulk_ingest_response.py +3 -20
  48. payi/types/categories/__init__.py +0 -1
  49. payi/types/categories/resource_list_params.py +5 -1
  50. payi/types/category_list_resources_params.py +5 -1
  51. payi/types/category_resource_response.py +31 -1
  52. payi/types/ingest_event_param.py +7 -6
  53. payi/types/ingest_units_params.py +5 -4
  54. payi/types/limit_create_params.py +3 -3
  55. payi/types/limit_list_response.py +1 -3
  56. payi/types/limit_response.py +1 -3
  57. payi/types/limits/__init__.py +2 -9
  58. payi/types/limits/{tag_remove_params.py → property_update_params.py} +4 -5
  59. payi/types/limits/{tag_delete_response.py → property_update_response.py} +3 -3
  60. payi/types/requests/request_id/property_update_params.py +2 -2
  61. payi/types/requests/response_id/property_update_params.py +2 -2
  62. payi/types/shared/__init__.py +2 -0
  63. payi/types/shared/api_error.py +18 -0
  64. payi/types/shared/pay_i_common_models_budget_management_create_limit_base.py +3 -3
  65. payi/types/shared/properties_request.py +11 -0
  66. payi/types/shared/xproxy_result.py +2 -0
  67. payi/types/shared_params/pay_i_common_models_budget_management_create_limit_base.py +3 -3
  68. payi/types/use_cases/definitions/limit_config_create_params.py +3 -3
  69. payi/types/use_cases/property_update_params.py +2 -2
  70. {payi-0.1.0a110.dist-info → payi-0.1.0a137.dist-info}/METADATA +6 -6
  71. {payi-0.1.0a110.dist-info → payi-0.1.0a137.dist-info}/RECORD +73 -75
  72. payi/resources/categories/fixed_cost_resources.py +0 -196
  73. payi/resources/limits/tags.py +0 -507
  74. payi/types/categories/fixed_cost_resource_create_params.py +0 -21
  75. payi/types/limits/limit_tags.py +0 -16
  76. payi/types/limits/tag_create_params.py +0 -13
  77. payi/types/limits/tag_create_response.py +0 -10
  78. payi/types/limits/tag_list_response.py +0 -10
  79. payi/types/limits/tag_remove_response.py +0 -10
  80. payi/types/limits/tag_update_params.py +0 -13
  81. payi/types/limits/tag_update_response.py +0 -10
  82. {payi-0.1.0a110.dist-info → payi-0.1.0a137.dist-info}/WHEEL +0 -0
  83. {payi-0.1.0a110.dist-info → payi-0.1.0a137.dist-info}/licenses/LICENSE +0 -0
@@ -2,24 +2,24 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Union, Optional
5
+ from typing import Dict, Union, Optional
6
6
  from datetime import datetime
7
7
  from typing_extensions import Literal
8
8
 
9
9
  import httpx
10
10
 
11
- from .tags import (
12
- TagsResource,
13
- AsyncTagsResource,
14
- TagsResourceWithRawResponse,
15
- AsyncTagsResourceWithRawResponse,
16
- TagsResourceWithStreamingResponse,
17
- AsyncTagsResourceWithStreamingResponse,
18
- )
19
11
  from ...types import limit_list_params, limit_reset_params, limit_create_params, limit_update_params
20
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
+ from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
21
13
  from ..._utils import maybe_transform, async_maybe_transform
22
14
  from ..._compat import cached_property
15
+ from .properties import (
16
+ PropertiesResource,
17
+ AsyncPropertiesResource,
18
+ PropertiesResourceWithRawResponse,
19
+ AsyncPropertiesResourceWithRawResponse,
20
+ PropertiesResourceWithStreamingResponse,
21
+ AsyncPropertiesResourceWithStreamingResponse,
22
+ )
23
23
  from ..._resource import SyncAPIResource, AsyncAPIResource
24
24
  from ..._response import (
25
25
  to_raw_response_wrapper,
@@ -39,8 +39,8 @@ __all__ = ["LimitsResource", "AsyncLimitsResource"]
39
39
 
40
40
  class LimitsResource(SyncAPIResource):
41
41
  @cached_property
42
- def tags(self) -> TagsResource:
43
- return TagsResource(self._client)
42
+ def properties(self) -> PropertiesResource:
43
+ return PropertiesResource(self._client)
44
44
 
45
45
  @cached_property
46
46
  def with_raw_response(self) -> LimitsResourceWithRawResponse:
@@ -66,16 +66,16 @@ class LimitsResource(SyncAPIResource):
66
66
  *,
67
67
  limit_name: str,
68
68
  max: float,
69
- limit_id: Optional[str] | NotGiven = NOT_GIVEN,
70
- limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
71
- limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
72
- threshold: Optional[float] | NotGiven = NOT_GIVEN,
69
+ limit_id: Optional[str] | Omit = omit,
70
+ limit_type: Literal["block", "allow"] | Omit = omit,
71
+ properties: Optional[Dict[str, Optional[str]]] | Omit = omit,
72
+ threshold: Optional[float] | Omit = omit,
73
73
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
74
74
  # The extra values given here take precedence over values defined on the client or passed to this method.
75
75
  extra_headers: Headers | None = None,
76
76
  extra_query: Query | None = None,
77
77
  extra_body: Body | None = None,
78
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
78
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
79
79
  ) -> LimitResponse:
80
80
  """
81
81
  Create a Limit
@@ -96,8 +96,8 @@ class LimitsResource(SyncAPIResource):
96
96
  "limit_name": limit_name,
97
97
  "max": max,
98
98
  "limit_id": limit_id,
99
- "limit_tags": limit_tags,
100
99
  "limit_type": limit_type,
100
+ "properties": properties,
101
101
  "threshold": threshold,
102
102
  },
103
103
  limit_create_params.LimitCreateParams,
@@ -117,7 +117,7 @@ class LimitsResource(SyncAPIResource):
117
117
  extra_headers: Headers | None = None,
118
118
  extra_query: Query | None = None,
119
119
  extra_body: Body | None = None,
120
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
120
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
121
121
  ) -> LimitResponse:
122
122
  """
123
123
  Get Limit details
@@ -145,14 +145,14 @@ class LimitsResource(SyncAPIResource):
145
145
  self,
146
146
  limit_id: str,
147
147
  *,
148
- limit_name: Optional[str] | NotGiven = NOT_GIVEN,
149
- max: Optional[float] | NotGiven = NOT_GIVEN,
148
+ limit_name: Optional[str] | Omit = omit,
149
+ max: Optional[float] | Omit = omit,
150
150
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
151
151
  # The extra values given here take precedence over values defined on the client or passed to this method.
152
152
  extra_headers: Headers | None = None,
153
153
  extra_query: Query | None = None,
154
154
  extra_body: Body | None = None,
155
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
155
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
156
156
  ) -> LimitResponse:
157
157
  """
158
158
  Update a Limit
@@ -186,16 +186,16 @@ class LimitsResource(SyncAPIResource):
186
186
  def list(
187
187
  self,
188
188
  *,
189
- cursor: str | NotGiven = NOT_GIVEN,
190
- limit: int | NotGiven = NOT_GIVEN,
191
- limit_name: str | NotGiven = NOT_GIVEN,
192
- sort_ascending: bool | NotGiven = NOT_GIVEN,
189
+ cursor: str | Omit = omit,
190
+ limit: int | Omit = omit,
191
+ limit_name: str | Omit = omit,
192
+ sort_ascending: bool | Omit = omit,
193
193
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194
194
  # The extra values given here take precedence over values defined on the client or passed to this method.
195
195
  extra_headers: Headers | None = None,
196
196
  extra_query: Query | None = None,
197
197
  extra_body: Body | None = None,
198
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
198
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
199
199
  ) -> SyncCursorPage[LimitListResponse]:
200
200
  """
201
201
  Get all Limits
@@ -239,7 +239,7 @@ class LimitsResource(SyncAPIResource):
239
239
  extra_headers: Headers | None = None,
240
240
  extra_query: Query | None = None,
241
241
  extra_body: Body | None = None,
242
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
242
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
243
243
  ) -> DefaultResponse:
244
244
  """
245
245
  Delete a Limit
@@ -267,13 +267,13 @@ class LimitsResource(SyncAPIResource):
267
267
  self,
268
268
  limit_id: str,
269
269
  *,
270
- reset_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
270
+ reset_date: Union[str, datetime] | Omit = omit,
271
271
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
272
272
  # The extra values given here take precedence over values defined on the client or passed to this method.
273
273
  extra_headers: Headers | None = None,
274
274
  extra_query: Query | None = None,
275
275
  extra_body: Body | None = None,
276
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
276
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
277
277
  ) -> LimitHistoryResponse:
278
278
  """
279
279
  Reset a Limit
@@ -306,8 +306,8 @@ class LimitsResource(SyncAPIResource):
306
306
 
307
307
  class AsyncLimitsResource(AsyncAPIResource):
308
308
  @cached_property
309
- def tags(self) -> AsyncTagsResource:
310
- return AsyncTagsResource(self._client)
309
+ def properties(self) -> AsyncPropertiesResource:
310
+ return AsyncPropertiesResource(self._client)
311
311
 
312
312
  @cached_property
313
313
  def with_raw_response(self) -> AsyncLimitsResourceWithRawResponse:
@@ -333,16 +333,16 @@ class AsyncLimitsResource(AsyncAPIResource):
333
333
  *,
334
334
  limit_name: str,
335
335
  max: float,
336
- limit_id: Optional[str] | NotGiven = NOT_GIVEN,
337
- limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
338
- limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
339
- threshold: Optional[float] | NotGiven = NOT_GIVEN,
336
+ limit_id: Optional[str] | Omit = omit,
337
+ limit_type: Literal["block", "allow"] | Omit = omit,
338
+ properties: Optional[Dict[str, Optional[str]]] | Omit = omit,
339
+ threshold: Optional[float] | Omit = omit,
340
340
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
341
341
  # The extra values given here take precedence over values defined on the client or passed to this method.
342
342
  extra_headers: Headers | None = None,
343
343
  extra_query: Query | None = None,
344
344
  extra_body: Body | None = None,
345
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
345
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
346
346
  ) -> LimitResponse:
347
347
  """
348
348
  Create a Limit
@@ -363,8 +363,8 @@ class AsyncLimitsResource(AsyncAPIResource):
363
363
  "limit_name": limit_name,
364
364
  "max": max,
365
365
  "limit_id": limit_id,
366
- "limit_tags": limit_tags,
367
366
  "limit_type": limit_type,
367
+ "properties": properties,
368
368
  "threshold": threshold,
369
369
  },
370
370
  limit_create_params.LimitCreateParams,
@@ -384,7 +384,7 @@ class AsyncLimitsResource(AsyncAPIResource):
384
384
  extra_headers: Headers | None = None,
385
385
  extra_query: Query | None = None,
386
386
  extra_body: Body | None = None,
387
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
387
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
388
388
  ) -> LimitResponse:
389
389
  """
390
390
  Get Limit details
@@ -412,14 +412,14 @@ class AsyncLimitsResource(AsyncAPIResource):
412
412
  self,
413
413
  limit_id: str,
414
414
  *,
415
- limit_name: Optional[str] | NotGiven = NOT_GIVEN,
416
- max: Optional[float] | NotGiven = NOT_GIVEN,
415
+ limit_name: Optional[str] | Omit = omit,
416
+ max: Optional[float] | Omit = omit,
417
417
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
418
418
  # The extra values given here take precedence over values defined on the client or passed to this method.
419
419
  extra_headers: Headers | None = None,
420
420
  extra_query: Query | None = None,
421
421
  extra_body: Body | None = None,
422
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
422
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
423
423
  ) -> LimitResponse:
424
424
  """
425
425
  Update a Limit
@@ -453,16 +453,16 @@ class AsyncLimitsResource(AsyncAPIResource):
453
453
  def list(
454
454
  self,
455
455
  *,
456
- cursor: str | NotGiven = NOT_GIVEN,
457
- limit: int | NotGiven = NOT_GIVEN,
458
- limit_name: str | NotGiven = NOT_GIVEN,
459
- sort_ascending: bool | NotGiven = NOT_GIVEN,
456
+ cursor: str | Omit = omit,
457
+ limit: int | Omit = omit,
458
+ limit_name: str | Omit = omit,
459
+ sort_ascending: bool | Omit = omit,
460
460
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
461
461
  # The extra values given here take precedence over values defined on the client or passed to this method.
462
462
  extra_headers: Headers | None = None,
463
463
  extra_query: Query | None = None,
464
464
  extra_body: Body | None = None,
465
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
465
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
466
466
  ) -> AsyncPaginator[LimitListResponse, AsyncCursorPage[LimitListResponse]]:
467
467
  """
468
468
  Get all Limits
@@ -506,7 +506,7 @@ class AsyncLimitsResource(AsyncAPIResource):
506
506
  extra_headers: Headers | None = None,
507
507
  extra_query: Query | None = None,
508
508
  extra_body: Body | None = None,
509
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
509
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
510
510
  ) -> DefaultResponse:
511
511
  """
512
512
  Delete a Limit
@@ -534,13 +534,13 @@ class AsyncLimitsResource(AsyncAPIResource):
534
534
  self,
535
535
  limit_id: str,
536
536
  *,
537
- reset_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
537
+ reset_date: Union[str, datetime] | Omit = omit,
538
538
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
539
539
  # The extra values given here take precedence over values defined on the client or passed to this method.
540
540
  extra_headers: Headers | None = None,
541
541
  extra_query: Query | None = None,
542
542
  extra_body: Body | None = None,
543
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
543
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
544
544
  ) -> LimitHistoryResponse:
545
545
  """
546
546
  Reset a Limit
@@ -595,8 +595,8 @@ class LimitsResourceWithRawResponse:
595
595
  )
596
596
 
597
597
  @cached_property
598
- def tags(self) -> TagsResourceWithRawResponse:
599
- return TagsResourceWithRawResponse(self._limits.tags)
598
+ def properties(self) -> PropertiesResourceWithRawResponse:
599
+ return PropertiesResourceWithRawResponse(self._limits.properties)
600
600
 
601
601
 
602
602
  class AsyncLimitsResourceWithRawResponse:
@@ -623,8 +623,8 @@ class AsyncLimitsResourceWithRawResponse:
623
623
  )
624
624
 
625
625
  @cached_property
626
- def tags(self) -> AsyncTagsResourceWithRawResponse:
627
- return AsyncTagsResourceWithRawResponse(self._limits.tags)
626
+ def properties(self) -> AsyncPropertiesResourceWithRawResponse:
627
+ return AsyncPropertiesResourceWithRawResponse(self._limits.properties)
628
628
 
629
629
 
630
630
  class LimitsResourceWithStreamingResponse:
@@ -651,8 +651,8 @@ class LimitsResourceWithStreamingResponse:
651
651
  )
652
652
 
653
653
  @cached_property
654
- def tags(self) -> TagsResourceWithStreamingResponse:
655
- return TagsResourceWithStreamingResponse(self._limits.tags)
654
+ def properties(self) -> PropertiesResourceWithStreamingResponse:
655
+ return PropertiesResourceWithStreamingResponse(self._limits.properties)
656
656
 
657
657
 
658
658
  class AsyncLimitsResourceWithStreamingResponse:
@@ -679,5 +679,5 @@ class AsyncLimitsResourceWithStreamingResponse:
679
679
  )
680
680
 
681
681
  @cached_property
682
- def tags(self) -> AsyncTagsResourceWithStreamingResponse:
683
- return AsyncTagsResourceWithStreamingResponse(self._limits.tags)
682
+ def properties(self) -> AsyncPropertiesResourceWithStreamingResponse:
683
+ return AsyncPropertiesResourceWithStreamingResponse(self._limits.properties)
@@ -0,0 +1,171 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Optional
6
+
7
+ import httpx
8
+
9
+ from ..._types import Body, Query, Headers, NotGiven, not_given
10
+ from ..._utils import maybe_transform, async_maybe_transform
11
+ from ..._compat import cached_property
12
+ from ..._resource import SyncAPIResource, AsyncAPIResource
13
+ from ..._response import (
14
+ to_raw_response_wrapper,
15
+ to_streamed_response_wrapper,
16
+ async_to_raw_response_wrapper,
17
+ async_to_streamed_response_wrapper,
18
+ )
19
+ from ..._base_client import make_request_options
20
+ from ...types.limits import property_update_params
21
+ from ...types.limits.property_update_response import PropertyUpdateResponse
22
+
23
+ __all__ = ["PropertiesResource", "AsyncPropertiesResource"]
24
+
25
+
26
+ class PropertiesResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> PropertiesResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
34
+ """
35
+ return PropertiesResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> PropertiesResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
43
+ """
44
+ return PropertiesResourceWithStreamingResponse(self)
45
+
46
+ def update(
47
+ self,
48
+ limit_id: str,
49
+ *,
50
+ properties: Dict[str, Optional[str]],
51
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52
+ # The extra values given here take precedence over values defined on the client or passed to this method.
53
+ extra_headers: Headers | None = None,
54
+ extra_query: Query | None = None,
55
+ extra_body: Body | None = None,
56
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
57
+ ) -> PropertyUpdateResponse:
58
+ """
59
+ Update a Limit Properties
60
+
61
+ Args:
62
+ extra_headers: Send extra headers
63
+
64
+ extra_query: Add additional query parameters to the request
65
+
66
+ extra_body: Add additional JSON properties to the request
67
+
68
+ timeout: Override the client-level default timeout for this request, in seconds
69
+ """
70
+ if not limit_id:
71
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
72
+ return self._put(
73
+ f"/api/v1/limits/{limit_id}/properties",
74
+ body=maybe_transform({"properties": properties}, property_update_params.PropertyUpdateParams),
75
+ options=make_request_options(
76
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
77
+ ),
78
+ cast_to=PropertyUpdateResponse,
79
+ )
80
+
81
+
82
+ class AsyncPropertiesResource(AsyncAPIResource):
83
+ @cached_property
84
+ def with_raw_response(self) -> AsyncPropertiesResourceWithRawResponse:
85
+ """
86
+ This property can be used as a prefix for any HTTP method call to return
87
+ the raw response object instead of the parsed content.
88
+
89
+ For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
90
+ """
91
+ return AsyncPropertiesResourceWithRawResponse(self)
92
+
93
+ @cached_property
94
+ def with_streaming_response(self) -> AsyncPropertiesResourceWithStreamingResponse:
95
+ """
96
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
97
+
98
+ For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
99
+ """
100
+ return AsyncPropertiesResourceWithStreamingResponse(self)
101
+
102
+ async def update(
103
+ self,
104
+ limit_id: str,
105
+ *,
106
+ properties: Dict[str, Optional[str]],
107
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
108
+ # The extra values given here take precedence over values defined on the client or passed to this method.
109
+ extra_headers: Headers | None = None,
110
+ extra_query: Query | None = None,
111
+ extra_body: Body | None = None,
112
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
113
+ ) -> PropertyUpdateResponse:
114
+ """
115
+ Update a Limit Properties
116
+
117
+ Args:
118
+ extra_headers: Send extra headers
119
+
120
+ extra_query: Add additional query parameters to the request
121
+
122
+ extra_body: Add additional JSON properties to the request
123
+
124
+ timeout: Override the client-level default timeout for this request, in seconds
125
+ """
126
+ if not limit_id:
127
+ raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
128
+ return await self._put(
129
+ f"/api/v1/limits/{limit_id}/properties",
130
+ body=await async_maybe_transform({"properties": properties}, property_update_params.PropertyUpdateParams),
131
+ options=make_request_options(
132
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
133
+ ),
134
+ cast_to=PropertyUpdateResponse,
135
+ )
136
+
137
+
138
+ class PropertiesResourceWithRawResponse:
139
+ def __init__(self, properties: PropertiesResource) -> None:
140
+ self._properties = properties
141
+
142
+ self.update = to_raw_response_wrapper(
143
+ properties.update,
144
+ )
145
+
146
+
147
+ class AsyncPropertiesResourceWithRawResponse:
148
+ def __init__(self, properties: AsyncPropertiesResource) -> None:
149
+ self._properties = properties
150
+
151
+ self.update = async_to_raw_response_wrapper(
152
+ properties.update,
153
+ )
154
+
155
+
156
+ class PropertiesResourceWithStreamingResponse:
157
+ def __init__(self, properties: PropertiesResource) -> None:
158
+ self._properties = properties
159
+
160
+ self.update = to_streamed_response_wrapper(
161
+ properties.update,
162
+ )
163
+
164
+
165
+ class AsyncPropertiesResourceWithStreamingResponse:
166
+ def __init__(self, properties: AsyncPropertiesResource) -> None:
167
+ self._properties = properties
168
+
169
+ self.update = async_to_streamed_response_wrapper(
170
+ properties.update,
171
+ )
@@ -2,11 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict
5
+ from typing import Dict, Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from ...._types import Body, Query, Headers, NotGiven, not_given
10
10
  from ...._utils import maybe_transform, async_maybe_transform
11
11
  from ...._compat import cached_property
12
12
  from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -47,16 +47,16 @@ class PropertiesResource(SyncAPIResource):
47
47
  self,
48
48
  request_id: str,
49
49
  *,
50
- properties: Dict[str, str],
50
+ properties: Dict[str, Optional[str]],
51
51
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52
52
  # The extra values given here take precedence over values defined on the client or passed to this method.
53
53
  extra_headers: Headers | None = None,
54
54
  extra_query: Query | None = None,
55
55
  extra_body: Body | None = None,
56
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
56
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
57
57
  ) -> PropertiesResponse:
58
58
  """
59
- Update Request properties
59
+ Update a Request properties
60
60
 
61
61
  Args:
62
62
  extra_headers: Send extra headers
@@ -103,16 +103,16 @@ class AsyncPropertiesResource(AsyncAPIResource):
103
103
  self,
104
104
  request_id: str,
105
105
  *,
106
- properties: Dict[str, str],
106
+ properties: Dict[str, Optional[str]],
107
107
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
108
108
  # The extra values given here take precedence over values defined on the client or passed to this method.
109
109
  extra_headers: Headers | None = None,
110
110
  extra_query: Query | None = None,
111
111
  extra_body: Body | None = None,
112
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
112
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
113
113
  ) -> PropertiesResponse:
114
114
  """
115
- Update Request properties
115
+ Update a Request properties
116
116
 
117
117
  Args:
118
118
  extra_headers: Send extra headers
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import httpx
6
6
 
7
- from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
7
+ from ...._types import Body, Query, Headers, NotGiven, not_given
8
8
  from ...._compat import cached_property
9
9
  from ...._resource import SyncAPIResource, AsyncAPIResource
10
10
  from ...._response import (
@@ -48,7 +48,7 @@ class ResultResource(SyncAPIResource):
48
48
  extra_headers: Headers | None = None,
49
49
  extra_query: Query | None = None,
50
50
  extra_body: Body | None = None,
51
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
52
52
  ) -> RequestResult:
53
53
  """
54
54
  Get a Request results
@@ -102,7 +102,7 @@ class AsyncResultResource(AsyncAPIResource):
102
102
  extra_headers: Headers | None = None,
103
103
  extra_query: Query | None = None,
104
104
  extra_body: Body | None = None,
105
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
105
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
106
106
  ) -> RequestResult:
107
107
  """
108
108
  Get a Request results
@@ -2,11 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict
5
+ from typing import Dict, Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from ...._types import Body, Query, Headers, NotGiven, not_given
10
10
  from ...._utils import maybe_transform, async_maybe_transform
11
11
  from ...._compat import cached_property
12
12
  from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -48,16 +48,16 @@ class PropertiesResource(SyncAPIResource):
48
48
  provider_response_id: str,
49
49
  *,
50
50
  category: str,
51
- properties: Dict[str, str],
51
+ properties: Dict[str, Optional[str]],
52
52
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
53
53
  # The extra values given here take precedence over values defined on the client or passed to this method.
54
54
  extra_headers: Headers | None = None,
55
55
  extra_query: Query | None = None,
56
56
  extra_body: Body | None = None,
57
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
57
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
58
58
  ) -> PropertiesResponse:
59
59
  """
60
- Update Request properties
60
+ Update a Request properties
61
61
 
62
62
  Args:
63
63
  extra_headers: Send extra headers
@@ -109,16 +109,16 @@ class AsyncPropertiesResource(AsyncAPIResource):
109
109
  provider_response_id: str,
110
110
  *,
111
111
  category: str,
112
- properties: Dict[str, str],
112
+ properties: Dict[str, Optional[str]],
113
113
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
114
114
  # The extra values given here take precedence over values defined on the client or passed to this method.
115
115
  extra_headers: Headers | None = None,
116
116
  extra_query: Query | None = None,
117
117
  extra_body: Body | None = None,
118
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
118
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
119
119
  ) -> PropertiesResponse:
120
120
  """
121
- Update Request properties
121
+ Update a Request properties
122
122
 
123
123
  Args:
124
124
  extra_headers: Send extra headers
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import httpx
6
6
 
7
- from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
7
+ from ...._types import Body, Query, Headers, NotGiven, not_given
8
8
  from ...._compat import cached_property
9
9
  from ...._resource import SyncAPIResource, AsyncAPIResource
10
10
  from ...._response import (
@@ -49,7 +49,7 @@ class ResultResource(SyncAPIResource):
49
49
  extra_headers: Headers | None = None,
50
50
  extra_query: Query | None = None,
51
51
  extra_body: Body | None = None,
52
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
52
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
53
53
  ) -> RequestResult:
54
54
  """
55
55
  Get a Request results
@@ -108,7 +108,7 @@ class AsyncResultResource(AsyncAPIResource):
108
108
  extra_headers: Headers | None = None,
109
109
  extra_query: Query | None = None,
110
110
  extra_body: Body | None = None,
111
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
111
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
112
112
  ) -> RequestResult:
113
113
  """
114
114
  Get a Request results