payi 0.1.0a27__py3-none-any.whl → 0.1.0a29__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.

payi/_client.py CHANGED
@@ -129,7 +129,7 @@ class Payi(SyncAPIClient):
129
129
  @override
130
130
  def auth_headers(self) -> dict[str, str]:
131
131
  api_key = self.api_key
132
- return {"Authorization": api_key}
132
+ return {"xProxy-api-key": api_key}
133
133
 
134
134
  @property
135
135
  @override
@@ -309,7 +309,7 @@ class AsyncPayi(AsyncAPIClient):
309
309
  @override
310
310
  def auth_headers(self) -> dict[str, str]:
311
311
  api_key = self.api_key
312
- return {"Authorization": api_key}
312
+ return {"xProxy-api-key": api_key}
313
313
 
314
314
  @property
315
315
  @override
payi/_compat.py CHANGED
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
4
4
  from datetime import date, datetime
5
- from typing_extensions import Self
5
+ from typing_extensions import Self, Literal
6
6
 
7
7
  import pydantic
8
8
  from pydantic.fields import FieldInfo
@@ -133,13 +133,15 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
133
133
  def model_dump(
134
134
  model: pydantic.BaseModel,
135
135
  *,
136
- exclude: IncEx = None,
136
+ exclude: IncEx | None = None,
137
137
  exclude_unset: bool = False,
138
138
  exclude_defaults: bool = False,
139
139
  warnings: bool = True,
140
+ mode: Literal["json", "python"] = "python",
140
141
  ) -> dict[str, Any]:
141
- if PYDANTIC_V2:
142
+ if PYDANTIC_V2 or hasattr(model, "model_dump"):
142
143
  return model.model_dump(
144
+ mode=mode,
143
145
  exclude=exclude,
144
146
  exclude_unset=exclude_unset,
145
147
  exclude_defaults=exclude_defaults,
payi/_models.py CHANGED
@@ -37,6 +37,7 @@ from ._utils import (
37
37
  PropertyInfo,
38
38
  is_list,
39
39
  is_given,
40
+ json_safe,
40
41
  lru_cache,
41
42
  is_mapping,
42
43
  parse_date,
@@ -176,7 +177,7 @@ class BaseModel(pydantic.BaseModel):
176
177
  # Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836.
177
178
  @classmethod
178
179
  @override
179
- def construct(
180
+ def construct( # pyright: ignore[reportIncompatibleMethodOverride]
180
181
  cls: Type[ModelT],
181
182
  _fields_set: set[str] | None = None,
182
183
  **values: object,
@@ -248,8 +249,8 @@ class BaseModel(pydantic.BaseModel):
248
249
  self,
249
250
  *,
250
251
  mode: Literal["json", "python"] | str = "python",
251
- include: IncEx = None,
252
- exclude: IncEx = None,
252
+ include: IncEx | None = None,
253
+ exclude: IncEx | None = None,
253
254
  by_alias: bool = False,
254
255
  exclude_unset: bool = False,
255
256
  exclude_defaults: bool = False,
@@ -279,8 +280,8 @@ class BaseModel(pydantic.BaseModel):
279
280
  Returns:
280
281
  A dictionary representation of the model.
281
282
  """
282
- if mode != "python":
283
- raise ValueError("mode is only supported in Pydantic v2")
283
+ if mode not in {"json", "python"}:
284
+ raise ValueError("mode must be either 'json' or 'python'")
284
285
  if round_trip != False:
285
286
  raise ValueError("round_trip is only supported in Pydantic v2")
286
287
  if warnings != True:
@@ -289,7 +290,7 @@ class BaseModel(pydantic.BaseModel):
289
290
  raise ValueError("context is only supported in Pydantic v2")
290
291
  if serialize_as_any != False:
291
292
  raise ValueError("serialize_as_any is only supported in Pydantic v2")
292
- return super().dict( # pyright: ignore[reportDeprecated]
293
+ dumped = super().dict( # pyright: ignore[reportDeprecated]
293
294
  include=include,
294
295
  exclude=exclude,
295
296
  by_alias=by_alias,
@@ -298,13 +299,15 @@ class BaseModel(pydantic.BaseModel):
298
299
  exclude_none=exclude_none,
299
300
  )
300
301
 
302
+ return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped
303
+
301
304
  @override
302
305
  def model_dump_json(
303
306
  self,
304
307
  *,
305
308
  indent: int | None = None,
306
- include: IncEx = None,
307
- exclude: IncEx = None,
309
+ include: IncEx | None = None,
310
+ exclude: IncEx | None = None,
308
311
  by_alias: bool = False,
309
312
  exclude_unset: bool = False,
310
313
  exclude_defaults: bool = False,
payi/_types.py CHANGED
@@ -16,7 +16,7 @@ from typing import (
16
16
  Optional,
17
17
  Sequence,
18
18
  )
19
- from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
19
+ from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
20
20
 
21
21
  import httpx
22
22
  import pydantic
@@ -193,7 +193,9 @@ StrBytesIntFloat = Union[str, bytes, int, float]
193
193
 
194
194
  # Note: copied from Pydantic
195
195
  # https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49
196
- IncEx: TypeAlias = "set[int] | set[str] | dict[int, Any] | dict[str, Any] | None"
196
+ IncEx: TypeAlias = Union[
197
+ Set[int], Set[str], Mapping[int, Union["IncEx", Literal[True]]], Mapping[str, Union["IncEx", Literal[True]]]
198
+ ]
197
199
 
198
200
  PostParser = Callable[[Any], Any]
199
201
 
payi/_utils/__init__.py CHANGED
@@ -6,6 +6,7 @@ from ._utils import (
6
6
  is_list as is_list,
7
7
  is_given as is_given,
8
8
  is_tuple as is_tuple,
9
+ json_safe as json_safe,
9
10
  lru_cache as lru_cache,
10
11
  is_mapping as is_mapping,
11
12
  is_tuple_t as is_tuple_t,
payi/_utils/_transform.py CHANGED
@@ -173,6 +173,11 @@ def _transform_recursive(
173
173
  # Iterable[T]
174
174
  or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
175
175
  ):
176
+ # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
177
+ # intended as an iterable, so we don't transform it.
178
+ if isinstance(data, dict):
179
+ return cast(object, data)
180
+
176
181
  inner_type = extract_type_arg(stripped_type, 0)
177
182
  return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
178
183
 
@@ -186,7 +191,7 @@ def _transform_recursive(
186
191
  return data
187
192
 
188
193
  if isinstance(data, pydantic.BaseModel):
189
- return model_dump(data, exclude_unset=True)
194
+ return model_dump(data, exclude_unset=True, mode="json")
190
195
 
191
196
  annotated_type = _get_annotated_type(annotation)
192
197
  if annotated_type is None:
@@ -311,6 +316,11 @@ async def _async_transform_recursive(
311
316
  # Iterable[T]
312
317
  or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
313
318
  ):
319
+ # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
320
+ # intended as an iterable, so we don't transform it.
321
+ if isinstance(data, dict):
322
+ return cast(object, data)
323
+
314
324
  inner_type = extract_type_arg(stripped_type, 0)
315
325
  return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
316
326
 
@@ -324,7 +334,7 @@ async def _async_transform_recursive(
324
334
  return data
325
335
 
326
336
  if isinstance(data, pydantic.BaseModel):
327
- return model_dump(data, exclude_unset=True)
337
+ return model_dump(data, exclude_unset=True, mode="json")
328
338
 
329
339
  annotated_type = _get_annotated_type(annotation)
330
340
  if annotated_type is None:
payi/_utils/_utils.py CHANGED
@@ -16,6 +16,7 @@ from typing import (
16
16
  overload,
17
17
  )
18
18
  from pathlib import Path
19
+ from datetime import date, datetime
19
20
  from typing_extensions import TypeGuard
20
21
 
21
22
  import sniffio
@@ -395,3 +396,19 @@ def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]:
395
396
  maxsize=maxsize,
396
397
  )
397
398
  return cast(Any, wrapper) # type: ignore[no-any-return]
399
+
400
+
401
+ def json_safe(data: object) -> object:
402
+ """Translates a mapping / sequence recursively in the same fashion
403
+ as `pydantic` v2's `model_dump(mode="json")`.
404
+ """
405
+ if is_mapping(data):
406
+ return {json_safe(key): json_safe(value) for key, value in data.items()}
407
+
408
+ if is_iterable(data) and not isinstance(data, (str, bytes, bytearray)):
409
+ return [json_safe(item) for item in data]
410
+
411
+ if isinstance(data, (datetime, date)):
412
+ return data.isoformat()
413
+
414
+ return data
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.27" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.29" # x-release-please-version
@@ -53,6 +53,7 @@ class BillingModelsResource(SyncAPIResource):
53
53
  *,
54
54
  name: str,
55
55
  type: Literal["costplus"],
56
+ default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
56
57
  prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
57
58
  prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
58
59
  threshold: Optional[float] | NotGiven = NOT_GIVEN,
@@ -79,6 +80,7 @@ class BillingModelsResource(SyncAPIResource):
79
80
  {
80
81
  "name": name,
81
82
  "type": type,
83
+ "default_price_modifier": default_price_modifier,
82
84
  "prepaid_amount": prepaid_amount,
83
85
  "prepaid_max": prepaid_max,
84
86
  "threshold": threshold,
@@ -127,6 +129,7 @@ class BillingModelsResource(SyncAPIResource):
127
129
  billing_model_id: str,
128
130
  *,
129
131
  type: Literal["costplus"],
132
+ default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
130
133
  name: Optional[str] | NotGiven = NOT_GIVEN,
131
134
  prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
132
135
  prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
@@ -155,6 +158,7 @@ class BillingModelsResource(SyncAPIResource):
155
158
  body=maybe_transform(
156
159
  {
157
160
  "type": type,
161
+ "default_price_modifier": default_price_modifier,
158
162
  "name": name,
159
163
  "prepaid_amount": prepaid_amount,
160
164
  "prepaid_max": prepaid_max,
@@ -243,6 +247,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
243
247
  *,
244
248
  name: str,
245
249
  type: Literal["costplus"],
250
+ default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
246
251
  prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
247
252
  prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
248
253
  threshold: Optional[float] | NotGiven = NOT_GIVEN,
@@ -269,6 +274,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
269
274
  {
270
275
  "name": name,
271
276
  "type": type,
277
+ "default_price_modifier": default_price_modifier,
272
278
  "prepaid_amount": prepaid_amount,
273
279
  "prepaid_max": prepaid_max,
274
280
  "threshold": threshold,
@@ -317,6 +323,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
317
323
  billing_model_id: str,
318
324
  *,
319
325
  type: Literal["costplus"],
326
+ default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
320
327
  name: Optional[str] | NotGiven = NOT_GIVEN,
321
328
  prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
322
329
  prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
@@ -345,6 +352,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
345
352
  body=await async_maybe_transform(
346
353
  {
347
354
  "type": type,
355
+ "default_price_modifier": default_price_modifier,
348
356
  "name": name,
349
357
  "prepaid_amount": prepaid_amount,
350
358
  "prepaid_max": prepaid_max,
@@ -2,6 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Optional
6
+
5
7
  import httpx
6
8
 
7
9
  from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -50,6 +52,7 @@ class TypesResource(SyncAPIResource):
50
52
  *,
51
53
  description: str,
52
54
  name: str,
55
+ logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
53
56
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
54
57
  # The extra values given here take precedence over values defined on the client or passed to this method.
55
58
  extra_headers: Headers | None = None,
@@ -75,6 +78,7 @@ class TypesResource(SyncAPIResource):
75
78
  {
76
79
  "description": description,
77
80
  "name": name,
81
+ "logging_enabled": logging_enabled,
78
82
  },
79
83
  type_create_params.TypeCreateParams,
80
84
  ),
@@ -121,7 +125,8 @@ class TypesResource(SyncAPIResource):
121
125
  self,
122
126
  experience_name: str,
123
127
  *,
124
- description: str,
128
+ description: Optional[str],
129
+ logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
125
130
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
126
131
  # The extra values given here take precedence over values defined on the client or passed to this method.
127
132
  extra_headers: Headers | None = None,
@@ -145,7 +150,13 @@ class TypesResource(SyncAPIResource):
145
150
  raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
146
151
  return self._patch(
147
152
  f"/api/v1/experiences/types/{experience_name}",
148
- body=maybe_transform({"description": description}, type_update_params.TypeUpdateParams),
153
+ body=maybe_transform(
154
+ {
155
+ "description": description,
156
+ "logging_enabled": logging_enabled,
157
+ },
158
+ type_update_params.TypeUpdateParams,
159
+ ),
149
160
  options=make_request_options(
150
161
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
151
162
  ),
@@ -248,6 +259,7 @@ class AsyncTypesResource(AsyncAPIResource):
248
259
  *,
249
260
  description: str,
250
261
  name: str,
262
+ logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
251
263
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
252
264
  # The extra values given here take precedence over values defined on the client or passed to this method.
253
265
  extra_headers: Headers | None = None,
@@ -273,6 +285,7 @@ class AsyncTypesResource(AsyncAPIResource):
273
285
  {
274
286
  "description": description,
275
287
  "name": name,
288
+ "logging_enabled": logging_enabled,
276
289
  },
277
290
  type_create_params.TypeCreateParams,
278
291
  ),
@@ -319,7 +332,8 @@ class AsyncTypesResource(AsyncAPIResource):
319
332
  self,
320
333
  experience_name: str,
321
334
  *,
322
- description: str,
335
+ description: Optional[str],
336
+ logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
323
337
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
324
338
  # The extra values given here take precedence over values defined on the client or passed to this method.
325
339
  extra_headers: Headers | None = None,
@@ -343,7 +357,13 @@ class AsyncTypesResource(AsyncAPIResource):
343
357
  raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
344
358
  return await self._patch(
345
359
  f"/api/v1/experiences/types/{experience_name}",
346
- body=await async_maybe_transform({"description": description}, type_update_params.TypeUpdateParams),
360
+ body=await async_maybe_transform(
361
+ {
362
+ "description": description,
363
+ "logging_enabled": logging_enabled,
364
+ },
365
+ type_update_params.TypeUpdateParams,
366
+ ),
347
367
  options=make_request_options(
348
368
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
349
369
  ),
payi/resources/ingest.py CHANGED
@@ -91,8 +91,11 @@ class IngestResource(SyncAPIResource):
91
91
  category: str,
92
92
  resource: str,
93
93
  units: Dict[str, ingest_units_params.Units],
94
+ end_to_end_latency_ms: Optional[int] | NotGiven = NOT_GIVEN,
94
95
  event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
96
+ http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
95
97
  provisioned_resource_name: Optional[str] | NotGiven = NOT_GIVEN,
98
+ time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
96
99
  budget_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
97
100
  request_tags: Union[list[str], None] | NotGiven = NOT_GIVEN,
98
101
  experience_id: Union[str, None] | NotGiven = NOT_GIVEN,
@@ -186,8 +189,11 @@ class IngestResource(SyncAPIResource):
186
189
  "category": category,
187
190
  "resource": resource,
188
191
  "units": units,
192
+ "end_to_end_latency_ms": end_to_end_latency_ms,
189
193
  "event_timestamp": event_timestamp,
194
+ "http_status_code": http_status_code,
190
195
  "provisioned_resource_name": provisioned_resource_name,
196
+ "time_to_first_token_ms": time_to_first_token_ms,
191
197
  },
192
198
  ingest_units_params.IngestUnitsParams,
193
199
  ),
@@ -258,8 +264,11 @@ class AsyncIngestResource(AsyncAPIResource):
258
264
  category: str,
259
265
  resource: str,
260
266
  units: Dict[str, ingest_units_params.Units],
267
+ end_to_end_latency_ms: Optional[int] | NotGiven = NOT_GIVEN,
261
268
  event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
269
+ http_status_code: Optional[int] | NotGiven = NOT_GIVEN,
262
270
  provisioned_resource_name: Optional[str] | NotGiven = NOT_GIVEN,
271
+ time_to_first_token_ms: Optional[int] | NotGiven = NOT_GIVEN,
263
272
  budget_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
264
273
  request_tags: Union[list[str], None] | NotGiven = NOT_GIVEN,
265
274
  experience_name: Union[str, None] | NotGiven = NOT_GIVEN,
@@ -352,8 +361,11 @@ class AsyncIngestResource(AsyncAPIResource):
352
361
  "category": category,
353
362
  "resource": resource,
354
363
  "units": units,
364
+ "end_to_end_latency_ms": end_to_end_latency_ms,
355
365
  "event_timestamp": event_timestamp,
366
+ "http_status_code": http_status_code,
356
367
  "provisioned_resource_name": provisioned_resource_name,
368
+ "time_to_first_token_ms": time_to_first_token_ms,
357
369
  },
358
370
  ingest_units_params.IngestUnitsParams,
359
371
  ),
@@ -22,6 +22,8 @@ class BillingModel(BaseModel):
22
22
 
23
23
  updated_on: datetime
24
24
 
25
+ default_price_modifier: Optional[float] = None
26
+
25
27
  prepaid_amount: Optional[float] = None
26
28
 
27
29
  prepaid_max: Optional[float] = None
@@ -13,6 +13,8 @@ class BillingModelCreateParams(TypedDict, total=False):
13
13
 
14
14
  type: Required[Literal["costplus"]]
15
15
 
16
+ default_price_modifier: Optional[float]
17
+
16
18
  prepaid_amount: Optional[float]
17
19
 
18
20
  prepaid_max: Optional[float]
@@ -11,6 +11,8 @@ __all__ = ["BillingModelUpdateParams"]
11
11
  class BillingModelUpdateParams(TypedDict, total=False):
12
12
  type: Required[Literal["costplus"]]
13
13
 
14
+ default_price_modifier: Optional[float]
15
+
14
16
  name: Optional[str]
15
17
 
16
18
  prepaid_amount: Optional[float]
@@ -10,4 +10,6 @@ __all__ = ["CostDetails"]
10
10
  class CostDetails(BaseModel):
11
11
  base: float
12
12
 
13
+ overage_base: Optional[float] = None
14
+
13
15
  overrun_base: Optional[float] = None
@@ -1,5 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ from typing import Optional
3
4
 
4
5
  from ..._models import BaseModel
5
6
 
@@ -12,3 +13,5 @@ class ExperienceType(BaseModel):
12
13
  name: str
13
14
 
14
15
  request_id: str
16
+
17
+ logging_enabled: Optional[bool] = None
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Optional
5
6
  from typing_extensions import Required, TypedDict
6
7
 
7
8
  __all__ = ["TypeCreateParams"]
@@ -11,3 +12,5 @@ class TypeCreateParams(TypedDict, total=False):
11
12
  description: Required[str]
12
13
 
13
14
  name: Required[str]
15
+
16
+ logging_enabled: Optional[bool]
@@ -2,10 +2,13 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Optional
5
6
  from typing_extensions import Required, TypedDict
6
7
 
7
8
  __all__ = ["TypeUpdateParams"]
8
9
 
9
10
 
10
11
  class TypeUpdateParams(TypedDict, total=False):
11
- description: Required[str]
12
+ description: Required[Optional[str]]
13
+
14
+ logging_enabled: Optional[bool]
@@ -26,14 +26,22 @@ class IngestEventParam(TypedDict, total=False):
26
26
 
27
27
  budget_ids: Optional[List[str]]
28
28
 
29
+ csat_rating: Optional[int]
30
+
31
+ end_to_end_latency_ms: Optional[int]
32
+
29
33
  event_timestamp: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
30
34
 
31
35
  experience_id: Optional[str]
32
36
 
33
37
  experience_name: Optional[str]
34
38
 
39
+ http_status_code: Optional[int]
40
+
35
41
  provisioned_resource_name: Optional[str]
36
42
 
37
43
  request_tags: Optional[List[str]]
38
44
 
45
+ time_to_first_token_ms: Optional[int]
46
+
39
47
  user_id: Optional[str]
@@ -18,10 +18,16 @@ class IngestUnitsParams(TypedDict, total=False):
18
18
 
19
19
  units: Required[Dict[str, Units]]
20
20
 
21
+ end_to_end_latency_ms: Optional[int]
22
+
21
23
  event_timestamp: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
22
24
 
25
+ http_status_code: Optional[int]
26
+
23
27
  provisioned_resource_name: Optional[str]
24
28
 
29
+ time_to_first_token_ms: Optional[int]
30
+
25
31
  budget_ids: Annotated[Union[list[str], None], PropertyInfo(alias="xProxy-Budget-IDs")]
26
32
 
27
33
  request_tags: Annotated[Union[list[str], None], PropertyInfo(alias="xProxy-Request-Tags")]
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: payi
3
- Version: 0.1.0a27
3
+ Version: 0.1.0a29
4
4
  Summary: The official Python library for the payi API
5
5
  Project-URL: Homepage, https://github.com/Pay-i/pay-i-python
6
6
  Project-URL: Repository, https://github.com/Pay-i/pay-i-python
7
7
  Author-email: Payi <support@payi.com>
8
- License-Expression: Apache-2.0
9
- License-File: LICENSE
8
+ License: Apache-2.0
10
9
  Classifier: Intended Audience :: Developers
11
10
  Classifier: License :: OSI Approved :: Apache Software License
12
11
  Classifier: Operating System :: MacOS
@@ -14,7 +13,6 @@ Classifier: Operating System :: Microsoft :: Windows
14
13
  Classifier: Operating System :: OS Independent
15
14
  Classifier: Operating System :: POSIX
16
15
  Classifier: Operating System :: POSIX :: Linux
17
- Classifier: Programming Language :: Python :: 3.7
18
16
  Classifier: Programming Language :: Python :: 3.8
19
17
  Classifier: Programming Language :: Python :: 3.9
20
18
  Classifier: Programming Language :: Python :: 3.10
@@ -22,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.11
22
20
  Classifier: Programming Language :: Python :: 3.12
23
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
22
  Classifier: Typing :: Typed
25
- Requires-Python: >=3.7
23
+ Requires-Python: >=3.8
26
24
  Requires-Dist: anyio<5,>=3.5.0
27
25
  Requires-Dist: cached-property; python_version < '3.8'
28
26
  Requires-Dist: distro<2,>=1.7.0
@@ -36,7 +34,7 @@ Description-Content-Type: text/markdown
36
34
 
37
35
  [![PyPI version](https://img.shields.io/pypi/v/payi.svg)](https://pypi.org/project/payi/)
38
36
 
39
- The Payi Python library provides convenient access to the Payi REST API from any Python 3.7+
37
+ The Payi Python library provides convenient access to the Payi REST API from any Python 3.8+
40
38
  application. The library includes type definitions for all request params and response fields,
41
39
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
42
40
 
@@ -62,8 +60,7 @@ import os
62
60
  from payi import Payi
63
61
 
64
62
  client = Payi(
65
- # This is the default and can be omitted
66
- api_key=os.environ.get("PAYI_API_KEY"),
63
+ api_key=os.environ.get("PAYI_API_KEY"), # This is the default and can be omitted
67
64
  )
68
65
 
69
66
  budget_response = client.budgets.create(
@@ -88,8 +85,7 @@ import asyncio
88
85
  from payi import AsyncPayi
89
86
 
90
87
  client = AsyncPayi(
91
- # This is the default and can be omitted
92
- api_key=os.environ.get("PAYI_API_KEY"),
88
+ api_key=os.environ.get("PAYI_API_KEY"), # This is the default and can be omitted
93
89
  )
94
90
 
95
91
 
@@ -369,7 +365,7 @@ print(payi.__version__)
369
365
 
370
366
  ## Requirements
371
367
 
372
- Python 3.7 or higher.
368
+ Python 3.8 or higher.
373
369
 
374
370
  ## Contributing
375
371
 
@@ -1,33 +1,33 @@
1
1
  payi/__init__.py,sha256=LWpfR6WSMPTnmmx3ToqqZ0A8CNduLcuxY1SSOqhPxuk,2381
2
2
  payi/_base_client.py,sha256=Jq9mZjEknHo-6ZANRPCQXVHTbbC4Hh7QLFv2jrNtGJ0,67842
3
- payi/_client.py,sha256=ljPrM5gfpC2WHYmifPcdLIedJUuKD91GWcS49c3RE38,18472
4
- payi/_compat.py,sha256=9CWnEaYK0kot7aSNW-m2W9xZb5giIdvKN9sWxvBbbSA,6488
3
+ payi/_client.py,sha256=ZB23I50J5Ia4etp6zoB7pfFf1XgWXeAL0PMq2UOPlbI,18474
4
+ payi/_compat.py,sha256=fQkXUY7reJc8m_yguMWSjHBfO8lNzw4wOAxtkhP9d1Q,6607
5
5
  payi/_constants.py,sha256=JE8kyZa2Q4NK_i4fO--8siEYTzeHnT0fYbOFDgDP4uk,464
6
6
  payi/_exceptions.py,sha256=ItygKNrNXIVY0H6LsGVZvFuAHB3Vtm_VZXmWzCnpHy0,3216
7
7
  payi/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
8
- payi/_models.py,sha256=pXirq94yiihFXBbiR50vA-0NIlDurxbJ_rLXK062vWQ,28267
8
+ payi/_models.py,sha256=uhxvXZC0JO7HuGR_GWXH-zYKuptF2rwiGVJfMMfg3fw,28470
9
9
  payi/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
10
  payi/_resource.py,sha256=j2jIkTr8OIC8sU6-05nxSaCyj4MaFlbZrwlyg4_xJos,1088
11
11
  payi/_response.py,sha256=9ZpP3Agz-3ReY0RSJo7O7BAwD0UluwRsTSvljdTh1dg,28597
12
12
  payi/_streaming.py,sha256=Z_wIyo206T6Jqh2rolFg2VXZgX24PahLmpURp0-NssU,10092
13
- payi/_types.py,sha256=mb6zn5qmTK5j0QMh0fevdShT091HBL4w0YCUfQ3u5VY,6101
14
- payi/_version.py,sha256=hNxmK25K5CFd8y7EdjZnmmwT5sQZXdk3veswB1PvBOM,165
13
+ payi/_types.py,sha256=J0i_n21O_stX9WmxhCAuKnzv4oJgEPGykFNVqcXg0d0,6165
14
+ payi/_version.py,sha256=LjV6CHhZAn2UT95fYR0p4FqYZhbby0Y-U5hNhP2zKUU,165
15
15
  payi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- payi/_utils/__init__.py,sha256=Uzq1-FIih_VUjzdNVWXks0sdC39KBKLMrZoz-_JOjJ4,1988
16
+ payi/_utils/__init__.py,sha256=k266EatJr88V8Zseb7xUimTlCeno9SynRfLwadHP1b4,2016
17
17
  payi/_utils/_logs.py,sha256=fmnf5D9TOgkgZKfgYmSa3PiUc3SZgkchn6CzJUeo0SQ,768
18
18
  payi/_utils/_proxy.py,sha256=z3zsateHtb0EARTWKk8QZNHfPkqJbqwd1lM993LBwGE,1902
19
19
  payi/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
20
  payi/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
21
21
  payi/_utils/_sync.py,sha256=9ex9pfOyd8xAF1LxpFx4IkqL8k0vk8srE2Ee-OTMQ0A,2840
22
- payi/_utils/_transform.py,sha256=NCz3q9_O-vuj60xVe-qzhEQ8uJWlZWJTsM-GwHDccf8,12958
22
+ payi/_utils/_transform.py,sha256=Dkkyr7OveGmOolepcvXmVJWE3kqim4b0nM0h7yWbgeY,13468
23
23
  payi/_utils/_typing.py,sha256=tFbktdpdHCQliwzGsWysgn0P5H0JRdagkZdb_LegGkY,3838
24
- payi/_utils/_utils.py,sha256=tYrr7IX-5NMwsVKbNggbzOM84uNw7XnAe06e2Ln8Or0,11472
24
+ payi/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
25
25
  payi/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
26
26
  payi/lib/helpers.py,sha256=JpI9vy--oJP5kUlcWK0yfyRUbIRMXkvLeUQC4g8rLNY,1472
27
27
  payi/resources/__init__.py,sha256=cnFr2LhHLYehosTS7idW9lW_CrDwFClh-Wpgp9uHxh0,3553
28
- payi/resources/billing_models.py,sha256=QOCR1PVOxpZlvwO_L_EJS_nQFJOfXHPdnli1P9BpHPU,19488
28
+ payi/resources/billing_models.py,sha256=mqKlq8R1RCsriT4QPsgCukBwYi0ETuB7M4_dsUjRdNg,20056
29
29
  payi/resources/csat.py,sha256=56Sn2JM3xbc33J7xiC0Q0aLd5KuZK0ty_jxN-ZNPz7M,6526
30
- payi/resources/ingest.py,sha256=mETi2sihDKDptJzdLo7AwAxVOREDRA-jAs7Mc6dC7pk,16105
30
+ payi/resources/ingest.py,sha256=37iLoReikYwGlBtSlNMjH9O4YvPGKuybfotQ_214Qlo,16903
31
31
  payi/resources/price_modifiers.py,sha256=m9IX__C7_oPcZzGNpHJ2BsjMkGQ29JZrxLM1nFa8dL4,13483
32
32
  payi/resources/budgets/__init__.py,sha256=w1UhOdDXtUH4A91ME5Tw2nr9bRvPJyJY1YWiVVy7jj0,989
33
33
  payi/resources/budgets/budgets.py,sha256=GCTSojdFjDdWuJM2lO_-QKktFhncaA84xPx5C-RI7ks,27456
@@ -37,12 +37,12 @@ payi/resources/categories/categories.py,sha256=dGsAX313gZlLy5pSRo5_TexD1rPeWU666
37
37
  payi/resources/categories/resources.py,sha256=I38bjAvpsLg4LRwJEvnKX3yyr_ErTxkkv12y19sYd7E,18712
38
38
  payi/resources/experiences/__init__.py,sha256=gguTTCoGlAWDyrDJh1CtZwIVsyBbzERX63vRtFtjxjI,1054
39
39
  payi/resources/experiences/experiences.py,sha256=fdWaZox-WRCGwo8CJLsQFYVE8bf-yn7lFDO_dtwpyFQ,13264
40
- payi/resources/experiences/types.py,sha256=QuNX3B7mtUNuxREn9tOGNRRI0dEfiDX2fvLp6mIL7dQ,18679
40
+ payi/resources/experiences/types.py,sha256=hz5dtgmVD2eEOUU7Y29yA_UGefl77-oT4sAHFVkp-qk,19380
41
41
  payi/types/__init__.py,sha256=U-QUsH_PYmS3gRyxADTjcj_yWAIchziTeOqT-b2Oe-A,2603
42
- payi/types/billing_model.py,sha256=KXx2FlyeRJ9CLdtCufxehSrCT-h0X4msvM2hAKsCvxg,561
43
- payi/types/billing_model_create_params.py,sha256=3AjATUFt_ZEBJqAwHKnpo3i0OqQLMCVpZlXOcCunAsk,476
42
+ payi/types/billing_model.py,sha256=yng5-Eypx4aQ07D7V8fTUG1zYXSRiBDYTTbzu9cvzi0,613
43
+ payi/types/billing_model_create_params.py,sha256=yVMwIEbWfijeGOJ9Ry8unogLWHTdcsPHrQTNwhxbPcA,521
44
44
  payi/types/billing_model_list_response.py,sha256=hOFjJPQAKiWEArZeZwd8e1lDi5e41zbN6NvV_1rzJeM,290
45
- payi/types/billing_model_update_params.py,sha256=x-r3EyBFovv4TgDqavsc9Jcz4XiGBZG3x9F-lVX5DMo,476
45
+ payi/types/billing_model_update_params.py,sha256=aIhgtZNiDaMaMxHJmLzt-uc5BIJZo9yvnfNbke00xEU,521
46
46
  payi/types/budget_create_params.py,sha256=MDXUCZFK9SZHUTkB9OrQ8SeF1Xu7gmivuYSbcN9X-3w,632
47
47
  payi/types/budget_history_response.py,sha256=4SnisCLr1HImVecgonZK7HIm9WTmYl0YMaTbMP70qZY,934
48
48
  payi/types/budget_list_params.py,sha256=KaJ0H4tfp6mpCyanpysVJBTAMa5aA2Kv73uO_EsBsKE,367
@@ -56,15 +56,15 @@ payi/types/category_list_response.py,sha256=5i7BhQ7kVlx8_r2MLJqAJwIELGitKE0uR63k
56
56
  payi/types/category_resource_response.py,sha256=4PfQZbOIMOlE701uXGU-qegZOH8DN1VYcSClhfe_GOA,601
57
57
  payi/types/category_response.py,sha256=43i8bii20Sb-z9R5M1Ia6RGfRZmdQqsWPlv4Bl1XQf0,293
58
58
  payi/types/cost_data.py,sha256=PDmleZu-HKKOIh_EZ5EgWvpGiTUSJQadsxedWhFVgEI,283
59
- payi/types/cost_details.py,sha256=3ldvnYILAG6Sz9wGWMs1SZvIfdGEbn5i4-CauWEXMPA,265
59
+ payi/types/cost_details.py,sha256=w9p79opEG3kcsjkRRP7niaMcUswdfB4Y7HCkVTcQ1zQ,307
60
60
  payi/types/csat.py,sha256=q-RdlcEJQpyWCdEJw7s-ntAeaY1SgLyMflehZ01CDFU,185
61
61
  payi/types/csat_create_params.py,sha256=YK2M8yuqkZ7p-Z5S_6nSOeALX0Ox6QI8xiA2AzZ9vJI,342
62
62
  payi/types/default_response.py,sha256=o617LpRsCIZHCZxAc5nVI2JQ3HPGZo4gCDvSDkxkIJ8,270
63
63
  payi/types/experience_instance.py,sha256=l-y2oD91l5t9mDYkgz8UR_Sx6JcjLVBRYjxflaJhzCY,237
64
64
  payi/types/ingest_bulk_params.py,sha256=aIsugHkiAe_DnGQ8JVpDUDYr1YNzR5cUY9mMPqusIP0,381
65
- payi/types/ingest_event_param.py,sha256=UzGSJUQCl6B2_UaSg-F-bc5nxbpnD8Wc1Idl38R8Mvo,866
65
+ payi/types/ingest_event_param.py,sha256=2aes3mqwMQssi71LcWGsr-on6IKaLPsFu-rjaQGP7E4,1020
66
66
  payi/types/ingest_response.py,sha256=Ug83Sfl-3tELRh5rWFclOZYgsZBkvCjUXJXrp1J5Uac,1197
67
- payi/types/ingest_units_params.py,sha256=vOos7NhlcAy7s11wTgOR4B5gDy5Kau2-gzRoaivP0Ho,1143
67
+ payi/types/ingest_units_params.py,sha256=YTd47S6qbcbpZVYCJa0w6SieSDZdQtDf_29OA7mrHJM,1265
68
68
  payi/types/paged_budget_list.py,sha256=WGX0c6QGyTwjhsgkABsvXXRaBFPLVg6gPbph_qtVmJg,1371
69
69
  payi/types/price_modifier.py,sha256=Sw_5tzCGnpjQzR5aZ70_ATpfBRQA_0ue2NRM3yMcvj0,531
70
70
  payi/types/price_modifier_create_params.py,sha256=RpcYr2JYFu-pxzY4Dx1ESMp9-FBHfKt03Iw-3tlZvXQ,404
@@ -85,17 +85,13 @@ payi/types/budgets/tag_update_response.py,sha256=0L-0k2pGw9GndpwArjKhHwOOJgOTOTY
85
85
  payi/types/categories/__init__.py,sha256=HQScxfK3F_J9HYbphrhG6bYb7S6vtrwafLViar5pHcM,285
86
86
  payi/types/categories/resource_create_params.py,sha256=jEXNx_FvWA9D5170Gwf_YUcuAOaDq0RIGaGgPSEsheA,725
87
87
  payi/types/categories/resource_list_response.py,sha256=ODMelDlXvYcwxBsJwTX8miofywUY_JB0OvsFVCKJunU,320
88
- payi/types/evaluations/__init__.py,sha256=crWSnR2SwRTTp1nadR_i_dfpGCv4dTPuBh_sMoss0tQ,288
89
- payi/types/evaluations/experience_create_params.py,sha256=3leYJN4FHKJbTeym_uPlvX0vSqD8G8Lr8iPV8BwM5gw,353
90
- payi/types/evaluations/request_create_params.py,sha256=OPV7ff1fGgi6FbUzndN4j5omqFcCUaRzblHLxDsoQaI,347
91
88
  payi/types/experiences/__init__.py,sha256=8gAwTPOFwf87LFLyCwmDek2cIb2DHJYyI4Ymqoz6X1o,455
92
- payi/types/experiences/experience_type.py,sha256=UoFekiOnkBZ5kqIHcBa8YE9T7uxwp-gLp3QGgxAxOoc,243
93
- payi/types/experiences/type_create_params.py,sha256=8dNpffodzeD5vm3s6UJrZVOG7YsiTkXo7viDnoEoCZY,311
89
+ payi/types/experiences/experience_type.py,sha256=1L08GHoLAfdBwE691RidkHIukpyqqO2_toL5CcWxE4k,315
90
+ payi/types/experiences/type_create_params.py,sha256=56vS9kTHex1eU9QQ-DWjBMqoHNhOukPZUY4jgGhnJnQ,376
94
91
  payi/types/experiences/type_list_params.py,sha256=VDZjHmK2tNAW_YLewcIzM-OG13iI2v-xCykokxkcgbs,286
95
92
  payi/types/experiences/type_list_response.py,sha256=DgkPLw40oUqBETLePVMVenstMsGG12rZRU9w6kgQN28,280
96
- payi/types/experiences/type_update_params.py,sha256=SOHb1GQiHktLB6YtEzdPllDDowS3FCfQqVWSmf0pD8Q,286
97
- payi/types/shared/__init__.py,sha256=3y7YS-bs2g4eULmnsGcuBLsTZX1fg_05Ab5PdL1vEns,87
98
- payi-0.1.0a27.dist-info/METADATA,sha256=EREhH6xd4VVwlug7IPVFcF8ba4gwSPWdqGNAd0jat4I,12447
99
- payi-0.1.0a27.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
100
- payi-0.1.0a27.dist-info/licenses/LICENSE,sha256=8vX1pjh3esb6D5DvXAf6NxiBcVyon8aHWNJCxmmHXeY,11334
101
- payi-0.1.0a27.dist-info/RECORD,,
93
+ payi/types/experiences/type_update_params.py,sha256=izwlElQB-jeFFX3K6S2TqVUMmhU0KTmwScQ5aoHZH0M,361
94
+ payi-0.1.0a29.dist-info/METADATA,sha256=ml0Mzau3CmtZ7W5ZgmL5NX2IfxbTnLKSrM3EzTPfXX4,12358
95
+ payi-0.1.0a29.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
96
+ payi-0.1.0a29.dist-info/licenses/LICENSE,sha256=8vX1pjh3esb6D5DvXAf6NxiBcVyon8aHWNJCxmmHXeY,11334
97
+ payi-0.1.0a29.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.25.0
2
+ Generator: hatchling 1.26.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,6 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from .request_create_params import RequestCreateParams as RequestCreateParams
6
- from .experience_create_params import ExperienceCreateParams as ExperienceCreateParams
@@ -1,14 +0,0 @@
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 Optional
6
- from typing_extensions import Required, TypedDict
7
-
8
- __all__ = ["ExperienceCreateParams"]
9
-
10
-
11
- class ExperienceCreateParams(TypedDict, total=False):
12
- evaluation: Required[int]
13
-
14
- user_id: Optional[str]
@@ -1,14 +0,0 @@
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 Optional
6
- from typing_extensions import Required, TypedDict
7
-
8
- __all__ = ["RequestCreateParams"]
9
-
10
-
11
- class RequestCreateParams(TypedDict, total=False):
12
- evaluation: Required[int]
13
-
14
- user_id: Optional[str]
@@ -1,2 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-