payi 0.1.0a29__py3-none-any.whl → 0.1.0a31__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/_base_client.py +8 -4
- payi/_client.py +8 -8
- payi/_compat.py +3 -5
- payi/_utils/_sync.py +40 -50
- payi/_version.py +1 -1
- payi/resources/__init__.py +14 -14
- payi/resources/billing_models.py +4 -4
- payi/resources/experiences/__init__.py +28 -0
- payi/resources/{csat.py → experiences/csat.py} +16 -16
- payi/resources/experiences/experiences.py +77 -13
- payi/resources/experiences/properties.py +174 -0
- payi/resources/requests/__init__.py +33 -0
- payi/resources/requests/properties.py +174 -0
- payi/resources/requests/requests.py +102 -0
- payi/types/__init__.py +1 -3
- payi/types/billing_model.py +1 -1
- payi/types/billing_model_create_params.py +1 -1
- payi/types/billing_model_update_params.py +1 -1
- payi/types/{experience_instance.py → experience_instance_response.py} +5 -2
- payi/types/experiences/__init__.py +4 -0
- payi/types/{csat.py → experiences/csat_response.py} +3 -3
- payi/types/experiences/properties_response.py +11 -0
- payi/types/experiences/property_create_params.py +12 -0
- payi/types/requests/__init__.py +5 -0
- payi/types/requests/property_create_params.py +12 -0
- {payi-0.1.0a29.dist-info → payi-0.1.0a31.dist-info}/METADATA +5 -4
- {payi-0.1.0a29.dist-info → payi-0.1.0a31.dist-info}/RECORD +30 -22
- /payi/types/{csat_create_params.py → experiences/csat_create_params.py} +0 -0
- {payi-0.1.0a29.dist-info → payi-0.1.0a31.dist-info}/WHEEL +0 -0
- {payi-0.1.0a29.dist-info → payi-0.1.0a31.dist-info}/licenses/LICENSE +0 -0
payi/_base_client.py
CHANGED
|
@@ -792,6 +792,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
792
792
|
custom_query: Mapping[str, object] | None = None,
|
|
793
793
|
_strict_response_validation: bool,
|
|
794
794
|
) -> None:
|
|
795
|
+
kwargs: dict[str, Any] = {}
|
|
795
796
|
if limits is not None:
|
|
796
797
|
warnings.warn(
|
|
797
798
|
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
|
|
@@ -804,6 +805,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
804
805
|
limits = DEFAULT_CONNECTION_LIMITS
|
|
805
806
|
|
|
806
807
|
if transport is not None:
|
|
808
|
+
kwargs["transport"] = transport
|
|
807
809
|
warnings.warn(
|
|
808
810
|
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
|
|
809
811
|
category=DeprecationWarning,
|
|
@@ -813,6 +815,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
813
815
|
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
|
|
814
816
|
|
|
815
817
|
if proxies is not None:
|
|
818
|
+
kwargs["proxies"] = proxies
|
|
816
819
|
warnings.warn(
|
|
817
820
|
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
|
|
818
821
|
category=DeprecationWarning,
|
|
@@ -856,10 +859,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
856
859
|
base_url=base_url,
|
|
857
860
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
858
861
|
timeout=cast(Timeout, timeout),
|
|
859
|
-
proxies=proxies,
|
|
860
|
-
transport=transport,
|
|
861
862
|
limits=limits,
|
|
862
863
|
follow_redirects=True,
|
|
864
|
+
**kwargs, # type: ignore
|
|
863
865
|
)
|
|
864
866
|
|
|
865
867
|
def is_closed(self) -> bool:
|
|
@@ -1358,6 +1360,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1358
1360
|
custom_headers: Mapping[str, str] | None = None,
|
|
1359
1361
|
custom_query: Mapping[str, object] | None = None,
|
|
1360
1362
|
) -> None:
|
|
1363
|
+
kwargs: dict[str, Any] = {}
|
|
1361
1364
|
if limits is not None:
|
|
1362
1365
|
warnings.warn(
|
|
1363
1366
|
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
|
|
@@ -1370,6 +1373,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1370
1373
|
limits = DEFAULT_CONNECTION_LIMITS
|
|
1371
1374
|
|
|
1372
1375
|
if transport is not None:
|
|
1376
|
+
kwargs["transport"] = transport
|
|
1373
1377
|
warnings.warn(
|
|
1374
1378
|
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
|
|
1375
1379
|
category=DeprecationWarning,
|
|
@@ -1379,6 +1383,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1379
1383
|
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
|
|
1380
1384
|
|
|
1381
1385
|
if proxies is not None:
|
|
1386
|
+
kwargs["proxies"] = proxies
|
|
1382
1387
|
warnings.warn(
|
|
1383
1388
|
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
|
|
1384
1389
|
category=DeprecationWarning,
|
|
@@ -1422,10 +1427,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1422
1427
|
base_url=base_url,
|
|
1423
1428
|
# cast to a valid type because mypy doesn't understand our type narrowing
|
|
1424
1429
|
timeout=cast(Timeout, timeout),
|
|
1425
|
-
proxies=proxies,
|
|
1426
|
-
transport=transport,
|
|
1427
1430
|
limits=limits,
|
|
1428
1431
|
follow_redirects=True,
|
|
1432
|
+
**kwargs, # type: ignore
|
|
1429
1433
|
)
|
|
1430
1434
|
|
|
1431
1435
|
def is_closed(self) -> bool:
|
payi/_client.py
CHANGED
|
@@ -50,9 +50,9 @@ class Payi(SyncAPIClient):
|
|
|
50
50
|
ingest: resources.IngestResource
|
|
51
51
|
categories: resources.CategoriesResource
|
|
52
52
|
experiences: resources.ExperiencesResource
|
|
53
|
-
csat: resources.CsatResource
|
|
54
53
|
billing_models: resources.BillingModelsResource
|
|
55
54
|
price_modifiers: resources.PriceModifiersResource
|
|
55
|
+
requests: resources.RequestsResource
|
|
56
56
|
with_raw_response: PayiWithRawResponse
|
|
57
57
|
with_streaming_response: PayiWithStreamedResponse
|
|
58
58
|
|
|
@@ -114,9 +114,9 @@ class Payi(SyncAPIClient):
|
|
|
114
114
|
self.ingest = resources.IngestResource(self)
|
|
115
115
|
self.categories = resources.CategoriesResource(self)
|
|
116
116
|
self.experiences = resources.ExperiencesResource(self)
|
|
117
|
-
self.csat = resources.CsatResource(self)
|
|
118
117
|
self.billing_models = resources.BillingModelsResource(self)
|
|
119
118
|
self.price_modifiers = resources.PriceModifiersResource(self)
|
|
119
|
+
self.requests = resources.RequestsResource(self)
|
|
120
120
|
self.with_raw_response = PayiWithRawResponse(self)
|
|
121
121
|
self.with_streaming_response = PayiWithStreamedResponse(self)
|
|
122
122
|
|
|
@@ -230,9 +230,9 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
230
230
|
ingest: resources.AsyncIngestResource
|
|
231
231
|
categories: resources.AsyncCategoriesResource
|
|
232
232
|
experiences: resources.AsyncExperiencesResource
|
|
233
|
-
csat: resources.AsyncCsatResource
|
|
234
233
|
billing_models: resources.AsyncBillingModelsResource
|
|
235
234
|
price_modifiers: resources.AsyncPriceModifiersResource
|
|
235
|
+
requests: resources.AsyncRequestsResource
|
|
236
236
|
with_raw_response: AsyncPayiWithRawResponse
|
|
237
237
|
with_streaming_response: AsyncPayiWithStreamedResponse
|
|
238
238
|
|
|
@@ -294,9 +294,9 @@ class AsyncPayi(AsyncAPIClient):
|
|
|
294
294
|
self.ingest = resources.AsyncIngestResource(self)
|
|
295
295
|
self.categories = resources.AsyncCategoriesResource(self)
|
|
296
296
|
self.experiences = resources.AsyncExperiencesResource(self)
|
|
297
|
-
self.csat = resources.AsyncCsatResource(self)
|
|
298
297
|
self.billing_models = resources.AsyncBillingModelsResource(self)
|
|
299
298
|
self.price_modifiers = resources.AsyncPriceModifiersResource(self)
|
|
299
|
+
self.requests = resources.AsyncRequestsResource(self)
|
|
300
300
|
self.with_raw_response = AsyncPayiWithRawResponse(self)
|
|
301
301
|
self.with_streaming_response = AsyncPayiWithStreamedResponse(self)
|
|
302
302
|
|
|
@@ -411,9 +411,9 @@ class PayiWithRawResponse:
|
|
|
411
411
|
self.ingest = resources.IngestResourceWithRawResponse(client.ingest)
|
|
412
412
|
self.categories = resources.CategoriesResourceWithRawResponse(client.categories)
|
|
413
413
|
self.experiences = resources.ExperiencesResourceWithRawResponse(client.experiences)
|
|
414
|
-
self.csat = resources.CsatResourceWithRawResponse(client.csat)
|
|
415
414
|
self.billing_models = resources.BillingModelsResourceWithRawResponse(client.billing_models)
|
|
416
415
|
self.price_modifiers = resources.PriceModifiersResourceWithRawResponse(client.price_modifiers)
|
|
416
|
+
self.requests = resources.RequestsResourceWithRawResponse(client.requests)
|
|
417
417
|
|
|
418
418
|
|
|
419
419
|
class AsyncPayiWithRawResponse:
|
|
@@ -422,9 +422,9 @@ class AsyncPayiWithRawResponse:
|
|
|
422
422
|
self.ingest = resources.AsyncIngestResourceWithRawResponse(client.ingest)
|
|
423
423
|
self.categories = resources.AsyncCategoriesResourceWithRawResponse(client.categories)
|
|
424
424
|
self.experiences = resources.AsyncExperiencesResourceWithRawResponse(client.experiences)
|
|
425
|
-
self.csat = resources.AsyncCsatResourceWithRawResponse(client.csat)
|
|
426
425
|
self.billing_models = resources.AsyncBillingModelsResourceWithRawResponse(client.billing_models)
|
|
427
426
|
self.price_modifiers = resources.AsyncPriceModifiersResourceWithRawResponse(client.price_modifiers)
|
|
427
|
+
self.requests = resources.AsyncRequestsResourceWithRawResponse(client.requests)
|
|
428
428
|
|
|
429
429
|
|
|
430
430
|
class PayiWithStreamedResponse:
|
|
@@ -433,9 +433,9 @@ class PayiWithStreamedResponse:
|
|
|
433
433
|
self.ingest = resources.IngestResourceWithStreamingResponse(client.ingest)
|
|
434
434
|
self.categories = resources.CategoriesResourceWithStreamingResponse(client.categories)
|
|
435
435
|
self.experiences = resources.ExperiencesResourceWithStreamingResponse(client.experiences)
|
|
436
|
-
self.csat = resources.CsatResourceWithStreamingResponse(client.csat)
|
|
437
436
|
self.billing_models = resources.BillingModelsResourceWithStreamingResponse(client.billing_models)
|
|
438
437
|
self.price_modifiers = resources.PriceModifiersResourceWithStreamingResponse(client.price_modifiers)
|
|
438
|
+
self.requests = resources.RequestsResourceWithStreamingResponse(client.requests)
|
|
439
439
|
|
|
440
440
|
|
|
441
441
|
class AsyncPayiWithStreamedResponse:
|
|
@@ -444,9 +444,9 @@ class AsyncPayiWithStreamedResponse:
|
|
|
444
444
|
self.ingest = resources.AsyncIngestResourceWithStreamingResponse(client.ingest)
|
|
445
445
|
self.categories = resources.AsyncCategoriesResourceWithStreamingResponse(client.categories)
|
|
446
446
|
self.experiences = resources.AsyncExperiencesResourceWithStreamingResponse(client.experiences)
|
|
447
|
-
self.csat = resources.AsyncCsatResourceWithStreamingResponse(client.csat)
|
|
448
447
|
self.billing_models = resources.AsyncBillingModelsResourceWithStreamingResponse(client.billing_models)
|
|
449
448
|
self.price_modifiers = resources.AsyncPriceModifiersResourceWithStreamingResponse(client.price_modifiers)
|
|
449
|
+
self.requests = resources.AsyncRequestsResourceWithStreamingResponse(client.requests)
|
|
450
450
|
|
|
451
451
|
|
|
452
452
|
Client = Payi
|
payi/_compat.py
CHANGED
|
@@ -145,7 +145,8 @@ def model_dump(
|
|
|
145
145
|
exclude=exclude,
|
|
146
146
|
exclude_unset=exclude_unset,
|
|
147
147
|
exclude_defaults=exclude_defaults,
|
|
148
|
-
warnings
|
|
148
|
+
# warnings are not supported in Pydantic v1
|
|
149
|
+
warnings=warnings if PYDANTIC_V2 else True,
|
|
149
150
|
)
|
|
150
151
|
return cast(
|
|
151
152
|
"dict[str, Any]",
|
|
@@ -213,9 +214,6 @@ if TYPE_CHECKING:
|
|
|
213
214
|
# __set__ is not defined at runtime, but @cached_property is designed to be settable
|
|
214
215
|
def __set__(self, instance: object, value: _T) -> None: ...
|
|
215
216
|
else:
|
|
216
|
-
|
|
217
|
-
from functools import cached_property as cached_property
|
|
218
|
-
except ImportError:
|
|
219
|
-
from cached_property import cached_property as cached_property
|
|
217
|
+
from functools import cached_property as cached_property
|
|
220
218
|
|
|
221
219
|
typed_cached_property = cached_property
|
payi/_utils/_sync.py
CHANGED
|
@@ -1,56 +1,62 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import sys
|
|
4
|
+
import asyncio
|
|
3
5
|
import functools
|
|
4
|
-
|
|
6
|
+
import contextvars
|
|
7
|
+
from typing import Any, TypeVar, Callable, Awaitable
|
|
5
8
|
from typing_extensions import ParamSpec
|
|
6
9
|
|
|
7
|
-
import anyio
|
|
8
|
-
import anyio.to_thread
|
|
9
|
-
|
|
10
|
-
from ._reflection import function_has_argument
|
|
11
|
-
|
|
12
10
|
T_Retval = TypeVar("T_Retval")
|
|
13
11
|
T_ParamSpec = ParamSpec("T_ParamSpec")
|
|
14
12
|
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
if sys.version_info >= (3, 9):
|
|
15
|
+
to_thread = asyncio.to_thread
|
|
16
|
+
else:
|
|
17
|
+
# backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
|
|
18
|
+
# for Python 3.8 support
|
|
19
|
+
async def to_thread(
|
|
20
|
+
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
|
|
21
|
+
) -> Any:
|
|
22
|
+
"""Asynchronously run function *func* in a separate thread.
|
|
23
|
+
|
|
24
|
+
Any *args and **kwargs supplied for this function are directly passed
|
|
25
|
+
to *func*. Also, the current :class:`contextvars.Context` is propagated,
|
|
26
|
+
allowing context variables from the main thread to be accessed in the
|
|
27
|
+
separate thread.
|
|
28
|
+
|
|
29
|
+
Returns a coroutine that can be awaited to get the eventual result of *func*.
|
|
30
|
+
"""
|
|
31
|
+
loop = asyncio.events.get_running_loop()
|
|
32
|
+
ctx = contextvars.copy_context()
|
|
33
|
+
func_call = functools.partial(ctx.run, func, *args, **kwargs)
|
|
34
|
+
return await loop.run_in_executor(None, func_call)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# inspired by `asyncer`, https://github.com/tiangolo/asyncer
|
|
38
|
+
def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
|
|
23
39
|
"""
|
|
24
40
|
Take a blocking function and create an async one that receives the same
|
|
25
|
-
positional and keyword arguments
|
|
26
|
-
in a
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
autocompletion and inline errors for the arguments of the function called and the
|
|
30
|
-
return value.
|
|
31
|
-
|
|
32
|
-
If the `cancellable` option is enabled and the task waiting for its completion is
|
|
33
|
-
cancelled, the thread will still run its course but its return value (or any raised
|
|
34
|
-
exception) will be ignored.
|
|
41
|
+
positional and keyword arguments. For python version 3.9 and above, it uses
|
|
42
|
+
asyncio.to_thread to run the function in a separate thread. For python version
|
|
43
|
+
3.8, it uses locally defined copy of the asyncio.to_thread function which was
|
|
44
|
+
introduced in python 3.9.
|
|
35
45
|
|
|
36
|
-
|
|
46
|
+
Usage:
|
|
37
47
|
|
|
38
|
-
```
|
|
39
|
-
def
|
|
40
|
-
#
|
|
41
|
-
return
|
|
48
|
+
```python
|
|
49
|
+
def blocking_func(arg1, arg2, kwarg1=None):
|
|
50
|
+
# blocking code
|
|
51
|
+
return result
|
|
42
52
|
|
|
43
53
|
|
|
44
|
-
result =
|
|
45
|
-
print(result)
|
|
54
|
+
result = asyncify(blocking_function)(arg1, arg2, kwarg1=value1)
|
|
46
55
|
```
|
|
47
56
|
|
|
48
57
|
## Arguments
|
|
49
58
|
|
|
50
59
|
`function`: a blocking regular callable (e.g. a function)
|
|
51
|
-
`cancellable`: `True` to allow cancellation of the operation
|
|
52
|
-
`limiter`: capacity limiter to use to limit the total amount of threads running
|
|
53
|
-
(if omitted, the default limiter is used)
|
|
54
60
|
|
|
55
61
|
## Return
|
|
56
62
|
|
|
@@ -60,22 +66,6 @@ def asyncify(
|
|
|
60
66
|
"""
|
|
61
67
|
|
|
62
68
|
async def wrapper(*args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs) -> T_Retval:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
# In `v4.1.0` anyio added the `abandon_on_cancel` argument and deprecated the old
|
|
66
|
-
# `cancellable` argument, so we need to use the new `abandon_on_cancel` to avoid
|
|
67
|
-
# surfacing deprecation warnings.
|
|
68
|
-
if function_has_argument(anyio.to_thread.run_sync, "abandon_on_cancel"):
|
|
69
|
-
return await anyio.to_thread.run_sync(
|
|
70
|
-
partial_f,
|
|
71
|
-
abandon_on_cancel=cancellable,
|
|
72
|
-
limiter=limiter,
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
return await anyio.to_thread.run_sync(
|
|
76
|
-
partial_f,
|
|
77
|
-
cancellable=cancellable,
|
|
78
|
-
limiter=limiter,
|
|
79
|
-
)
|
|
69
|
+
return await to_thread(function, *args, **kwargs)
|
|
80
70
|
|
|
81
71
|
return wrapper
|
payi/_version.py
CHANGED
payi/resources/__init__.py
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
from .csat import (
|
|
4
|
-
CsatResource,
|
|
5
|
-
AsyncCsatResource,
|
|
6
|
-
CsatResourceWithRawResponse,
|
|
7
|
-
AsyncCsatResourceWithRawResponse,
|
|
8
|
-
CsatResourceWithStreamingResponse,
|
|
9
|
-
AsyncCsatResourceWithStreamingResponse,
|
|
10
|
-
)
|
|
11
3
|
from .ingest import (
|
|
12
4
|
IngestResource,
|
|
13
5
|
AsyncIngestResource,
|
|
@@ -24,6 +16,14 @@ from .budgets import (
|
|
|
24
16
|
BudgetsResourceWithStreamingResponse,
|
|
25
17
|
AsyncBudgetsResourceWithStreamingResponse,
|
|
26
18
|
)
|
|
19
|
+
from .requests import (
|
|
20
|
+
RequestsResource,
|
|
21
|
+
AsyncRequestsResource,
|
|
22
|
+
RequestsResourceWithRawResponse,
|
|
23
|
+
AsyncRequestsResourceWithRawResponse,
|
|
24
|
+
RequestsResourceWithStreamingResponse,
|
|
25
|
+
AsyncRequestsResourceWithStreamingResponse,
|
|
26
|
+
)
|
|
27
27
|
from .categories import (
|
|
28
28
|
CategoriesResource,
|
|
29
29
|
AsyncCategoriesResource,
|
|
@@ -82,12 +82,6 @@ __all__ = [
|
|
|
82
82
|
"AsyncExperiencesResourceWithRawResponse",
|
|
83
83
|
"ExperiencesResourceWithStreamingResponse",
|
|
84
84
|
"AsyncExperiencesResourceWithStreamingResponse",
|
|
85
|
-
"CsatResource",
|
|
86
|
-
"AsyncCsatResource",
|
|
87
|
-
"CsatResourceWithRawResponse",
|
|
88
|
-
"AsyncCsatResourceWithRawResponse",
|
|
89
|
-
"CsatResourceWithStreamingResponse",
|
|
90
|
-
"AsyncCsatResourceWithStreamingResponse",
|
|
91
85
|
"BillingModelsResource",
|
|
92
86
|
"AsyncBillingModelsResource",
|
|
93
87
|
"BillingModelsResourceWithRawResponse",
|
|
@@ -100,4 +94,10 @@ __all__ = [
|
|
|
100
94
|
"AsyncPriceModifiersResourceWithRawResponse",
|
|
101
95
|
"PriceModifiersResourceWithStreamingResponse",
|
|
102
96
|
"AsyncPriceModifiersResourceWithStreamingResponse",
|
|
97
|
+
"RequestsResource",
|
|
98
|
+
"AsyncRequestsResource",
|
|
99
|
+
"RequestsResourceWithRawResponse",
|
|
100
|
+
"AsyncRequestsResourceWithRawResponse",
|
|
101
|
+
"RequestsResourceWithStreamingResponse",
|
|
102
|
+
"AsyncRequestsResourceWithStreamingResponse",
|
|
103
103
|
]
|
payi/resources/billing_models.py
CHANGED
|
@@ -52,7 +52,7 @@ class BillingModelsResource(SyncAPIResource):
|
|
|
52
52
|
self,
|
|
53
53
|
*,
|
|
54
54
|
name: str,
|
|
55
|
-
type: Literal["costplus"],
|
|
55
|
+
type: Literal["invalid", "costplus", "subscription", "hybrid"],
|
|
56
56
|
default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
|
|
57
57
|
prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
|
|
58
58
|
prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
|
|
@@ -128,7 +128,7 @@ class BillingModelsResource(SyncAPIResource):
|
|
|
128
128
|
self,
|
|
129
129
|
billing_model_id: str,
|
|
130
130
|
*,
|
|
131
|
-
type: Literal["costplus"],
|
|
131
|
+
type: Literal["invalid", "costplus", "subscription", "hybrid"],
|
|
132
132
|
default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
|
|
133
133
|
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
134
134
|
prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
|
|
@@ -246,7 +246,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
|
|
|
246
246
|
self,
|
|
247
247
|
*,
|
|
248
248
|
name: str,
|
|
249
|
-
type: Literal["costplus"],
|
|
249
|
+
type: Literal["invalid", "costplus", "subscription", "hybrid"],
|
|
250
250
|
default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
|
|
251
251
|
prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
|
|
252
252
|
prepaid_max: Optional[float] | NotGiven = NOT_GIVEN,
|
|
@@ -322,7 +322,7 @@ class AsyncBillingModelsResource(AsyncAPIResource):
|
|
|
322
322
|
self,
|
|
323
323
|
billing_model_id: str,
|
|
324
324
|
*,
|
|
325
|
-
type: Literal["costplus"],
|
|
325
|
+
type: Literal["invalid", "costplus", "subscription", "hybrid"],
|
|
326
326
|
default_price_modifier: Optional[float] | NotGiven = NOT_GIVEN,
|
|
327
327
|
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
328
328
|
prepaid_amount: Optional[float] | NotGiven = NOT_GIVEN,
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
from .csat import (
|
|
4
|
+
CsatResource,
|
|
5
|
+
AsyncCsatResource,
|
|
6
|
+
CsatResourceWithRawResponse,
|
|
7
|
+
AsyncCsatResourceWithRawResponse,
|
|
8
|
+
CsatResourceWithStreamingResponse,
|
|
9
|
+
AsyncCsatResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
3
11
|
from .types import (
|
|
4
12
|
TypesResource,
|
|
5
13
|
AsyncTypesResource,
|
|
@@ -8,6 +16,14 @@ from .types import (
|
|
|
8
16
|
TypesResourceWithStreamingResponse,
|
|
9
17
|
AsyncTypesResourceWithStreamingResponse,
|
|
10
18
|
)
|
|
19
|
+
from .properties import (
|
|
20
|
+
PropertiesResource,
|
|
21
|
+
AsyncPropertiesResource,
|
|
22
|
+
PropertiesResourceWithRawResponse,
|
|
23
|
+
AsyncPropertiesResourceWithRawResponse,
|
|
24
|
+
PropertiesResourceWithStreamingResponse,
|
|
25
|
+
AsyncPropertiesResourceWithStreamingResponse,
|
|
26
|
+
)
|
|
11
27
|
from .experiences import (
|
|
12
28
|
ExperiencesResource,
|
|
13
29
|
AsyncExperiencesResource,
|
|
@@ -24,6 +40,18 @@ __all__ = [
|
|
|
24
40
|
"AsyncTypesResourceWithRawResponse",
|
|
25
41
|
"TypesResourceWithStreamingResponse",
|
|
26
42
|
"AsyncTypesResourceWithStreamingResponse",
|
|
43
|
+
"CsatResource",
|
|
44
|
+
"AsyncCsatResource",
|
|
45
|
+
"CsatResourceWithRawResponse",
|
|
46
|
+
"AsyncCsatResourceWithRawResponse",
|
|
47
|
+
"CsatResourceWithStreamingResponse",
|
|
48
|
+
"AsyncCsatResourceWithStreamingResponse",
|
|
49
|
+
"PropertiesResource",
|
|
50
|
+
"AsyncPropertiesResource",
|
|
51
|
+
"PropertiesResourceWithRawResponse",
|
|
52
|
+
"AsyncPropertiesResourceWithRawResponse",
|
|
53
|
+
"PropertiesResourceWithStreamingResponse",
|
|
54
|
+
"AsyncPropertiesResourceWithStreamingResponse",
|
|
27
55
|
"ExperiencesResource",
|
|
28
56
|
"AsyncExperiencesResource",
|
|
29
57
|
"ExperiencesResourceWithRawResponse",
|
|
@@ -6,22 +6,22 @@ from typing import Optional
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from .._utils import (
|
|
9
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
10
|
+
from ..._utils import (
|
|
12
11
|
maybe_transform,
|
|
13
12
|
async_maybe_transform,
|
|
14
13
|
)
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
14
|
+
from ..._compat import cached_property
|
|
15
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
16
|
+
from ..._response import (
|
|
18
17
|
to_raw_response_wrapper,
|
|
19
18
|
to_streamed_response_wrapper,
|
|
20
19
|
async_to_raw_response_wrapper,
|
|
21
20
|
async_to_streamed_response_wrapper,
|
|
22
21
|
)
|
|
23
|
-
from
|
|
24
|
-
from
|
|
22
|
+
from ..._base_client import make_request_options
|
|
23
|
+
from ...types.experiences import csat_create_params
|
|
24
|
+
from ...types.experiences.csat_response import CsatResponse
|
|
25
25
|
|
|
26
26
|
__all__ = ["CsatResource", "AsyncCsatResource"]
|
|
27
27
|
|
|
@@ -58,9 +58,9 @@ class CsatResource(SyncAPIResource):
|
|
|
58
58
|
extra_query: Query | None = None,
|
|
59
59
|
extra_body: Body | None = None,
|
|
60
60
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
61
|
-
) ->
|
|
61
|
+
) -> CsatResponse:
|
|
62
62
|
"""
|
|
63
|
-
|
|
63
|
+
Update an Experience properties
|
|
64
64
|
|
|
65
65
|
Args:
|
|
66
66
|
extra_headers: Send extra headers
|
|
@@ -74,7 +74,7 @@ class CsatResource(SyncAPIResource):
|
|
|
74
74
|
if not experience_id:
|
|
75
75
|
raise ValueError(f"Expected a non-empty value for `experience_id` but received {experience_id!r}")
|
|
76
76
|
return self._post(
|
|
77
|
-
f"/api/v1/
|
|
77
|
+
f"/api/v1/experiences/instances/{experience_id}/csat",
|
|
78
78
|
body=maybe_transform(
|
|
79
79
|
{
|
|
80
80
|
"csat_rating": csat_rating,
|
|
@@ -85,7 +85,7 @@ class CsatResource(SyncAPIResource):
|
|
|
85
85
|
options=make_request_options(
|
|
86
86
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
87
87
|
),
|
|
88
|
-
cast_to=
|
|
88
|
+
cast_to=CsatResponse,
|
|
89
89
|
)
|
|
90
90
|
|
|
91
91
|
|
|
@@ -121,9 +121,9 @@ class AsyncCsatResource(AsyncAPIResource):
|
|
|
121
121
|
extra_query: Query | None = None,
|
|
122
122
|
extra_body: Body | None = None,
|
|
123
123
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
124
|
-
) ->
|
|
124
|
+
) -> CsatResponse:
|
|
125
125
|
"""
|
|
126
|
-
|
|
126
|
+
Update an Experience properties
|
|
127
127
|
|
|
128
128
|
Args:
|
|
129
129
|
extra_headers: Send extra headers
|
|
@@ -137,7 +137,7 @@ class AsyncCsatResource(AsyncAPIResource):
|
|
|
137
137
|
if not experience_id:
|
|
138
138
|
raise ValueError(f"Expected a non-empty value for `experience_id` but received {experience_id!r}")
|
|
139
139
|
return await self._post(
|
|
140
|
-
f"/api/v1/
|
|
140
|
+
f"/api/v1/experiences/instances/{experience_id}/csat",
|
|
141
141
|
body=await async_maybe_transform(
|
|
142
142
|
{
|
|
143
143
|
"csat_rating": csat_rating,
|
|
@@ -148,7 +148,7 @@ class AsyncCsatResource(AsyncAPIResource):
|
|
|
148
148
|
options=make_request_options(
|
|
149
149
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
150
150
|
),
|
|
151
|
-
cast_to=
|
|
151
|
+
cast_to=CsatResponse,
|
|
152
152
|
)
|
|
153
153
|
|
|
154
154
|
|