|
14 | 14 | monitor_update_params, |
15 | 15 | monitor_list_runs_params, |
16 | 16 | monitor_list_changes_params, |
| 17 | + monitor_get_credit_usage_params, |
17 | 18 | monitor_list_account_runs_params, |
18 | 19 | monitor_list_account_changes_params, |
19 | 20 | ) |
|
35 | 36 | from ..types.monitor_update_response import MonitorUpdateResponse |
36 | 37 | from ..types.monitor_retrieve_response import MonitorRetrieveResponse |
37 | 38 | from ..types.monitor_list_runs_response import MonitorListRunsResponse |
| 39 | +from ..types.monitor_get_limits_response import MonitorGetLimitsResponse |
38 | 40 | from ..types.monitor_list_changes_response import MonitorListChangesResponse |
39 | 41 | from ..types.monitor_retrieve_change_response import MonitorRetrieveChangeResponse |
| 42 | +from ..types.monitor_get_credit_usage_response import MonitorGetCreditUsageResponse |
40 | 43 | from ..types.monitor_list_account_runs_response import MonitorListAccountRunsResponse |
41 | 44 | from ..types.monitor_list_account_changes_response import MonitorListAccountChangesResponse |
42 | 45 |
|
@@ -348,6 +351,72 @@ def delete( |
348 | 351 | cast_to=MonitorDeleteResponse, |
349 | 352 | ) |
350 | 353 |
|
| 354 | + def get_credit_usage( |
| 355 | + self, |
| 356 | + *, |
| 357 | + since: Union[str, datetime] | Omit = omit, |
| 358 | + until: Union[str, datetime] | Omit = omit, |
| 359 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 360 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 361 | + extra_headers: Headers | None = None, |
| 362 | + extra_query: Query | None = None, |
| 363 | + extra_body: Body | None = None, |
| 364 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 365 | + ) -> MonitorGetCreditUsageResponse: |
| 366 | + """ |
| 367 | + Returns credits charged per monitor over an optional [since, until] window, |
| 368 | + newest spenders first. |
| 369 | +
|
| 370 | + Args: |
| 371 | + since: Only include items at or after this ISO 8601 timestamp. |
| 372 | +
|
| 373 | + until: Only include items before this ISO 8601 timestamp. |
| 374 | +
|
| 375 | + extra_headers: Send extra headers |
| 376 | +
|
| 377 | + extra_query: Add additional query parameters to the request |
| 378 | +
|
| 379 | + extra_body: Add additional JSON properties to the request |
| 380 | +
|
| 381 | + timeout: Override the client-level default timeout for this request, in seconds |
| 382 | + """ |
| 383 | + return self._get( |
| 384 | + "/monitors/credit-usage", |
| 385 | + options=make_request_options( |
| 386 | + extra_headers=extra_headers, |
| 387 | + extra_query=extra_query, |
| 388 | + extra_body=extra_body, |
| 389 | + timeout=timeout, |
| 390 | + query=maybe_transform( |
| 391 | + { |
| 392 | + "since": since, |
| 393 | + "until": until, |
| 394 | + }, |
| 395 | + monitor_get_credit_usage_params.MonitorGetCreditUsageParams, |
| 396 | + ), |
| 397 | + ), |
| 398 | + cast_to=MonitorGetCreditUsageResponse, |
| 399 | + ) |
| 400 | + |
| 401 | + def get_limits( |
| 402 | + self, |
| 403 | + *, |
| 404 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 405 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 406 | + extra_headers: Headers | None = None, |
| 407 | + extra_query: Query | None = None, |
| 408 | + extra_body: Body | None = None, |
| 409 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 410 | + ) -> MonitorGetLimitsResponse: |
| 411 | + """Returns how many monitors the account has and the maximum it allows.""" |
| 412 | + return self._get( |
| 413 | + "/monitors/limits", |
| 414 | + options=make_request_options( |
| 415 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 416 | + ), |
| 417 | + cast_to=MonitorGetLimitsResponse, |
| 418 | + ) |
| 419 | + |
351 | 420 | def list_account_changes( |
352 | 421 | self, |
353 | 422 | *, |
@@ -956,6 +1025,72 @@ async def delete( |
956 | 1025 | cast_to=MonitorDeleteResponse, |
957 | 1026 | ) |
958 | 1027 |
|
| 1028 | + async def get_credit_usage( |
| 1029 | + self, |
| 1030 | + *, |
| 1031 | + since: Union[str, datetime] | Omit = omit, |
| 1032 | + until: Union[str, datetime] | Omit = omit, |
| 1033 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1034 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1035 | + extra_headers: Headers | None = None, |
| 1036 | + extra_query: Query | None = None, |
| 1037 | + extra_body: Body | None = None, |
| 1038 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1039 | + ) -> MonitorGetCreditUsageResponse: |
| 1040 | + """ |
| 1041 | + Returns credits charged per monitor over an optional [since, until] window, |
| 1042 | + newest spenders first. |
| 1043 | +
|
| 1044 | + Args: |
| 1045 | + since: Only include items at or after this ISO 8601 timestamp. |
| 1046 | +
|
| 1047 | + until: Only include items before this ISO 8601 timestamp. |
| 1048 | +
|
| 1049 | + extra_headers: Send extra headers |
| 1050 | +
|
| 1051 | + extra_query: Add additional query parameters to the request |
| 1052 | +
|
| 1053 | + extra_body: Add additional JSON properties to the request |
| 1054 | +
|
| 1055 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1056 | + """ |
| 1057 | + return await self._get( |
| 1058 | + "/monitors/credit-usage", |
| 1059 | + options=make_request_options( |
| 1060 | + extra_headers=extra_headers, |
| 1061 | + extra_query=extra_query, |
| 1062 | + extra_body=extra_body, |
| 1063 | + timeout=timeout, |
| 1064 | + query=await async_maybe_transform( |
| 1065 | + { |
| 1066 | + "since": since, |
| 1067 | + "until": until, |
| 1068 | + }, |
| 1069 | + monitor_get_credit_usage_params.MonitorGetCreditUsageParams, |
| 1070 | + ), |
| 1071 | + ), |
| 1072 | + cast_to=MonitorGetCreditUsageResponse, |
| 1073 | + ) |
| 1074 | + |
| 1075 | + async def get_limits( |
| 1076 | + self, |
| 1077 | + *, |
| 1078 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1079 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1080 | + extra_headers: Headers | None = None, |
| 1081 | + extra_query: Query | None = None, |
| 1082 | + extra_body: Body | None = None, |
| 1083 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1084 | + ) -> MonitorGetLimitsResponse: |
| 1085 | + """Returns how many monitors the account has and the maximum it allows.""" |
| 1086 | + return await self._get( |
| 1087 | + "/monitors/limits", |
| 1088 | + options=make_request_options( |
| 1089 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 1090 | + ), |
| 1091 | + cast_to=MonitorGetLimitsResponse, |
| 1092 | + ) |
| 1093 | + |
959 | 1094 | async def list_account_changes( |
960 | 1095 | self, |
961 | 1096 | *, |
@@ -1278,6 +1413,12 @@ def __init__(self, monitors: MonitorsResource) -> None: |
1278 | 1413 | self.delete = to_raw_response_wrapper( |
1279 | 1414 | monitors.delete, |
1280 | 1415 | ) |
| 1416 | + self.get_credit_usage = to_raw_response_wrapper( |
| 1417 | + monitors.get_credit_usage, |
| 1418 | + ) |
| 1419 | + self.get_limits = to_raw_response_wrapper( |
| 1420 | + monitors.get_limits, |
| 1421 | + ) |
1281 | 1422 | self.list_account_changes = to_raw_response_wrapper( |
1282 | 1423 | monitors.list_account_changes, |
1283 | 1424 | ) |
@@ -1317,6 +1458,12 @@ def __init__(self, monitors: AsyncMonitorsResource) -> None: |
1317 | 1458 | self.delete = async_to_raw_response_wrapper( |
1318 | 1459 | monitors.delete, |
1319 | 1460 | ) |
| 1461 | + self.get_credit_usage = async_to_raw_response_wrapper( |
| 1462 | + monitors.get_credit_usage, |
| 1463 | + ) |
| 1464 | + self.get_limits = async_to_raw_response_wrapper( |
| 1465 | + monitors.get_limits, |
| 1466 | + ) |
1320 | 1467 | self.list_account_changes = async_to_raw_response_wrapper( |
1321 | 1468 | monitors.list_account_changes, |
1322 | 1469 | ) |
@@ -1356,6 +1503,12 @@ def __init__(self, monitors: MonitorsResource) -> None: |
1356 | 1503 | self.delete = to_streamed_response_wrapper( |
1357 | 1504 | monitors.delete, |
1358 | 1505 | ) |
| 1506 | + self.get_credit_usage = to_streamed_response_wrapper( |
| 1507 | + monitors.get_credit_usage, |
| 1508 | + ) |
| 1509 | + self.get_limits = to_streamed_response_wrapper( |
| 1510 | + monitors.get_limits, |
| 1511 | + ) |
1359 | 1512 | self.list_account_changes = to_streamed_response_wrapper( |
1360 | 1513 | monitors.list_account_changes, |
1361 | 1514 | ) |
@@ -1395,6 +1548,12 @@ def __init__(self, monitors: AsyncMonitorsResource) -> None: |
1395 | 1548 | self.delete = async_to_streamed_response_wrapper( |
1396 | 1549 | monitors.delete, |
1397 | 1550 | ) |
| 1551 | + self.get_credit_usage = async_to_streamed_response_wrapper( |
| 1552 | + monitors.get_credit_usage, |
| 1553 | + ) |
| 1554 | + self.get_limits = async_to_streamed_response_wrapper( |
| 1555 | + monitors.get_limits, |
| 1556 | + ) |
1398 | 1557 | self.list_account_changes = async_to_streamed_response_wrapper( |
1399 | 1558 | monitors.list_account_changes, |
1400 | 1559 | ) |
|
0 commit comments