Skip to content

Commit 5e0ea7b

Browse files
feat(api): aggregated API specs update
1 parent 3350bb9 commit 5e0ea7b

4 files changed

Lines changed: 49 additions & 5 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 645
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-6ff85e022c3a07d4d1dddfb6fb263de4f7482ed0099d5d8e814ba7d2d1158f4e.yml
3-
openapi_spec_hash: 44c0a0aa8c3959d840b1cd449a281ed9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-6c0a6b2ebeb53f375b862c8cb43c0a1a2b6b63148df5e3d846da34baf63548f4.yml
3+
openapi_spec_hash: 9a8fc579465b9222bd17c6e039e2ff5b
44
config_hash: e81f299feec21ef63a02ee2de1ba99a3

src/gcore/resources/cloud/quotas/requests.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from __future__ import annotations
44

5-
from typing import List
5+
from typing import List, Union, Iterable
6+
from datetime import datetime
67
from typing_extensions import Literal
78

89
import httpx
@@ -93,8 +94,11 @@ def create(
9394
def list(
9495
self,
9596
*,
97+
created_from: Union[str, datetime] | Omit = omit,
98+
created_to: Union[str, datetime] | Omit = omit,
9699
limit: int | Omit = omit,
97100
offset: int | Omit = omit,
101+
request_ids: Iterable[int] | Omit = omit,
98102
status: List[Literal["done", "in progress", "rejected"]] | Omit = omit,
99103
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
100104
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -107,11 +111,17 @@ def list(
107111
Get a list of sent requests to change current quotas and their statuses.
108112
109113
Args:
114+
created_from: Filter limit requests created at or after this datetime (inclusive)
115+
116+
created_to: Filter limit requests created at or before this datetime (inclusive)
117+
110118
limit: Optional. Limit the number of returned items
111119
112120
offset: Optional. Offset value is used to exclude the first set of records from the
113121
result
114122
123+
request_ids: List of limit request IDs for filtering
124+
115125
status: List of limit requests statuses for filtering
116126
117127
extra_headers: Send extra headers
@@ -132,8 +142,11 @@ def list(
132142
timeout=timeout,
133143
query=maybe_transform(
134144
{
145+
"created_from": created_from,
146+
"created_to": created_to,
135147
"limit": limit,
136148
"offset": offset,
149+
"request_ids": request_ids,
137150
"status": status,
138151
},
139152
request_list_params.RequestListParams,
@@ -277,8 +290,11 @@ async def create(
277290
def list(
278291
self,
279292
*,
293+
created_from: Union[str, datetime] | Omit = omit,
294+
created_to: Union[str, datetime] | Omit = omit,
280295
limit: int | Omit = omit,
281296
offset: int | Omit = omit,
297+
request_ids: Iterable[int] | Omit = omit,
282298
status: List[Literal["done", "in progress", "rejected"]] | Omit = omit,
283299
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
284300
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -291,11 +307,17 @@ def list(
291307
Get a list of sent requests to change current quotas and their statuses.
292308
293309
Args:
310+
created_from: Filter limit requests created at or after this datetime (inclusive)
311+
312+
created_to: Filter limit requests created at or before this datetime (inclusive)
313+
294314
limit: Optional. Limit the number of returned items
295315
296316
offset: Optional. Offset value is used to exclude the first set of records from the
297317
result
298318
319+
request_ids: List of limit request IDs for filtering
320+
299321
status: List of limit requests statuses for filtering
300322
301323
extra_headers: Send extra headers
@@ -316,8 +338,11 @@ def list(
316338
timeout=timeout,
317339
query=maybe_transform(
318340
{
341+
"created_from": created_from,
342+
"created_to": created_to,
319343
"limit": limit,
320344
"offset": offset,
345+
"request_ids": request_ids,
321346
"status": status,
322347
},
323348
request_list_params.RequestListParams,

src/gcore/types/cloud/quotas/request_list_params.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22

33
from __future__ import annotations
44

5-
from typing import List
6-
from typing_extensions import Literal, TypedDict
5+
from typing import List, Union, Iterable
6+
from datetime import datetime
7+
from typing_extensions import Literal, Annotated, TypedDict
8+
9+
from ...._utils import PropertyInfo
710

811
__all__ = ["RequestListParams"]
912

1013

1114
class RequestListParams(TypedDict, total=False):
15+
created_from: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
16+
"""Filter limit requests created at or after this datetime (inclusive)"""
17+
18+
created_to: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
19+
"""Filter limit requests created at or before this datetime (inclusive)"""
20+
1221
limit: int
1322
"""Optional. Limit the number of returned items"""
1423

@@ -18,5 +27,8 @@ class RequestListParams(TypedDict, total=False):
1827
Offset value is used to exclude the first set of records from the result
1928
"""
2029

30+
request_ids: Iterable[int]
31+
"""List of limit request IDs for filtering"""
32+
2133
status: List[Literal["done", "in progress", "rejected"]]
2234
"""List of limit requests statuses for filtering"""

tests/api_resources/cloud/quotas/test_requests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from gcore import Gcore, AsyncGcore
1111
from tests.utils import assert_matches_type
12+
from gcore._utils import parse_datetime
1213
from gcore.pagination import SyncOffsetPage, AsyncOffsetPage
1314
from gcore.types.cloud.quotas import RequestGetResponse, RequestListResponse
1415

@@ -134,8 +135,11 @@ def test_method_list(self, client: Gcore) -> None:
134135
@parametrize
135136
def test_method_list_with_all_params(self, client: Gcore) -> None:
136137
request = client.cloud.quotas.requests.list(
138+
created_from=parse_datetime("2024-01-01T00:00:00Z"),
139+
created_to=parse_datetime("2024-12-31T23:59:59Z"),
137140
limit=1000,
138141
offset=0,
142+
request_ids=[1, 2, 3],
139143
status=["done", "in progress"],
140144
)
141145
assert_matches_type(SyncOffsetPage[RequestListResponse], request, path=["response"])
@@ -344,8 +348,11 @@ async def test_method_list(self, async_client: AsyncGcore) -> None:
344348
@parametrize
345349
async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> None:
346350
request = await async_client.cloud.quotas.requests.list(
351+
created_from=parse_datetime("2024-01-01T00:00:00Z"),
352+
created_to=parse_datetime("2024-12-31T23:59:59Z"),
347353
limit=1000,
348354
offset=0,
355+
request_ids=[1, 2, 3],
349356
status=["done", "in progress"],
350357
)
351358
assert_matches_type(AsyncOffsetPage[RequestListResponse], request, path=["response"])

0 commit comments

Comments
 (0)