payi 0.1.0a13__py3-none-any.whl → 0.1.0a15__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.
Files changed (36) hide show
  1. payi/_base_client.py +6 -6
  2. payi/_client.py +8 -0
  3. payi/_compat.py +3 -3
  4. payi/_models.py +9 -0
  5. payi/_version.py +1 -1
  6. payi/resources/__init__.py +14 -0
  7. payi/resources/budgets/budgets.py +12 -4
  8. payi/resources/categories/__init__.py +33 -0
  9. payi/resources/categories/categories.py +388 -0
  10. payi/resources/categories/resources.py +450 -0
  11. payi/resources/ingest.py +152 -21
  12. payi/types/__init__.py +11 -1
  13. payi/types/budget_create_params.py +4 -0
  14. payi/types/budget_history_response.py +3 -75
  15. payi/types/budget_response.py +3 -26
  16. payi/types/budget_update_params.py +4 -3
  17. payi/types/bulk_ingest_response.py +44 -0
  18. payi/types/categories/__init__.py +6 -0
  19. payi/types/categories/resource_create_params.py +25 -0
  20. payi/types/categories/resource_list_response.py +9 -0
  21. payi/types/category_delete_resource_response.py +9 -0
  22. payi/types/category_delete_response.py +9 -0
  23. payi/types/category_list_resources_response.py +9 -0
  24. payi/types/category_list_response.py +9 -0
  25. payi/types/category_resource_response.py +24 -0
  26. payi/types/category_response.py +15 -0
  27. payi/types/ingest_bulk_params.py +14 -0
  28. payi/types/{proxy_result.py → ingest_response.py} +15 -6
  29. payi/types/ingest_units_param.py +23 -0
  30. payi/types/ingest_units_params.py +6 -2
  31. payi/types/paged_budget_list.py +3 -26
  32. payi/types/total_cost_data.py +31 -0
  33. {payi-0.1.0a13.dist-info → payi-0.1.0a15.dist-info}/METADATA +8 -2
  34. {payi-0.1.0a13.dist-info → payi-0.1.0a15.dist-info}/RECORD +36 -20
  35. {payi-0.1.0a13.dist-info → payi-0.1.0a15.dist-info}/WHEEL +0 -0
  36. {payi-0.1.0a13.dist-info → payi-0.1.0a15.dist-info}/licenses/LICENSE +0 -0
payi/resources/ingest.py CHANGED
@@ -2,9 +2,12 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Dict, Union, Iterable, cast
6
+ from datetime import datetime
7
+
5
8
  import httpx
6
9
 
7
- from ..types import ingest_units_params
10
+ from ..types import ingest_bulk_params, ingest_units_params
8
11
  from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
12
  from .._utils import (
10
13
  maybe_transform,
@@ -20,7 +23,9 @@ from .._response import (
20
23
  async_to_streamed_response_wrapper,
21
24
  )
22
25
  from .._base_client import make_request_options
23
- from ..types.proxy_result import ProxyResult
26
+ from ..types.ingest_response import IngestResponse
27
+ from ..types.ingest_units_param import IngestUnitsParam
28
+ from ..types.bulk_ingest_response import BulkIngestResponse
24
29
 
25
30
  __all__ = ["IngestResource", "AsyncIngestResource"]
26
31
 
@@ -34,6 +39,46 @@ class IngestResource(SyncAPIResource):
34
39
  def with_streaming_response(self) -> IngestResourceWithStreamingResponse:
35
40
  return IngestResourceWithStreamingResponse(self)
36
41
 
42
+ def bulk(
43
+ self,
44
+ *,
45
+ items: Iterable[IngestUnitsParam],
46
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
47
+ # The extra values given here take precedence over values defined on the client or passed to this method.
48
+ extra_headers: Headers | None = None,
49
+ extra_query: Query | None = None,
50
+ extra_body: Body | None = None,
51
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
52
+ ) -> BulkIngestResponse:
53
+ """
54
+ Bulk Ingest
55
+
56
+ Args:
57
+
58
+ items (Iterable[IngestUnitsParams]): The items to ingest
59
+
60
+ extra_headers: Send extra headers
61
+
62
+ extra_query: Add additional query parameters to the request
63
+
64
+ extra_body: Add additional JSON properties to the request
65
+
66
+ timeout: Override the client-level default timeout for this request, in seconds
67
+ """
68
+ return self._post(
69
+ "/api/v1/ingest/bulk",
70
+ body=cast(Dict[str, object], maybe_transform(
71
+ {
72
+ "items": items,
73
+ },
74
+ ingest_bulk_params.IngestBulkParams)
75
+ )["items"],
76
+ options=make_request_options(
77
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
78
+ ),
79
+ cast_to=BulkIngestResponse,
80
+ )
81
+
37
82
  def units(
38
83
  self,
39
84
  *,
@@ -41,34 +86,46 @@ class IngestResource(SyncAPIResource):
41
86
  input: int,
42
87
  output: int,
43
88
  resource: str,
44
- budget_ids: list[str] | NotGiven = NOT_GIVEN,
45
- request_tags: list[str] | NotGiven = NOT_GIVEN,
89
+ event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
90
+ budget_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
91
+ request_tags: Union[list[str], None] | NotGiven = NOT_GIVEN,
46
92
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
47
93
  # The extra values given here take precedence over values defined on the client or passed to this method.
48
94
  extra_headers: Headers | None = None,
49
95
  extra_query: Query | None = None,
50
96
  extra_body: Body | None = None,
51
97
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
52
- ) -> ProxyResult:
98
+ ) -> IngestResponse:
53
99
  """
54
100
  Ingest a request
55
101
 
56
102
  Args:
57
103
  category (str): The name of the category
58
- resource (str): The name of the resource.
104
+
105
+ resource (str): The name of the resource
106
+
59
107
  input (int): The number of input units
108
+
60
109
  output (int): The number of output units
110
+
111
+ event_timestamp: (str, datetime, None): The timestamp of the event. Defaults to None.
112
+
61
113
  budget_ids (list[str], optional): The budget IDs to associate with the request. Defaults to None.
114
+
62
115
  request_tags (list[str], optional): The request tags to associate with the request. Defaults to None.
116
+
63
117
  extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
118
+
64
119
  extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
120
+
65
121
  extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
122
+
66
123
  timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
67
124
  """
68
125
  valid_ids_str: str | NotGiven = NOT_GIVEN
69
126
  valid_tags_str: str | NotGiven = NOT_GIVEN
70
127
 
71
- if isinstance(budget_ids, NotGiven):
128
+ if budget_ids is None or isinstance(budget_ids, NotGiven):
72
129
  valid_ids_str = NOT_GIVEN
73
130
  elif not isinstance(budget_ids, list): # type: ignore
74
131
  raise TypeError("budget_ids must be a list")
@@ -77,7 +134,7 @@ class IngestResource(SyncAPIResource):
77
134
  valid_ids = [id.strip() for id in budget_ids if id.strip()]
78
135
  valid_ids_str = ",".join(valid_ids) if valid_ids else NOT_GIVEN
79
136
 
80
- if isinstance(request_tags, NotGiven):
137
+ if request_tags is None or isinstance(request_tags, NotGiven):
81
138
  valid_tags_str = NOT_GIVEN
82
139
  elif not isinstance(request_tags, list): # type: ignore
83
140
  raise TypeError("request_tags must be a list")
@@ -103,13 +160,14 @@ class IngestResource(SyncAPIResource):
103
160
  "input": input,
104
161
  "output": output,
105
162
  "resource": resource,
163
+ "event_timestamp": event_timestamp,
106
164
  },
107
165
  ingest_units_params.IngestUnitsParams,
108
166
  ),
109
167
  options=make_request_options(
110
168
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
111
169
  ),
112
- cast_to=ProxyResult,
170
+ cast_to=IngestResponse,
113
171
  )
114
172
 
115
173
 
@@ -122,26 +180,23 @@ class AsyncIngestResource(AsyncAPIResource):
122
180
  def with_streaming_response(self) -> AsyncIngestResourceWithStreamingResponse:
123
181
  return AsyncIngestResourceWithStreamingResponse(self)
124
182
 
125
- async def units(
183
+ async def bulk(
126
184
  self,
127
185
  *,
128
- category: str,
129
- input: int,
130
- output: int,
131
- resource: str,
132
- budget_ids: list[str] | NotGiven = NOT_GIVEN,
133
- request_tags: list[str] | NotGiven = NOT_GIVEN,
186
+ items: Iterable[IngestUnitsParam],
134
187
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
135
188
  # The extra values given here take precedence over values defined on the client or passed to this method.
136
189
  extra_headers: Headers | None = None,
137
190
  extra_query: Query | None = None,
138
191
  extra_body: Body | None = None,
139
192
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
140
- ) -> ProxyResult:
193
+ ) -> BulkIngestResponse:
141
194
  """
142
- Ingest a request
195
+ Bulk Ingest
143
196
 
144
197
  Args:
198
+ items (Iterable[IngestUnitsParams]): The items to ingest
199
+
145
200
  extra_headers: Send extra headers
146
201
 
147
202
  extra_query: Add additional query parameters to the request
@@ -150,17 +205,80 @@ class AsyncIngestResource(AsyncAPIResource):
150
205
 
151
206
  timeout: Override the client-level default timeout for this request, in seconds
152
207
  """
208
+ return await self._post(
209
+ "/api/v1/ingest/bulk",
210
+ body= cast(Dict[str, object],
211
+ await async_maybe_transform(
212
+ {
213
+ "items": items,
214
+ },
215
+ ingest_bulk_params.IngestBulkParams)
216
+ )["items"],
217
+ options=make_request_options(
218
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
219
+ ),
220
+ cast_to=BulkIngestResponse,
221
+ )
222
+
223
+ async def units(
224
+ self,
225
+ *,
226
+ category: str,
227
+ input: int,
228
+ output: int,
229
+ resource: str,
230
+ event_timestamp: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
231
+ budget_ids: Union[list[str], None] | NotGiven = NOT_GIVEN,
232
+ request_tags: Union[list[str], None] | NotGiven = NOT_GIVEN,
233
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
234
+ # The extra values given here take precedence over values defined on the client or passed to this method.
235
+ extra_headers: Headers | None = None,
236
+ extra_query: Query | None = None,
237
+ extra_body: Body | None = None,
238
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
239
+ ) -> IngestResponse:
240
+ """
241
+ Ingest a request
242
+
243
+ Args:
244
+ category (str): The name of the category
245
+
246
+ resource (str): The name of the resource
247
+
248
+ input (int): The number of input units
249
+
250
+ output (int): The number of output units
251
+
252
+ event_timestamp: (datetime, None): The timestamp of the event. Defaults to None.
253
+
254
+ budget_ids (list[str], optional): The budget IDs to associate with the request. Defaults to None.
255
+
256
+ request_tags (list[str], optional): The request tags to associate with the request. Defaults to None.
257
+
258
+ extra_headers (Dict[str, str], optional): Additional headers for the request. Defaults to None.
259
+
260
+ extra_query (Dict[str, str], optional): Additional query parameters. Defaults to None.
261
+
262
+ extra_body (Dict[str, Any], optional): Additional body parameters. Defaults to None.
263
+
264
+ timeout (Union[float, None], optional): The timeout for the request in seconds. Defaults to None.
265
+ """
153
266
  valid_ids_str: str | NotGiven = NOT_GIVEN
154
267
  valid_tags_str: str | NotGiven = NOT_GIVEN
155
268
 
156
- if isinstance(budget_ids, NotGiven):
269
+ if budget_ids is None or isinstance(budget_ids, NotGiven):
157
270
  valid_ids_str = NOT_GIVEN
271
+ elif not isinstance(budget_ids, list): # type: ignore
272
+ raise TypeError("budget_ids must be a list")
158
273
  else:
159
274
  # Proceed with the list comprehension if budget_ids is not NotGiven
160
275
  valid_ids = [id.strip() for id in budget_ids if id.strip()]
161
276
  valid_ids_str = ",".join(valid_ids) if valid_ids else NOT_GIVEN
162
- if isinstance(request_tags, NotGiven):
277
+
278
+ if request_tags is None or isinstance(request_tags, NotGiven):
163
279
  valid_tags_str = NOT_GIVEN
280
+ elif not isinstance(request_tags, list): # type: ignore
281
+ raise TypeError("request_tags must be a list")
164
282
  else:
165
283
  # Proceed with the list comprehension if budget_ids is not NotGiven
166
284
  valid_tags = [tag.strip() for tag in request_tags if tag.strip()]
@@ -183,13 +301,14 @@ class AsyncIngestResource(AsyncAPIResource):
183
301
  "input": input,
184
302
  "output": output,
185
303
  "resource": resource,
304
+ "event_timestamp": event_timestamp,
186
305
  },
187
306
  ingest_units_params.IngestUnitsParams,
188
307
  ),
189
308
  options=make_request_options(
190
309
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
191
310
  ),
192
- cast_to=ProxyResult,
311
+ cast_to=IngestResponse,
193
312
  )
194
313
 
195
314
 
@@ -197,6 +316,9 @@ class IngestResourceWithRawResponse:
197
316
  def __init__(self, ingest: IngestResource) -> None:
198
317
  self._ingest = ingest
199
318
 
319
+ self.bulk = to_raw_response_wrapper(
320
+ ingest.bulk,
321
+ )
200
322
  self.units = to_raw_response_wrapper(
201
323
  ingest.units,
202
324
  )
@@ -206,6 +328,9 @@ class AsyncIngestResourceWithRawResponse:
206
328
  def __init__(self, ingest: AsyncIngestResource) -> None:
207
329
  self._ingest = ingest
208
330
 
331
+ self.bulk = async_to_raw_response_wrapper(
332
+ ingest.bulk,
333
+ )
209
334
  self.units = async_to_raw_response_wrapper(
210
335
  ingest.units,
211
336
  )
@@ -215,6 +340,9 @@ class IngestResourceWithStreamingResponse:
215
340
  def __init__(self, ingest: IngestResource) -> None:
216
341
  self._ingest = ingest
217
342
 
343
+ self.bulk = to_streamed_response_wrapper(
344
+ ingest.bulk,
345
+ )
218
346
  self.units = to_streamed_response_wrapper(
219
347
  ingest.units,
220
348
  )
@@ -224,6 +352,9 @@ class AsyncIngestResourceWithStreamingResponse:
224
352
  def __init__(self, ingest: AsyncIngestResource) -> None:
225
353
  self._ingest = ingest
226
354
 
355
+ self.bulk = async_to_streamed_response_wrapper(
356
+ ingest.bulk,
357
+ )
227
358
  self.units = async_to_streamed_response_wrapper(
228
359
  ingest.units,
229
360
  )
payi/types/__init__.py CHANGED
@@ -4,13 +4,23 @@ from __future__ import annotations
4
4
 
5
5
  from .cost_data import CostData as CostData
6
6
  from .cost_details import CostDetails as CostDetails
7
- from .proxy_result import ProxyResult as ProxyResult
8
7
  from .requests_data import RequestsData as RequestsData
9
8
  from .budget_response import BudgetResponse as BudgetResponse
9
+ from .ingest_response import IngestResponse as IngestResponse
10
+ from .total_cost_data import TotalCostData as TotalCostData
10
11
  from .default_response import DefaultResponse as DefaultResponse
12
+ from .category_response import CategoryResponse as CategoryResponse
11
13
  from .paged_budget_list import PagedBudgetList as PagedBudgetList
12
14
  from .budget_list_params import BudgetListParams as BudgetListParams
15
+ from .ingest_bulk_params import IngestBulkParams as IngestBulkParams
16
+ from .ingest_units_param import IngestUnitsParam as IngestUnitsParam
13
17
  from .ingest_units_params import IngestUnitsParams as IngestUnitsParams
14
18
  from .budget_create_params import BudgetCreateParams as BudgetCreateParams
15
19
  from .budget_update_params import BudgetUpdateParams as BudgetUpdateParams
20
+ from .bulk_ingest_response import BulkIngestResponse as BulkIngestResponse
21
+ from .category_list_response import CategoryListResponse as CategoryListResponse
16
22
  from .budget_history_response import BudgetHistoryResponse as BudgetHistoryResponse
23
+ from .category_delete_response import CategoryDeleteResponse as CategoryDeleteResponse
24
+ from .category_resource_response import CategoryResourceResponse as CategoryResourceResponse
25
+ from .category_list_resources_response import CategoryListResourcesResponse as CategoryListResourcesResponse
26
+ from .category_delete_resource_response import CategoryDeleteResourceResponse as CategoryDeleteResourceResponse
@@ -15,10 +15,14 @@ class BudgetCreateParams(TypedDict, total=False):
15
15
 
16
16
  base_cost_estimate: Literal["max"]
17
17
 
18
+ billing_model_id: Optional[str]
19
+
18
20
  budget_response_type: Literal["block", "allow"]
19
21
 
20
22
  budget_tags: Optional[List[str]]
21
23
 
22
24
  budget_type: Literal["conservative", "liberal"]
23
25
 
26
+ cost_basis: Literal["base", "billed"]
27
+
24
28
  currency: Literal["usd"]
@@ -4,82 +4,10 @@ from typing import List, Optional
4
4
  from datetime import datetime
5
5
  from typing_extensions import Literal
6
6
 
7
- from pydantic import Field as FieldInfo
8
-
9
7
  from .._models import BaseModel
8
+ from .total_cost_data import TotalCostData
10
9
 
11
- __all__ = [
12
- "BudgetHistoryResponse",
13
- "BudgetHistory",
14
- "BudgetHistoryTotals",
15
- "BudgetHistoryTotalsCost",
16
- "BudgetHistoryTotalsCostInput",
17
- "BudgetHistoryTotalsCostOutput",
18
- "BudgetHistoryTotalsCostTotal",
19
- "BudgetHistoryTotalsRequests",
20
- ]
21
-
22
-
23
- class BudgetHistoryTotalsCostInput(BaseModel):
24
- base: Optional[float] = None
25
-
26
- billed: Optional[float] = None
27
-
28
- overrun_base: Optional[float] = FieldInfo(alias="overrunBase", default=None)
29
-
30
- overrun_billed: Optional[float] = FieldInfo(alias="overrunBilled", default=None)
31
-
32
- revenue: Optional[float] = None
33
-
34
-
35
- class BudgetHistoryTotalsCostOutput(BaseModel):
36
- base: Optional[float] = None
37
-
38
- billed: Optional[float] = None
39
-
40
- overrun_base: Optional[float] = FieldInfo(alias="overrunBase", default=None)
41
-
42
- overrun_billed: Optional[float] = FieldInfo(alias="overrunBilled", default=None)
43
-
44
- revenue: Optional[float] = None
45
-
46
-
47
- class BudgetHistoryTotalsCostTotal(BaseModel):
48
- base: Optional[float] = None
49
-
50
- billed: Optional[float] = None
51
-
52
- overrun_base: Optional[float] = FieldInfo(alias="overrunBase", default=None)
53
-
54
- overrun_billed: Optional[float] = FieldInfo(alias="overrunBilled", default=None)
55
-
56
- revenue: Optional[float] = None
57
-
58
-
59
- class BudgetHistoryTotalsCost(BaseModel):
60
- input: BudgetHistoryTotalsCostInput
61
-
62
- output: BudgetHistoryTotalsCostOutput
63
-
64
- total: BudgetHistoryTotalsCostTotal
65
-
66
-
67
- class BudgetHistoryTotalsRequests(BaseModel):
68
- blocked: Optional[int] = None
69
-
70
- exceeded: Optional[int] = None
71
-
72
- failed: Optional[int] = None
73
-
74
- successful: Optional[int] = None
75
-
76
- total: Optional[int] = None
77
-
78
-
79
- class BudgetHistoryTotals(BaseModel):
80
- cost: BudgetHistoryTotalsCost
81
-
82
- requests: BudgetHistoryTotalsRequests
10
+ __all__ = ["BudgetHistoryResponse", "BudgetHistory"]
83
11
 
84
12
 
85
13
  class BudgetHistory(BaseModel):
@@ -99,7 +27,7 @@ class BudgetHistory(BaseModel):
99
27
 
100
28
  max: Optional[float] = None
101
29
 
102
- totals: Optional[BudgetHistoryTotals] = None
30
+ totals: Optional[TotalCostData] = None
103
31
 
104
32
 
105
33
  class BudgetHistoryResponse(BaseModel):
@@ -5,32 +5,9 @@ from datetime import datetime
5
5
  from typing_extensions import Literal
6
6
 
7
7
  from .._models import BaseModel
8
- from .cost_data import CostData
9
- from .requests_data import RequestsData
8
+ from .total_cost_data import TotalCostData
10
9
 
11
- __all__ = ["BudgetResponse", "Budget", "BudgetTotals", "BudgetTotalsBudgetTransactions"]
12
-
13
-
14
- class BudgetTotalsBudgetTransactions(BaseModel):
15
- blocked: int
16
-
17
- blocked_external: int
18
-
19
- exceeded: int
20
-
21
- successful: int
22
-
23
- error: Optional[int] = None
24
-
25
- total: Optional[int] = None
26
-
27
-
28
- class BudgetTotals(BaseModel):
29
- budget_transactions: BudgetTotalsBudgetTransactions
30
-
31
- cost: CostData
32
-
33
- requests: RequestsData
10
+ __all__ = ["BudgetResponse", "Budget"]
34
11
 
35
12
 
36
13
  class Budget(BaseModel):
@@ -52,7 +29,7 @@ class Budget(BaseModel):
52
29
 
53
30
  max: float
54
31
 
55
- totals: BudgetTotals
32
+ totals: TotalCostData
56
33
 
57
34
  budget_tags: Optional[List[str]] = None
58
35
 
@@ -2,12 +2,13 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing_extensions import Required, TypedDict
5
+ from typing import Optional
6
+ from typing_extensions import TypedDict
6
7
 
7
8
  __all__ = ["BudgetUpdateParams"]
8
9
 
9
10
 
10
11
  class BudgetUpdateParams(TypedDict, total=False):
11
- budget_name: Required[str]
12
+ budget_name: Optional[str]
12
13
 
13
- max: float
14
+ max: Optional[float]
@@ -0,0 +1,44 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from datetime import datetime
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+
10
+ __all__ = ["BulkIngestResponse", "Error", "ErrorXproxyResult", "ErrorXproxyResultXproxyError"]
11
+
12
+
13
+ class ErrorXproxyResultXproxyError(BaseModel):
14
+ code: Optional[str] = None
15
+
16
+ message: Optional[str] = None
17
+
18
+
19
+ class ErrorXproxyResult(BaseModel):
20
+ message: str
21
+
22
+ status_code: int = FieldInfo(alias="statusCode")
23
+
24
+ xproxy_error: Optional[ErrorXproxyResultXproxyError] = None
25
+
26
+
27
+ class Error(BaseModel):
28
+ item_index: Optional[int] = None
29
+
30
+ xproxy_result: Optional[ErrorXproxyResult] = None
31
+
32
+
33
+ class BulkIngestResponse(BaseModel):
34
+ ingest_count: int
35
+
36
+ ingest_timestamp: datetime
37
+
38
+ request_id: str
39
+
40
+ error_count: Optional[int] = None
41
+
42
+ errors: Optional[List[Error]] = None
43
+
44
+ total_count: Optional[int] = None
@@ -0,0 +1,6 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .resource_create_params import ResourceCreateParams as ResourceCreateParams
6
+ from .resource_list_response import ResourceListResponse as ResourceListResponse
@@ -0,0 +1,25 @@
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 Union
6
+ from datetime import datetime
7
+ from typing_extensions import Required, Annotated, TypedDict
8
+
9
+ from ..._utils import PropertyInfo
10
+
11
+ __all__ = ["ResourceCreateParams"]
12
+
13
+
14
+ class ResourceCreateParams(TypedDict, total=False):
15
+ category: Required[str]
16
+
17
+ input_price: float
18
+
19
+ max_input_units: int
20
+
21
+ max_output_units: int
22
+
23
+ output_price: float
24
+
25
+ start_timestamp: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+
5
+ from ..category_resource_response import CategoryResourceResponse
6
+
7
+ __all__ = ["ResourceListResponse"]
8
+
9
+ ResourceListResponse = List[CategoryResourceResponse]
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+
5
+ from .category_resource_response import CategoryResourceResponse
6
+
7
+ __all__ = ["CategoryDeleteResourceResponse"]
8
+
9
+ CategoryDeleteResourceResponse = List[CategoryResourceResponse]
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List
4
+
5
+ from .category_resource_response import CategoryResourceResponse
6
+
7
+ __all__ = ["CategoryDeleteResponse"]
8
+
9
+ CategoryDeleteResponse = Dict[str, List[CategoryResourceResponse]]
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+
5
+ from .category_resource_response import CategoryResourceResponse
6
+
7
+ __all__ = ["CategoryListResourcesResponse"]
8
+
9
+ CategoryListResourcesResponse = List[CategoryResourceResponse]
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+
5
+ from .category_response import CategoryResponse
6
+
7
+ __all__ = ["CategoryListResponse"]
8
+
9
+ CategoryListResponse = List[CategoryResponse]
@@ -0,0 +1,24 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from datetime import datetime
5
+
6
+ from .._models import BaseModel
7
+
8
+ __all__ = ["CategoryResourceResponse"]
9
+
10
+
11
+ class CategoryResourceResponse(BaseModel):
12
+ category: str
13
+
14
+ resource: str
15
+
16
+ input_price: Optional[float] = None
17
+
18
+ max_input_units: Optional[int] = None
19
+
20
+ max_output_units: Optional[int] = None
21
+
22
+ output_price: Optional[float] = None
23
+
24
+ start_timestamp: Optional[datetime] = None
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from datetime import datetime
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["CategoryResponse"]
8
+
9
+
10
+ class CategoryResponse(BaseModel):
11
+ category: str
12
+
13
+ resource_count: int
14
+
15
+ start_timestamp: datetime