payi 0.1.0a53__py3-none-any.whl → 0.1.0a56__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 +1 -96
- payi/_client.py +10 -17
- payi/_models.py +5 -2
- payi/_version.py +1 -1
- payi/lib/helpers.py +12 -1
- payi/resources/__init__.py +14 -28
- payi/resources/categories/resources.py +7 -7
- payi/resources/experiences/types/types.py +5 -2
- payi/resources/ingest.py +58 -6
- payi/resources/limits/limits.py +4 -0
- payi/resources/limits/tags.py +12 -0
- payi/resources/requests/properties.py +1 -1
- payi/resources/use_cases/__init__.py +47 -0
- payi/resources/use_cases/properties.py +174 -0
- payi/resources/use_cases/types/__init__.py +33 -0
- payi/resources/use_cases/types/limit_config.py +275 -0
- payi/resources/{billing_models.py → use_cases/types/types.py} +225 -161
- payi/resources/{price_modifiers.py → use_cases/use_cases.py} +160 -130
- payi/types/__init__.py +6 -9
- payi/types/categories/resource_create_params.py +6 -6
- payi/types/category_resource_response.py +2 -2
- payi/types/experience_instance_response.py +2 -0
- payi/types/experiences/__init__.py +0 -1
- payi/types/experiences/experience_type.py +8 -14
- payi/types/experiences/type_create_params.py +8 -14
- payi/types/ingest_event_param.py +10 -0
- payi/types/ingest_response.py +2 -0
- payi/types/ingest_units_params.py +9 -1
- payi/types/limit_list_params.py +6 -1
- payi/types/limits/tag_create_params.py +1 -0
- payi/types/limits/tag_remove_params.py +1 -0
- payi/types/limits/tag_update_params.py +1 -0
- payi/types/requests/request_result.py +2 -0
- payi/types/shared/__init__.py +4 -0
- payi/types/shared/pay_i_common_models_budget_management_create_limit_base.py +18 -0
- payi/types/shared_params/__init__.py +5 -0
- payi/types/shared_params/pay_i_common_models_budget_management_create_limit_base.py +18 -0
- payi/types/use_case_instance_response.py +15 -0
- payi/types/use_cases/__init__.py +10 -0
- payi/types/use_cases/property_create_params.py +12 -0
- payi/types/use_cases/type_create_params.py +22 -0
- payi/types/use_cases/type_list_params.py +12 -0
- payi/types/{billing_model_list_response.py → use_cases/type_list_response.py} +3 -3
- payi/types/use_cases/type_update_params.py +14 -0
- payi/types/use_cases/types/__init__.py +5 -0
- payi/types/use_cases/types/limit_config_create_params.py +18 -0
- payi/types/use_cases/use_case_type.py +24 -0
- {payi-0.1.0a53.dist-info → payi-0.1.0a56.dist-info}/METADATA +25 -4
- {payi-0.1.0a53.dist-info → payi-0.1.0a56.dist-info}/RECORD +52 -43
- {payi-0.1.0a53.dist-info → payi-0.1.0a56.dist-info}/WHEEL +1 -1
- payi/types/billing_model.py +0 -31
- payi/types/billing_model_create_params.py +0 -22
- payi/types/billing_model_update_params.py +0 -22
- payi/types/price_modifier.py +0 -26
- payi/types/price_modifier_create_params.py +0 -17
- payi/types/price_modifier_retrieve_response.py +0 -10
- payi/types/price_modifier_update_params.py +0 -17
- /payi/types/{experiences → shared}/properties_response.py +0 -0
- {payi-0.1.0a53.dist-info → payi-0.1.0a56.dist-info}/licenses/LICENSE +0 -0
|
@@ -4,62 +4,79 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
8
|
+
from ..._compat import cached_property
|
|
9
|
+
from .properties import (
|
|
10
|
+
PropertiesResource,
|
|
11
|
+
AsyncPropertiesResource,
|
|
12
|
+
PropertiesResourceWithRawResponse,
|
|
13
|
+
AsyncPropertiesResourceWithRawResponse,
|
|
14
|
+
PropertiesResourceWithStreamingResponse,
|
|
15
|
+
AsyncPropertiesResourceWithStreamingResponse,
|
|
12
16
|
)
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from .._response import (
|
|
17
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
18
|
+
from ..._response import (
|
|
16
19
|
to_raw_response_wrapper,
|
|
17
20
|
to_streamed_response_wrapper,
|
|
18
21
|
async_to_raw_response_wrapper,
|
|
19
22
|
async_to_streamed_response_wrapper,
|
|
20
23
|
)
|
|
21
|
-
from
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
from .types.types import (
|
|
25
|
+
TypesResource,
|
|
26
|
+
AsyncTypesResource,
|
|
27
|
+
TypesResourceWithRawResponse,
|
|
28
|
+
AsyncTypesResourceWithRawResponse,
|
|
29
|
+
TypesResourceWithStreamingResponse,
|
|
30
|
+
AsyncTypesResourceWithStreamingResponse,
|
|
31
|
+
)
|
|
32
|
+
from ..._base_client import make_request_options
|
|
33
|
+
from ...types.use_case_instance_response import UseCaseInstanceResponse
|
|
34
|
+
|
|
35
|
+
__all__ = ["UseCasesResource", "AsyncUseCasesResource"]
|
|
24
36
|
|
|
25
|
-
__all__ = ["PriceModifiersResource", "AsyncPriceModifiersResource"]
|
|
26
37
|
|
|
38
|
+
class UseCasesResource(SyncAPIResource):
|
|
39
|
+
@cached_property
|
|
40
|
+
def types(self) -> TypesResource:
|
|
41
|
+
return TypesResource(self._client)
|
|
42
|
+
|
|
43
|
+
@cached_property
|
|
44
|
+
def properties(self) -> PropertiesResource:
|
|
45
|
+
return PropertiesResource(self._client)
|
|
27
46
|
|
|
28
|
-
class PriceModifiersResource(SyncAPIResource):
|
|
29
47
|
@cached_property
|
|
30
|
-
def with_raw_response(self) ->
|
|
48
|
+
def with_raw_response(self) -> UseCasesResourceWithRawResponse:
|
|
31
49
|
"""
|
|
32
50
|
This property can be used as a prefix for any HTTP method call to return
|
|
33
51
|
the raw response object instead of the parsed content.
|
|
34
52
|
|
|
35
53
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
36
54
|
"""
|
|
37
|
-
return
|
|
55
|
+
return UseCasesResourceWithRawResponse(self)
|
|
38
56
|
|
|
39
57
|
@cached_property
|
|
40
|
-
def with_streaming_response(self) ->
|
|
58
|
+
def with_streaming_response(self) -> UseCasesResourceWithStreamingResponse:
|
|
41
59
|
"""
|
|
42
60
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
43
61
|
|
|
44
62
|
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
45
63
|
"""
|
|
46
|
-
return
|
|
64
|
+
return UseCasesResourceWithStreamingResponse(self)
|
|
47
65
|
|
|
48
66
|
def create(
|
|
49
67
|
self,
|
|
68
|
+
use_case_name: str,
|
|
50
69
|
*,
|
|
51
|
-
billing_model_id: str,
|
|
52
|
-
category: str,
|
|
53
|
-
price_modifier: float,
|
|
54
|
-
resource: str,
|
|
55
70
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
56
71
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
57
72
|
extra_headers: Headers | None = None,
|
|
58
73
|
extra_query: Query | None = None,
|
|
59
74
|
extra_body: Body | None = None,
|
|
60
75
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
61
|
-
) ->
|
|
76
|
+
) -> UseCaseInstanceResponse:
|
|
62
77
|
"""
|
|
78
|
+
Create a Use Case instance
|
|
79
|
+
|
|
63
80
|
Args:
|
|
64
81
|
extra_headers: Send extra headers
|
|
65
82
|
|
|
@@ -69,26 +86,19 @@ class PriceModifiersResource(SyncAPIResource):
|
|
|
69
86
|
|
|
70
87
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
71
88
|
"""
|
|
89
|
+
if not use_case_name:
|
|
90
|
+
raise ValueError(f"Expected a non-empty value for `use_case_name` but received {use_case_name!r}")
|
|
72
91
|
return self._post(
|
|
73
|
-
"/api/v1/
|
|
74
|
-
body=maybe_transform(
|
|
75
|
-
{
|
|
76
|
-
"billing_model_id": billing_model_id,
|
|
77
|
-
"category": category,
|
|
78
|
-
"price_modifier": price_modifier,
|
|
79
|
-
"resource": resource,
|
|
80
|
-
},
|
|
81
|
-
price_modifier_create_params.PriceModifierCreateParams,
|
|
82
|
-
),
|
|
92
|
+
f"/api/v1/use_cases/instances/{use_case_name}",
|
|
83
93
|
options=make_request_options(
|
|
84
94
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
85
95
|
),
|
|
86
|
-
cast_to=
|
|
96
|
+
cast_to=UseCaseInstanceResponse,
|
|
87
97
|
)
|
|
88
98
|
|
|
89
99
|
def retrieve(
|
|
90
100
|
self,
|
|
91
|
-
|
|
101
|
+
use_case_id: str,
|
|
92
102
|
*,
|
|
93
103
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
94
104
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -96,8 +106,10 @@ class PriceModifiersResource(SyncAPIResource):
|
|
|
96
106
|
extra_query: Query | None = None,
|
|
97
107
|
extra_body: Body | None = None,
|
|
98
108
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
99
|
-
) ->
|
|
109
|
+
) -> UseCaseInstanceResponse:
|
|
100
110
|
"""
|
|
111
|
+
Get a Use Case instance details
|
|
112
|
+
|
|
101
113
|
Args:
|
|
102
114
|
extra_headers: Send extra headers
|
|
103
115
|
|
|
@@ -107,31 +119,30 @@ class PriceModifiersResource(SyncAPIResource):
|
|
|
107
119
|
|
|
108
120
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
109
121
|
"""
|
|
110
|
-
if not
|
|
111
|
-
raise ValueError(f"Expected a non-empty value for `
|
|
122
|
+
if not use_case_id:
|
|
123
|
+
raise ValueError(f"Expected a non-empty value for `use_case_id` but received {use_case_id!r}")
|
|
112
124
|
return self._get(
|
|
113
|
-
f"/api/v1/
|
|
125
|
+
f"/api/v1/use_cases/instances/{use_case_id}",
|
|
114
126
|
options=make_request_options(
|
|
115
127
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
116
128
|
),
|
|
117
|
-
cast_to=
|
|
129
|
+
cast_to=UseCaseInstanceResponse,
|
|
118
130
|
)
|
|
119
131
|
|
|
120
|
-
def
|
|
132
|
+
def delete(
|
|
121
133
|
self,
|
|
134
|
+
use_case_id: str,
|
|
122
135
|
*,
|
|
123
|
-
billing_model_id: str,
|
|
124
|
-
category: str,
|
|
125
|
-
price_modifier: float,
|
|
126
|
-
resource: str,
|
|
127
136
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
128
137
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
129
138
|
extra_headers: Headers | None = None,
|
|
130
139
|
extra_query: Query | None = None,
|
|
131
140
|
extra_body: Body | None = None,
|
|
132
141
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
133
|
-
) ->
|
|
142
|
+
) -> UseCaseInstanceResponse:
|
|
134
143
|
"""
|
|
144
|
+
Delete a Use Case instance
|
|
145
|
+
|
|
135
146
|
Args:
|
|
136
147
|
extra_headers: Send extra headers
|
|
137
148
|
|
|
@@ -141,59 +152,59 @@ class PriceModifiersResource(SyncAPIResource):
|
|
|
141
152
|
|
|
142
153
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
143
154
|
"""
|
|
144
|
-
|
|
145
|
-
"
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"billing_model_id": billing_model_id,
|
|
149
|
-
"category": category,
|
|
150
|
-
"price_modifier": price_modifier,
|
|
151
|
-
"resource": resource,
|
|
152
|
-
},
|
|
153
|
-
price_modifier_update_params.PriceModifierUpdateParams,
|
|
154
|
-
),
|
|
155
|
+
if not use_case_id:
|
|
156
|
+
raise ValueError(f"Expected a non-empty value for `use_case_id` but received {use_case_id!r}")
|
|
157
|
+
return self._delete(
|
|
158
|
+
f"/api/v1/use_cases/instances/{use_case_id}",
|
|
155
159
|
options=make_request_options(
|
|
156
160
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
157
161
|
),
|
|
158
|
-
cast_to=
|
|
162
|
+
cast_to=UseCaseInstanceResponse,
|
|
159
163
|
)
|
|
160
164
|
|
|
161
165
|
|
|
162
|
-
class
|
|
166
|
+
class AsyncUseCasesResource(AsyncAPIResource):
|
|
167
|
+
@cached_property
|
|
168
|
+
def types(self) -> AsyncTypesResource:
|
|
169
|
+
return AsyncTypesResource(self._client)
|
|
170
|
+
|
|
171
|
+
@cached_property
|
|
172
|
+
def properties(self) -> AsyncPropertiesResource:
|
|
173
|
+
return AsyncPropertiesResource(self._client)
|
|
174
|
+
|
|
163
175
|
@cached_property
|
|
164
|
-
def with_raw_response(self) ->
|
|
176
|
+
def with_raw_response(self) -> AsyncUseCasesResourceWithRawResponse:
|
|
165
177
|
"""
|
|
166
178
|
This property can be used as a prefix for any HTTP method call to return
|
|
167
179
|
the raw response object instead of the parsed content.
|
|
168
180
|
|
|
169
181
|
For more information, see https://www.github.com/Pay-i/pay-i-python#accessing-raw-response-data-eg-headers
|
|
170
182
|
"""
|
|
171
|
-
return
|
|
183
|
+
return AsyncUseCasesResourceWithRawResponse(self)
|
|
172
184
|
|
|
173
185
|
@cached_property
|
|
174
|
-
def with_streaming_response(self) ->
|
|
186
|
+
def with_streaming_response(self) -> AsyncUseCasesResourceWithStreamingResponse:
|
|
175
187
|
"""
|
|
176
188
|
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
177
189
|
|
|
178
190
|
For more information, see https://www.github.com/Pay-i/pay-i-python#with_streaming_response
|
|
179
191
|
"""
|
|
180
|
-
return
|
|
192
|
+
return AsyncUseCasesResourceWithStreamingResponse(self)
|
|
181
193
|
|
|
182
194
|
async def create(
|
|
183
195
|
self,
|
|
196
|
+
use_case_name: str,
|
|
184
197
|
*,
|
|
185
|
-
billing_model_id: str,
|
|
186
|
-
category: str,
|
|
187
|
-
price_modifier: float,
|
|
188
|
-
resource: str,
|
|
189
198
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
190
199
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
191
200
|
extra_headers: Headers | None = None,
|
|
192
201
|
extra_query: Query | None = None,
|
|
193
202
|
extra_body: Body | None = None,
|
|
194
203
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
195
|
-
) ->
|
|
204
|
+
) -> UseCaseInstanceResponse:
|
|
196
205
|
"""
|
|
206
|
+
Create a Use Case instance
|
|
207
|
+
|
|
197
208
|
Args:
|
|
198
209
|
extra_headers: Send extra headers
|
|
199
210
|
|
|
@@ -203,26 +214,19 @@ class AsyncPriceModifiersResource(AsyncAPIResource):
|
|
|
203
214
|
|
|
204
215
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
205
216
|
"""
|
|
217
|
+
if not use_case_name:
|
|
218
|
+
raise ValueError(f"Expected a non-empty value for `use_case_name` but received {use_case_name!r}")
|
|
206
219
|
return await self._post(
|
|
207
|
-
"/api/v1/
|
|
208
|
-
body=await async_maybe_transform(
|
|
209
|
-
{
|
|
210
|
-
"billing_model_id": billing_model_id,
|
|
211
|
-
"category": category,
|
|
212
|
-
"price_modifier": price_modifier,
|
|
213
|
-
"resource": resource,
|
|
214
|
-
},
|
|
215
|
-
price_modifier_create_params.PriceModifierCreateParams,
|
|
216
|
-
),
|
|
220
|
+
f"/api/v1/use_cases/instances/{use_case_name}",
|
|
217
221
|
options=make_request_options(
|
|
218
222
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
219
223
|
),
|
|
220
|
-
cast_to=
|
|
224
|
+
cast_to=UseCaseInstanceResponse,
|
|
221
225
|
)
|
|
222
226
|
|
|
223
227
|
async def retrieve(
|
|
224
228
|
self,
|
|
225
|
-
|
|
229
|
+
use_case_id: str,
|
|
226
230
|
*,
|
|
227
231
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
228
232
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -230,8 +234,10 @@ class AsyncPriceModifiersResource(AsyncAPIResource):
|
|
|
230
234
|
extra_query: Query | None = None,
|
|
231
235
|
extra_body: Body | None = None,
|
|
232
236
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
233
|
-
) ->
|
|
237
|
+
) -> UseCaseInstanceResponse:
|
|
234
238
|
"""
|
|
239
|
+
Get a Use Case instance details
|
|
240
|
+
|
|
235
241
|
Args:
|
|
236
242
|
extra_headers: Send extra headers
|
|
237
243
|
|
|
@@ -241,31 +247,30 @@ class AsyncPriceModifiersResource(AsyncAPIResource):
|
|
|
241
247
|
|
|
242
248
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
243
249
|
"""
|
|
244
|
-
if not
|
|
245
|
-
raise ValueError(f"Expected a non-empty value for `
|
|
250
|
+
if not use_case_id:
|
|
251
|
+
raise ValueError(f"Expected a non-empty value for `use_case_id` but received {use_case_id!r}")
|
|
246
252
|
return await self._get(
|
|
247
|
-
f"/api/v1/
|
|
253
|
+
f"/api/v1/use_cases/instances/{use_case_id}",
|
|
248
254
|
options=make_request_options(
|
|
249
255
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
250
256
|
),
|
|
251
|
-
cast_to=
|
|
257
|
+
cast_to=UseCaseInstanceResponse,
|
|
252
258
|
)
|
|
253
259
|
|
|
254
|
-
async def
|
|
260
|
+
async def delete(
|
|
255
261
|
self,
|
|
262
|
+
use_case_id: str,
|
|
256
263
|
*,
|
|
257
|
-
billing_model_id: str,
|
|
258
|
-
category: str,
|
|
259
|
-
price_modifier: float,
|
|
260
|
-
resource: str,
|
|
261
264
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
262
265
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
263
266
|
extra_headers: Headers | None = None,
|
|
264
267
|
extra_query: Query | None = None,
|
|
265
268
|
extra_body: Body | None = None,
|
|
266
269
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
267
|
-
) ->
|
|
270
|
+
) -> UseCaseInstanceResponse:
|
|
268
271
|
"""
|
|
272
|
+
Delete a Use Case instance
|
|
273
|
+
|
|
269
274
|
Args:
|
|
270
275
|
extra_headers: Send extra headers
|
|
271
276
|
|
|
@@ -275,79 +280,104 @@ class AsyncPriceModifiersResource(AsyncAPIResource):
|
|
|
275
280
|
|
|
276
281
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
277
282
|
"""
|
|
278
|
-
|
|
279
|
-
"
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
"billing_model_id": billing_model_id,
|
|
283
|
-
"category": category,
|
|
284
|
-
"price_modifier": price_modifier,
|
|
285
|
-
"resource": resource,
|
|
286
|
-
},
|
|
287
|
-
price_modifier_update_params.PriceModifierUpdateParams,
|
|
288
|
-
),
|
|
283
|
+
if not use_case_id:
|
|
284
|
+
raise ValueError(f"Expected a non-empty value for `use_case_id` but received {use_case_id!r}")
|
|
285
|
+
return await self._delete(
|
|
286
|
+
f"/api/v1/use_cases/instances/{use_case_id}",
|
|
289
287
|
options=make_request_options(
|
|
290
288
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
291
289
|
),
|
|
292
|
-
cast_to=
|
|
290
|
+
cast_to=UseCaseInstanceResponse,
|
|
293
291
|
)
|
|
294
292
|
|
|
295
293
|
|
|
296
|
-
class
|
|
297
|
-
def __init__(self,
|
|
298
|
-
self.
|
|
294
|
+
class UseCasesResourceWithRawResponse:
|
|
295
|
+
def __init__(self, use_cases: UseCasesResource) -> None:
|
|
296
|
+
self._use_cases = use_cases
|
|
299
297
|
|
|
300
298
|
self.create = to_raw_response_wrapper(
|
|
301
|
-
|
|
299
|
+
use_cases.create,
|
|
302
300
|
)
|
|
303
301
|
self.retrieve = to_raw_response_wrapper(
|
|
304
|
-
|
|
302
|
+
use_cases.retrieve,
|
|
305
303
|
)
|
|
306
|
-
self.
|
|
307
|
-
|
|
304
|
+
self.delete = to_raw_response_wrapper(
|
|
305
|
+
use_cases.delete,
|
|
308
306
|
)
|
|
309
307
|
|
|
308
|
+
@cached_property
|
|
309
|
+
def types(self) -> TypesResourceWithRawResponse:
|
|
310
|
+
return TypesResourceWithRawResponse(self._use_cases.types)
|
|
311
|
+
|
|
312
|
+
@cached_property
|
|
313
|
+
def properties(self) -> PropertiesResourceWithRawResponse:
|
|
314
|
+
return PropertiesResourceWithRawResponse(self._use_cases.properties)
|
|
315
|
+
|
|
310
316
|
|
|
311
|
-
class
|
|
312
|
-
def __init__(self,
|
|
313
|
-
self.
|
|
317
|
+
class AsyncUseCasesResourceWithRawResponse:
|
|
318
|
+
def __init__(self, use_cases: AsyncUseCasesResource) -> None:
|
|
319
|
+
self._use_cases = use_cases
|
|
314
320
|
|
|
315
321
|
self.create = async_to_raw_response_wrapper(
|
|
316
|
-
|
|
322
|
+
use_cases.create,
|
|
317
323
|
)
|
|
318
324
|
self.retrieve = async_to_raw_response_wrapper(
|
|
319
|
-
|
|
325
|
+
use_cases.retrieve,
|
|
320
326
|
)
|
|
321
|
-
self.
|
|
322
|
-
|
|
327
|
+
self.delete = async_to_raw_response_wrapper(
|
|
328
|
+
use_cases.delete,
|
|
323
329
|
)
|
|
324
330
|
|
|
331
|
+
@cached_property
|
|
332
|
+
def types(self) -> AsyncTypesResourceWithRawResponse:
|
|
333
|
+
return AsyncTypesResourceWithRawResponse(self._use_cases.types)
|
|
334
|
+
|
|
335
|
+
@cached_property
|
|
336
|
+
def properties(self) -> AsyncPropertiesResourceWithRawResponse:
|
|
337
|
+
return AsyncPropertiesResourceWithRawResponse(self._use_cases.properties)
|
|
338
|
+
|
|
325
339
|
|
|
326
|
-
class
|
|
327
|
-
def __init__(self,
|
|
328
|
-
self.
|
|
340
|
+
class UseCasesResourceWithStreamingResponse:
|
|
341
|
+
def __init__(self, use_cases: UseCasesResource) -> None:
|
|
342
|
+
self._use_cases = use_cases
|
|
329
343
|
|
|
330
344
|
self.create = to_streamed_response_wrapper(
|
|
331
|
-
|
|
345
|
+
use_cases.create,
|
|
332
346
|
)
|
|
333
347
|
self.retrieve = to_streamed_response_wrapper(
|
|
334
|
-
|
|
348
|
+
use_cases.retrieve,
|
|
335
349
|
)
|
|
336
|
-
self.
|
|
337
|
-
|
|
350
|
+
self.delete = to_streamed_response_wrapper(
|
|
351
|
+
use_cases.delete,
|
|
338
352
|
)
|
|
339
353
|
|
|
354
|
+
@cached_property
|
|
355
|
+
def types(self) -> TypesResourceWithStreamingResponse:
|
|
356
|
+
return TypesResourceWithStreamingResponse(self._use_cases.types)
|
|
357
|
+
|
|
358
|
+
@cached_property
|
|
359
|
+
def properties(self) -> PropertiesResourceWithStreamingResponse:
|
|
360
|
+
return PropertiesResourceWithStreamingResponse(self._use_cases.properties)
|
|
361
|
+
|
|
340
362
|
|
|
341
|
-
class
|
|
342
|
-
def __init__(self,
|
|
343
|
-
self.
|
|
363
|
+
class AsyncUseCasesResourceWithStreamingResponse:
|
|
364
|
+
def __init__(self, use_cases: AsyncUseCasesResource) -> None:
|
|
365
|
+
self._use_cases = use_cases
|
|
344
366
|
|
|
345
367
|
self.create = async_to_streamed_response_wrapper(
|
|
346
|
-
|
|
368
|
+
use_cases.create,
|
|
347
369
|
)
|
|
348
370
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
349
|
-
|
|
371
|
+
use_cases.retrieve,
|
|
350
372
|
)
|
|
351
|
-
self.
|
|
352
|
-
|
|
373
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
374
|
+
use_cases.delete,
|
|
353
375
|
)
|
|
376
|
+
|
|
377
|
+
@cached_property
|
|
378
|
+
def types(self) -> AsyncTypesResourceWithStreamingResponse:
|
|
379
|
+
return AsyncTypesResourceWithStreamingResponse(self._use_cases.types)
|
|
380
|
+
|
|
381
|
+
@cached_property
|
|
382
|
+
def properties(self) -> AsyncPropertiesResourceWithStreamingResponse:
|
|
383
|
+
return AsyncPropertiesResourceWithStreamingResponse(self._use_cases.properties)
|
payi/types/__init__.py
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from .shared import
|
|
5
|
+
from .shared import (
|
|
6
|
+
PropertiesResponse as PropertiesResponse,
|
|
7
|
+
PayICommonModelsBudgetManagementCostDetailsBase as PayICommonModelsBudgetManagementCostDetailsBase,
|
|
8
|
+
PayICommonModelsBudgetManagementCreateLimitBase as PayICommonModelsBudgetManagementCreateLimitBase,
|
|
9
|
+
)
|
|
6
10
|
from .cost_data import CostData as CostData
|
|
7
11
|
from .cost_details import CostDetails as CostDetails
|
|
8
|
-
from .billing_model import BillingModel as BillingModel
|
|
9
12
|
from .requests_data import RequestsData as RequestsData
|
|
10
13
|
from .limit_response import LimitResponse as LimitResponse
|
|
11
|
-
from .price_modifier import PriceModifier as PriceModifier
|
|
12
14
|
from .ingest_response import IngestResponse as IngestResponse
|
|
13
15
|
from .total_cost_data import TotalCostData as TotalCostData
|
|
14
16
|
from .default_response import DefaultResponse as DefaultResponse
|
|
@@ -26,14 +28,9 @@ from .category_list_response import CategoryListResponse as CategoryListResponse
|
|
|
26
28
|
from .limit_history_response import LimitHistoryResponse as LimitHistoryResponse
|
|
27
29
|
from .category_delete_response import CategoryDeleteResponse as CategoryDeleteResponse
|
|
28
30
|
from .category_resource_response import CategoryResourceResponse as CategoryResourceResponse
|
|
29
|
-
from .
|
|
30
|
-
from .billing_model_list_response import BillingModelListResponse as BillingModelListResponse
|
|
31
|
-
from .billing_model_update_params import BillingModelUpdateParams as BillingModelUpdateParams
|
|
31
|
+
from .use_case_instance_response import UseCaseInstanceResponse as UseCaseInstanceResponse
|
|
32
32
|
from .experience_instance_response import ExperienceInstanceResponse as ExperienceInstanceResponse
|
|
33
|
-
from .price_modifier_create_params import PriceModifierCreateParams as PriceModifierCreateParams
|
|
34
|
-
from .price_modifier_update_params import PriceModifierUpdateParams as PriceModifierUpdateParams
|
|
35
33
|
from .category_list_resources_response import CategoryListResourcesResponse as CategoryListResourcesResponse
|
|
36
|
-
from .price_modifier_retrieve_response import PriceModifierRetrieveResponse as PriceModifierRetrieveResponse
|
|
37
34
|
from .category_delete_resource_response import CategoryDeleteResourceResponse as CategoryDeleteResourceResponse
|
|
38
35
|
from .pay_i_common_models_api_router_header_info_param import (
|
|
39
36
|
PayICommonModelsAPIRouterHeaderInfoParam as PayICommonModelsAPIRouterHeaderInfoParam,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, Union
|
|
5
|
+
from typing import Dict, Union, Optional
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from typing_extensions import Required, Annotated, TypedDict
|
|
8
8
|
|
|
@@ -16,16 +16,16 @@ class ResourceCreateParams(TypedDict, total=False):
|
|
|
16
16
|
|
|
17
17
|
units: Required[Dict[str, Units]]
|
|
18
18
|
|
|
19
|
-
max_input_units: int
|
|
19
|
+
max_input_units: Optional[int]
|
|
20
20
|
|
|
21
|
-
max_output_units: int
|
|
21
|
+
max_output_units: Optional[int]
|
|
22
22
|
|
|
23
|
-
max_total_units: int
|
|
23
|
+
max_total_units: Optional[int]
|
|
24
24
|
|
|
25
25
|
start_timestamp: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class Units(TypedDict, total=False):
|
|
29
|
-
input_price:
|
|
29
|
+
input_price: float
|
|
30
30
|
|
|
31
|
-
output_price:
|
|
31
|
+
output_price: float
|
|
@@ -9,9 +9,9 @@ __all__ = ["CategoryResourceResponse", "Units"]
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Units(BaseModel):
|
|
12
|
-
input_price: float
|
|
12
|
+
input_price: Optional[float] = None
|
|
13
13
|
|
|
14
|
-
output_price: float
|
|
14
|
+
output_price: Optional[float] = None
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class CategoryResourceResponse(BaseModel):
|
|
@@ -7,5 +7,4 @@ from .type_list_params import TypeListParams as TypeListParams
|
|
|
7
7
|
from .type_create_params import TypeCreateParams as TypeCreateParams
|
|
8
8
|
from .type_list_response import TypeListResponse as TypeListResponse
|
|
9
9
|
from .type_update_params import TypeUpdateParams as TypeUpdateParams
|
|
10
|
-
from .properties_response import PropertiesResponse as PropertiesResponse
|
|
11
10
|
from .property_create_params import PropertyCreateParams as PropertyCreateParams
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
4
|
-
from typing_extensions import Literal
|
|
3
|
+
from typing import Optional
|
|
5
4
|
|
|
6
5
|
from ..._models import BaseModel
|
|
6
|
+
from ..shared.pay_i_common_models_budget_management_create_limit_base import (
|
|
7
|
+
PayICommonModelsBudgetManagementCreateLimitBase,
|
|
8
|
+
)
|
|
7
9
|
|
|
8
|
-
__all__ = ["ExperienceType"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class LimitConfig(BaseModel):
|
|
12
|
-
max: float
|
|
13
|
-
|
|
14
|
-
limit_tags: Optional[List[str]] = None
|
|
15
|
-
|
|
16
|
-
limit_type: Optional[Literal["block", "allow"]] = None
|
|
17
|
-
|
|
18
|
-
threshold: Optional[float] = None
|
|
10
|
+
__all__ = ["ExperienceType"]
|
|
19
11
|
|
|
20
12
|
|
|
21
13
|
class ExperienceType(BaseModel):
|
|
@@ -25,6 +17,8 @@ class ExperienceType(BaseModel):
|
|
|
25
17
|
|
|
26
18
|
request_id: str
|
|
27
19
|
|
|
28
|
-
limit_config: Optional[
|
|
20
|
+
limit_config: Optional[PayICommonModelsBudgetManagementCreateLimitBase] = None
|
|
29
21
|
|
|
30
22
|
logging_enabled: Optional[bool] = None
|
|
23
|
+
|
|
24
|
+
type_version: Optional[int] = None
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import
|
|
6
|
-
from typing_extensions import
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
from ..shared_params.pay_i_common_models_budget_management_create_limit_base import (
|
|
9
|
+
PayICommonModelsBudgetManagementCreateLimitBase,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = ["TypeCreateParams"]
|
|
9
13
|
|
|
10
14
|
|
|
11
15
|
class TypeCreateParams(TypedDict, total=False):
|
|
@@ -13,16 +17,6 @@ class TypeCreateParams(TypedDict, total=False):
|
|
|
13
17
|
|
|
14
18
|
name: Required[str]
|
|
15
19
|
|
|
16
|
-
limit_config:
|
|
20
|
+
limit_config: PayICommonModelsBudgetManagementCreateLimitBase
|
|
17
21
|
|
|
18
22
|
logging_enabled: Optional[bool]
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class LimitConfig(TypedDict, total=False):
|
|
22
|
-
max: Required[float]
|
|
23
|
-
|
|
24
|
-
limit_tags: Optional[List[str]]
|
|
25
|
-
|
|
26
|
-
limit_type: Literal["block", "allow"]
|
|
27
|
-
|
|
28
|
-
threshold: Optional[float]
|