payi 0.1.0a15__py3-none-any.whl → 0.1.0a16__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.

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