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
|
@@ -4,6 +4,14 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
|
+
from .csat import (
|
|
8
|
+
CsatResource,
|
|
9
|
+
AsyncCsatResource,
|
|
10
|
+
CsatResourceWithRawResponse,
|
|
11
|
+
AsyncCsatResourceWithRawResponse,
|
|
12
|
+
CsatResourceWithStreamingResponse,
|
|
13
|
+
AsyncCsatResourceWithStreamingResponse,
|
|
14
|
+
)
|
|
7
15
|
from .types import (
|
|
8
16
|
TypesResource,
|
|
9
17
|
AsyncTypesResource,
|
|
@@ -14,6 +22,14 @@ from .types import (
|
|
|
14
22
|
)
|
|
15
23
|
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
16
24
|
from ..._compat import cached_property
|
|
25
|
+
from .properties import (
|
|
26
|
+
PropertiesResource,
|
|
27
|
+
AsyncPropertiesResource,
|
|
28
|
+
PropertiesResourceWithRawResponse,
|
|
29
|
+
AsyncPropertiesResourceWithRawResponse,
|
|
30
|
+
PropertiesResourceWithStreamingResponse,
|
|
31
|
+
AsyncPropertiesResourceWithStreamingResponse,
|
|
32
|
+
)
|
|
17
33
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
18
34
|
from ..._response import (
|
|
19
35
|
to_raw_response_wrapper,
|
|
@@ -22,7 +38,7 @@ from ..._response import (
|
|
|
22
38
|
async_to_streamed_response_wrapper,
|
|
23
39
|
)
|
|
24
40
|
from ..._base_client import make_request_options
|
|
25
|
-
from ...types.
|
|
41
|
+
from ...types.experience_instance_response import ExperienceInstanceResponse
|
|
26
42
|
|
|
27
43
|
__all__ = ["ExperiencesResource", "AsyncExperiencesResource"]
|
|
28
44
|
|
|
@@ -32,6 +48,14 @@ class ExperiencesResource(SyncAPIResource):
|
|
|
32
48
|
def types(self) -> TypesResource:
|
|
33
49
|
return TypesResource(self._client)
|
|
34
50
|
|
|
51
|
+
@cached_property
|
|
52
|
+
def csat(self) -> CsatResource:
|
|
53
|
+
return CsatResource(self._client)
|
|
54
|
+
|
|
55
|
+
@cached_property
|
|
56
|
+
def properties(self) -> PropertiesResource:
|
|
57
|
+
return PropertiesResource(self._client)
|
|
58
|
+
|
|
35
59
|
@cached_property
|
|
36
60
|
def with_raw_response(self) -> ExperiencesResourceWithRawResponse:
|
|
37
61
|
"""
|
|
@@ -61,7 +85,7 @@ class ExperiencesResource(SyncAPIResource):
|
|
|
61
85
|
extra_query: Query | None = None,
|
|
62
86
|
extra_body: Body | None = None,
|
|
63
87
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
64
|
-
) ->
|
|
88
|
+
) -> ExperienceInstanceResponse:
|
|
65
89
|
"""
|
|
66
90
|
Create an Experience
|
|
67
91
|
|
|
@@ -81,7 +105,7 @@ class ExperiencesResource(SyncAPIResource):
|
|
|
81
105
|
options=make_request_options(
|
|
82
106
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
83
107
|
),
|
|
84
|
-
cast_to=
|
|
108
|
+
cast_to=ExperienceInstanceResponse,
|
|
85
109
|
)
|
|
86
110
|
|
|
87
111
|
def retrieve(
|
|
@@ -94,7 +118,7 @@ class ExperiencesResource(SyncAPIResource):
|
|
|
94
118
|
extra_query: Query | None = None,
|
|
95
119
|
extra_body: Body | None = None,
|
|
96
120
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
97
|
-
) ->
|
|
121
|
+
) -> ExperienceInstanceResponse:
|
|
98
122
|
"""
|
|
99
123
|
Get an Experience details
|
|
100
124
|
|
|
@@ -114,7 +138,7 @@ class ExperiencesResource(SyncAPIResource):
|
|
|
114
138
|
options=make_request_options(
|
|
115
139
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
116
140
|
),
|
|
117
|
-
cast_to=
|
|
141
|
+
cast_to=ExperienceInstanceResponse,
|
|
118
142
|
)
|
|
119
143
|
|
|
120
144
|
def delete(
|
|
@@ -127,7 +151,7 @@ class ExperiencesResource(SyncAPIResource):
|
|
|
127
151
|
extra_query: Query | None = None,
|
|
128
152
|
extra_body: Body | None = None,
|
|
129
153
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
130
|
-
) ->
|
|
154
|
+
) -> ExperienceInstanceResponse:
|
|
131
155
|
"""
|
|
132
156
|
Delete an Experience
|
|
133
157
|
|
|
@@ -147,7 +171,7 @@ class ExperiencesResource(SyncAPIResource):
|
|
|
147
171
|
options=make_request_options(
|
|
148
172
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
149
173
|
),
|
|
150
|
-
cast_to=
|
|
174
|
+
cast_to=ExperienceInstanceResponse,
|
|
151
175
|
)
|
|
152
176
|
|
|
153
177
|
|
|
@@ -156,6 +180,14 @@ class AsyncExperiencesResource(AsyncAPIResource):
|
|
|
156
180
|
def types(self) -> AsyncTypesResource:
|
|
157
181
|
return AsyncTypesResource(self._client)
|
|
158
182
|
|
|
183
|
+
@cached_property
|
|
184
|
+
def csat(self) -> AsyncCsatResource:
|
|
185
|
+
return AsyncCsatResource(self._client)
|
|
186
|
+
|
|
187
|
+
@cached_property
|
|
188
|
+
def properties(self) -> AsyncPropertiesResource:
|
|
189
|
+
return AsyncPropertiesResource(self._client)
|
|
190
|
+
|
|
159
191
|
@cached_property
|
|
160
192
|
def with_raw_response(self) -> AsyncExperiencesResourceWithRawResponse:
|
|
161
193
|
"""
|
|
@@ -185,7 +217,7 @@ class AsyncExperiencesResource(AsyncAPIResource):
|
|
|
185
217
|
extra_query: Query | None = None,
|
|
186
218
|
extra_body: Body | None = None,
|
|
187
219
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
188
|
-
) ->
|
|
220
|
+
) -> ExperienceInstanceResponse:
|
|
189
221
|
"""
|
|
190
222
|
Create an Experience
|
|
191
223
|
|
|
@@ -205,7 +237,7 @@ class AsyncExperiencesResource(AsyncAPIResource):
|
|
|
205
237
|
options=make_request_options(
|
|
206
238
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
207
239
|
),
|
|
208
|
-
cast_to=
|
|
240
|
+
cast_to=ExperienceInstanceResponse,
|
|
209
241
|
)
|
|
210
242
|
|
|
211
243
|
async def retrieve(
|
|
@@ -218,7 +250,7 @@ class AsyncExperiencesResource(AsyncAPIResource):
|
|
|
218
250
|
extra_query: Query | None = None,
|
|
219
251
|
extra_body: Body | None = None,
|
|
220
252
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
221
|
-
) ->
|
|
253
|
+
) -> ExperienceInstanceResponse:
|
|
222
254
|
"""
|
|
223
255
|
Get an Experience details
|
|
224
256
|
|
|
@@ -238,7 +270,7 @@ class AsyncExperiencesResource(AsyncAPIResource):
|
|
|
238
270
|
options=make_request_options(
|
|
239
271
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
240
272
|
),
|
|
241
|
-
cast_to=
|
|
273
|
+
cast_to=ExperienceInstanceResponse,
|
|
242
274
|
)
|
|
243
275
|
|
|
244
276
|
async def delete(
|
|
@@ -251,7 +283,7 @@ class AsyncExperiencesResource(AsyncAPIResource):
|
|
|
251
283
|
extra_query: Query | None = None,
|
|
252
284
|
extra_body: Body | None = None,
|
|
253
285
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
254
|
-
) ->
|
|
286
|
+
) -> ExperienceInstanceResponse:
|
|
255
287
|
"""
|
|
256
288
|
Delete an Experience
|
|
257
289
|
|
|
@@ -271,7 +303,7 @@ class AsyncExperiencesResource(AsyncAPIResource):
|
|
|
271
303
|
options=make_request_options(
|
|
272
304
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
273
305
|
),
|
|
274
|
-
cast_to=
|
|
306
|
+
cast_to=ExperienceInstanceResponse,
|
|
275
307
|
)
|
|
276
308
|
|
|
277
309
|
|
|
@@ -293,6 +325,14 @@ class ExperiencesResourceWithRawResponse:
|
|
|
293
325
|
def types(self) -> TypesResourceWithRawResponse:
|
|
294
326
|
return TypesResourceWithRawResponse(self._experiences.types)
|
|
295
327
|
|
|
328
|
+
@cached_property
|
|
329
|
+
def csat(self) -> CsatResourceWithRawResponse:
|
|
330
|
+
return CsatResourceWithRawResponse(self._experiences.csat)
|
|
331
|
+
|
|
332
|
+
@cached_property
|
|
333
|
+
def properties(self) -> PropertiesResourceWithRawResponse:
|
|
334
|
+
return PropertiesResourceWithRawResponse(self._experiences.properties)
|
|
335
|
+
|
|
296
336
|
|
|
297
337
|
class AsyncExperiencesResourceWithRawResponse:
|
|
298
338
|
def __init__(self, experiences: AsyncExperiencesResource) -> None:
|
|
@@ -312,6 +352,14 @@ class AsyncExperiencesResourceWithRawResponse:
|
|
|
312
352
|
def types(self) -> AsyncTypesResourceWithRawResponse:
|
|
313
353
|
return AsyncTypesResourceWithRawResponse(self._experiences.types)
|
|
314
354
|
|
|
355
|
+
@cached_property
|
|
356
|
+
def csat(self) -> AsyncCsatResourceWithRawResponse:
|
|
357
|
+
return AsyncCsatResourceWithRawResponse(self._experiences.csat)
|
|
358
|
+
|
|
359
|
+
@cached_property
|
|
360
|
+
def properties(self) -> AsyncPropertiesResourceWithRawResponse:
|
|
361
|
+
return AsyncPropertiesResourceWithRawResponse(self._experiences.properties)
|
|
362
|
+
|
|
315
363
|
|
|
316
364
|
class ExperiencesResourceWithStreamingResponse:
|
|
317
365
|
def __init__(self, experiences: ExperiencesResource) -> None:
|
|
@@ -331,6 +379,14 @@ class ExperiencesResourceWithStreamingResponse:
|
|
|
331
379
|
def types(self) -> TypesResourceWithStreamingResponse:
|
|
332
380
|
return TypesResourceWithStreamingResponse(self._experiences.types)
|
|
333
381
|
|
|
382
|
+
@cached_property
|
|
383
|
+
def csat(self) -> CsatResourceWithStreamingResponse:
|
|
384
|
+
return CsatResourceWithStreamingResponse(self._experiences.csat)
|
|
385
|
+
|
|
386
|
+
@cached_property
|
|
387
|
+
def properties(self) -> PropertiesResourceWithStreamingResponse:
|
|
388
|
+
return PropertiesResourceWithStreamingResponse(self._experiences.properties)
|
|
389
|
+
|
|
334
390
|
|
|
335
391
|
class AsyncExperiencesResourceWithStreamingResponse:
|
|
336
392
|
def __init__(self, experiences: AsyncExperiencesResource) -> None:
|
|
@@ -349,3 +405,11 @@ class AsyncExperiencesResourceWithStreamingResponse:
|
|
|
349
405
|
@cached_property
|
|
350
406
|
def types(self) -> AsyncTypesResourceWithStreamingResponse:
|
|
351
407
|
return AsyncTypesResourceWithStreamingResponse(self._experiences.types)
|
|
408
|
+
|
|
409
|
+
@cached_property
|
|
410
|
+
def csat(self) -> AsyncCsatResourceWithStreamingResponse:
|
|
411
|
+
return AsyncCsatResourceWithStreamingResponse(self._experiences.csat)
|
|
412
|
+
|
|
413
|
+
@cached_property
|
|
414
|
+
def properties(self) -> AsyncPropertiesResourceWithStreamingResponse:
|
|
415
|
+
return AsyncPropertiesResourceWithStreamingResponse(self._experiences.properties)
|
|
@@ -0,0 +1,174 @@
|
|
|
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 NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
10
|
+
from ..._utils import (
|
|
11
|
+
maybe_transform,
|
|
12
|
+
async_maybe_transform,
|
|
13
|
+
)
|
|
14
|
+
from ..._compat import cached_property
|
|
15
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
16
|
+
from ..._response import (
|
|
17
|
+
to_raw_response_wrapper,
|
|
18
|
+
to_streamed_response_wrapper,
|
|
19
|
+
async_to_raw_response_wrapper,
|
|
20
|
+
async_to_streamed_response_wrapper,
|
|
21
|
+
)
|
|
22
|
+
from ..._base_client import make_request_options
|
|
23
|
+
from ...types.experiences import property_create_params
|
|
24
|
+
from ...types.experience_instance_response import ExperienceInstanceResponse
|
|
25
|
+
|
|
26
|
+
__all__ = ["PropertiesResource", "AsyncPropertiesResource"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class PropertiesResource(SyncAPIResource):
|
|
30
|
+
@cached_property
|
|
31
|
+
def with_raw_response(self) -> PropertiesResourceWithRawResponse:
|
|
32
|
+
"""
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
34
|
+
the raw response object instead of the parsed content.
|
|
35
|
+
|
|
36
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
37
|
+
"""
|
|
38
|
+
return PropertiesResourceWithRawResponse(self)
|
|
39
|
+
|
|
40
|
+
@cached_property
|
|
41
|
+
def with_streaming_response(self) -> PropertiesResourceWithStreamingResponse:
|
|
42
|
+
"""
|
|
43
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
46
|
+
"""
|
|
47
|
+
return PropertiesResourceWithStreamingResponse(self)
|
|
48
|
+
|
|
49
|
+
def create(
|
|
50
|
+
self,
|
|
51
|
+
experience_id: str,
|
|
52
|
+
*,
|
|
53
|
+
properties: Optional[Dict[str, str]],
|
|
54
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
55
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
56
|
+
extra_headers: Headers | None = None,
|
|
57
|
+
extra_query: Query | None = None,
|
|
58
|
+
extra_body: Body | None = None,
|
|
59
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
60
|
+
) -> ExperienceInstanceResponse:
|
|
61
|
+
"""
|
|
62
|
+
Update an Experience properties
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
extra_headers: Send extra headers
|
|
66
|
+
|
|
67
|
+
extra_query: Add additional query parameters to the request
|
|
68
|
+
|
|
69
|
+
extra_body: Add additional JSON properties to the request
|
|
70
|
+
|
|
71
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
72
|
+
"""
|
|
73
|
+
if not experience_id:
|
|
74
|
+
raise ValueError(f"Expected a non-empty value for `experience_id` but received {experience_id!r}")
|
|
75
|
+
return self._post(
|
|
76
|
+
f"/api/v1/experiences/instances/{experience_id}/properties",
|
|
77
|
+
body=maybe_transform({"properties": properties}, property_create_params.PropertyCreateParams),
|
|
78
|
+
options=make_request_options(
|
|
79
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
80
|
+
),
|
|
81
|
+
cast_to=ExperienceInstanceResponse,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class AsyncPropertiesResource(AsyncAPIResource):
|
|
86
|
+
@cached_property
|
|
87
|
+
def with_raw_response(self) -> AsyncPropertiesResourceWithRawResponse:
|
|
88
|
+
"""
|
|
89
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
90
|
+
the raw response object instead of the parsed content.
|
|
91
|
+
|
|
92
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
93
|
+
"""
|
|
94
|
+
return AsyncPropertiesResourceWithRawResponse(self)
|
|
95
|
+
|
|
96
|
+
@cached_property
|
|
97
|
+
def with_streaming_response(self) -> AsyncPropertiesResourceWithStreamingResponse:
|
|
98
|
+
"""
|
|
99
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
100
|
+
|
|
101
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
102
|
+
"""
|
|
103
|
+
return AsyncPropertiesResourceWithStreamingResponse(self)
|
|
104
|
+
|
|
105
|
+
async def create(
|
|
106
|
+
self,
|
|
107
|
+
experience_id: str,
|
|
108
|
+
*,
|
|
109
|
+
properties: Optional[Dict[str, str]],
|
|
110
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
111
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
112
|
+
extra_headers: Headers | None = None,
|
|
113
|
+
extra_query: Query | None = None,
|
|
114
|
+
extra_body: Body | None = None,
|
|
115
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
116
|
+
) -> ExperienceInstanceResponse:
|
|
117
|
+
"""
|
|
118
|
+
Update an Experience properties
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
extra_headers: Send extra headers
|
|
122
|
+
|
|
123
|
+
extra_query: Add additional query parameters to the request
|
|
124
|
+
|
|
125
|
+
extra_body: Add additional JSON properties to the request
|
|
126
|
+
|
|
127
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
128
|
+
"""
|
|
129
|
+
if not experience_id:
|
|
130
|
+
raise ValueError(f"Expected a non-empty value for `experience_id` but received {experience_id!r}")
|
|
131
|
+
return await self._post(
|
|
132
|
+
f"/api/v1/experiences/instances/{experience_id}/properties",
|
|
133
|
+
body=await async_maybe_transform({"properties": properties}, property_create_params.PropertyCreateParams),
|
|
134
|
+
options=make_request_options(
|
|
135
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
136
|
+
),
|
|
137
|
+
cast_to=ExperienceInstanceResponse,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class PropertiesResourceWithRawResponse:
|
|
142
|
+
def __init__(self, properties: PropertiesResource) -> None:
|
|
143
|
+
self._properties = properties
|
|
144
|
+
|
|
145
|
+
self.create = to_raw_response_wrapper(
|
|
146
|
+
properties.create,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class AsyncPropertiesResourceWithRawResponse:
|
|
151
|
+
def __init__(self, properties: AsyncPropertiesResource) -> None:
|
|
152
|
+
self._properties = properties
|
|
153
|
+
|
|
154
|
+
self.create = async_to_raw_response_wrapper(
|
|
155
|
+
properties.create,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class PropertiesResourceWithStreamingResponse:
|
|
160
|
+
def __init__(self, properties: PropertiesResource) -> None:
|
|
161
|
+
self._properties = properties
|
|
162
|
+
|
|
163
|
+
self.create = to_streamed_response_wrapper(
|
|
164
|
+
properties.create,
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class AsyncPropertiesResourceWithStreamingResponse:
|
|
169
|
+
def __init__(self, properties: AsyncPropertiesResource) -> None:
|
|
170
|
+
self._properties = properties
|
|
171
|
+
|
|
172
|
+
self.create = async_to_streamed_response_wrapper(
|
|
173
|
+
properties.create,
|
|
174
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .requests import (
|
|
4
|
+
RequestsResource,
|
|
5
|
+
AsyncRequestsResource,
|
|
6
|
+
RequestsResourceWithRawResponse,
|
|
7
|
+
AsyncRequestsResourceWithRawResponse,
|
|
8
|
+
RequestsResourceWithStreamingResponse,
|
|
9
|
+
AsyncRequestsResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .properties import (
|
|
12
|
+
PropertiesResource,
|
|
13
|
+
AsyncPropertiesResource,
|
|
14
|
+
PropertiesResourceWithRawResponse,
|
|
15
|
+
AsyncPropertiesResourceWithRawResponse,
|
|
16
|
+
PropertiesResourceWithStreamingResponse,
|
|
17
|
+
AsyncPropertiesResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"PropertiesResource",
|
|
22
|
+
"AsyncPropertiesResource",
|
|
23
|
+
"PropertiesResourceWithRawResponse",
|
|
24
|
+
"AsyncPropertiesResourceWithRawResponse",
|
|
25
|
+
"PropertiesResourceWithStreamingResponse",
|
|
26
|
+
"AsyncPropertiesResourceWithStreamingResponse",
|
|
27
|
+
"RequestsResource",
|
|
28
|
+
"AsyncRequestsResource",
|
|
29
|
+
"RequestsResourceWithRawResponse",
|
|
30
|
+
"AsyncRequestsResourceWithRawResponse",
|
|
31
|
+
"RequestsResourceWithStreamingResponse",
|
|
32
|
+
"AsyncRequestsResourceWithStreamingResponse",
|
|
33
|
+
]
|
|
@@ -0,0 +1,174 @@
|
|
|
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 NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
10
|
+
from ..._utils import (
|
|
11
|
+
maybe_transform,
|
|
12
|
+
async_maybe_transform,
|
|
13
|
+
)
|
|
14
|
+
from ..._compat import cached_property
|
|
15
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
16
|
+
from ..._response import (
|
|
17
|
+
to_raw_response_wrapper,
|
|
18
|
+
to_streamed_response_wrapper,
|
|
19
|
+
async_to_raw_response_wrapper,
|
|
20
|
+
async_to_streamed_response_wrapper,
|
|
21
|
+
)
|
|
22
|
+
from ..._base_client import make_request_options
|
|
23
|
+
from ...types.requests import property_create_params
|
|
24
|
+
from ...types.experiences.properties_response import PropertiesResponse
|
|
25
|
+
|
|
26
|
+
__all__ = ["PropertiesResource", "AsyncPropertiesResource"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class PropertiesResource(SyncAPIResource):
|
|
30
|
+
@cached_property
|
|
31
|
+
def with_raw_response(self) -> PropertiesResourceWithRawResponse:
|
|
32
|
+
"""
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
34
|
+
the raw response object instead of the parsed content.
|
|
35
|
+
|
|
36
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
37
|
+
"""
|
|
38
|
+
return PropertiesResourceWithRawResponse(self)
|
|
39
|
+
|
|
40
|
+
@cached_property
|
|
41
|
+
def with_streaming_response(self) -> PropertiesResourceWithStreamingResponse:
|
|
42
|
+
"""
|
|
43
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
46
|
+
"""
|
|
47
|
+
return PropertiesResourceWithStreamingResponse(self)
|
|
48
|
+
|
|
49
|
+
def create(
|
|
50
|
+
self,
|
|
51
|
+
request_id: str,
|
|
52
|
+
*,
|
|
53
|
+
properties: Optional[Dict[str, str]],
|
|
54
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
55
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
56
|
+
extra_headers: Headers | None = None,
|
|
57
|
+
extra_query: Query | None = None,
|
|
58
|
+
extra_body: Body | None = None,
|
|
59
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
60
|
+
) -> PropertiesResponse:
|
|
61
|
+
"""
|
|
62
|
+
Create properties for a Request
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
extra_headers: Send extra headers
|
|
66
|
+
|
|
67
|
+
extra_query: Add additional query parameters to the request
|
|
68
|
+
|
|
69
|
+
extra_body: Add additional JSON properties to the request
|
|
70
|
+
|
|
71
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
72
|
+
"""
|
|
73
|
+
if not request_id:
|
|
74
|
+
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
75
|
+
return self._post(
|
|
76
|
+
f"/api/v1/requests/{request_id}/properties",
|
|
77
|
+
body=maybe_transform({"properties": properties}, property_create_params.PropertyCreateParams),
|
|
78
|
+
options=make_request_options(
|
|
79
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
80
|
+
),
|
|
81
|
+
cast_to=PropertiesResponse,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class AsyncPropertiesResource(AsyncAPIResource):
|
|
86
|
+
@cached_property
|
|
87
|
+
def with_raw_response(self) -> AsyncPropertiesResourceWithRawResponse:
|
|
88
|
+
"""
|
|
89
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
90
|
+
the raw response object instead of the parsed content.
|
|
91
|
+
|
|
92
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
93
|
+
"""
|
|
94
|
+
return AsyncPropertiesResourceWithRawResponse(self)
|
|
95
|
+
|
|
96
|
+
@cached_property
|
|
97
|
+
def with_streaming_response(self) -> AsyncPropertiesResourceWithStreamingResponse:
|
|
98
|
+
"""
|
|
99
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
100
|
+
|
|
101
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
102
|
+
"""
|
|
103
|
+
return AsyncPropertiesResourceWithStreamingResponse(self)
|
|
104
|
+
|
|
105
|
+
async def create(
|
|
106
|
+
self,
|
|
107
|
+
request_id: str,
|
|
108
|
+
*,
|
|
109
|
+
properties: Optional[Dict[str, str]],
|
|
110
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
111
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
112
|
+
extra_headers: Headers | None = None,
|
|
113
|
+
extra_query: Query | None = None,
|
|
114
|
+
extra_body: Body | None = None,
|
|
115
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
116
|
+
) -> PropertiesResponse:
|
|
117
|
+
"""
|
|
118
|
+
Create properties for a Request
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
extra_headers: Send extra headers
|
|
122
|
+
|
|
123
|
+
extra_query: Add additional query parameters to the request
|
|
124
|
+
|
|
125
|
+
extra_body: Add additional JSON properties to the request
|
|
126
|
+
|
|
127
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
128
|
+
"""
|
|
129
|
+
if not request_id:
|
|
130
|
+
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
131
|
+
return await self._post(
|
|
132
|
+
f"/api/v1/requests/{request_id}/properties",
|
|
133
|
+
body=await async_maybe_transform({"properties": properties}, property_create_params.PropertyCreateParams),
|
|
134
|
+
options=make_request_options(
|
|
135
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
136
|
+
),
|
|
137
|
+
cast_to=PropertiesResponse,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class PropertiesResourceWithRawResponse:
|
|
142
|
+
def __init__(self, properties: PropertiesResource) -> None:
|
|
143
|
+
self._properties = properties
|
|
144
|
+
|
|
145
|
+
self.create = to_raw_response_wrapper(
|
|
146
|
+
properties.create,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class AsyncPropertiesResourceWithRawResponse:
|
|
151
|
+
def __init__(self, properties: AsyncPropertiesResource) -> None:
|
|
152
|
+
self._properties = properties
|
|
153
|
+
|
|
154
|
+
self.create = async_to_raw_response_wrapper(
|
|
155
|
+
properties.create,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class PropertiesResourceWithStreamingResponse:
|
|
160
|
+
def __init__(self, properties: PropertiesResource) -> None:
|
|
161
|
+
self._properties = properties
|
|
162
|
+
|
|
163
|
+
self.create = to_streamed_response_wrapper(
|
|
164
|
+
properties.create,
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class AsyncPropertiesResourceWithStreamingResponse:
|
|
169
|
+
def __init__(self, properties: AsyncPropertiesResource) -> None:
|
|
170
|
+
self._properties = properties
|
|
171
|
+
|
|
172
|
+
self.create = async_to_streamed_response_wrapper(
|
|
173
|
+
properties.create,
|
|
174
|
+
)
|