Skip to content

Commit 789277a

Browse files
feat(api): aggregated API specs update
1 parent ff1db23 commit 789277a

8 files changed

Lines changed: 28 additions & 46 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: 641
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-d3062187985fbeaf2d7852a622344a75a8a87e0e941743194c44f74ee0222dbb.yml
3-
openapi_spec_hash: 01b0048f185d3ceb84fe75a52a27afc8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-26212428643e136f317e84302b933a8f4c65f88cc78c254ed40ad1c0793341f2.yml
3+
openapi_spec_hash: 6907d8b360bddcbc5adaef5054eab10e
44
config_hash: c6c8ef25ca05ecd4082810d4afd564cf

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,7 @@ Methods:
21562156
- <code title="get /dns/v2/network-mappings/{id}">client.dns.network_mappings.<a href="./src/gcore/resources/dns/network_mappings.py">get</a>(id) -> <a href="./src/gcore/types/dns/dns_network_mapping.py">DNSNetworkMapping</a></code>
21572157
- <code title="get /dns/v2/network-mappings/{name}">client.dns.network_mappings.<a href="./src/gcore/resources/dns/network_mappings.py">get_by_name</a>(name) -> <a href="./src/gcore/types/dns/dns_network_mapping.py">DNSNetworkMapping</a></code>
21582158
- <code title="post /dns/v2/network-mappings/import">client.dns.network*mappings.<a href="./src/gcore/resources/dns/network_mappings.py">import*</a>() -> <a href="./src/gcore/types/dns/network_mapping_import_response.py">NetworkMappingImportResponse</a></code>
2159-
- <code title="put /dns/v2/network-mappings/{id}">client.dns.network_mappings.<a href="./src/gcore/resources/dns/network_mappings.py">replace</a>(path_id, \*\*<a href="src/gcore/types/dns/network_mapping_replace_params.py">params</a>) -> object</code>
2159+
- <code title="put /dns/v2/network-mappings/{id}">client.dns.network_mappings.<a href="./src/gcore/resources/dns/network_mappings.py">replace</a>(id, \*\*<a href="src/gcore/types/dns/network_mapping_replace_params.py">params</a>) -> object</code>
21602160

21612161
# Storage
21622162

src/gcore/resources/dns/network_mappings.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def with_streaming_response(self) -> NetworkMappingsResourceWithStreamingRespons
5151
def create(
5252
self,
5353
*,
54-
id: int | Omit = omit,
5554
mapping: Iterable[DNSMappingEntryParam] | Omit = omit,
5655
name: str | Omit = omit,
5756
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -112,7 +111,6 @@ def create(
112111
"/dns/v2/network-mappings",
113112
body=maybe_transform(
114113
{
115-
"id": id,
116114
"mapping": mapping,
117115
"name": name,
118116
},
@@ -388,9 +386,8 @@ def import_(
388386

389387
def replace(
390388
self,
391-
path_id: int,
389+
id: int,
392390
*,
393-
body_id: int | Omit = omit,
394391
mapping: Iterable[DNSMappingEntryParam] | Omit = omit,
395392
name: str | Omit = omit,
396393
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -446,10 +443,9 @@ def replace(
446443
timeout: Override the client-level default timeout for this request, in seconds
447444
"""
448445
return self._put(
449-
f"/dns/v2/network-mappings/{path_id}",
446+
f"/dns/v2/network-mappings/{id}",
450447
body=maybe_transform(
451448
{
452-
"body_id": body_id,
453449
"mapping": mapping,
454450
"name": name,
455451
},
@@ -485,7 +481,6 @@ def with_streaming_response(self) -> AsyncNetworkMappingsResourceWithStreamingRe
485481
async def create(
486482
self,
487483
*,
488-
id: int | Omit = omit,
489484
mapping: Iterable[DNSMappingEntryParam] | Omit = omit,
490485
name: str | Omit = omit,
491486
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -546,7 +541,6 @@ async def create(
546541
"/dns/v2/network-mappings",
547542
body=await async_maybe_transform(
548543
{
549-
"id": id,
550544
"mapping": mapping,
551545
"name": name,
552546
},
@@ -822,9 +816,8 @@ async def import_(
822816

823817
async def replace(
824818
self,
825-
path_id: int,
819+
id: int,
826820
*,
827-
body_id: int | Omit = omit,
828821
mapping: Iterable[DNSMappingEntryParam] | Omit = omit,
829822
name: str | Omit = omit,
830823
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -880,10 +873,9 @@ async def replace(
880873
timeout: Override the client-level default timeout for this request, in seconds
881874
"""
882875
return await self._put(
883-
f"/dns/v2/network-mappings/{path_id}",
876+
f"/dns/v2/network-mappings/{id}",
884877
body=await async_maybe_transform(
885878
{
886-
"body_id": body_id,
887879
"mapping": mapping,
888880
"name": name,
889881
},

src/gcore/types/dns/dns_mapping_entry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
class DNSMappingEntry(BaseModel):
11-
cidr4: Optional[List[object]] = None
11+
cidr4: Optional[List[str]] = None
1212

13-
cidr6: Optional[List[object]] = None
13+
cidr6: Optional[List[str]] = None
1414

1515
tags: Optional[List[str]] = None

src/gcore/types/dns/dns_mapping_entry_param.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
from typing import Iterable
65
from typing_extensions import TypedDict
76

87
from ..._types import SequenceNotStr
@@ -11,8 +10,8 @@
1110

1211

1312
class DNSMappingEntryParam(TypedDict, total=False):
14-
cidr4: Iterable[object]
13+
cidr4: SequenceNotStr[str]
1514

16-
cidr6: Iterable[object]
15+
cidr6: SequenceNotStr[str]
1716

1817
tags: SequenceNotStr[str]

src/gcore/types/dns/network_mapping_create_params.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212

1313
class NetworkMappingCreateParams(TypedDict, total=False):
14-
id: int
15-
1614
mapping: Iterable[DNSMappingEntryParam]
1715

1816
name: str

src/gcore/types/dns/network_mapping_replace_params.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33
from __future__ import annotations
44

55
from typing import Iterable
6-
from typing_extensions import Annotated, TypedDict
6+
from typing_extensions import TypedDict
77

8-
from ..._utils import PropertyInfo
98
from .dns_mapping_entry_param import DNSMappingEntryParam
109

1110
__all__ = ["NetworkMappingReplaceParams"]
1211

1312

1413
class NetworkMappingReplaceParams(TypedDict, total=False):
15-
body_id: Annotated[int, PropertyInfo(alias="id")]
16-
1714
mapping: Iterable[DNSMappingEntryParam]
1815

1916
name: str

tests/api_resources/dns/test_network_mappings.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ def test_method_create(self, client: Gcore) -> None:
3030
@parametrize
3131
def test_method_create_with_all_params(self, client: Gcore) -> None:
3232
network_mapping = client.dns.network_mappings.create(
33-
id=0,
3433
mapping=[
3534
{
36-
"cidr4": [{}],
37-
"cidr6": [{}],
35+
"cidr4": ["string"],
36+
"cidr6": ["string"],
3837
"tags": ["string"],
3938
}
4039
],
@@ -225,19 +224,18 @@ def test_streaming_response_import(self, client: Gcore) -> None:
225224
@parametrize
226225
def test_method_replace(self, client: Gcore) -> None:
227226
network_mapping = client.dns.network_mappings.replace(
228-
path_id=0,
227+
id=0,
229228
)
230229
assert_matches_type(object, network_mapping, path=["response"])
231230

232231
@parametrize
233232
def test_method_replace_with_all_params(self, client: Gcore) -> None:
234233
network_mapping = client.dns.network_mappings.replace(
235-
path_id=0,
236-
body_id=0,
234+
id=0,
237235
mapping=[
238236
{
239-
"cidr4": [{}],
240-
"cidr6": [{}],
237+
"cidr4": ["string"],
238+
"cidr6": ["string"],
241239
"tags": ["string"],
242240
}
243241
],
@@ -248,7 +246,7 @@ def test_method_replace_with_all_params(self, client: Gcore) -> None:
248246
@parametrize
249247
def test_raw_response_replace(self, client: Gcore) -> None:
250248
response = client.dns.network_mappings.with_raw_response.replace(
251-
path_id=0,
249+
id=0,
252250
)
253251

254252
assert response.is_closed is True
@@ -259,7 +257,7 @@ def test_raw_response_replace(self, client: Gcore) -> None:
259257
@parametrize
260258
def test_streaming_response_replace(self, client: Gcore) -> None:
261259
with client.dns.network_mappings.with_streaming_response.replace(
262-
path_id=0,
260+
id=0,
263261
) as response:
264262
assert not response.is_closed
265263
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -283,11 +281,10 @@ async def test_method_create(self, async_client: AsyncGcore) -> None:
283281
@parametrize
284282
async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> None:
285283
network_mapping = await async_client.dns.network_mappings.create(
286-
id=0,
287284
mapping=[
288285
{
289-
"cidr4": [{}],
290-
"cidr6": [{}],
286+
"cidr4": ["string"],
287+
"cidr6": ["string"],
291288
"tags": ["string"],
292289
}
293290
],
@@ -478,19 +475,18 @@ async def test_streaming_response_import(self, async_client: AsyncGcore) -> None
478475
@parametrize
479476
async def test_method_replace(self, async_client: AsyncGcore) -> None:
480477
network_mapping = await async_client.dns.network_mappings.replace(
481-
path_id=0,
478+
id=0,
482479
)
483480
assert_matches_type(object, network_mapping, path=["response"])
484481

485482
@parametrize
486483
async def test_method_replace_with_all_params(self, async_client: AsyncGcore) -> None:
487484
network_mapping = await async_client.dns.network_mappings.replace(
488-
path_id=0,
489-
body_id=0,
485+
id=0,
490486
mapping=[
491487
{
492-
"cidr4": [{}],
493-
"cidr6": [{}],
488+
"cidr4": ["string"],
489+
"cidr6": ["string"],
494490
"tags": ["string"],
495491
}
496492
],
@@ -501,7 +497,7 @@ async def test_method_replace_with_all_params(self, async_client: AsyncGcore) ->
501497
@parametrize
502498
async def test_raw_response_replace(self, async_client: AsyncGcore) -> None:
503499
response = await async_client.dns.network_mappings.with_raw_response.replace(
504-
path_id=0,
500+
id=0,
505501
)
506502

507503
assert response.is_closed is True
@@ -512,7 +508,7 @@ async def test_raw_response_replace(self, async_client: AsyncGcore) -> None:
512508
@parametrize
513509
async def test_streaming_response_replace(self, async_client: AsyncGcore) -> None:
514510
async with async_client.dns.network_mappings.with_streaming_response.replace(
515-
path_id=0,
511+
id=0,
516512
) as response:
517513
assert not response.is_closed
518514
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

0 commit comments

Comments
 (0)