payi 0.1.0a33__py3-none-any.whl → 0.1.0a35__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 +6 -0
- payi/_client.py +9 -9
- payi/_models.py +5 -1
- payi/_version.py +1 -1
- payi/lib/helpers.py +11 -8
- payi/resources/__init__.py +13 -13
- payi/resources/billing_models.py +4 -4
- payi/resources/experiences/__init__.py +0 -14
- payi/resources/experiences/experiences.py +0 -32
- payi/resources/experiences/properties.py +5 -5
- payi/resources/ingest.py +49 -23
- payi/resources/{budgets → limits}/__init__.py +13 -13
- payi/resources/{budgets/budgets.py → limits/limits.py} +213 -196
- payi/resources/{budgets → limits}/tags.py +68 -68
- payi/resources/requests/properties.py +5 -5
- payi/types/__init__.py +8 -6
- payi/types/billing_model.py +1 -1
- payi/types/billing_model_create_params.py +1 -1
- payi/types/billing_model_update_params.py +1 -1
- payi/types/category_resource_response.py +4 -0
- payi/types/experiences/__init__.py +0 -2
- payi/types/experiences/property_create_params.py +2 -2
- payi/types/ingest_event_param.py +29 -5
- payi/types/ingest_response.py +7 -7
- payi/types/ingest_units_params.py +28 -4
- payi/types/{budget_create_params.py → limit_create_params.py} +7 -9
- payi/types/limit_history_response.py +34 -0
- payi/types/{budget_list_params.py → limit_list_params.py} +3 -3
- payi/types/limit_reset_params.py +16 -0
- payi/types/{budget_response.py → limit_response.py} +11 -13
- payi/types/{budget_update_params.py → limit_update_params.py} +3 -3
- payi/types/{budgets → limits}/__init__.py +1 -1
- payi/types/{budgets/budget_tags.py → limits/limit_tags.py} +2 -2
- payi/types/{budgets → limits}/tag_create_params.py +1 -1
- payi/types/{budgets → limits}/tag_create_response.py +2 -2
- payi/types/{budgets → limits}/tag_delete_response.py +2 -2
- payi/types/{budgets → limits}/tag_list_response.py +2 -2
- payi/types/{budgets → limits}/tag_remove_params.py +1 -1
- payi/types/{budgets → limits}/tag_remove_response.py +2 -2
- payi/types/{budgets → limits}/tag_update_params.py +1 -1
- payi/types/{budgets → limits}/tag_update_response.py +2 -2
- payi/types/{paged_budget_list.py → paged_limit_list.py} +9 -11
- payi/types/requests/property_create_params.py +2 -2
- payi/types/shared/__init__.py +3 -0
- payi/types/{experiences/csat_response.py → shared/evaluation_response.py} +3 -2
- {payi-0.1.0a33.dist-info → payi-0.1.0a35.dist-info}/METADATA +22 -23
- {payi-0.1.0a33.dist-info → payi-0.1.0a35.dist-info}/RECORD +49 -49
- {payi-0.1.0a33.dist-info → payi-0.1.0a35.dist-info}/licenses/LICENSE +1 -1
- payi/resources/experiences/csat.py +0 -188
- payi/types/budget_history_response.py +0 -38
- payi/types/experiences/csat_create_params.py +0 -14
- {payi-0.1.0a33.dist-info → payi-0.1.0a35.dist-info}/WHEEL +0 -0
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List, Optional
|
|
5
|
+
from typing import List, Union, Optional
|
|
6
|
+
from datetime import datetime
|
|
6
7
|
from typing_extensions import Literal
|
|
7
8
|
|
|
8
9
|
import httpx
|
|
@@ -15,7 +16,7 @@ from .tags import (
|
|
|
15
16
|
TagsResourceWithStreamingResponse,
|
|
16
17
|
AsyncTagsResourceWithStreamingResponse,
|
|
17
18
|
)
|
|
18
|
-
from ...types import
|
|
19
|
+
from ...types import limit_list_params, limit_reset_params, limit_create_params, limit_update_params
|
|
19
20
|
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
20
21
|
from ..._utils import (
|
|
21
22
|
maybe_transform,
|
|
@@ -30,49 +31,48 @@ from ..._response import (
|
|
|
30
31
|
async_to_streamed_response_wrapper,
|
|
31
32
|
)
|
|
32
33
|
from ..._base_client import make_request_options
|
|
33
|
-
from ...types.
|
|
34
|
+
from ...types.limit_response import LimitResponse
|
|
34
35
|
from ...types.default_response import DefaultResponse
|
|
35
|
-
from ...types.
|
|
36
|
-
from ...types.
|
|
36
|
+
from ...types.paged_limit_list import PagedLimitList
|
|
37
|
+
from ...types.limit_history_response import LimitHistoryResponse
|
|
37
38
|
|
|
38
|
-
__all__ = ["
|
|
39
|
+
__all__ = ["LimitsResource", "AsyncLimitsResource"]
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
class
|
|
42
|
+
class LimitsResource(SyncAPIResource):
|
|
42
43
|
@cached_property
|
|
43
44
|
def tags(self) -> TagsResource:
|
|
44
45
|
return TagsResource(self._client)
|
|
45
46
|
|
|
46
47
|
@cached_property
|
|
47
|
-
def with_raw_response(self) ->
|
|
48
|
+
def with_raw_response(self) -> LimitsResourceWithRawResponse:
|
|
48
49
|
"""
|
|
49
50
|
This property can be used as a prefix for any HTTP method call to return the
|
|
50
51
|
the raw response object instead of the parsed content.
|
|
51
52
|
|
|
52
53
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
53
54
|
"""
|
|
54
|
-
return
|
|
55
|
+
return LimitsResourceWithRawResponse(self)
|
|
55
56
|
|
|
56
57
|
@cached_property
|
|
57
|
-
def with_streaming_response(self) ->
|
|
58
|
+
def with_streaming_response(self) -> LimitsResourceWithStreamingResponse:
|
|
58
59
|
"""
|
|
59
60
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
60
61
|
|
|
61
62
|
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
62
63
|
"""
|
|
63
|
-
return
|
|
64
|
+
return LimitsResourceWithStreamingResponse(self)
|
|
64
65
|
|
|
65
66
|
def create(
|
|
66
67
|
self,
|
|
67
68
|
*,
|
|
68
|
-
|
|
69
|
+
limit_name: str,
|
|
69
70
|
max: float,
|
|
70
|
-
base_cost_estimate: Literal["max"] | NotGiven = NOT_GIVEN,
|
|
71
71
|
billing_model_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
72
|
-
budget_response_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
73
|
-
budget_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
74
72
|
cost_basis: Literal["base", "billed"] | NotGiven = NOT_GIVEN,
|
|
75
73
|
currency: Literal["usd"] | NotGiven = NOT_GIVEN,
|
|
74
|
+
limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
75
|
+
limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
76
76
|
threshold: Optional[float] | NotGiven = NOT_GIVEN,
|
|
77
77
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
78
78
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -80,47 +80,43 @@ class BudgetsResource(SyncAPIResource):
|
|
|
80
80
|
extra_query: Query | None = None,
|
|
81
81
|
extra_body: Body | None = None,
|
|
82
82
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
83
|
-
) ->
|
|
83
|
+
) -> LimitResponse:
|
|
84
84
|
"""
|
|
85
|
-
Create a
|
|
85
|
+
Create a Limit
|
|
86
86
|
|
|
87
87
|
Args:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
|
|
96
|
-
extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
|
|
97
|
-
timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
|
|
88
|
+
extra_headers: Send extra headers
|
|
89
|
+
|
|
90
|
+
extra_query: Add additional query parameters to the request
|
|
91
|
+
|
|
92
|
+
extra_body: Add additional JSON properties to the request
|
|
93
|
+
|
|
94
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
98
95
|
"""
|
|
99
96
|
return self._post(
|
|
100
|
-
"/api/v1/
|
|
97
|
+
"/api/v1/limits",
|
|
101
98
|
body=maybe_transform(
|
|
102
99
|
{
|
|
103
|
-
"
|
|
100
|
+
"limit_name": limit_name,
|
|
104
101
|
"max": max,
|
|
105
|
-
"base_cost_estimate": base_cost_estimate,
|
|
106
102
|
"billing_model_id": billing_model_id,
|
|
107
|
-
"budget_response_type": budget_response_type,
|
|
108
|
-
"budget_tags": budget_tags,
|
|
109
103
|
"cost_basis": cost_basis,
|
|
110
104
|
"currency": currency,
|
|
105
|
+
"limit_tags": limit_tags,
|
|
106
|
+
"limit_type": limit_type,
|
|
111
107
|
"threshold": threshold,
|
|
112
108
|
},
|
|
113
|
-
|
|
109
|
+
limit_create_params.LimitCreateParams,
|
|
114
110
|
),
|
|
115
111
|
options=make_request_options(
|
|
116
112
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
117
113
|
),
|
|
118
|
-
cast_to=
|
|
114
|
+
cast_to=LimitResponse,
|
|
119
115
|
)
|
|
120
116
|
|
|
121
117
|
def retrieve(
|
|
122
118
|
self,
|
|
123
|
-
|
|
119
|
+
limit_id: str,
|
|
124
120
|
*,
|
|
125
121
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
126
122
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -128,32 +124,34 @@ class BudgetsResource(SyncAPIResource):
|
|
|
128
124
|
extra_query: Query | None = None,
|
|
129
125
|
extra_body: Body | None = None,
|
|
130
126
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
131
|
-
) ->
|
|
127
|
+
) -> LimitResponse:
|
|
132
128
|
"""
|
|
133
|
-
Get
|
|
129
|
+
Get Limit details
|
|
134
130
|
|
|
135
131
|
Args:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
extra_query
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
132
|
+
extra_headers: Send extra headers
|
|
133
|
+
|
|
134
|
+
extra_query: Add additional query parameters to the request
|
|
135
|
+
|
|
136
|
+
extra_body: Add additional JSON properties to the request
|
|
137
|
+
|
|
138
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
139
|
+
"""
|
|
140
|
+
if not limit_id:
|
|
141
|
+
raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
|
|
144
142
|
return self._get(
|
|
145
|
-
f"/api/v1/
|
|
143
|
+
f"/api/v1/limits/{limit_id}",
|
|
146
144
|
options=make_request_options(
|
|
147
145
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
148
146
|
),
|
|
149
|
-
cast_to=
|
|
147
|
+
cast_to=LimitResponse,
|
|
150
148
|
)
|
|
151
149
|
|
|
152
150
|
def update(
|
|
153
151
|
self,
|
|
154
|
-
|
|
152
|
+
limit_id: str,
|
|
155
153
|
*,
|
|
156
|
-
|
|
154
|
+
limit_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
157
155
|
max: Optional[float] | NotGiven = NOT_GIVEN,
|
|
158
156
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
159
157
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -161,40 +159,40 @@ class BudgetsResource(SyncAPIResource):
|
|
|
161
159
|
extra_query: Query | None = None,
|
|
162
160
|
extra_body: Body | None = None,
|
|
163
161
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
164
|
-
) ->
|
|
162
|
+
) -> LimitResponse:
|
|
165
163
|
"""
|
|
166
|
-
Update a
|
|
164
|
+
Update a Limit
|
|
167
165
|
|
|
168
166
|
Args:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
timeout
|
|
176
|
-
"""
|
|
177
|
-
if not
|
|
178
|
-
raise ValueError(f"Expected a non-empty value for `
|
|
167
|
+
extra_headers: Send extra headers
|
|
168
|
+
|
|
169
|
+
extra_query: Add additional query parameters to the request
|
|
170
|
+
|
|
171
|
+
extra_body: Add additional JSON properties to the request
|
|
172
|
+
|
|
173
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
174
|
+
"""
|
|
175
|
+
if not limit_id:
|
|
176
|
+
raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
|
|
179
177
|
return self._put(
|
|
180
|
-
f"/api/v1/
|
|
178
|
+
f"/api/v1/limits/{limit_id}",
|
|
181
179
|
body=maybe_transform(
|
|
182
180
|
{
|
|
183
|
-
"
|
|
181
|
+
"limit_name": limit_name,
|
|
184
182
|
"max": max,
|
|
185
183
|
},
|
|
186
|
-
|
|
184
|
+
limit_update_params.LimitUpdateParams,
|
|
187
185
|
),
|
|
188
186
|
options=make_request_options(
|
|
189
187
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
190
188
|
),
|
|
191
|
-
cast_to=
|
|
189
|
+
cast_to=LimitResponse,
|
|
192
190
|
)
|
|
193
191
|
|
|
194
192
|
def list(
|
|
195
193
|
self,
|
|
196
194
|
*,
|
|
197
|
-
|
|
195
|
+
limit_name: str | NotGiven = NOT_GIVEN,
|
|
198
196
|
page_number: int | NotGiven = NOT_GIVEN,
|
|
199
197
|
page_size: int | NotGiven = NOT_GIVEN,
|
|
200
198
|
sort_ascending: bool | NotGiven = NOT_GIVEN,
|
|
@@ -206,18 +204,21 @@ class BudgetsResource(SyncAPIResource):
|
|
|
206
204
|
extra_query: Query | None = None,
|
|
207
205
|
extra_body: Body | None = None,
|
|
208
206
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
209
|
-
) ->
|
|
207
|
+
) -> PagedLimitList:
|
|
210
208
|
"""
|
|
211
|
-
Get all
|
|
209
|
+
Get all Limits
|
|
212
210
|
|
|
213
211
|
Args:
|
|
214
|
-
extra_headers
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
extra_headers: Send extra headers
|
|
213
|
+
|
|
214
|
+
extra_query: Add additional query parameters to the request
|
|
215
|
+
|
|
216
|
+
extra_body: Add additional JSON properties to the request
|
|
217
|
+
|
|
218
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
218
219
|
"""
|
|
219
220
|
return self._get(
|
|
220
|
-
"/api/v1/
|
|
221
|
+
"/api/v1/limits",
|
|
221
222
|
options=make_request_options(
|
|
222
223
|
extra_headers=extra_headers,
|
|
223
224
|
extra_query=extra_query,
|
|
@@ -225,22 +226,22 @@ class BudgetsResource(SyncAPIResource):
|
|
|
225
226
|
timeout=timeout,
|
|
226
227
|
query=maybe_transform(
|
|
227
228
|
{
|
|
228
|
-
"
|
|
229
|
+
"limit_name": limit_name,
|
|
229
230
|
"page_number": page_number,
|
|
230
231
|
"page_size": page_size,
|
|
231
232
|
"sort_ascending": sort_ascending,
|
|
232
233
|
"sort_by": sort_by,
|
|
233
234
|
"tags": tags,
|
|
234
235
|
},
|
|
235
|
-
|
|
236
|
+
limit_list_params.LimitListParams,
|
|
236
237
|
),
|
|
237
238
|
),
|
|
238
|
-
cast_to=
|
|
239
|
+
cast_to=PagedLimitList,
|
|
239
240
|
)
|
|
240
241
|
|
|
241
242
|
def delete(
|
|
242
243
|
self,
|
|
243
|
-
|
|
244
|
+
limit_id: str,
|
|
244
245
|
*,
|
|
245
246
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
246
247
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -250,19 +251,21 @@ class BudgetsResource(SyncAPIResource):
|
|
|
250
251
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
251
252
|
) -> DefaultResponse:
|
|
252
253
|
"""
|
|
253
|
-
Delete a
|
|
254
|
+
Delete a Limit
|
|
254
255
|
|
|
255
256
|
Args:
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
extra_query
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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
|
+
if not limit_id:
|
|
266
|
+
raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
|
|
264
267
|
return self._delete(
|
|
265
|
-
f"/api/v1/
|
|
268
|
+
f"/api/v1/limits/{limit_id}",
|
|
266
269
|
options=make_request_options(
|
|
267
270
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
268
271
|
),
|
|
@@ -271,71 +274,79 @@ class BudgetsResource(SyncAPIResource):
|
|
|
271
274
|
|
|
272
275
|
def reset(
|
|
273
276
|
self,
|
|
274
|
-
|
|
277
|
+
limit_id: str,
|
|
275
278
|
*,
|
|
279
|
+
reset_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
276
280
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
277
281
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
278
282
|
extra_headers: Headers | None = None,
|
|
279
283
|
extra_query: Query | None = None,
|
|
280
284
|
extra_body: Body | None = None,
|
|
281
285
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
282
|
-
) ->
|
|
286
|
+
) -> LimitHistoryResponse:
|
|
283
287
|
"""
|
|
284
|
-
Reset a
|
|
288
|
+
Reset a Limit
|
|
285
289
|
|
|
286
290
|
Args:
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
reset_date: Effective reset date
|
|
292
|
+
|
|
293
|
+
extra_headers: Send extra headers
|
|
294
|
+
|
|
295
|
+
extra_query: Add additional query parameters to the request
|
|
296
|
+
|
|
297
|
+
extra_body: Add additional JSON properties to the request
|
|
298
|
+
|
|
299
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
300
|
+
"""
|
|
301
|
+
if not limit_id:
|
|
302
|
+
raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
|
|
295
303
|
return self._post(
|
|
296
|
-
f"/api/v1/
|
|
304
|
+
f"/api/v1/limits/{limit_id}/reset",
|
|
297
305
|
options=make_request_options(
|
|
298
|
-
extra_headers=extra_headers,
|
|
306
|
+
extra_headers=extra_headers,
|
|
307
|
+
extra_query=extra_query,
|
|
308
|
+
extra_body=extra_body,
|
|
309
|
+
timeout=timeout,
|
|
310
|
+
query=maybe_transform({"reset_date": reset_date}, limit_reset_params.LimitResetParams),
|
|
299
311
|
),
|
|
300
|
-
cast_to=
|
|
312
|
+
cast_to=LimitHistoryResponse,
|
|
301
313
|
)
|
|
302
314
|
|
|
303
315
|
|
|
304
|
-
class
|
|
316
|
+
class AsyncLimitsResource(AsyncAPIResource):
|
|
305
317
|
@cached_property
|
|
306
318
|
def tags(self) -> AsyncTagsResource:
|
|
307
319
|
return AsyncTagsResource(self._client)
|
|
308
320
|
|
|
309
321
|
@cached_property
|
|
310
|
-
def with_raw_response(self) ->
|
|
322
|
+
def with_raw_response(self) -> AsyncLimitsResourceWithRawResponse:
|
|
311
323
|
"""
|
|
312
324
|
This property can be used as a prefix for any HTTP method call to return the
|
|
313
325
|
the raw response object instead of the parsed content.
|
|
314
326
|
|
|
315
327
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
316
328
|
"""
|
|
317
|
-
return
|
|
329
|
+
return AsyncLimitsResourceWithRawResponse(self)
|
|
318
330
|
|
|
319
331
|
@cached_property
|
|
320
|
-
def with_streaming_response(self) ->
|
|
332
|
+
def with_streaming_response(self) -> AsyncLimitsResourceWithStreamingResponse:
|
|
321
333
|
"""
|
|
322
334
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
323
335
|
|
|
324
336
|
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
325
337
|
"""
|
|
326
|
-
return
|
|
338
|
+
return AsyncLimitsResourceWithStreamingResponse(self)
|
|
327
339
|
|
|
328
340
|
async def create(
|
|
329
341
|
self,
|
|
330
342
|
*,
|
|
331
|
-
|
|
343
|
+
limit_name: str,
|
|
332
344
|
max: float,
|
|
333
|
-
base_cost_estimate: Literal["max"] | NotGiven = NOT_GIVEN,
|
|
334
345
|
billing_model_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
335
|
-
budget_response_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
336
|
-
budget_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
337
346
|
cost_basis: Literal["base", "billed"] | NotGiven = NOT_GIVEN,
|
|
338
347
|
currency: Literal["usd"] | NotGiven = NOT_GIVEN,
|
|
348
|
+
limit_tags: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
349
|
+
limit_type: Literal["block", "allow"] | NotGiven = NOT_GIVEN,
|
|
339
350
|
threshold: Optional[float] | NotGiven = NOT_GIVEN,
|
|
340
351
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
341
352
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -343,9 +354,9 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
343
354
|
extra_query: Query | None = None,
|
|
344
355
|
extra_body: Body | None = None,
|
|
345
356
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
346
|
-
) ->
|
|
357
|
+
) -> LimitResponse:
|
|
347
358
|
"""
|
|
348
|
-
Create a
|
|
359
|
+
Create a Limit
|
|
349
360
|
|
|
350
361
|
Args:
|
|
351
362
|
extra_headers: Send extra headers
|
|
@@ -357,30 +368,29 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
357
368
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
358
369
|
"""
|
|
359
370
|
return await self._post(
|
|
360
|
-
"/api/v1/
|
|
371
|
+
"/api/v1/limits",
|
|
361
372
|
body=await async_maybe_transform(
|
|
362
373
|
{
|
|
363
|
-
"
|
|
374
|
+
"limit_name": limit_name,
|
|
364
375
|
"max": max,
|
|
365
|
-
"base_cost_estimate": base_cost_estimate,
|
|
366
376
|
"billing_model_id": billing_model_id,
|
|
367
|
-
"budget_response_type": budget_response_type,
|
|
368
|
-
"budget_tags": budget_tags,
|
|
369
377
|
"cost_basis": cost_basis,
|
|
370
378
|
"currency": currency,
|
|
379
|
+
"limit_tags": limit_tags,
|
|
380
|
+
"limit_type": limit_type,
|
|
371
381
|
"threshold": threshold,
|
|
372
382
|
},
|
|
373
|
-
|
|
383
|
+
limit_create_params.LimitCreateParams,
|
|
374
384
|
),
|
|
375
385
|
options=make_request_options(
|
|
376
386
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
377
387
|
),
|
|
378
|
-
cast_to=
|
|
388
|
+
cast_to=LimitResponse,
|
|
379
389
|
)
|
|
380
390
|
|
|
381
391
|
async def retrieve(
|
|
382
392
|
self,
|
|
383
|
-
|
|
393
|
+
limit_id: str,
|
|
384
394
|
*,
|
|
385
395
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
386
396
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -388,9 +398,9 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
388
398
|
extra_query: Query | None = None,
|
|
389
399
|
extra_body: Body | None = None,
|
|
390
400
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
391
|
-
) ->
|
|
401
|
+
) -> LimitResponse:
|
|
392
402
|
"""
|
|
393
|
-
Get
|
|
403
|
+
Get Limit details
|
|
394
404
|
|
|
395
405
|
Args:
|
|
396
406
|
extra_headers: Send extra headers
|
|
@@ -401,21 +411,21 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
401
411
|
|
|
402
412
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
403
413
|
"""
|
|
404
|
-
if not
|
|
405
|
-
raise ValueError(f"Expected a non-empty value for `
|
|
414
|
+
if not limit_id:
|
|
415
|
+
raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
|
|
406
416
|
return await self._get(
|
|
407
|
-
f"/api/v1/
|
|
417
|
+
f"/api/v1/limits/{limit_id}",
|
|
408
418
|
options=make_request_options(
|
|
409
419
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
410
420
|
),
|
|
411
|
-
cast_to=
|
|
421
|
+
cast_to=LimitResponse,
|
|
412
422
|
)
|
|
413
423
|
|
|
414
424
|
async def update(
|
|
415
425
|
self,
|
|
416
|
-
|
|
426
|
+
limit_id: str,
|
|
417
427
|
*,
|
|
418
|
-
|
|
428
|
+
limit_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
419
429
|
max: Optional[float] | NotGiven = NOT_GIVEN,
|
|
420
430
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
421
431
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -423,9 +433,9 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
423
433
|
extra_query: Query | None = None,
|
|
424
434
|
extra_body: Body | None = None,
|
|
425
435
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
426
|
-
) ->
|
|
436
|
+
) -> LimitResponse:
|
|
427
437
|
"""
|
|
428
|
-
Update a
|
|
438
|
+
Update a Limit
|
|
429
439
|
|
|
430
440
|
Args:
|
|
431
441
|
extra_headers: Send extra headers
|
|
@@ -436,27 +446,27 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
436
446
|
|
|
437
447
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
438
448
|
"""
|
|
439
|
-
if not
|
|
440
|
-
raise ValueError(f"Expected a non-empty value for `
|
|
449
|
+
if not limit_id:
|
|
450
|
+
raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
|
|
441
451
|
return await self._put(
|
|
442
|
-
f"/api/v1/
|
|
452
|
+
f"/api/v1/limits/{limit_id}",
|
|
443
453
|
body=await async_maybe_transform(
|
|
444
454
|
{
|
|
445
|
-
"
|
|
455
|
+
"limit_name": limit_name,
|
|
446
456
|
"max": max,
|
|
447
457
|
},
|
|
448
|
-
|
|
458
|
+
limit_update_params.LimitUpdateParams,
|
|
449
459
|
),
|
|
450
460
|
options=make_request_options(
|
|
451
461
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
452
462
|
),
|
|
453
|
-
cast_to=
|
|
463
|
+
cast_to=LimitResponse,
|
|
454
464
|
)
|
|
455
465
|
|
|
456
466
|
async def list(
|
|
457
467
|
self,
|
|
458
468
|
*,
|
|
459
|
-
|
|
469
|
+
limit_name: str | NotGiven = NOT_GIVEN,
|
|
460
470
|
page_number: int | NotGiven = NOT_GIVEN,
|
|
461
471
|
page_size: int | NotGiven = NOT_GIVEN,
|
|
462
472
|
sort_ascending: bool | NotGiven = NOT_GIVEN,
|
|
@@ -468,9 +478,9 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
468
478
|
extra_query: Query | None = None,
|
|
469
479
|
extra_body: Body | None = None,
|
|
470
480
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
471
|
-
) ->
|
|
481
|
+
) -> PagedLimitList:
|
|
472
482
|
"""
|
|
473
|
-
Get all
|
|
483
|
+
Get all Limits
|
|
474
484
|
|
|
475
485
|
Args:
|
|
476
486
|
extra_headers: Send extra headers
|
|
@@ -482,7 +492,7 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
482
492
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
483
493
|
"""
|
|
484
494
|
return await self._get(
|
|
485
|
-
"/api/v1/
|
|
495
|
+
"/api/v1/limits",
|
|
486
496
|
options=make_request_options(
|
|
487
497
|
extra_headers=extra_headers,
|
|
488
498
|
extra_query=extra_query,
|
|
@@ -490,22 +500,22 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
490
500
|
timeout=timeout,
|
|
491
501
|
query=await async_maybe_transform(
|
|
492
502
|
{
|
|
493
|
-
"
|
|
503
|
+
"limit_name": limit_name,
|
|
494
504
|
"page_number": page_number,
|
|
495
505
|
"page_size": page_size,
|
|
496
506
|
"sort_ascending": sort_ascending,
|
|
497
507
|
"sort_by": sort_by,
|
|
498
508
|
"tags": tags,
|
|
499
509
|
},
|
|
500
|
-
|
|
510
|
+
limit_list_params.LimitListParams,
|
|
501
511
|
),
|
|
502
512
|
),
|
|
503
|
-
cast_to=
|
|
513
|
+
cast_to=PagedLimitList,
|
|
504
514
|
)
|
|
505
515
|
|
|
506
516
|
async def delete(
|
|
507
517
|
self,
|
|
508
|
-
|
|
518
|
+
limit_id: str,
|
|
509
519
|
*,
|
|
510
520
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
511
521
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -515,7 +525,7 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
515
525
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
516
526
|
) -> DefaultResponse:
|
|
517
527
|
"""
|
|
518
|
-
Delete a
|
|
528
|
+
Delete a Limit
|
|
519
529
|
|
|
520
530
|
Args:
|
|
521
531
|
extra_headers: Send extra headers
|
|
@@ -526,10 +536,10 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
526
536
|
|
|
527
537
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
528
538
|
"""
|
|
529
|
-
if not
|
|
530
|
-
raise ValueError(f"Expected a non-empty value for `
|
|
539
|
+
if not limit_id:
|
|
540
|
+
raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
|
|
531
541
|
return await self._delete(
|
|
532
|
-
f"/api/v1/
|
|
542
|
+
f"/api/v1/limits/{limit_id}",
|
|
533
543
|
options=make_request_options(
|
|
534
544
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
535
545
|
),
|
|
@@ -538,19 +548,22 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
538
548
|
|
|
539
549
|
async def reset(
|
|
540
550
|
self,
|
|
541
|
-
|
|
551
|
+
limit_id: str,
|
|
542
552
|
*,
|
|
553
|
+
reset_date: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
543
554
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
544
555
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
545
556
|
extra_headers: Headers | None = None,
|
|
546
557
|
extra_query: Query | None = None,
|
|
547
558
|
extra_body: Body | None = None,
|
|
548
559
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
549
|
-
) ->
|
|
560
|
+
) -> LimitHistoryResponse:
|
|
550
561
|
"""
|
|
551
|
-
Reset a
|
|
562
|
+
Reset a Limit
|
|
552
563
|
|
|
553
564
|
Args:
|
|
565
|
+
reset_date: Effective reset date
|
|
566
|
+
|
|
554
567
|
extra_headers: Send extra headers
|
|
555
568
|
|
|
556
569
|
extra_query: Add additional query parameters to the request
|
|
@@ -559,124 +572,128 @@ class AsyncBudgetsResource(AsyncAPIResource):
|
|
|
559
572
|
|
|
560
573
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
561
574
|
"""
|
|
562
|
-
if not
|
|
563
|
-
raise ValueError(f"Expected a non-empty value for `
|
|
575
|
+
if not limit_id:
|
|
576
|
+
raise ValueError(f"Expected a non-empty value for `limit_id` but received {limit_id!r}")
|
|
564
577
|
return await self._post(
|
|
565
|
-
f"/api/v1/
|
|
578
|
+
f"/api/v1/limits/{limit_id}/reset",
|
|
566
579
|
options=make_request_options(
|
|
567
|
-
extra_headers=extra_headers,
|
|
580
|
+
extra_headers=extra_headers,
|
|
581
|
+
extra_query=extra_query,
|
|
582
|
+
extra_body=extra_body,
|
|
583
|
+
timeout=timeout,
|
|
584
|
+
query=await async_maybe_transform({"reset_date": reset_date}, limit_reset_params.LimitResetParams),
|
|
568
585
|
),
|
|
569
|
-
cast_to=
|
|
586
|
+
cast_to=LimitHistoryResponse,
|
|
570
587
|
)
|
|
571
588
|
|
|
572
589
|
|
|
573
|
-
class
|
|
574
|
-
def __init__(self,
|
|
575
|
-
self.
|
|
590
|
+
class LimitsResourceWithRawResponse:
|
|
591
|
+
def __init__(self, limits: LimitsResource) -> None:
|
|
592
|
+
self._limits = limits
|
|
576
593
|
|
|
577
594
|
self.create = to_raw_response_wrapper(
|
|
578
|
-
|
|
595
|
+
limits.create,
|
|
579
596
|
)
|
|
580
597
|
self.retrieve = to_raw_response_wrapper(
|
|
581
|
-
|
|
598
|
+
limits.retrieve,
|
|
582
599
|
)
|
|
583
600
|
self.update = to_raw_response_wrapper(
|
|
584
|
-
|
|
601
|
+
limits.update,
|
|
585
602
|
)
|
|
586
603
|
self.list = to_raw_response_wrapper(
|
|
587
|
-
|
|
604
|
+
limits.list,
|
|
588
605
|
)
|
|
589
606
|
self.delete = to_raw_response_wrapper(
|
|
590
|
-
|
|
607
|
+
limits.delete,
|
|
591
608
|
)
|
|
592
609
|
self.reset = to_raw_response_wrapper(
|
|
593
|
-
|
|
610
|
+
limits.reset,
|
|
594
611
|
)
|
|
595
612
|
|
|
596
613
|
@cached_property
|
|
597
614
|
def tags(self) -> TagsResourceWithRawResponse:
|
|
598
|
-
return TagsResourceWithRawResponse(self.
|
|
615
|
+
return TagsResourceWithRawResponse(self._limits.tags)
|
|
599
616
|
|
|
600
617
|
|
|
601
|
-
class
|
|
602
|
-
def __init__(self,
|
|
603
|
-
self.
|
|
618
|
+
class AsyncLimitsResourceWithRawResponse:
|
|
619
|
+
def __init__(self, limits: AsyncLimitsResource) -> None:
|
|
620
|
+
self._limits = limits
|
|
604
621
|
|
|
605
622
|
self.create = async_to_raw_response_wrapper(
|
|
606
|
-
|
|
623
|
+
limits.create,
|
|
607
624
|
)
|
|
608
625
|
self.retrieve = async_to_raw_response_wrapper(
|
|
609
|
-
|
|
626
|
+
limits.retrieve,
|
|
610
627
|
)
|
|
611
628
|
self.update = async_to_raw_response_wrapper(
|
|
612
|
-
|
|
629
|
+
limits.update,
|
|
613
630
|
)
|
|
614
631
|
self.list = async_to_raw_response_wrapper(
|
|
615
|
-
|
|
632
|
+
limits.list,
|
|
616
633
|
)
|
|
617
634
|
self.delete = async_to_raw_response_wrapper(
|
|
618
|
-
|
|
635
|
+
limits.delete,
|
|
619
636
|
)
|
|
620
637
|
self.reset = async_to_raw_response_wrapper(
|
|
621
|
-
|
|
638
|
+
limits.reset,
|
|
622
639
|
)
|
|
623
640
|
|
|
624
641
|
@cached_property
|
|
625
642
|
def tags(self) -> AsyncTagsResourceWithRawResponse:
|
|
626
|
-
return AsyncTagsResourceWithRawResponse(self.
|
|
643
|
+
return AsyncTagsResourceWithRawResponse(self._limits.tags)
|
|
627
644
|
|
|
628
645
|
|
|
629
|
-
class
|
|
630
|
-
def __init__(self,
|
|
631
|
-
self.
|
|
646
|
+
class LimitsResourceWithStreamingResponse:
|
|
647
|
+
def __init__(self, limits: LimitsResource) -> None:
|
|
648
|
+
self._limits = limits
|
|
632
649
|
|
|
633
650
|
self.create = to_streamed_response_wrapper(
|
|
634
|
-
|
|
651
|
+
limits.create,
|
|
635
652
|
)
|
|
636
653
|
self.retrieve = to_streamed_response_wrapper(
|
|
637
|
-
|
|
654
|
+
limits.retrieve,
|
|
638
655
|
)
|
|
639
656
|
self.update = to_streamed_response_wrapper(
|
|
640
|
-
|
|
657
|
+
limits.update,
|
|
641
658
|
)
|
|
642
659
|
self.list = to_streamed_response_wrapper(
|
|
643
|
-
|
|
660
|
+
limits.list,
|
|
644
661
|
)
|
|
645
662
|
self.delete = to_streamed_response_wrapper(
|
|
646
|
-
|
|
663
|
+
limits.delete,
|
|
647
664
|
)
|
|
648
665
|
self.reset = to_streamed_response_wrapper(
|
|
649
|
-
|
|
666
|
+
limits.reset,
|
|
650
667
|
)
|
|
651
668
|
|
|
652
669
|
@cached_property
|
|
653
670
|
def tags(self) -> TagsResourceWithStreamingResponse:
|
|
654
|
-
return TagsResourceWithStreamingResponse(self.
|
|
671
|
+
return TagsResourceWithStreamingResponse(self._limits.tags)
|
|
655
672
|
|
|
656
673
|
|
|
657
|
-
class
|
|
658
|
-
def __init__(self,
|
|
659
|
-
self.
|
|
674
|
+
class AsyncLimitsResourceWithStreamingResponse:
|
|
675
|
+
def __init__(self, limits: AsyncLimitsResource) -> None:
|
|
676
|
+
self._limits = limits
|
|
660
677
|
|
|
661
678
|
self.create = async_to_streamed_response_wrapper(
|
|
662
|
-
|
|
679
|
+
limits.create,
|
|
663
680
|
)
|
|
664
681
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
665
|
-
|
|
682
|
+
limits.retrieve,
|
|
666
683
|
)
|
|
667
684
|
self.update = async_to_streamed_response_wrapper(
|
|
668
|
-
|
|
685
|
+
limits.update,
|
|
669
686
|
)
|
|
670
687
|
self.list = async_to_streamed_response_wrapper(
|
|
671
|
-
|
|
688
|
+
limits.list,
|
|
672
689
|
)
|
|
673
690
|
self.delete = async_to_streamed_response_wrapper(
|
|
674
|
-
|
|
691
|
+
limits.delete,
|
|
675
692
|
)
|
|
676
693
|
self.reset = async_to_streamed_response_wrapper(
|
|
677
|
-
|
|
694
|
+
limits.reset,
|
|
678
695
|
)
|
|
679
696
|
|
|
680
697
|
@cached_property
|
|
681
698
|
def tags(self) -> AsyncTagsResourceWithStreamingResponse:
|
|
682
|
-
return AsyncTagsResourceWithStreamingResponse(self.
|
|
699
|
+
return AsyncTagsResourceWithStreamingResponse(self._limits.tags)
|