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,471 @@
|
|
|
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
|
+
|
|
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 type_create_params, type_update_params
|
|
24
|
+
from ...types.experiences.experience_type import ExperienceType
|
|
25
|
+
from ...types.experiences.type_list_response import TypeListResponse
|
|
26
|
+
|
|
27
|
+
__all__ = ["TypesResource", "AsyncTypesResource"]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class TypesResource(SyncAPIResource):
|
|
31
|
+
@cached_property
|
|
32
|
+
def with_raw_response(self) -> TypesResourceWithRawResponse:
|
|
33
|
+
return TypesResourceWithRawResponse(self)
|
|
34
|
+
|
|
35
|
+
@cached_property
|
|
36
|
+
def with_streaming_response(self) -> TypesResourceWithStreamingResponse:
|
|
37
|
+
return TypesResourceWithStreamingResponse(self)
|
|
38
|
+
|
|
39
|
+
def create(
|
|
40
|
+
self,
|
|
41
|
+
*,
|
|
42
|
+
description: str,
|
|
43
|
+
name: str,
|
|
44
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
45
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
46
|
+
extra_headers: Headers | None = None,
|
|
47
|
+
extra_query: Query | None = None,
|
|
48
|
+
extra_body: Body | None = None,
|
|
49
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
50
|
+
) -> ExperienceType:
|
|
51
|
+
"""Adds a new experience type.
|
|
52
|
+
|
|
53
|
+
Instances of this type can be created via
|
|
54
|
+
/experiences/instance.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
extra_headers: Send extra headers
|
|
58
|
+
|
|
59
|
+
extra_query: Add additional query parameters to the request
|
|
60
|
+
|
|
61
|
+
extra_body: Add additional JSON properties to the request
|
|
62
|
+
|
|
63
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
64
|
+
"""
|
|
65
|
+
return self._post(
|
|
66
|
+
"/api/v1/experiences/types",
|
|
67
|
+
body=maybe_transform(
|
|
68
|
+
{
|
|
69
|
+
"description": description,
|
|
70
|
+
"name": name,
|
|
71
|
+
},
|
|
72
|
+
type_create_params.TypeCreateParams,
|
|
73
|
+
),
|
|
74
|
+
options=make_request_options(
|
|
75
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
76
|
+
),
|
|
77
|
+
cast_to=ExperienceType,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def retrieve(
|
|
81
|
+
self,
|
|
82
|
+
experience_type_id: str,
|
|
83
|
+
*,
|
|
84
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
85
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
86
|
+
extra_headers: Headers | None = None,
|
|
87
|
+
extra_query: Query | None = None,
|
|
88
|
+
extra_body: Body | None = None,
|
|
89
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
90
|
+
) -> ExperienceType:
|
|
91
|
+
"""
|
|
92
|
+
Get details for a specific Experience Type
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
extra_headers: Send extra headers
|
|
96
|
+
|
|
97
|
+
extra_query: Add additional query parameters to the request
|
|
98
|
+
|
|
99
|
+
extra_body: Add additional JSON properties to the request
|
|
100
|
+
|
|
101
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
102
|
+
"""
|
|
103
|
+
if not experience_type_id:
|
|
104
|
+
raise ValueError(f"Expected a non-empty value for `experience_type_id` but received {experience_type_id!r}")
|
|
105
|
+
return self._get(
|
|
106
|
+
f"/api/v1/experiences/types/{experience_type_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=ExperienceType,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
def update(
|
|
114
|
+
self,
|
|
115
|
+
experience_type_id: str,
|
|
116
|
+
*,
|
|
117
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
118
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
119
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
120
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
121
|
+
extra_headers: Headers | None = None,
|
|
122
|
+
extra_query: Query | None = None,
|
|
123
|
+
extra_body: Body | None = None,
|
|
124
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
125
|
+
) -> ExperienceType:
|
|
126
|
+
"""
|
|
127
|
+
Updates an existing experience type.
|
|
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_type_id:
|
|
139
|
+
raise ValueError(f"Expected a non-empty value for `experience_type_id` but received {experience_type_id!r}")
|
|
140
|
+
return self._patch(
|
|
141
|
+
f"/api/v1/experiences/types/{experience_type_id}",
|
|
142
|
+
body=maybe_transform(
|
|
143
|
+
{
|
|
144
|
+
"description": description,
|
|
145
|
+
"name": name,
|
|
146
|
+
},
|
|
147
|
+
type_update_params.TypeUpdateParams,
|
|
148
|
+
),
|
|
149
|
+
options=make_request_options(
|
|
150
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
151
|
+
),
|
|
152
|
+
cast_to=ExperienceType,
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
def list(
|
|
156
|
+
self,
|
|
157
|
+
*,
|
|
158
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
159
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
160
|
+
extra_headers: Headers | None = None,
|
|
161
|
+
extra_query: Query | None = None,
|
|
162
|
+
extra_body: Body | None = None,
|
|
163
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
164
|
+
) -> TypeListResponse:
|
|
165
|
+
"""Get all Experience Types"""
|
|
166
|
+
return self._get(
|
|
167
|
+
"/api/v1/experiences/types",
|
|
168
|
+
options=make_request_options(
|
|
169
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
170
|
+
),
|
|
171
|
+
cast_to=TypeListResponse,
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
def delete(
|
|
175
|
+
self,
|
|
176
|
+
experience_type_id: str,
|
|
177
|
+
*,
|
|
178
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
179
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
180
|
+
extra_headers: Headers | None = None,
|
|
181
|
+
extra_query: Query | None = None,
|
|
182
|
+
extra_body: Body | None = None,
|
|
183
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
184
|
+
) -> ExperienceType:
|
|
185
|
+
"""Deletes an experience type.
|
|
186
|
+
|
|
187
|
+
This will remove visiblity of this type from all
|
|
188
|
+
dashboard stats.
|
|
189
|
+
|
|
190
|
+
Args:
|
|
191
|
+
extra_headers: Send extra headers
|
|
192
|
+
|
|
193
|
+
extra_query: Add additional query parameters to the request
|
|
194
|
+
|
|
195
|
+
extra_body: Add additional JSON properties to the request
|
|
196
|
+
|
|
197
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
198
|
+
"""
|
|
199
|
+
if not experience_type_id:
|
|
200
|
+
raise ValueError(f"Expected a non-empty value for `experience_type_id` but received {experience_type_id!r}")
|
|
201
|
+
return self._delete(
|
|
202
|
+
f"/api/v1/experiences/types/{experience_type_id}",
|
|
203
|
+
options=make_request_options(
|
|
204
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
205
|
+
),
|
|
206
|
+
cast_to=ExperienceType,
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
class AsyncTypesResource(AsyncAPIResource):
|
|
211
|
+
@cached_property
|
|
212
|
+
def with_raw_response(self) -> AsyncTypesResourceWithRawResponse:
|
|
213
|
+
return AsyncTypesResourceWithRawResponse(self)
|
|
214
|
+
|
|
215
|
+
@cached_property
|
|
216
|
+
def with_streaming_response(self) -> AsyncTypesResourceWithStreamingResponse:
|
|
217
|
+
return AsyncTypesResourceWithStreamingResponse(self)
|
|
218
|
+
|
|
219
|
+
async def create(
|
|
220
|
+
self,
|
|
221
|
+
*,
|
|
222
|
+
description: str,
|
|
223
|
+
name: str,
|
|
224
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
225
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
226
|
+
extra_headers: Headers | None = None,
|
|
227
|
+
extra_query: Query | None = None,
|
|
228
|
+
extra_body: Body | None = None,
|
|
229
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
230
|
+
) -> ExperienceType:
|
|
231
|
+
"""Adds a new experience type.
|
|
232
|
+
|
|
233
|
+
Instances of this type can be created via
|
|
234
|
+
/experiences/instance.
|
|
235
|
+
|
|
236
|
+
Args:
|
|
237
|
+
extra_headers: Send extra headers
|
|
238
|
+
|
|
239
|
+
extra_query: Add additional query parameters to the request
|
|
240
|
+
|
|
241
|
+
extra_body: Add additional JSON properties to the request
|
|
242
|
+
|
|
243
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
244
|
+
"""
|
|
245
|
+
return await self._post(
|
|
246
|
+
"/api/v1/experiences/types",
|
|
247
|
+
body=await async_maybe_transform(
|
|
248
|
+
{
|
|
249
|
+
"description": description,
|
|
250
|
+
"name": name,
|
|
251
|
+
},
|
|
252
|
+
type_create_params.TypeCreateParams,
|
|
253
|
+
),
|
|
254
|
+
options=make_request_options(
|
|
255
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
256
|
+
),
|
|
257
|
+
cast_to=ExperienceType,
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
async def retrieve(
|
|
261
|
+
self,
|
|
262
|
+
experience_type_id: str,
|
|
263
|
+
*,
|
|
264
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
265
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
266
|
+
extra_headers: Headers | None = None,
|
|
267
|
+
extra_query: Query | None = None,
|
|
268
|
+
extra_body: Body | None = None,
|
|
269
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
270
|
+
) -> ExperienceType:
|
|
271
|
+
"""
|
|
272
|
+
Get details for a specific Experience Type
|
|
273
|
+
|
|
274
|
+
Args:
|
|
275
|
+
extra_headers: Send extra headers
|
|
276
|
+
|
|
277
|
+
extra_query: Add additional query parameters to the request
|
|
278
|
+
|
|
279
|
+
extra_body: Add additional JSON properties to the request
|
|
280
|
+
|
|
281
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
282
|
+
"""
|
|
283
|
+
if not experience_type_id:
|
|
284
|
+
raise ValueError(f"Expected a non-empty value for `experience_type_id` but received {experience_type_id!r}")
|
|
285
|
+
return await self._get(
|
|
286
|
+
f"/api/v1/experiences/types/{experience_type_id}",
|
|
287
|
+
options=make_request_options(
|
|
288
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
289
|
+
),
|
|
290
|
+
cast_to=ExperienceType,
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
async def update(
|
|
294
|
+
self,
|
|
295
|
+
experience_type_id: str,
|
|
296
|
+
*,
|
|
297
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
298
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
299
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
300
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
301
|
+
extra_headers: Headers | None = None,
|
|
302
|
+
extra_query: Query | None = None,
|
|
303
|
+
extra_body: Body | None = None,
|
|
304
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
305
|
+
) -> ExperienceType:
|
|
306
|
+
"""
|
|
307
|
+
Updates an existing experience type.
|
|
308
|
+
|
|
309
|
+
Args:
|
|
310
|
+
extra_headers: Send extra headers
|
|
311
|
+
|
|
312
|
+
extra_query: Add additional query parameters to the request
|
|
313
|
+
|
|
314
|
+
extra_body: Add additional JSON properties to the request
|
|
315
|
+
|
|
316
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
317
|
+
"""
|
|
318
|
+
if not experience_type_id:
|
|
319
|
+
raise ValueError(f"Expected a non-empty value for `experience_type_id` but received {experience_type_id!r}")
|
|
320
|
+
return await self._patch(
|
|
321
|
+
f"/api/v1/experiences/types/{experience_type_id}",
|
|
322
|
+
body=await async_maybe_transform(
|
|
323
|
+
{
|
|
324
|
+
"description": description,
|
|
325
|
+
"name": name,
|
|
326
|
+
},
|
|
327
|
+
type_update_params.TypeUpdateParams,
|
|
328
|
+
),
|
|
329
|
+
options=make_request_options(
|
|
330
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
331
|
+
),
|
|
332
|
+
cast_to=ExperienceType,
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
async def list(
|
|
336
|
+
self,
|
|
337
|
+
*,
|
|
338
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
339
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
340
|
+
extra_headers: Headers | None = None,
|
|
341
|
+
extra_query: Query | None = None,
|
|
342
|
+
extra_body: Body | None = None,
|
|
343
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
344
|
+
) -> TypeListResponse:
|
|
345
|
+
"""Get all Experience Types"""
|
|
346
|
+
return await self._get(
|
|
347
|
+
"/api/v1/experiences/types",
|
|
348
|
+
options=make_request_options(
|
|
349
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
350
|
+
),
|
|
351
|
+
cast_to=TypeListResponse,
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
async def delete(
|
|
355
|
+
self,
|
|
356
|
+
experience_type_id: str,
|
|
357
|
+
*,
|
|
358
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
359
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
360
|
+
extra_headers: Headers | None = None,
|
|
361
|
+
extra_query: Query | None = None,
|
|
362
|
+
extra_body: Body | None = None,
|
|
363
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
364
|
+
) -> ExperienceType:
|
|
365
|
+
"""Deletes an experience type.
|
|
366
|
+
|
|
367
|
+
This will remove visiblity of this type from all
|
|
368
|
+
dashboard stats.
|
|
369
|
+
|
|
370
|
+
Args:
|
|
371
|
+
extra_headers: Send extra headers
|
|
372
|
+
|
|
373
|
+
extra_query: Add additional query parameters to the request
|
|
374
|
+
|
|
375
|
+
extra_body: Add additional JSON properties to the request
|
|
376
|
+
|
|
377
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
378
|
+
"""
|
|
379
|
+
if not experience_type_id:
|
|
380
|
+
raise ValueError(f"Expected a non-empty value for `experience_type_id` but received {experience_type_id!r}")
|
|
381
|
+
return await self._delete(
|
|
382
|
+
f"/api/v1/experiences/types/{experience_type_id}",
|
|
383
|
+
options=make_request_options(
|
|
384
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
385
|
+
),
|
|
386
|
+
cast_to=ExperienceType,
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
class TypesResourceWithRawResponse:
|
|
391
|
+
def __init__(self, types: TypesResource) -> None:
|
|
392
|
+
self._types = types
|
|
393
|
+
|
|
394
|
+
self.create = to_raw_response_wrapper(
|
|
395
|
+
types.create,
|
|
396
|
+
)
|
|
397
|
+
self.retrieve = to_raw_response_wrapper(
|
|
398
|
+
types.retrieve,
|
|
399
|
+
)
|
|
400
|
+
self.update = to_raw_response_wrapper(
|
|
401
|
+
types.update,
|
|
402
|
+
)
|
|
403
|
+
self.list = to_raw_response_wrapper(
|
|
404
|
+
types.list,
|
|
405
|
+
)
|
|
406
|
+
self.delete = to_raw_response_wrapper(
|
|
407
|
+
types.delete,
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
class AsyncTypesResourceWithRawResponse:
|
|
412
|
+
def __init__(self, types: AsyncTypesResource) -> None:
|
|
413
|
+
self._types = types
|
|
414
|
+
|
|
415
|
+
self.create = async_to_raw_response_wrapper(
|
|
416
|
+
types.create,
|
|
417
|
+
)
|
|
418
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
419
|
+
types.retrieve,
|
|
420
|
+
)
|
|
421
|
+
self.update = async_to_raw_response_wrapper(
|
|
422
|
+
types.update,
|
|
423
|
+
)
|
|
424
|
+
self.list = async_to_raw_response_wrapper(
|
|
425
|
+
types.list,
|
|
426
|
+
)
|
|
427
|
+
self.delete = async_to_raw_response_wrapper(
|
|
428
|
+
types.delete,
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
class TypesResourceWithStreamingResponse:
|
|
433
|
+
def __init__(self, types: TypesResource) -> None:
|
|
434
|
+
self._types = types
|
|
435
|
+
|
|
436
|
+
self.create = to_streamed_response_wrapper(
|
|
437
|
+
types.create,
|
|
438
|
+
)
|
|
439
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
440
|
+
types.retrieve,
|
|
441
|
+
)
|
|
442
|
+
self.update = to_streamed_response_wrapper(
|
|
443
|
+
types.update,
|
|
444
|
+
)
|
|
445
|
+
self.list = to_streamed_response_wrapper(
|
|
446
|
+
types.list,
|
|
447
|
+
)
|
|
448
|
+
self.delete = to_streamed_response_wrapper(
|
|
449
|
+
types.delete,
|
|
450
|
+
)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
class AsyncTypesResourceWithStreamingResponse:
|
|
454
|
+
def __init__(self, types: AsyncTypesResource) -> None:
|
|
455
|
+
self._types = types
|
|
456
|
+
|
|
457
|
+
self.create = async_to_streamed_response_wrapper(
|
|
458
|
+
types.create,
|
|
459
|
+
)
|
|
460
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
461
|
+
types.retrieve,
|
|
462
|
+
)
|
|
463
|
+
self.update = async_to_streamed_response_wrapper(
|
|
464
|
+
types.update,
|
|
465
|
+
)
|
|
466
|
+
self.list = async_to_streamed_response_wrapper(
|
|
467
|
+
types.list,
|
|
468
|
+
)
|
|
469
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
470
|
+
types.delete,
|
|
471
|
+
)
|
payi/resources/ingest.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import Union, Iterable
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
@@ -24,7 +24,6 @@ from .._response import (
|
|
|
24
24
|
)
|
|
25
25
|
from .._base_client import make_request_options
|
|
26
26
|
from ..types.ingest_response import IngestResponse
|
|
27
|
-
from ..types.ingest_units_param import IngestUnitsParam
|
|
28
27
|
from ..types.bulk_ingest_response import BulkIngestResponse
|
|
29
28
|
|
|
30
29
|
__all__ = ["IngestResource", "AsyncIngestResource"]
|
|
@@ -42,7 +41,7 @@ class IngestResource(SyncAPIResource):
|
|
|
42
41
|
def bulk(
|
|
43
42
|
self,
|
|
44
43
|
*,
|
|
45
|
-
|
|
44
|
+
events: Iterable[ingest_bulk_params.Event],
|
|
46
45
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
47
46
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
48
47
|
extra_headers: Headers | None = None,
|
|
@@ -67,12 +66,7 @@ class IngestResource(SyncAPIResource):
|
|
|
67
66
|
"""
|
|
68
67
|
return self._post(
|
|
69
68
|
"/api/v1/ingest/bulk",
|
|
70
|
-
body=
|
|
71
|
-
{
|
|
72
|
-
"items": items,
|
|
73
|
-
},
|
|
74
|
-
ingest_bulk_params.IngestBulkParams)
|
|
75
|
-
)["items"],
|
|
69
|
+
body=maybe_transform(events, Iterable[ingest_bulk_params.Event]),
|
|
76
70
|
options=make_request_options(
|
|
77
71
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
78
72
|
),
|
|
@@ -89,6 +83,8 @@ class IngestResource(SyncAPIResource):
|
|
|
89
83
|
event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
90
84
|
budget_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
|
|
91
85
|
request_tags: Union[list[str], None] | NotGiven = NOT_GIVEN,
|
|
86
|
+
experience_instance_id: Union[str, None] | NotGiven = NOT_GIVEN,
|
|
87
|
+
user_id: Union[str, None] | NotGiven = NOT_GIVEN,
|
|
92
88
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
93
89
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
94
90
|
extra_headers: Headers | None = None,
|
|
@@ -113,6 +109,10 @@ class IngestResource(SyncAPIResource):
|
|
|
113
109
|
budget_ids (list[str], optional): The budget IDs to associate with the request. Defaults to None.
|
|
114
110
|
|
|
115
111
|
request_tags (list[str], optional): The request tags to associate with the request. Defaults to None.
|
|
112
|
+
|
|
113
|
+
experience_instance_id (str, optional): The experience instance id
|
|
114
|
+
|
|
115
|
+
user_id (str, optional): The user id
|
|
116
116
|
|
|
117
117
|
extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
|
|
118
118
|
|
|
@@ -143,11 +143,19 @@ class IngestResource(SyncAPIResource):
|
|
|
143
143
|
valid_tags = [tag.strip() for tag in request_tags if tag.strip()]
|
|
144
144
|
valid_tags_str = ",".join(valid_tags) if valid_tags else NOT_GIVEN
|
|
145
145
|
|
|
146
|
+
if experience_instance_id is None or isinstance(experience_instance_id, NotGiven):
|
|
147
|
+
experience_instance_id = NOT_GIVEN
|
|
148
|
+
|
|
149
|
+
if user_id is None or isinstance(user_id, NotGiven):
|
|
150
|
+
user_id = NOT_GIVEN
|
|
151
|
+
|
|
146
152
|
extra_headers = {
|
|
147
153
|
**strip_not_given(
|
|
148
154
|
{
|
|
149
155
|
"xProxy-Budget-IDs": valid_ids_str,
|
|
150
156
|
"xProxy-Request-Tags": valid_tags_str,
|
|
157
|
+
"xProxy-Experience-InstanceId": experience_instance_id,
|
|
158
|
+
"xProxy-User-ID": user_id,
|
|
151
159
|
}
|
|
152
160
|
),
|
|
153
161
|
**(extra_headers or {}),
|
|
@@ -183,7 +191,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
183
191
|
async def bulk(
|
|
184
192
|
self,
|
|
185
193
|
*,
|
|
186
|
-
|
|
194
|
+
events: Iterable[ingest_bulk_params.Event],
|
|
187
195
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
188
196
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
189
197
|
extra_headers: Headers | None = None,
|
|
@@ -207,13 +215,7 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
207
215
|
"""
|
|
208
216
|
return await self._post(
|
|
209
217
|
"/api/v1/ingest/bulk",
|
|
210
|
-
body=
|
|
211
|
-
await async_maybe_transform(
|
|
212
|
-
{
|
|
213
|
-
"items": items,
|
|
214
|
-
},
|
|
215
|
-
ingest_bulk_params.IngestBulkParams)
|
|
216
|
-
)["items"],
|
|
218
|
+
body=await async_maybe_transform(events, Iterable[ingest_bulk_params.Event]),
|
|
217
219
|
options=make_request_options(
|
|
218
220
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
219
221
|
),
|
|
@@ -230,6 +232,8 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
230
232
|
event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
231
233
|
budget_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
|
|
232
234
|
request_tags: Union[list[str], None] | NotGiven = NOT_GIVEN,
|
|
235
|
+
experience_instance_id: Union[str, None] | NotGiven = NOT_GIVEN,
|
|
236
|
+
user_id: Union[str, None] | NotGiven = NOT_GIVEN,
|
|
233
237
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
234
238
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
235
239
|
extra_headers: Headers | None = None,
|
|
@@ -255,6 +259,10 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
255
259
|
|
|
256
260
|
request_tags (list[str], optional): The request tags to associate with the request. Defaults to None.
|
|
257
261
|
|
|
262
|
+
experience_instance_id (str, optional): The experience instance id
|
|
263
|
+
|
|
264
|
+
user_id (str, optional): The user id
|
|
265
|
+
|
|
258
266
|
extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
|
|
259
267
|
|
|
260
268
|
extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
|
|
@@ -284,11 +292,19 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
284
292
|
valid_tags = [tag.strip() for tag in request_tags if tag.strip()]
|
|
285
293
|
valid_tags_str = ",".join(valid_tags) if valid_tags else NOT_GIVEN
|
|
286
294
|
|
|
295
|
+
if experience_instance_id is None or isinstance(experience_instance_id, NotGiven):
|
|
296
|
+
experience_instance_id = NOT_GIVEN
|
|
297
|
+
|
|
298
|
+
if user_id is None or isinstance(user_id, NotGiven):
|
|
299
|
+
user_id = NOT_GIVEN
|
|
300
|
+
|
|
287
301
|
extra_headers = {
|
|
288
302
|
**strip_not_given(
|
|
289
303
|
{
|
|
290
304
|
"xProxy-Budget-IDs": valid_ids_str,
|
|
291
305
|
"xProxy-Request-Tags": valid_tags_str,
|
|
306
|
+
"xProxy-Experience-InstanceId": experience_instance_id,
|
|
307
|
+
"xProxy-User-ID": user_id,
|
|
292
308
|
}
|
|
293
309
|
),
|
|
294
310
|
**(extra_headers or {}),
|
payi/types/__init__.py
CHANGED
|
@@ -13,7 +13,7 @@ from .category_response import CategoryResponse as CategoryResponse
|
|
|
13
13
|
from .paged_budget_list import PagedBudgetList as PagedBudgetList
|
|
14
14
|
from .budget_list_params import BudgetListParams as BudgetListParams
|
|
15
15
|
from .ingest_bulk_params import IngestBulkParams as IngestBulkParams
|
|
16
|
-
from .
|
|
16
|
+
from .experience_instance import ExperienceInstance as ExperienceInstance
|
|
17
17
|
from .ingest_units_params import IngestUnitsParams as IngestUnitsParams
|
|
18
18
|
from .budget_create_params import BudgetCreateParams as BudgetCreateParams
|
|
19
19
|
from .budget_update_params import BudgetUpdateParams as BudgetUpdateParams
|
payi/types/budget_list_params.py
CHANGED
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing_extensions import
|
|
6
|
-
|
|
7
|
-
from .._utils import PropertyInfo
|
|
5
|
+
from typing_extensions import TypedDict
|
|
8
6
|
|
|
9
7
|
__all__ = ["BudgetListParams"]
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
class BudgetListParams(TypedDict, total=False):
|
|
13
|
-
budget_name:
|
|
11
|
+
budget_name: str
|
|
14
12
|
|
|
15
|
-
page_number:
|
|
13
|
+
page_number: int
|
|
16
14
|
|
|
17
|
-
page_size:
|
|
15
|
+
page_size: int
|
|
18
16
|
|
|
19
|
-
sort_ascending:
|
|
17
|
+
sort_ascending: bool
|
|
20
18
|
|
|
21
|
-
sort_by:
|
|
19
|
+
sort_by: str
|
|
22
20
|
|
|
23
|
-
tags:
|
|
21
|
+
tags: str
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
from typing import List
|
|
4
|
+
from typing_extensions import TypeAlias
|
|
4
5
|
|
|
5
6
|
from .budget_tags import BudgetTags
|
|
6
7
|
|
|
7
8
|
__all__ = ["TagCreateResponse"]
|
|
8
9
|
|
|
9
|
-
TagCreateResponse = List[BudgetTags]
|
|
10
|
+
TagCreateResponse: TypeAlias = List[BudgetTags]
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
from typing import List
|
|
4
|
+
from typing_extensions import TypeAlias
|
|
4
5
|
|
|
5
6
|
from .budget_tags import BudgetTags
|
|
6
7
|
|
|
7
8
|
__all__ = ["TagDeleteResponse"]
|
|
8
9
|
|
|
9
|
-
TagDeleteResponse = List[BudgetTags]
|
|
10
|
+
TagDeleteResponse: TypeAlias = List[BudgetTags]
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
from typing import List
|
|
4
|
+
from typing_extensions import TypeAlias
|
|
4
5
|
|
|
5
6
|
from .budget_tags import BudgetTags
|
|
6
7
|
|
|
7
8
|
__all__ = ["TagListResponse"]
|
|
8
9
|
|
|
9
|
-
TagListResponse = List[BudgetTags]
|
|
10
|
+
TagListResponse: TypeAlias = List[BudgetTags]
|