payi 0.1.0a37__py3-none-any.whl → 0.1.0a39__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/_version.py +1 -1
- payi/resources/experiences/experiences.py +8 -8
- payi/resources/experiences/types/__init__.py +33 -0
- payi/resources/experiences/types/limit_config.py +275 -0
- payi/resources/experiences/{types.py → types/types.py} +47 -11
- payi/resources/ingest.py +0 -83
- payi/resources/limits/limits.py +4 -8
- payi/resources/requests/__init__.py +14 -0
- payi/resources/requests/requests.py +32 -0
- payi/resources/requests/result.py +169 -0
- payi/types/__init__.py +1 -4
- payi/types/cost_data.py +5 -2
- payi/types/experience_instance_response.py +2 -4
- payi/types/experiences/experience_type.py +15 -2
- payi/types/experiences/type_create_params.py +15 -3
- payi/types/experiences/type_update_params.py +2 -2
- payi/types/experiences/types/__init__.py +5 -0
- payi/types/experiences/types/limit_config_create_params.py +18 -0
- payi/types/ingest_response.py +7 -2
- payi/types/limit_create_params.py +1 -3
- payi/types/limit_response.py +0 -2
- payi/types/paged_limit_list.py +0 -2
- payi/types/requests/__init__.py +1 -0
- payi/types/requests/request_result.py +48 -0
- payi/types/shared/__init__.py +3 -1
- payi/types/shared/pay_i_common_models_budget_management_cost_details_base.py +10 -0
- {payi-0.1.0a37.dist-info → payi-0.1.0a39.dist-info}/METADATA +1 -1
- {payi-0.1.0a37.dist-info → payi-0.1.0a39.dist-info}/RECORD +30 -26
- payi/types/bulk_ingest_response.py +0 -51
- payi/types/ingest_bulk_params.py +0 -14
- payi/types/ingest_event_param.py +0 -60
- {payi-0.1.0a37.dist-info → payi-0.1.0a39.dist-info}/WHEEL +0 -0
- {payi-0.1.0a37.dist-info → payi-0.1.0a39.dist-info}/licenses/LICENSE +0 -0
payi/_version.py
CHANGED
|
@@ -4,14 +4,6 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
|
-
from .types import (
|
|
8
|
-
TypesResource,
|
|
9
|
-
AsyncTypesResource,
|
|
10
|
-
TypesResourceWithRawResponse,
|
|
11
|
-
AsyncTypesResourceWithRawResponse,
|
|
12
|
-
TypesResourceWithStreamingResponse,
|
|
13
|
-
AsyncTypesResourceWithStreamingResponse,
|
|
14
|
-
)
|
|
15
7
|
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
16
8
|
from ..._compat import cached_property
|
|
17
9
|
from .properties import (
|
|
@@ -29,6 +21,14 @@ from ..._response import (
|
|
|
29
21
|
async_to_raw_response_wrapper,
|
|
30
22
|
async_to_streamed_response_wrapper,
|
|
31
23
|
)
|
|
24
|
+
from .types.types import (
|
|
25
|
+
TypesResource,
|
|
26
|
+
AsyncTypesResource,
|
|
27
|
+
TypesResourceWithRawResponse,
|
|
28
|
+
AsyncTypesResourceWithRawResponse,
|
|
29
|
+
TypesResourceWithStreamingResponse,
|
|
30
|
+
AsyncTypesResourceWithStreamingResponse,
|
|
31
|
+
)
|
|
32
32
|
from ..._base_client import make_request_options
|
|
33
33
|
from ...types.experience_instance_response import ExperienceInstanceResponse
|
|
34
34
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .types import (
|
|
4
|
+
TypesResource,
|
|
5
|
+
AsyncTypesResource,
|
|
6
|
+
TypesResourceWithRawResponse,
|
|
7
|
+
AsyncTypesResourceWithRawResponse,
|
|
8
|
+
TypesResourceWithStreamingResponse,
|
|
9
|
+
AsyncTypesResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .limit_config import (
|
|
12
|
+
LimitConfigResource,
|
|
13
|
+
AsyncLimitConfigResource,
|
|
14
|
+
LimitConfigResourceWithRawResponse,
|
|
15
|
+
AsyncLimitConfigResourceWithRawResponse,
|
|
16
|
+
LimitConfigResourceWithStreamingResponse,
|
|
17
|
+
AsyncLimitConfigResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"LimitConfigResource",
|
|
22
|
+
"AsyncLimitConfigResource",
|
|
23
|
+
"LimitConfigResourceWithRawResponse",
|
|
24
|
+
"AsyncLimitConfigResourceWithRawResponse",
|
|
25
|
+
"LimitConfigResourceWithStreamingResponse",
|
|
26
|
+
"AsyncLimitConfigResourceWithStreamingResponse",
|
|
27
|
+
"TypesResource",
|
|
28
|
+
"AsyncTypesResource",
|
|
29
|
+
"TypesResourceWithRawResponse",
|
|
30
|
+
"AsyncTypesResourceWithRawResponse",
|
|
31
|
+
"TypesResourceWithStreamingResponse",
|
|
32
|
+
"AsyncTypesResourceWithStreamingResponse",
|
|
33
|
+
]
|
|
@@ -0,0 +1,275 @@
|
|
|
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 List, Optional
|
|
6
|
+
from typing_extensions import Literal
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
+
from ...._utils import (
|
|
12
|
+
maybe_transform,
|
|
13
|
+
async_maybe_transform,
|
|
14
|
+
)
|
|
15
|
+
from ...._compat import cached_property
|
|
16
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
17
|
+
from ...._response import (
|
|
18
|
+
to_raw_response_wrapper,
|
|
19
|
+
to_streamed_response_wrapper,
|
|
20
|
+
async_to_raw_response_wrapper,
|
|
21
|
+
async_to_streamed_response_wrapper,
|
|
22
|
+
)
|
|
23
|
+
from ...._base_client import make_request_options
|
|
24
|
+
from ....types.experiences.types import limit_config_create_params
|
|
25
|
+
from ....types.experiences.experience_type import ExperienceType
|
|
26
|
+
|
|
27
|
+
__all__ = ["LimitConfigResource", "AsyncLimitConfigResource"]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class LimitConfigResource(SyncAPIResource):
|
|
31
|
+
@cached_property
|
|
32
|
+
def with_raw_response(self) -> LimitConfigResourceWithRawResponse:
|
|
33
|
+
"""
|
|
34
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
35
|
+
the raw response object instead of the parsed content.
|
|
36
|
+
|
|
37
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
38
|
+
"""
|
|
39
|
+
return LimitConfigResourceWithRawResponse(self)
|
|
40
|
+
|
|
41
|
+
@cached_property
|
|
42
|
+
def with_streaming_response(self) -> LimitConfigResourceWithStreamingResponse:
|
|
43
|
+
"""
|
|
44
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
45
|
+
|
|
46
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
47
|
+
"""
|
|
48
|
+
return LimitConfigResourceWithStreamingResponse(self)
|
|
49
|
+
|
|
50
|
+
def create(
|
|
51
|
+
self,
|
|
52
|
+
experience_name: str,
|
|
53
|
+
*,
|
|
54
|
+
max: float,
|
|
55
|
+
limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
56
|
+
limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
57
|
+
threshold: Optional[float] | NotGiven = NOT_GIVEN,
|
|
58
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
59
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
60
|
+
extra_headers: Headers | None = None,
|
|
61
|
+
extra_query: Query | None = None,
|
|
62
|
+
extra_body: Body | None = None,
|
|
63
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
64
|
+
) -> ExperienceType:
|
|
65
|
+
"""
|
|
66
|
+
Create a new Experience Type default limit configuration
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
extra_headers: Send extra headers
|
|
70
|
+
|
|
71
|
+
extra_query: Add additional query parameters to the request
|
|
72
|
+
|
|
73
|
+
extra_body: Add additional JSON properties to the request
|
|
74
|
+
|
|
75
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
76
|
+
"""
|
|
77
|
+
if not experience_name:
|
|
78
|
+
raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
|
|
79
|
+
return self._post(
|
|
80
|
+
f"/api/v1/experiences/types/{experience_name}/limit_config",
|
|
81
|
+
body=maybe_transform(
|
|
82
|
+
{
|
|
83
|
+
"max": max,
|
|
84
|
+
"limit_tags": limit_tags,
|
|
85
|
+
"limit_type": limit_type,
|
|
86
|
+
"threshold": threshold,
|
|
87
|
+
},
|
|
88
|
+
limit_config_create_params.LimitConfigCreateParams,
|
|
89
|
+
),
|
|
90
|
+
options=make_request_options(
|
|
91
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
92
|
+
),
|
|
93
|
+
cast_to=ExperienceType,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
def delete(
|
|
97
|
+
self,
|
|
98
|
+
experience_name: str,
|
|
99
|
+
*,
|
|
100
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
101
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
102
|
+
extra_headers: Headers | None = None,
|
|
103
|
+
extra_query: Query | None = None,
|
|
104
|
+
extra_body: Body | None = None,
|
|
105
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
106
|
+
) -> ExperienceType:
|
|
107
|
+
"""
|
|
108
|
+
Delete an Experience Type default limit configuration
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
extra_headers: Send extra headers
|
|
112
|
+
|
|
113
|
+
extra_query: Add additional query parameters to the request
|
|
114
|
+
|
|
115
|
+
extra_body: Add additional JSON properties to the request
|
|
116
|
+
|
|
117
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
118
|
+
"""
|
|
119
|
+
if not experience_name:
|
|
120
|
+
raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
|
|
121
|
+
return self._delete(
|
|
122
|
+
f"/api/v1/experiences/types/{experience_name}/limit_config",
|
|
123
|
+
options=make_request_options(
|
|
124
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
125
|
+
),
|
|
126
|
+
cast_to=ExperienceType,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class AsyncLimitConfigResource(AsyncAPIResource):
|
|
131
|
+
@cached_property
|
|
132
|
+
def with_raw_response(self) -> AsyncLimitConfigResourceWithRawResponse:
|
|
133
|
+
"""
|
|
134
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
135
|
+
the raw response object instead of the parsed content.
|
|
136
|
+
|
|
137
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
138
|
+
"""
|
|
139
|
+
return AsyncLimitConfigResourceWithRawResponse(self)
|
|
140
|
+
|
|
141
|
+
@cached_property
|
|
142
|
+
def with_streaming_response(self) -> AsyncLimitConfigResourceWithStreamingResponse:
|
|
143
|
+
"""
|
|
144
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
145
|
+
|
|
146
|
+
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
147
|
+
"""
|
|
148
|
+
return AsyncLimitConfigResourceWithStreamingResponse(self)
|
|
149
|
+
|
|
150
|
+
async def create(
|
|
151
|
+
self,
|
|
152
|
+
experience_name: str,
|
|
153
|
+
*,
|
|
154
|
+
max: float,
|
|
155
|
+
limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
156
|
+
limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
157
|
+
threshold: Optional[float] | NotGiven = NOT_GIVEN,
|
|
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
|
+
) -> ExperienceType:
|
|
165
|
+
"""
|
|
166
|
+
Create a new Experience Type default limit configuration
|
|
167
|
+
|
|
168
|
+
Args:
|
|
169
|
+
extra_headers: Send extra headers
|
|
170
|
+
|
|
171
|
+
extra_query: Add additional query parameters to the request
|
|
172
|
+
|
|
173
|
+
extra_body: Add additional JSON properties to the request
|
|
174
|
+
|
|
175
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
176
|
+
"""
|
|
177
|
+
if not experience_name:
|
|
178
|
+
raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
|
|
179
|
+
return await self._post(
|
|
180
|
+
f"/api/v1/experiences/types/{experience_name}/limit_config",
|
|
181
|
+
body=await async_maybe_transform(
|
|
182
|
+
{
|
|
183
|
+
"max": max,
|
|
184
|
+
"limit_tags": limit_tags,
|
|
185
|
+
"limit_type": limit_type,
|
|
186
|
+
"threshold": threshold,
|
|
187
|
+
},
|
|
188
|
+
limit_config_create_params.LimitConfigCreateParams,
|
|
189
|
+
),
|
|
190
|
+
options=make_request_options(
|
|
191
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
192
|
+
),
|
|
193
|
+
cast_to=ExperienceType,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
async def delete(
|
|
197
|
+
self,
|
|
198
|
+
experience_name: str,
|
|
199
|
+
*,
|
|
200
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
201
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
202
|
+
extra_headers: Headers | None = None,
|
|
203
|
+
extra_query: Query | None = None,
|
|
204
|
+
extra_body: Body | None = None,
|
|
205
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
206
|
+
) -> ExperienceType:
|
|
207
|
+
"""
|
|
208
|
+
Delete an Experience Type default limit configuration
|
|
209
|
+
|
|
210
|
+
Args:
|
|
211
|
+
extra_headers: Send extra headers
|
|
212
|
+
|
|
213
|
+
extra_query: Add additional query parameters to the request
|
|
214
|
+
|
|
215
|
+
extra_body: Add additional JSON properties to the request
|
|
216
|
+
|
|
217
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
218
|
+
"""
|
|
219
|
+
if not experience_name:
|
|
220
|
+
raise ValueError(f"Expected a non-empty value for `experience_name` but received {experience_name!r}")
|
|
221
|
+
return await self._delete(
|
|
222
|
+
f"/api/v1/experiences/types/{experience_name}/limit_config",
|
|
223
|
+
options=make_request_options(
|
|
224
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
225
|
+
),
|
|
226
|
+
cast_to=ExperienceType,
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class LimitConfigResourceWithRawResponse:
|
|
231
|
+
def __init__(self, limit_config: LimitConfigResource) -> None:
|
|
232
|
+
self._limit_config = limit_config
|
|
233
|
+
|
|
234
|
+
self.create = to_raw_response_wrapper(
|
|
235
|
+
limit_config.create,
|
|
236
|
+
)
|
|
237
|
+
self.delete = to_raw_response_wrapper(
|
|
238
|
+
limit_config.delete,
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
class AsyncLimitConfigResourceWithRawResponse:
|
|
243
|
+
def __init__(self, limit_config: AsyncLimitConfigResource) -> None:
|
|
244
|
+
self._limit_config = limit_config
|
|
245
|
+
|
|
246
|
+
self.create = async_to_raw_response_wrapper(
|
|
247
|
+
limit_config.create,
|
|
248
|
+
)
|
|
249
|
+
self.delete = async_to_raw_response_wrapper(
|
|
250
|
+
limit_config.delete,
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
class LimitConfigResourceWithStreamingResponse:
|
|
255
|
+
def __init__(self, limit_config: LimitConfigResource) -> None:
|
|
256
|
+
self._limit_config = limit_config
|
|
257
|
+
|
|
258
|
+
self.create = to_streamed_response_wrapper(
|
|
259
|
+
limit_config.create,
|
|
260
|
+
)
|
|
261
|
+
self.delete = to_streamed_response_wrapper(
|
|
262
|
+
limit_config.delete,
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
class AsyncLimitConfigResourceWithStreamingResponse:
|
|
267
|
+
def __init__(self, limit_config: AsyncLimitConfigResource) -> None:
|
|
268
|
+
self._limit_config = limit_config
|
|
269
|
+
|
|
270
|
+
self.create = async_to_streamed_response_wrapper(
|
|
271
|
+
limit_config.create,
|
|
272
|
+
)
|
|
273
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
274
|
+
limit_config.delete,
|
|
275
|
+
)
|
|
@@ -6,28 +6,40 @@ from typing import Optional
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from
|
|
9
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
10
|
+
from ...._utils import (
|
|
11
11
|
maybe_transform,
|
|
12
12
|
async_maybe_transform,
|
|
13
13
|
)
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
14
|
+
from ...._compat import cached_property
|
|
15
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
16
|
+
from ...._response import (
|
|
17
17
|
to_raw_response_wrapper,
|
|
18
18
|
to_streamed_response_wrapper,
|
|
19
19
|
async_to_raw_response_wrapper,
|
|
20
20
|
async_to_streamed_response_wrapper,
|
|
21
21
|
)
|
|
22
|
-
from
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
from .limit_config import (
|
|
23
|
+
LimitConfigResource,
|
|
24
|
+
AsyncLimitConfigResource,
|
|
25
|
+
LimitConfigResourceWithRawResponse,
|
|
26
|
+
AsyncLimitConfigResourceWithRawResponse,
|
|
27
|
+
LimitConfigResourceWithStreamingResponse,
|
|
28
|
+
AsyncLimitConfigResourceWithStreamingResponse,
|
|
29
|
+
)
|
|
30
|
+
from ...._base_client import make_request_options
|
|
31
|
+
from ....types.experiences import type_list_params, type_create_params, type_update_params
|
|
32
|
+
from ....types.experiences.experience_type import ExperienceType
|
|
33
|
+
from ....types.experiences.type_list_response import TypeListResponse
|
|
26
34
|
|
|
27
35
|
__all__ = ["TypesResource", "AsyncTypesResource"]
|
|
28
36
|
|
|
29
37
|
|
|
30
38
|
class TypesResource(SyncAPIResource):
|
|
39
|
+
@cached_property
|
|
40
|
+
def limit_config(self) -> LimitConfigResource:
|
|
41
|
+
return LimitConfigResource(self._client)
|
|
42
|
+
|
|
31
43
|
@cached_property
|
|
32
44
|
def with_raw_response(self) -> TypesResourceWithRawResponse:
|
|
33
45
|
"""
|
|
@@ -52,6 +64,7 @@ class TypesResource(SyncAPIResource):
|
|
|
52
64
|
*,
|
|
53
65
|
description: str,
|
|
54
66
|
name: str,
|
|
67
|
+
limit_config: type_create_params.LimitConfig | NotGiven = NOT_GIVEN,
|
|
55
68
|
logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
56
69
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
57
70
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -78,6 +91,7 @@ class TypesResource(SyncAPIResource):
|
|
|
78
91
|
{
|
|
79
92
|
"description": description,
|
|
80
93
|
"name": name,
|
|
94
|
+
"limit_config": limit_config,
|
|
81
95
|
"logging_enabled": logging_enabled,
|
|
82
96
|
},
|
|
83
97
|
type_create_params.TypeCreateParams,
|
|
@@ -125,7 +139,7 @@ class TypesResource(SyncAPIResource):
|
|
|
125
139
|
self,
|
|
126
140
|
experience_name: str,
|
|
127
141
|
*,
|
|
128
|
-
description: Optional[str],
|
|
142
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
129
143
|
logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
130
144
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
131
145
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -235,6 +249,10 @@ class TypesResource(SyncAPIResource):
|
|
|
235
249
|
|
|
236
250
|
|
|
237
251
|
class AsyncTypesResource(AsyncAPIResource):
|
|
252
|
+
@cached_property
|
|
253
|
+
def limit_config(self) -> AsyncLimitConfigResource:
|
|
254
|
+
return AsyncLimitConfigResource(self._client)
|
|
255
|
+
|
|
238
256
|
@cached_property
|
|
239
257
|
def with_raw_response(self) -> AsyncTypesResourceWithRawResponse:
|
|
240
258
|
"""
|
|
@@ -259,6 +277,7 @@ class AsyncTypesResource(AsyncAPIResource):
|
|
|
259
277
|
*,
|
|
260
278
|
description: str,
|
|
261
279
|
name: str,
|
|
280
|
+
limit_config: type_create_params.LimitConfig | NotGiven = NOT_GIVEN,
|
|
262
281
|
logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
263
282
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
264
283
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -285,6 +304,7 @@ class AsyncTypesResource(AsyncAPIResource):
|
|
|
285
304
|
{
|
|
286
305
|
"description": description,
|
|
287
306
|
"name": name,
|
|
307
|
+
"limit_config": limit_config,
|
|
288
308
|
"logging_enabled": logging_enabled,
|
|
289
309
|
},
|
|
290
310
|
type_create_params.TypeCreateParams,
|
|
@@ -332,7 +352,7 @@ class AsyncTypesResource(AsyncAPIResource):
|
|
|
332
352
|
self,
|
|
333
353
|
experience_name: str,
|
|
334
354
|
*,
|
|
335
|
-
description: Optional[str],
|
|
355
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
336
356
|
logging_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
337
357
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
338
358
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -461,6 +481,10 @@ class TypesResourceWithRawResponse:
|
|
|
461
481
|
types.delete,
|
|
462
482
|
)
|
|
463
483
|
|
|
484
|
+
@cached_property
|
|
485
|
+
def limit_config(self) -> LimitConfigResourceWithRawResponse:
|
|
486
|
+
return LimitConfigResourceWithRawResponse(self._types.limit_config)
|
|
487
|
+
|
|
464
488
|
|
|
465
489
|
class AsyncTypesResourceWithRawResponse:
|
|
466
490
|
def __init__(self, types: AsyncTypesResource) -> None:
|
|
@@ -482,6 +506,10 @@ class AsyncTypesResourceWithRawResponse:
|
|
|
482
506
|
types.delete,
|
|
483
507
|
)
|
|
484
508
|
|
|
509
|
+
@cached_property
|
|
510
|
+
def limit_config(self) -> AsyncLimitConfigResourceWithRawResponse:
|
|
511
|
+
return AsyncLimitConfigResourceWithRawResponse(self._types.limit_config)
|
|
512
|
+
|
|
485
513
|
|
|
486
514
|
class TypesResourceWithStreamingResponse:
|
|
487
515
|
def __init__(self, types: TypesResource) -> None:
|
|
@@ -503,6 +531,10 @@ class TypesResourceWithStreamingResponse:
|
|
|
503
531
|
types.delete,
|
|
504
532
|
)
|
|
505
533
|
|
|
534
|
+
@cached_property
|
|
535
|
+
def limit_config(self) -> LimitConfigResourceWithStreamingResponse:
|
|
536
|
+
return LimitConfigResourceWithStreamingResponse(self._types.limit_config)
|
|
537
|
+
|
|
506
538
|
|
|
507
539
|
class AsyncTypesResourceWithStreamingResponse:
|
|
508
540
|
def __init__(self, types: AsyncTypesResource) -> None:
|
|
@@ -523,3 +555,7 @@ class AsyncTypesResourceWithStreamingResponse:
|
|
|
523
555
|
self.delete = async_to_streamed_response_wrapper(
|
|
524
556
|
types.delete,
|
|
525
557
|
)
|
|
558
|
+
|
|
559
|
+
@cached_property
|
|
560
|
+
def limit_config(self) -> AsyncLimitConfigResourceWithStreamingResponse:
|
|
561
|
+
return AsyncLimitConfigResourceWithStreamingResponse(self._types.limit_config)
|
payi/resources/ingest.py
CHANGED
|
@@ -24,8 +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_event_param import IngestEventParam
|
|
28
|
-
from ..types.bulk_ingest_response import BulkIngestResponse
|
|
29
27
|
from ..types.pay_i_common_models_api_router_header_info_param import PayICommonModelsAPIRouterHeaderInfoParam
|
|
30
28
|
|
|
31
29
|
__all__ = ["IngestResource", "AsyncIngestResource"]
|
|
@@ -51,41 +49,6 @@ class IngestResource(SyncAPIResource):
|
|
|
51
49
|
"""
|
|
52
50
|
return IngestResourceWithStreamingResponse(self)
|
|
53
51
|
|
|
54
|
-
def bulk(
|
|
55
|
-
self,
|
|
56
|
-
*,
|
|
57
|
-
events: Iterable[IngestEventParam],
|
|
58
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
59
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
60
|
-
extra_headers: Headers | None = None,
|
|
61
|
-
extra_query: Query | None = None,
|
|
62
|
-
extra_body: Body | None = None,
|
|
63
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
64
|
-
) -> BulkIngestResponse:
|
|
65
|
-
"""
|
|
66
|
-
Bulk Ingest
|
|
67
|
-
|
|
68
|
-
Args:
|
|
69
|
-
|
|
70
|
-
items (Iterable[IngestUnitsParams]): The items to ingest
|
|
71
|
-
|
|
72
|
-
extra_headers: Send extra headers
|
|
73
|
-
|
|
74
|
-
extra_query: Add additional query parameters to the request
|
|
75
|
-
|
|
76
|
-
extra_body: Add additional JSON properties to the request
|
|
77
|
-
|
|
78
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
79
|
-
"""
|
|
80
|
-
return self._post(
|
|
81
|
-
"/api/v1/ingest/bulk",
|
|
82
|
-
body=maybe_transform(events, Iterable[IngestEventParam]),
|
|
83
|
-
options=make_request_options(
|
|
84
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
85
|
-
),
|
|
86
|
-
cast_to=BulkIngestResponse,
|
|
87
|
-
)
|
|
88
|
-
|
|
89
52
|
def units(
|
|
90
53
|
self,
|
|
91
54
|
*,
|
|
@@ -237,40 +200,6 @@ class AsyncIngestResource(AsyncAPIResource):
|
|
|
237
200
|
"""
|
|
238
201
|
return AsyncIngestResourceWithStreamingResponse(self)
|
|
239
202
|
|
|
240
|
-
async def bulk(
|
|
241
|
-
self,
|
|
242
|
-
*,
|
|
243
|
-
events: Iterable[IngestEventParam],
|
|
244
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
245
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
246
|
-
extra_headers: Headers | None = None,
|
|
247
|
-
extra_query: Query | None = None,
|
|
248
|
-
extra_body: Body | None = None,
|
|
249
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
250
|
-
) -> BulkIngestResponse:
|
|
251
|
-
"""
|
|
252
|
-
Bulk Ingest
|
|
253
|
-
|
|
254
|
-
Args:
|
|
255
|
-
items (Iterable[IngestUnitsParams]): The items to ingest
|
|
256
|
-
|
|
257
|
-
extra_headers: Send extra headers
|
|
258
|
-
|
|
259
|
-
extra_query: Add additional query parameters to the request
|
|
260
|
-
|
|
261
|
-
extra_body: Add additional JSON properties to the request
|
|
262
|
-
|
|
263
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
264
|
-
"""
|
|
265
|
-
return await self._post(
|
|
266
|
-
"/api/v1/ingest/bulk",
|
|
267
|
-
body=await async_maybe_transform(events, Iterable[IngestEventParam]),
|
|
268
|
-
options=make_request_options(
|
|
269
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
270
|
-
),
|
|
271
|
-
cast_to=BulkIngestResponse,
|
|
272
|
-
)
|
|
273
|
-
|
|
274
203
|
async def units(
|
|
275
204
|
self,
|
|
276
205
|
*,
|
|
@@ -405,9 +334,6 @@ class IngestResourceWithRawResponse:
|
|
|
405
334
|
def __init__(self, ingest: IngestResource) -> None:
|
|
406
335
|
self._ingest = ingest
|
|
407
336
|
|
|
408
|
-
self.bulk = to_raw_response_wrapper(
|
|
409
|
-
ingest.bulk,
|
|
410
|
-
)
|
|
411
337
|
self.units = to_raw_response_wrapper(
|
|
412
338
|
ingest.units,
|
|
413
339
|
)
|
|
@@ -417,9 +343,6 @@ class AsyncIngestResourceWithRawResponse:
|
|
|
417
343
|
def __init__(self, ingest: AsyncIngestResource) -> None:
|
|
418
344
|
self._ingest = ingest
|
|
419
345
|
|
|
420
|
-
self.bulk = async_to_raw_response_wrapper(
|
|
421
|
-
ingest.bulk,
|
|
422
|
-
)
|
|
423
346
|
self.units = async_to_raw_response_wrapper(
|
|
424
347
|
ingest.units,
|
|
425
348
|
)
|
|
@@ -429,9 +352,6 @@ class IngestResourceWithStreamingResponse:
|
|
|
429
352
|
def __init__(self, ingest: IngestResource) -> None:
|
|
430
353
|
self._ingest = ingest
|
|
431
354
|
|
|
432
|
-
self.bulk = to_streamed_response_wrapper(
|
|
433
|
-
ingest.bulk,
|
|
434
|
-
)
|
|
435
355
|
self.units = to_streamed_response_wrapper(
|
|
436
356
|
ingest.units,
|
|
437
357
|
)
|
|
@@ -441,9 +361,6 @@ class AsyncIngestResourceWithStreamingResponse:
|
|
|
441
361
|
def __init__(self, ingest: AsyncIngestResource) -> None:
|
|
442
362
|
self._ingest = ingest
|
|
443
363
|
|
|
444
|
-
self.bulk = async_to_streamed_response_wrapper(
|
|
445
|
-
ingest.bulk,
|
|
446
|
-
)
|
|
447
364
|
self.units = async_to_streamed_response_wrapper(
|
|
448
365
|
ingest.units,
|
|
449
366
|
)
|
payi/resources/limits/limits.py
CHANGED
|
@@ -69,8 +69,7 @@ class LimitsResource(SyncAPIResource):
|
|
|
69
69
|
limit_name: str,
|
|
70
70
|
max: float,
|
|
71
71
|
billing_model_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
72
|
-
|
|
73
|
-
currency: Literal["usd"] | NotGiven = NOT_GIVEN,
|
|
72
|
+
limit_basis: Literal["base", "billed"] | NotGiven = NOT_GIVEN,
|
|
74
73
|
limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
75
74
|
limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
76
75
|
threshold: Optional[float] | NotGiven = NOT_GIVEN,
|
|
@@ -100,8 +99,7 @@ class LimitsResource(SyncAPIResource):
|
|
|
100
99
|
"limit_name": limit_name,
|
|
101
100
|
"max": max,
|
|
102
101
|
"billing_model_id": billing_model_id,
|
|
103
|
-
"
|
|
104
|
-
"currency": currency,
|
|
102
|
+
"limit_basis": limit_basis,
|
|
105
103
|
"limit_tags": limit_tags,
|
|
106
104
|
"limit_type": limit_type,
|
|
107
105
|
"threshold": threshold,
|
|
@@ -343,8 +341,7 @@ class AsyncLimitsResource(AsyncAPIResource):
|
|
|
343
341
|
limit_name: str,
|
|
344
342
|
max: float,
|
|
345
343
|
billing_model_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
346
|
-
|
|
347
|
-
currency: Literal["usd"] | NotGiven = NOT_GIVEN,
|
|
344
|
+
limit_basis: Literal["base", "billed"] | NotGiven = NOT_GIVEN,
|
|
348
345
|
limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
349
346
|
limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
350
347
|
threshold: Optional[float] | NotGiven = NOT_GIVEN,
|
|
@@ -374,8 +371,7 @@ class AsyncLimitsResource(AsyncAPIResource):
|
|
|
374
371
|
"limit_name": limit_name,
|
|
375
372
|
"max": max,
|
|
376
373
|
"billing_model_id": billing_model_id,
|
|
377
|
-
"
|
|
378
|
-
"currency": currency,
|
|
374
|
+
"limit_basis": limit_basis,
|
|
379
375
|
"limit_tags": limit_tags,
|
|
380
376
|
"limit_type": limit_type,
|
|
381
377
|
"threshold": threshold,
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
from .result import (
|
|
4
|
+
ResultResource,
|
|
5
|
+
AsyncResultResource,
|
|
6
|
+
ResultResourceWithRawResponse,
|
|
7
|
+
AsyncResultResourceWithRawResponse,
|
|
8
|
+
ResultResourceWithStreamingResponse,
|
|
9
|
+
AsyncResultResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
3
11
|
from .requests import (
|
|
4
12
|
RequestsResource,
|
|
5
13
|
AsyncRequestsResource,
|
|
@@ -24,6 +32,12 @@ __all__ = [
|
|
|
24
32
|
"AsyncPropertiesResourceWithRawResponse",
|
|
25
33
|
"PropertiesResourceWithStreamingResponse",
|
|
26
34
|
"AsyncPropertiesResourceWithStreamingResponse",
|
|
35
|
+
"ResultResource",
|
|
36
|
+
"AsyncResultResource",
|
|
37
|
+
"ResultResourceWithRawResponse",
|
|
38
|
+
"AsyncResultResourceWithRawResponse",
|
|
39
|
+
"ResultResourceWithStreamingResponse",
|
|
40
|
+
"AsyncResultResourceWithStreamingResponse",
|
|
27
41
|
"RequestsResource",
|
|
28
42
|
"AsyncRequestsResource",
|
|
29
43
|
"RequestsResourceWithRawResponse",
|