payi 0.1.0a15__py3-none-any.whl → 0.1.0a17__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 +29 -42
- payi/_client.py +8 -0
- payi/_compat.py +12 -17
- payi/_files.py +4 -8
- payi/_response.py +9 -8
- payi/_types.py +3 -6
- payi/_utils/_proxy.py +1 -2
- payi/_utils/_reflection.py +1 -1
- payi/_utils/_utils.py +6 -12
- payi/_version.py +1 -1
- payi/resources/__init__.py +14 -0
- payi/resources/experiences/__init__.py +33 -0
- payi/resources/experiences/experiences.py +345 -0
- payi/resources/experiences/types.py +471 -0
- payi/resources/ingest.py +33 -17
- payi/types/__init__.py +1 -1
- payi/types/budget_list_params.py +7 -9
- payi/types/budgets/tag_create_response.py +2 -1
- payi/types/budgets/tag_delete_response.py +2 -1
- payi/types/budgets/tag_list_response.py +2 -1
- payi/types/budgets/tag_remove_response.py +2 -1
- payi/types/budgets/tag_update_response.py +2 -1
- payi/types/categories/resource_list_response.py +2 -1
- payi/types/category_delete_resource_response.py +2 -1
- payi/types/category_delete_response.py +2 -1
- payi/types/category_list_resources_response.py +2 -1
- payi/types/category_list_response.py +2 -1
- payi/types/category_resource_response.py +2 -2
- payi/types/experience_instance.py +13 -0
- payi/types/experiences/__init__.py +8 -0
- payi/types/experiences/experience_type.py +17 -0
- payi/types/experiences/type_create_params.py +13 -0
- payi/types/experiences/type_list_response.py +10 -0
- payi/types/experiences/type_update_params.py +14 -0
- payi/types/ingest_bulk_params.py +25 -5
- payi/types/ingest_response.py +2 -0
- payi/types/ingest_units_params.py +4 -0
- {payi-0.1.0a15.dist-info → payi-0.1.0a17.dist-info}/METADATA +1 -1
- payi-0.1.0a17.dist-info/RECORD +82 -0
- payi/types/ingest_units_param.py +0 -23
- payi-0.1.0a15.dist-info/RECORD +0 -74
- {payi-0.1.0a15.dist-info → payi-0.1.0a17.dist-info}/WHEEL +0 -0
- {payi-0.1.0a15.dist-info → payi-0.1.0a17.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from .types import (
|
|
8
|
+
TypesResource,
|
|
9
|
+
AsyncTypesResource,
|
|
10
|
+
TypesResourceWithRawResponse,
|
|
11
|
+
AsyncTypesResourceWithRawResponse,
|
|
12
|
+
TypesResourceWithStreamingResponse,
|
|
13
|
+
AsyncTypesResourceWithStreamingResponse,
|
|
14
|
+
)
|
|
15
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
16
|
+
from ..._compat import cached_property
|
|
17
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
18
|
+
from ..._response import (
|
|
19
|
+
to_raw_response_wrapper,
|
|
20
|
+
to_streamed_response_wrapper,
|
|
21
|
+
async_to_raw_response_wrapper,
|
|
22
|
+
async_to_streamed_response_wrapper,
|
|
23
|
+
)
|
|
24
|
+
from ..._base_client import make_request_options
|
|
25
|
+
from ...types.experience_instance import ExperienceInstance
|
|
26
|
+
|
|
27
|
+
__all__ = ["ExperiencesResource", "AsyncExperiencesResource"]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ExperiencesResource(SyncAPIResource):
|
|
31
|
+
@cached_property
|
|
32
|
+
def types(self) -> TypesResource:
|
|
33
|
+
return TypesResource(self._client)
|
|
34
|
+
|
|
35
|
+
@cached_property
|
|
36
|
+
def with_raw_response(self) -> ExperiencesResourceWithRawResponse:
|
|
37
|
+
return ExperiencesResourceWithRawResponse(self)
|
|
38
|
+
|
|
39
|
+
@cached_property
|
|
40
|
+
def with_streaming_response(self) -> ExperiencesResourceWithStreamingResponse:
|
|
41
|
+
return ExperiencesResourceWithStreamingResponse(self)
|
|
42
|
+
|
|
43
|
+
def create(
|
|
44
|
+
self,
|
|
45
|
+
experience_type_id: str,
|
|
46
|
+
*,
|
|
47
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
48
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
49
|
+
extra_headers: Headers | None = None,
|
|
50
|
+
extra_query: Query | None = None,
|
|
51
|
+
extra_body: Body | None = None,
|
|
52
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
53
|
+
) -> ExperienceInstance:
|
|
54
|
+
"""Creates a new experience instance.
|
|
55
|
+
|
|
56
|
+
This ID can then be passed into router calls
|
|
57
|
+
for a specific user experience.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
extra_headers: Send extra headers
|
|
61
|
+
|
|
62
|
+
extra_query: Add additional query parameters to the request
|
|
63
|
+
|
|
64
|
+
extra_body: Add additional JSON properties to the request
|
|
65
|
+
|
|
66
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
67
|
+
"""
|
|
68
|
+
if not experience_type_id:
|
|
69
|
+
raise ValueError(f"Expected a non-empty value for `experience_type_id` but received {experience_type_id!r}")
|
|
70
|
+
return self._post(
|
|
71
|
+
f"/api/v1/experiences/instances/{experience_type_id}",
|
|
72
|
+
options=make_request_options(
|
|
73
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
74
|
+
),
|
|
75
|
+
cast_to=ExperienceInstance,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
def retrieve(
|
|
79
|
+
self,
|
|
80
|
+
experience_instance_id: str,
|
|
81
|
+
*,
|
|
82
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
83
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
84
|
+
extra_headers: Headers | None = None,
|
|
85
|
+
extra_query: Query | None = None,
|
|
86
|
+
extra_body: Body | None = None,
|
|
87
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
88
|
+
) -> ExperienceInstance:
|
|
89
|
+
"""
|
|
90
|
+
Get details for an experience instance.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
extra_headers: Send extra headers
|
|
94
|
+
|
|
95
|
+
extra_query: Add additional query parameters to the request
|
|
96
|
+
|
|
97
|
+
extra_body: Add additional JSON properties to the request
|
|
98
|
+
|
|
99
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
100
|
+
"""
|
|
101
|
+
if not experience_instance_id:
|
|
102
|
+
raise ValueError(
|
|
103
|
+
f"Expected a non-empty value for `experience_instance_id` but received {experience_instance_id!r}"
|
|
104
|
+
)
|
|
105
|
+
return self._get(
|
|
106
|
+
f"/api/v1/experiences/instances/{experience_instance_id}",
|
|
107
|
+
options=make_request_options(
|
|
108
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
109
|
+
),
|
|
110
|
+
cast_to=ExperienceInstance,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
def delete(
|
|
114
|
+
self,
|
|
115
|
+
experience_instance_id: str,
|
|
116
|
+
*,
|
|
117
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
118
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
119
|
+
extra_headers: Headers | None = None,
|
|
120
|
+
extra_query: Query | None = None,
|
|
121
|
+
extra_body: Body | None = None,
|
|
122
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
123
|
+
) -> ExperienceInstance:
|
|
124
|
+
"""Deletes an experience instance.
|
|
125
|
+
|
|
126
|
+
This will remove all costs associated with this
|
|
127
|
+
experience instance.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
extra_headers: Send extra headers
|
|
131
|
+
|
|
132
|
+
extra_query: Add additional query parameters to the request
|
|
133
|
+
|
|
134
|
+
extra_body: Add additional JSON properties to the request
|
|
135
|
+
|
|
136
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
137
|
+
"""
|
|
138
|
+
if not experience_instance_id:
|
|
139
|
+
raise ValueError(
|
|
140
|
+
f"Expected a non-empty value for `experience_instance_id` but received {experience_instance_id!r}"
|
|
141
|
+
)
|
|
142
|
+
return self._delete(
|
|
143
|
+
f"/api/v1/experiences/instances/{experience_instance_id}",
|
|
144
|
+
options=make_request_options(
|
|
145
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
146
|
+
),
|
|
147
|
+
cast_to=ExperienceInstance,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class AsyncExperiencesResource(AsyncAPIResource):
|
|
152
|
+
@cached_property
|
|
153
|
+
def types(self) -> AsyncTypesResource:
|
|
154
|
+
return AsyncTypesResource(self._client)
|
|
155
|
+
|
|
156
|
+
@cached_property
|
|
157
|
+
def with_raw_response(self) -> AsyncExperiencesResourceWithRawResponse:
|
|
158
|
+
return AsyncExperiencesResourceWithRawResponse(self)
|
|
159
|
+
|
|
160
|
+
@cached_property
|
|
161
|
+
def with_streaming_response(self) -> AsyncExperiencesResourceWithStreamingResponse:
|
|
162
|
+
return AsyncExperiencesResourceWithStreamingResponse(self)
|
|
163
|
+
|
|
164
|
+
async def create(
|
|
165
|
+
self,
|
|
166
|
+
experience_type_id: str,
|
|
167
|
+
*,
|
|
168
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
169
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
170
|
+
extra_headers: Headers | None = None,
|
|
171
|
+
extra_query: Query | None = None,
|
|
172
|
+
extra_body: Body | None = None,
|
|
173
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
174
|
+
) -> ExperienceInstance:
|
|
175
|
+
"""Creates a new experience instance.
|
|
176
|
+
|
|
177
|
+
This ID can then be passed into router calls
|
|
178
|
+
for a specific user experience.
|
|
179
|
+
|
|
180
|
+
Args:
|
|
181
|
+
extra_headers: Send extra headers
|
|
182
|
+
|
|
183
|
+
extra_query: Add additional query parameters to the request
|
|
184
|
+
|
|
185
|
+
extra_body: Add additional JSON properties to the request
|
|
186
|
+
|
|
187
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
188
|
+
"""
|
|
189
|
+
if not experience_type_id:
|
|
190
|
+
raise ValueError(f"Expected a non-empty value for `experience_type_id` but received {experience_type_id!r}")
|
|
191
|
+
return await self._post(
|
|
192
|
+
f"/api/v1/experiences/instances/{experience_type_id}",
|
|
193
|
+
options=make_request_options(
|
|
194
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
195
|
+
),
|
|
196
|
+
cast_to=ExperienceInstance,
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
async def retrieve(
|
|
200
|
+
self,
|
|
201
|
+
experience_instance_id: str,
|
|
202
|
+
*,
|
|
203
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
204
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
205
|
+
extra_headers: Headers | None = None,
|
|
206
|
+
extra_query: Query | None = None,
|
|
207
|
+
extra_body: Body | None = None,
|
|
208
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
209
|
+
) -> ExperienceInstance:
|
|
210
|
+
"""
|
|
211
|
+
Get details for an experience instance.
|
|
212
|
+
|
|
213
|
+
Args:
|
|
214
|
+
extra_headers: Send extra headers
|
|
215
|
+
|
|
216
|
+
extra_query: Add additional query parameters to the request
|
|
217
|
+
|
|
218
|
+
extra_body: Add additional JSON properties to the request
|
|
219
|
+
|
|
220
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
221
|
+
"""
|
|
222
|
+
if not experience_instance_id:
|
|
223
|
+
raise ValueError(
|
|
224
|
+
f"Expected a non-empty value for `experience_instance_id` but received {experience_instance_id!r}"
|
|
225
|
+
)
|
|
226
|
+
return await self._get(
|
|
227
|
+
f"/api/v1/experiences/instances/{experience_instance_id}",
|
|
228
|
+
options=make_request_options(
|
|
229
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
230
|
+
),
|
|
231
|
+
cast_to=ExperienceInstance,
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
async def delete(
|
|
235
|
+
self,
|
|
236
|
+
experience_instance_id: str,
|
|
237
|
+
*,
|
|
238
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
239
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
240
|
+
extra_headers: Headers | None = None,
|
|
241
|
+
extra_query: Query | None = None,
|
|
242
|
+
extra_body: Body | None = None,
|
|
243
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
244
|
+
) -> ExperienceInstance:
|
|
245
|
+
"""Deletes an experience instance.
|
|
246
|
+
|
|
247
|
+
This will remove all costs associated with this
|
|
248
|
+
experience instance.
|
|
249
|
+
|
|
250
|
+
Args:
|
|
251
|
+
extra_headers: Send extra headers
|
|
252
|
+
|
|
253
|
+
extra_query: Add additional query parameters to the request
|
|
254
|
+
|
|
255
|
+
extra_body: Add additional JSON properties to the request
|
|
256
|
+
|
|
257
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
258
|
+
"""
|
|
259
|
+
if not experience_instance_id:
|
|
260
|
+
raise ValueError(
|
|
261
|
+
f"Expected a non-empty value for `experience_instance_id` but received {experience_instance_id!r}"
|
|
262
|
+
)
|
|
263
|
+
return await self._delete(
|
|
264
|
+
f"/api/v1/experiences/instances/{experience_instance_id}",
|
|
265
|
+
options=make_request_options(
|
|
266
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
267
|
+
),
|
|
268
|
+
cast_to=ExperienceInstance,
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
class ExperiencesResourceWithRawResponse:
|
|
273
|
+
def __init__(self, experiences: ExperiencesResource) -> None:
|
|
274
|
+
self._experiences = experiences
|
|
275
|
+
|
|
276
|
+
self.create = to_raw_response_wrapper(
|
|
277
|
+
experiences.create,
|
|
278
|
+
)
|
|
279
|
+
self.retrieve = to_raw_response_wrapper(
|
|
280
|
+
experiences.retrieve,
|
|
281
|
+
)
|
|
282
|
+
self.delete = to_raw_response_wrapper(
|
|
283
|
+
experiences.delete,
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
@cached_property
|
|
287
|
+
def types(self) -> TypesResourceWithRawResponse:
|
|
288
|
+
return TypesResourceWithRawResponse(self._experiences.types)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
class AsyncExperiencesResourceWithRawResponse:
|
|
292
|
+
def __init__(self, experiences: AsyncExperiencesResource) -> None:
|
|
293
|
+
self._experiences = experiences
|
|
294
|
+
|
|
295
|
+
self.create = async_to_raw_response_wrapper(
|
|
296
|
+
experiences.create,
|
|
297
|
+
)
|
|
298
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
299
|
+
experiences.retrieve,
|
|
300
|
+
)
|
|
301
|
+
self.delete = async_to_raw_response_wrapper(
|
|
302
|
+
experiences.delete,
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
@cached_property
|
|
306
|
+
def types(self) -> AsyncTypesResourceWithRawResponse:
|
|
307
|
+
return AsyncTypesResourceWithRawResponse(self._experiences.types)
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
class ExperiencesResourceWithStreamingResponse:
|
|
311
|
+
def __init__(self, experiences: ExperiencesResource) -> None:
|
|
312
|
+
self._experiences = experiences
|
|
313
|
+
|
|
314
|
+
self.create = to_streamed_response_wrapper(
|
|
315
|
+
experiences.create,
|
|
316
|
+
)
|
|
317
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
318
|
+
experiences.retrieve,
|
|
319
|
+
)
|
|
320
|
+
self.delete = to_streamed_response_wrapper(
|
|
321
|
+
experiences.delete,
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
@cached_property
|
|
325
|
+
def types(self) -> TypesResourceWithStreamingResponse:
|
|
326
|
+
return TypesResourceWithStreamingResponse(self._experiences.types)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
class AsyncExperiencesResourceWithStreamingResponse:
|
|
330
|
+
def __init__(self, experiences: AsyncExperiencesResource) -> None:
|
|
331
|
+
self._experiences = experiences
|
|
332
|
+
|
|
333
|
+
self.create = async_to_streamed_response_wrapper(
|
|
334
|
+
experiences.create,
|
|
335
|
+
)
|
|
336
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
337
|
+
experiences.retrieve,
|
|
338
|
+
)
|
|
339
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
340
|
+
experiences.delete,
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
@cached_property
|
|
344
|
+
def types(self) -> AsyncTypesResourceWithStreamingResponse:
|
|
345
|
+
return AsyncTypesResourceWithStreamingResponse(self._experiences.types)
|