Skip to content

Commit 46ef334

Browse files
feat(api): aggregated API specs update
1 parent b0d1b0d commit 46ef334

4 files changed

Lines changed: 19 additions & 6 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-520b868ef84890063a573a0950c561d928555de782b94a4964b81ddfac2b9965.yml
3-
openapi_spec_hash: 312c4e3f3849455e8b59d4acd991d0f9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-2f258036cad399055647446f0aae41c40f29bf6b486de68ed565653c10adb569.yml
3+
openapi_spec_hash: 319b97727a2c05125aa27228db52053c
44
config_hash: 332323cce99008ceec46e04aeb672e0a

src/gcore/resources/cloud/regions.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def with_streaming_response(self) -> RegionsResourceWithStreamingResponse:
4747
def list(
4848
self,
4949
*,
50+
display_name: str | Omit = omit,
5051
limit: int | Omit = omit,
5152
offset: int | Omit = omit,
5253
order_by: Literal["created_at.asc", "created_at.desc", "display_name.asc", "display_name.desc"] | Omit = omit,
@@ -62,9 +63,11 @@ def list(
6263
"""List regions
6364
6465
Args:
65-
limit: Limit the number of returned regions.
66+
display_name: Filter regions by display name.
6667
67-
Falls back to default of 100 if not
68+
Case-insensitive exact match.
69+
70+
limit: Limit the number of returned regions. Falls back to default of 100 if not
6871
specified. Limited by max limit value of 1000
6972
7073
offset: Offset value is used to exclude the first set of records from the result
@@ -94,6 +97,7 @@ def list(
9497
timeout=timeout,
9598
query=maybe_transform(
9699
{
100+
"display_name": display_name,
97101
"limit": limit,
98102
"offset": offset,
99103
"order_by": order_by,
@@ -173,6 +177,7 @@ def with_streaming_response(self) -> AsyncRegionsResourceWithStreamingResponse:
173177
def list(
174178
self,
175179
*,
180+
display_name: str | Omit = omit,
176181
limit: int | Omit = omit,
177182
offset: int | Omit = omit,
178183
order_by: Literal["created_at.asc", "created_at.desc", "display_name.asc", "display_name.desc"] | Omit = omit,
@@ -188,9 +193,11 @@ def list(
188193
"""List regions
189194
190195
Args:
191-
limit: Limit the number of returned regions.
196+
display_name: Filter regions by display name.
197+
198+
Case-insensitive exact match.
192199
193-
Falls back to default of 100 if not
200+
limit: Limit the number of returned regions. Falls back to default of 100 if not
194201
specified. Limited by max limit value of 1000
195202
196203
offset: Offset value is used to exclude the first set of records from the result
@@ -220,6 +227,7 @@ def list(
220227
timeout=timeout,
221228
query=maybe_transform(
222229
{
230+
"display_name": display_name,
223231
"limit": limit,
224232
"offset": offset,
225233
"order_by": order_by,

src/gcore/types/cloud/region_list_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99

1010
class RegionListParams(TypedDict, total=False):
11+
display_name: str
12+
"""Filter regions by display name. Case-insensitive exact match."""
13+
1114
limit: int
1215
"""Limit the number of returned regions.
1316

tests/api_resources/cloud/test_regions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def test_method_list(self, client: Gcore) -> None:
2626
@parametrize
2727
def test_method_list_with_all_params(self, client: Gcore) -> None:
2828
region = client.cloud.regions.list(
29+
display_name="Luxembourg",
2930
limit=100,
3031
offset=0,
3132
order_by="created_at.desc",
@@ -107,6 +108,7 @@ async def test_method_list(self, async_client: AsyncGcore) -> None:
107108
@parametrize
108109
async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> None:
109110
region = await async_client.cloud.regions.list(
111+
display_name="Luxembourg",
110112
limit=100,
111113
offset=0,
112114
order_by="created_at.desc",

0 commit comments

Comments
 (0)