payi 0.1.0a36__py3-none-any.whl → 0.1.0a38__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 (34) hide show
  1. payi/_version.py +1 -1
  2. payi/lib/instrument.py +41 -33
  3. payi/resources/experiences/experiences.py +8 -8
  4. payi/resources/experiences/types/__init__.py +33 -0
  5. payi/resources/experiences/types/limit_config.py +275 -0
  6. payi/resources/experiences/{types.py → types/types.py} +47 -11
  7. payi/resources/ingest.py +5 -6
  8. payi/resources/limits/limits.py +4 -8
  9. payi/resources/requests/__init__.py +14 -0
  10. payi/resources/requests/requests.py +32 -0
  11. payi/resources/requests/result.py +169 -0
  12. payi/types/__init__.py +4 -1
  13. payi/types/cost_data.py +5 -2
  14. payi/types/experience_instance_response.py +2 -4
  15. payi/types/experiences/experience_type.py +15 -2
  16. payi/types/experiences/type_create_params.py +15 -3
  17. payi/types/experiences/type_update_params.py +2 -2
  18. payi/types/experiences/types/__init__.py +5 -0
  19. payi/types/experiences/types/limit_config_create_params.py +18 -0
  20. payi/types/ingest_event_param.py +4 -15
  21. payi/types/ingest_response.py +7 -2
  22. payi/types/ingest_units_params.py +4 -15
  23. payi/types/limit_create_params.py +1 -3
  24. payi/types/limit_response.py +0 -2
  25. payi/types/paged_limit_list.py +0 -2
  26. payi/types/pay_i_common_models_api_router_header_info_param.py +14 -0
  27. payi/types/requests/__init__.py +1 -0
  28. payi/types/requests/request_result.py +48 -0
  29. payi/types/shared/__init__.py +3 -1
  30. payi/types/shared/pay_i_common_models_budget_management_cost_details_base.py +10 -0
  31. {payi-0.1.0a36.dist-info → payi-0.1.0a38.dist-info}/METADATA +1 -1
  32. {payi-0.1.0a36.dist-info → payi-0.1.0a38.dist-info}/RECORD +34 -26
  33. {payi-0.1.0a36.dist-info → payi-0.1.0a38.dist-info}/WHEEL +0 -0
  34. {payi-0.1.0a36.dist-info → payi-0.1.0a38.dist-info}/licenses/LICENSE +0 -0
payi/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "payi"
4
- __version__ = "0.1.0-alpha.36" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.38" # x-release-please-version
payi/lib/instrument.py CHANGED
@@ -216,13 +216,13 @@ class PayiInstrumentor:
216
216
  # should not happen
217
217
  return wrapped(*args, **kwargs)
218
218
 
219
- if context.get("proxy", True):
220
- proxy_extra_headers = kwargs.get("extra_headers", {})
221
-
222
- self._update_headers(context, proxy_extra_headers)
219
+ # after _udpate_headers, all metadata to add to ingest is in extra_headers, keyed by the xproxy-xxx header name
220
+ extra_headers = kwargs.get("extra_headers", {})
221
+ self._update_headers(context, extra_headers)
223
222
 
223
+ if context.get("proxy", True):
224
224
  if "extra_headers" not in kwargs:
225
- kwargs["extra_headers"] = proxy_extra_headers
225
+ kwargs["extra_headers"] = extra_headers
226
226
 
227
227
  return wrapped(*args, **kwargs)
228
228
 
@@ -242,16 +242,16 @@ class PayiInstrumentor:
242
242
  stream = kwargs.get("stream", False)
243
243
 
244
244
  try:
245
- limit_ids = context.get("limit_ids")
246
- request_tags = context.get("request_tags")
247
- experience_name = context.get("experience_name")
248
- experience_id = context.get("experience_id")
249
- user_id = context.get("user_id")
245
+ limit_ids = extra_headers.pop("xProxy-Limit-IDs", None)
246
+ request_tags = extra_headers.pop("xProxy-Request-Tags", None)
247
+ experience_name = extra_headers.pop("xProxy-Experience-Name", None)
248
+ experience_id = extra_headers.pop("xProxy-Experience-ID", None)
249
+ user_id = extra_headers.pop("xProxy-User-ID", None)
250
250
 
251
251
  if limit_ids:
252
- ingest["limit_ids"] = limit_ids
252
+ ingest["limit_ids"] = limit_ids.split(",")
253
253
  if request_tags:
254
- ingest["request_tags"] = request_tags
254
+ ingest["request_tags"] = request_tags.split(",")
255
255
  if experience_name:
256
256
  ingest["experience_name"] = experience_name
257
257
  if experience_id:
@@ -259,8 +259,6 @@ class PayiInstrumentor:
259
259
  if user_id:
260
260
  ingest["user_id"] = user_id
261
261
 
262
- extra_headers: dict[str, str] = kwargs.get("extra_headers") or {}
263
-
264
262
  if len(extra_headers) > 0:
265
263
  ingest["provider_request_headers"] = {k: [v] for k, v in extra_headers.items()} # type: ignore
266
264
 
@@ -321,30 +319,40 @@ class PayiInstrumentor:
321
319
  experience_id: Optional[str] = context.get("experience_id")
322
320
  user_id: Optional[str] = context.get("user_id")
323
321
 
322
+ # Merge limits from the decorator and extra headers
324
323
  if limit_ids is not None:
325
- existing_limit_ids = extra_headers.get("xProxy-Limit-IDs")
326
- limit_ids_str = ",".join(limit_ids)
327
- if existing_limit_ids is None:
328
- extra_headers["xProxy-Limit-IDs"] = limit_ids_str
324
+ existing_limit_ids = extra_headers.get("xProxy-Limit-IDs", None)
325
+
326
+ if not existing_limit_ids:
327
+ extra_headers["xProxy-Limit-IDs"] = ",".join(limit_ids)
329
328
  else:
330
- extra_headers["xProxy-Limit-IDs"] = f"{existing_limit_ids},{limit_ids_str}"
329
+ existing_ids = existing_limit_ids.split(',')
330
+ combined_ids = list(set(existing_ids + limit_ids))
331
+ extra_headers["xProxy-Limit-IDs"] = ",".join(combined_ids)
331
332
 
333
+ # Merge request from the decorator and extra headers
332
334
  if request_tags is not None:
333
- existing_request_tags = extra_headers.get("xProxy-Request-Tags")
334
- request_tags_str = ",".join(request_tags)
335
- if existing_request_tags is None:
336
- extra_headers["xProxy-Request-Tags"] = request_tags_str
337
- else:
338
- extra_headers["xProxy-Request-Tags"] = f"{existing_request_tags},{request_tags_str}"
339
-
340
- if experience_name is not None:
341
- extra_headers["xProxy-Experience-Name"] = experience_name
335
+ existing_request_tags = extra_headers.get("xProxy-Request-Tags", None)
342
336
 
343
- if experience_id is not None:
344
- extra_headers["xProxy-Experience-ID"] = experience_id
345
-
346
- if user_id is not None:
347
- extra_headers["xProxy-User-ID"] = user_id
337
+ if not existing_request_tags:
338
+ extra_headers["xProxy-Request-Tags"] = ",".join(request_tags)
339
+ else:
340
+ existing_tags = existing_request_tags.split(',')
341
+ combined_tags = list(set(existing_tags + request_tags))
342
+ extra_headers["xProxy-Request-Tags"] = ",".join(combined_tags)
343
+
344
+ # inner extra_headers user_id takes precedence over outer decorator user_id
345
+ if user_id is not None and extra_headers.get("xProxy-User-ID", None) is None:
346
+ extra_headers["xProxy-User-ID"] = user_id
347
+
348
+ # inner extra_headers experience_name and experience_id take precedence over outer decorator experience_name and experience_id
349
+ # if either inner value is specified, ignore outer decorator values
350
+ if extra_headers.get("xProxy-Experience-Name", None) is None and extra_headers.get("xProxy-Experience-ID", None) is None:
351
+ if experience_name is not None:
352
+ extra_headers["xProxy-Experience-Name"] = experience_name
353
+
354
+ if experience_id is not None:
355
+ extra_headers["xProxy-Experience-ID"] = experience_id
348
356
 
349
357
  @staticmethod
350
358
  def payi_wrapper(func: Any) -> Any:
@@ -4,14 +4,6 @@ from __future__ import annotations
4
4
 
5
5
  import httpx
6
6
 
7
- from .types import (
8
- TypesResource,
9
- AsyncTypesResource,
10
- TypesResourceWithRawResponse,
11
- AsyncTypesResourceWithRawResponse,
12
- TypesResourceWithStreamingResponse,
13
- AsyncTypesResourceWithStreamingResponse,
14
- )
15
7
  from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
16
8
  from ..._compat import cached_property
17
9
  from .properties import (
@@ -29,6 +21,14 @@ from ..._response import (
29
21
  async_to_raw_response_wrapper,
30
22
  async_to_streamed_response_wrapper,
31
23
  )
24
+ from .types.types import (
25
+ TypesResource,
26
+ AsyncTypesResource,
27
+ TypesResourceWithRawResponse,
28
+ AsyncTypesResourceWithRawResponse,
29
+ TypesResourceWithStreamingResponse,
30
+ AsyncTypesResourceWithStreamingResponse,
31
+ )
32
32
  from ..._base_client import make_request_options
33
33
  from ...types.experience_instance_response import ExperienceInstanceResponse
34
34
 
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .types import (
4
+ TypesResource,
5
+ AsyncTypesResource,
6
+ TypesResourceWithRawResponse,
7
+ AsyncTypesResourceWithRawResponse,
8
+ TypesResourceWithStreamingResponse,
9
+ AsyncTypesResourceWithStreamingResponse,
10
+ )
11
+ from .limit_config import (
12
+ LimitConfigResource,
13
+ AsyncLimitConfigResource,
14
+ LimitConfigResourceWithRawResponse,
15
+ AsyncLimitConfigResourceWithRawResponse,
16
+ LimitConfigResourceWithStreamingResponse,
17
+ AsyncLimitConfigResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "LimitConfigResource",
22
+ "AsyncLimitConfigResource",
23
+ "LimitConfigResourceWithRawResponse",
24
+ "AsyncLimitConfigResourceWithRawResponse",
25
+ "LimitConfigResourceWithStreamingResponse",
26
+ "AsyncLimitConfigResourceWithStreamingResponse",
27
+ "TypesResource",
28
+ "AsyncTypesResource",
29
+ "TypesResourceWithRawResponse",
30
+ "AsyncTypesResourceWithRawResponse",
31
+ "TypesResourceWithStreamingResponse",
32
+ "AsyncTypesResourceWithStreamingResponse",
33
+ ]
@@ -0,0 +1,275 @@
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 List, Optional
6
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11
+ from ...._utils import (
12
+ maybe_transform,
13
+ async_maybe_transform,
14
+ )
15
+ from ...._compat import cached_property
16
+ from ...._resource import SyncAPIResource, AsyncAPIResource
17
+ from ...._response import (
18
+ to_raw_response_wrapper,
19
+ to_streamed_response_wrapper,
20
+ async_to_raw_response_wrapper,
21
+ async_to_streamed_response_wrapper,
22
+ )
23
+ from ...._base_client import make_request_options
24
+ from ....types.experiences.types import limit_config_create_params
25
+ from ....types.experiences.experience_type import ExperienceType
26
+
27
+ __all__ = ["LimitConfigResource", "AsyncLimitConfigResource"]
28
+
29
+
30
+ class LimitConfigResource(SyncAPIResource):
31
+ @cached_property
32
+ def with_raw_response(self) -> LimitConfigResourceWithRawResponse:
33
+ """
34
+ This property can be used as a prefix for any HTTP method call to return
35
+ the raw response object instead of the parsed content.
36
+
37
+ For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
38
+ """
39
+ return LimitConfigResourceWithRawResponse(self)
40
+
41
+ @cached_property
42
+ def with_streaming_response(self) -> LimitConfigResourceWithStreamingResponse:
43
+ """
44
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
45
+
46
+ For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
47
+ """
48
+ return LimitConfigResourceWithStreamingResponse(self)
49
+
50
+ def create(
51
+ self,
52
+ experience_name: str,
53
+ *,
54
+ max: float,
55
+ limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
56
+ limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
57
+ threshold: Optional[float] | NotGiven = NOT_GIVEN,
58
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
59
+ # The extra values given here take precedence over values defined on the client or passed to this method.
60
+ extra_headers: Headers | None = None,
61
+ extra_query: Query | None = None,
62
+ extra_body: Body | None = None,
63
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
64
+ ) -> ExperienceType:
65
+ """
66
+ Create a new Experience Type default limit configuration
67
+
68
+ Args:
69
+ extra_headers: Send extra headers
70
+
71
+ extra_query: Add additional query parameters to the request
72
+
73
+ extra_body: Add additional JSON properties to the request
74
+
75
+ timeout: Override the client-level default timeout for this request, in seconds
76
+ """
77
+ if not experience_name:
78
+ raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
79
+ return self._post(
80
+ f"/api/v1/experiences/types/{experience_name}/limit_config",
81
+ body=maybe_transform(
82
+ {
83
+ "max": max,
84
+ "limit_tags": limit_tags,
85
+ "limit_type": limit_type,
86
+ "threshold": threshold,
87
+ },
88
+ limit_config_create_params.LimitConfigCreateParams,
89
+ ),
90
+ options=make_request_options(
91
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
92
+ ),
93
+ cast_to=ExperienceType,
94
+ )
95
+
96
+ def delete(
97
+ self,
98
+ experience_name: str,
99
+ *,
100
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
101
+ # The extra values given here take precedence over values defined on the client or passed to this method.
102
+ extra_headers: Headers | None = None,
103
+ extra_query: Query | None = None,
104
+ extra_body: Body | None = None,
105
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
106
+ ) -> ExperienceType:
107
+ """
108
+ Delete an Experience Type default limit configuration
109
+
110
+ Args:
111
+ extra_headers: Send extra headers
112
+
113
+ extra_query: Add additional query parameters to the request
114
+
115
+ extra_body: Add additional JSON properties to the request
116
+
117
+ timeout: Override the client-level default timeout for this request, in seconds
118
+ """
119
+ if not experience_name:
120
+ raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
121
+ return self._delete(
122
+ f"/api/v1/experiences/types/{experience_name}/limit_config",
123
+ options=make_request_options(
124
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
125
+ ),
126
+ cast_to=ExperienceType,
127
+ )
128
+
129
+
130
+ class AsyncLimitConfigResource(AsyncAPIResource):
131
+ @cached_property
132
+ def with_raw_response(self) -> AsyncLimitConfigResourceWithRawResponse:
133
+ """
134
+ This property can be used as a prefix for any HTTP method call to return
135
+ the raw response object instead of the parsed content.
136
+
137
+ For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
138
+ """
139
+ return AsyncLimitConfigResourceWithRawResponse(self)
140
+
141
+ @cached_property
142
+ def with_streaming_response(self) -> AsyncLimitConfigResourceWithStreamingResponse:
143
+ """
144
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
145
+
146
+ For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
147
+ """
148
+ return AsyncLimitConfigResourceWithStreamingResponse(self)
149
+
150
+ async def create(
151
+ self,
152
+ experience_name: str,
153
+ *,
154
+ max: float,
155
+ limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
156
+ limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
157
+ threshold: Optional[float] | NotGiven = NOT_GIVEN,
158
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
159
+ # The extra values given here take precedence over values defined on the client or passed to this method.
160
+ extra_headers: Headers | None = None,
161
+ extra_query: Query | None = None,
162
+ extra_body: Body | None = None,
163
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
164
+ ) -> ExperienceType:
165
+ """
166
+ Create a new Experience Type default limit configuration
167
+
168
+ Args:
169
+ extra_headers: Send extra headers
170
+
171
+ extra_query: Add additional query parameters to the request
172
+
173
+ extra_body: Add additional JSON properties to the request
174
+
175
+ timeout: Override the client-level default timeout for this request, in seconds
176
+ """
177
+ if not experience_name:
178
+ raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
179
+ return await self._post(
180
+ f"/api/v1/experiences/types/{experience_name}/limit_config",
181
+ body=await async_maybe_transform(
182
+ {
183
+ "max": max,
184
+ "limit_tags": limit_tags,
185
+ "limit_type": limit_type,
186
+ "threshold": threshold,
187
+ },
188
+ limit_config_create_params.LimitConfigCreateParams,
189
+ ),
190
+ options=make_request_options(
191
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
192
+ ),
193
+ cast_to=ExperienceType,
194
+ )
195
+
196
+ async def delete(
197
+ self,
198
+ experience_name: str,
199
+ *,
200
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
201
+ # The extra values given here take precedence over values defined on the client or passed to this method.
202
+ extra_headers: Headers | None = None,
203
+ extra_query: Query | None = None,
204
+ extra_body: Body | None = None,
205
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
206
+ ) -> ExperienceType:
207
+ """
208
+ Delete an Experience Type default limit configuration
209
+
210
+ Args:
211
+ extra_headers: Send extra headers
212
+
213
+ extra_query: Add additional query parameters to the request
214
+
215
+ extra_body: Add additional JSON properties to the request
216
+
217
+ timeout: Override the client-level default timeout for this request, in seconds
218
+ """
219
+ if not experience_name:
220
+ raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
221
+ return await self._delete(
222
+ f"/api/v1/experiences/types/{experience_name}/limit_config",
223
+ options=make_request_options(
224
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
225
+ ),
226
+ cast_to=ExperienceType,
227
+ )
228
+
229
+
230
+ class LimitConfigResourceWithRawResponse:
231
+ def __init__(self, limit_config: LimitConfigResource) -> None:
232
+ self._limit_config = limit_config
233
+
234
+ self.create = to_raw_response_wrapper(
235
+ limit_config.create,
236
+ )
237
+ self.delete = to_raw_response_wrapper(
238
+ limit_config.delete,
239
+ )
240
+
241
+
242
+ class AsyncLimitConfigResourceWithRawResponse:
243
+ def __init__(self, limit_config: AsyncLimitConfigResource) -> None:
244
+ self._limit_config = limit_config
245
+
246
+ self.create = async_to_raw_response_wrapper(
247
+ limit_config.create,
248
+ )
249
+ self.delete = async_to_raw_response_wrapper(
250
+ limit_config.delete,
251
+ )
252
+
253
+
254
+ class LimitConfigResourceWithStreamingResponse:
255
+ def __init__(self, limit_config: LimitConfigResource) -> None:
256
+ self._limit_config = limit_config
257
+
258
+ self.create = to_streamed_response_wrapper(
259
+ limit_config.create,
260
+ )
261
+ self.delete = to_streamed_response_wrapper(
262
+ limit_config.delete,
263
+ )
264
+
265
+
266
+ class AsyncLimitConfigResourceWithStreamingResponse:
267
+ def __init__(self, limit_config: AsyncLimitConfigResource) -> None:
268
+ self._limit_config = limit_config
269
+
270
+ self.create = async_to_streamed_response_wrapper(
271
+ limit_config.create,
272
+ )
273
+ self.delete = async_to_streamed_response_wrapper(
274
+ limit_config.delete,
275
+ )
@@ -6,28 +6,40 @@ from typing import Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
10
- from ..._utils import (
9
+ from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
10
+ from ...._utils import (
11
11
  maybe_transform,
12
12
  async_maybe_transform,
13
13
  )
14
- from ..._compat import cached_property
15
- from ..._resource import SyncAPIResource, AsyncAPIResource
16
- from ..._response import (
14
+ from ...._compat import cached_property
15
+ from ...._resource import SyncAPIResource, AsyncAPIResource
16
+ from ...._response import (
17
17
  to_raw_response_wrapper,
18
18
  to_streamed_response_wrapper,
19
19
  async_to_raw_response_wrapper,
20
20
  async_to_streamed_response_wrapper,
21
21
  )
22
- from ..._base_client import make_request_options
23
- from ...types.experiences import type_list_params, type_create_params, type_update_params
24
- from ...types.experiences.experience_type import ExperienceType
25
- from ...types.experiences.type_list_response import TypeListResponse
22
+ from .limit_config import (
23
+ LimitConfigResource,
24
+ AsyncLimitConfigResource,
25
+ LimitConfigResourceWithRawResponse,
26
+ AsyncLimitConfigResourceWithRawResponse,
27
+ LimitConfigResourceWithStreamingResponse,
28
+ AsyncLimitConfigResourceWithStreamingResponse,
29
+ )
30
+ from ...._base_client import make_request_options
31
+ from ....types.experiences import type_list_params, type_create_params, type_update_params
32
+ from ....types.experiences.experience_type import ExperienceType
33
+ from ....types.experiences.type_list_response import TypeListResponse
26
34
 
27
35
  __all__ = ["TypesResource", "AsyncTypesResource"]
28
36
 
29
37
 
30
38
  class TypesResource(SyncAPIResource):
39
+ @cached_property
40
+ def limit_config(self) -> LimitConfigResource:
41
+ return LimitConfigResource(self._client)
42
+
31
43
  @cached_property
32
44
  def with_raw_response(self) -> TypesResourceWithRawResponse:
33
45
  """
@@ -52,6 +64,7 @@ class TypesResource(SyncAPIResource):
52
64
  *,
53
65
  description: str,
54
66
  name: str,
67
+ limit_config: type_create_params.LimitConfig | NotGiven = NOT_GIVEN,
55
68
  logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
56
69
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
57
70
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -78,6 +91,7 @@ class TypesResource(SyncAPIResource):
78
91
  {
79
92
  "description": description,
80
93
  "name": name,
94
+ "limit_config": limit_config,
81
95
  "logging_enabled": logging_enabled,
82
96
  },
83
97
  type_create_params.TypeCreateParams,
@@ -125,7 +139,7 @@ class TypesResource(SyncAPIResource):
125
139
  self,
126
140
  experience_name: str,
127
141
  *,
128
- description: Optional[str],
142
+ description: Optional[str] | NotGiven = NOT_GIVEN,
129
143
  logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
130
144
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
131
145
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -235,6 +249,10 @@ class TypesResource(SyncAPIResource):
235
249
 
236
250
 
237
251
  class AsyncTypesResource(AsyncAPIResource):
252
+ @cached_property
253
+ def limit_config(self) -> AsyncLimitConfigResource:
254
+ return AsyncLimitConfigResource(self._client)
255
+
238
256
  @cached_property
239
257
  def with_raw_response(self) -> AsyncTypesResourceWithRawResponse:
240
258
  """
@@ -259,6 +277,7 @@ class AsyncTypesResource(AsyncAPIResource):
259
277
  *,
260
278
  description: str,
261
279
  name: str,
280
+ limit_config: type_create_params.LimitConfig | NotGiven = NOT_GIVEN,
262
281
  logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
263
282
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
264
283
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -285,6 +304,7 @@ class AsyncTypesResource(AsyncAPIResource):
285
304
  {
286
305
  "description": description,
287
306
  "name": name,
307
+ "limit_config": limit_config,
288
308
  "logging_enabled": logging_enabled,
289
309
  },
290
310
  type_create_params.TypeCreateParams,
@@ -332,7 +352,7 @@ class AsyncTypesResource(AsyncAPIResource):
332
352
  self,
333
353
  experience_name: str,
334
354
  *,
335
- description: Optional[str],
355
+ description: Optional[str] | NotGiven = NOT_GIVEN,
336
356
  logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
337
357
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
338
358
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -461,6 +481,10 @@ class TypesResourceWithRawResponse:
461
481
  types.delete,
462
482
  )
463
483
 
484
+ @cached_property
485
+ def limit_config(self) -> LimitConfigResourceWithRawResponse:
486
+ return LimitConfigResourceWithRawResponse(self._types.limit_config)
487
+
464
488
 
465
489
  class AsyncTypesResourceWithRawResponse:
466
490
  def __init__(self, types: AsyncTypesResource) -> None:
@@ -482,6 +506,10 @@ class AsyncTypesResourceWithRawResponse:
482
506
  types.delete,
483
507
  )
484
508
 
509
+ @cached_property
510
+ def limit_config(self) -> AsyncLimitConfigResourceWithRawResponse:
511
+ return AsyncLimitConfigResourceWithRawResponse(self._types.limit_config)
512
+
485
513
 
486
514
  class TypesResourceWithStreamingResponse:
487
515
  def __init__(self, types: TypesResource) -> None:
@@ -503,6 +531,10 @@ class TypesResourceWithStreamingResponse:
503
531
  types.delete,
504
532
  )
505
533
 
534
+ @cached_property
535
+ def limit_config(self) -> LimitConfigResourceWithStreamingResponse:
536
+ return LimitConfigResourceWithStreamingResponse(self._types.limit_config)
537
+
506
538
 
507
539
  class AsyncTypesResourceWithStreamingResponse:
508
540
  def __init__(self, types: AsyncTypesResource) -> None:
@@ -523,3 +555,7 @@ class AsyncTypesResourceWithStreamingResponse:
523
555
  self.delete = async_to_streamed_response_wrapper(
524
556
  types.delete,
525
557
  )
558
+
559
+ @cached_property
560
+ def limit_config(self) -> AsyncLimitConfigResourceWithStreamingResponse:
561
+ return AsyncLimitConfigResourceWithStreamingResponse(self._types.limit_config)
payi/resources/ingest.py CHANGED
@@ -26,6 +26,7 @@ from .._base_client import make_request_options
26
26
  from ..types.ingest_response import IngestResponse
27
27
  from ..types.ingest_event_param import IngestEventParam
28
28
  from ..types.bulk_ingest_response import BulkIngestResponse
29
+ from ..types.pay_i_common_models_api_router_header_info_param import PayICommonModelsAPIRouterHeaderInfoParam
29
30
 
30
31
  __all__ = ["IngestResource", "AsyncIngestResource"]
31
32
 
@@ -96,10 +97,9 @@ class IngestResource(SyncAPIResource):
96
97
  experience_properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
97
98
  http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
98
99
  properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
99
- provider_request_headers: Optional[Iterable[ingest_units_params.ProviderRequestHeader]] | NotGiven = NOT_GIVEN,
100
+ provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
100
101
  provider_request_json: Optional[str] | NotGiven = NOT_GIVEN,
101
- provider_response_headers: Optional[Iterable[ingest_units_params.ProviderResponseHeader]]
102
- | NotGiven = NOT_GIVEN,
102
+ provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
103
103
  provider_response_json: Union[str, List[str], None] | NotGiven = NOT_GIVEN,
104
104
  provider_uri: Optional[str] | NotGiven = NOT_GIVEN,
105
105
  time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
@@ -282,10 +282,9 @@ class AsyncIngestResource(AsyncAPIResource):
282
282
  experience_properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
283
283
  http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
284
284
  properties: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
285
- provider_request_headers: Optional[Iterable[ingest_units_params.ProviderRequestHeader]] | NotGiven = NOT_GIVEN,
285
+ provider_request_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
286
286
  provider_request_json: Optional[str] | NotGiven = NOT_GIVEN,
287
- provider_response_headers: Optional[Iterable[ingest_units_params.ProviderResponseHeader]]
288
- | NotGiven = NOT_GIVEN,
287
+ provider_response_headers: Optional[Iterable[PayICommonModelsAPIRouterHeaderInfoParam]] | NotGiven = NOT_GIVEN,
289
288
  provider_response_json: Union[str, List[str], None] | NotGiven = NOT_GIVEN,
290
289
  provider_uri: Optional[str] | NotGiven = NOT_GIVEN,
291
290
  time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,