Skip to content

Commit 06e1dc3

Browse files
fix!: streamline naming for create/replace models
1 parent 143cc71 commit 06e1dc3

10 files changed

Lines changed: 52 additions & 52 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 633
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-13b60e34552837742dacb42e3d25d8131082d2f5362fa2bde2d2e0d2c7f40424.yml
33
openapi_spec_hash: 3e9d9a4580d1579dadb5096822f9eb74
4-
config_hash: c71c5fd84e30d315500ae54ec3a83b71
4+
config_hash: d269f66003019c08690390a35368f05c

api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ Methods:
149149
Types:
150150

151151
```python
152-
from gcore.types.cloud import SSHKey, SSHKeyCreated
152+
from gcore.types.cloud import SSHKey, SSHKeyCreate
153153
```
154154

155155
Methods:
156156

157-
- <code title="post /cloud/v1/ssh_keys/{project_id}">client.cloud.ssh_keys.<a href="./src/gcore/resources/cloud/ssh_keys.py">create</a>(\*, project_id, \*\*<a href="src/gcore/types/cloud/ssh_key_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/ssh_key_created.py">SSHKeyCreated</a></code>
157+
- <code title="post /cloud/v1/ssh_keys/{project_id}">client.cloud.ssh_keys.<a href="./src/gcore/resources/cloud/ssh_keys.py">create</a>(\*, project_id, \*\*<a href="src/gcore/types/cloud/ssh_key_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/ssh_key_create.py">SSHKeyCreate</a></code>
158158
- <code title="patch /cloud/v1/ssh_keys/{project_id}/{ssh_key_id}">client.cloud.ssh_keys.<a href="./src/gcore/resources/cloud/ssh_keys.py">update</a>(ssh_key_id, \*, project_id, \*\*<a href="src/gcore/types/cloud/ssh_key_update_params.py">params</a>) -> <a href="./src/gcore/types/cloud/ssh_key.py">SSHKey</a></code>
159159
- <code title="get /cloud/v1/ssh_keys/{project_id}">client.cloud.ssh_keys.<a href="./src/gcore/resources/cloud/ssh_keys.py">list</a>(\*, project_id, \*\*<a href="src/gcore/types/cloud/ssh_key_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/ssh_key.py">SyncOffsetPage[SSHKey]</a></code>
160160
- <code title="delete /cloud/v1/ssh_keys/{project_id}/{ssh_key_id}">client.cloud.ssh_keys.<a href="./src/gcore/resources/cloud/ssh_keys.py">delete</a>(ssh_key_id, \*, project_id) -> None</code>
@@ -699,19 +699,19 @@ Types:
699699
```python
700700
from gcore.types.cloud.registries import (
701701
RegistryUser,
702-
RegistryUserCreated,
702+
RegistryUserCreate,
703703
RegistryUserList,
704704
UserRefreshSecretResponse,
705705
)
706706
```
707707

708708
Methods:
709709

710-
- <code title="post /cloud/v1/registries/{project_id}/{region_id}/{registry_id}/users">client.cloud.registries.users.<a href="./src/gcore/resources/cloud/registries/users.py">create</a>(registry_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/registries/user_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/registries/registry_user_created.py">RegistryUserCreated</a></code>
710+
- <code title="post /cloud/v1/registries/{project_id}/{region_id}/{registry_id}/users">client.cloud.registries.users.<a href="./src/gcore/resources/cloud/registries/users.py">create</a>(registry_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/registries/user_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/registries/registry_user_create.py">RegistryUserCreate</a></code>
711711
- <code title="patch /cloud/v1/registries/{project_id}/{region_id}/{registry_id}/users/{user_id}">client.cloud.registries.users.<a href="./src/gcore/resources/cloud/registries/users.py">update</a>(user_id, \*, project_id, region_id, registry_id, \*\*<a href="src/gcore/types/cloud/registries/user_update_params.py">params</a>) -> <a href="./src/gcore/types/cloud/registries/registry_user.py">RegistryUser</a></code>
712712
- <code title="get /cloud/v1/registries/{project_id}/{region_id}/{registry_id}/users">client.cloud.registries.users.<a href="./src/gcore/resources/cloud/registries/users.py">list</a>(registry_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/registries/registry_user_list.py">RegistryUserList</a></code>
713713
- <code title="delete /cloud/v1/registries/{project_id}/{region_id}/{registry_id}/users/{user_id}">client.cloud.registries.users.<a href="./src/gcore/resources/cloud/registries/users.py">delete</a>(user_id, \*, project_id, region_id, registry_id) -> None</code>
714-
- <code title="post /cloud/v1/registries/{project_id}/{region_id}/{registry_id}/users/batch">client.cloud.registries.users.<a href="./src/gcore/resources/cloud/registries/users.py">create_multiple</a>(registry_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/registries/user_create_multiple_params.py">params</a>) -> <a href="./src/gcore/types/cloud/registries/registry_user_created.py">RegistryUserCreated</a></code>
714+
- <code title="post /cloud/v1/registries/{project_id}/{region_id}/{registry_id}/users/batch">client.cloud.registries.users.<a href="./src/gcore/resources/cloud/registries/users.py">create_multiple</a>(registry_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/registries/user_create_multiple_params.py">params</a>) -> <a href="./src/gcore/types/cloud/registries/registry_user_create.py">RegistryUserCreate</a></code>
715715
- <code title="post /cloud/v1/registries/{project_id}/{region_id}/{registry_id}/users/{user_id}/refresh_secret">client.cloud.registries.users.<a href="./src/gcore/resources/cloud/registries/users.py">refresh_secret</a>(user_id, \*, project_id, region_id, registry_id) -> <a href="./src/gcore/types/cloud/registries/user_refresh_secret_response.py">UserRefreshSecretResponse</a></code>
716716

717717
## FileShares
@@ -2266,13 +2266,13 @@ Methods:
22662266
Types:
22672267

22682268
```python
2269-
from gcore.types.cdn.resources import OriginShielding, OriginShieldingUpdated
2269+
from gcore.types.cdn.resources import OriginShielding, OriginShieldingReplace
22702270
```
22712271

22722272
Methods:
22732273

22742274
- <code title="get /cdn/resources/{resource_id}/shielding_v2">client.cdn.resources.shield.<a href="./src/gcore/resources/cdn/resources/shield.py">get</a>(resource_id) -> <a href="./src/gcore/types/cdn/resources/origin_shielding.py">OriginShielding</a></code>
2275-
- <code title="put /cdn/resources/{resource_id}/shielding_v2">client.cdn.resources.shield.<a href="./src/gcore/resources/cdn/resources/shield.py">replace</a>(resource_id, \*\*<a href="src/gcore/types/cdn/resources/shield_replace_params.py">params</a>) -> <a href="./src/gcore/types/cdn/resources/origin_shielding_updated.py">object</a></code>
2275+
- <code title="put /cdn/resources/{resource_id}/shielding_v2">client.cdn.resources.shield.<a href="./src/gcore/resources/cdn/resources/shield.py">replace</a>(resource_id, \*\*<a href="src/gcore/types/cdn/resources/shield_replace_params.py">params</a>) -> <a href="./src/gcore/types/cdn/resources/origin_shielding_replace.py">object</a></code>
22762276

22772277
### Rules
22782278

src/gcore/resources/cloud/registries/users.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from ....types.cloud.registries import user_create_params, user_update_params, user_create_multiple_params
2121
from ....types.cloud.registries.registry_user import RegistryUser
2222
from ....types.cloud.registries.registry_user_list import RegistryUserList
23-
from ....types.cloud.registries.registry_user_created import RegistryUserCreated
23+
from ....types.cloud.registries.registry_user_create import RegistryUserCreate
2424
from ....types.cloud.registries.user_refresh_secret_response import UserRefreshSecretResponse
2525

2626
__all__ = ["UsersResource", "AsyncUsersResource"]
@@ -62,7 +62,7 @@ def create(
6262
extra_query: Query | None = None,
6363
extra_body: Body | None = None,
6464
timeout: float | httpx.Timeout | None | NotGiven = not_given,
65-
) -> RegistryUserCreated:
65+
) -> RegistryUserCreate:
6666
"""
6767
Create a new user for accessing the container registry.
6868
@@ -105,7 +105,7 @@ def create(
105105
options=make_request_options(
106106
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
107107
),
108-
cast_to=RegistryUserCreated,
108+
cast_to=RegistryUserCreate,
109109
)
110110

111111
def update(
@@ -248,7 +248,7 @@ def create_multiple(
248248
extra_query: Query | None = None,
249249
extra_body: Body | None = None,
250250
timeout: float | httpx.Timeout | None | NotGiven = not_given,
251-
) -> RegistryUserCreated:
251+
) -> RegistryUserCreate:
252252
"""
253253
Create multiple users for accessing the container registry in a single request.
254254
@@ -273,7 +273,7 @@ def create_multiple(
273273
options=make_request_options(
274274
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
275275
),
276-
cast_to=RegistryUserCreated,
276+
cast_to=RegistryUserCreate,
277277
)
278278

279279
def refresh_secret(
@@ -351,7 +351,7 @@ async def create(
351351
extra_query: Query | None = None,
352352
extra_body: Body | None = None,
353353
timeout: float | httpx.Timeout | None | NotGiven = not_given,
354-
) -> RegistryUserCreated:
354+
) -> RegistryUserCreate:
355355
"""
356356
Create a new user for accessing the container registry.
357357
@@ -394,7 +394,7 @@ async def create(
394394
options=make_request_options(
395395
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
396396
),
397-
cast_to=RegistryUserCreated,
397+
cast_to=RegistryUserCreate,
398398
)
399399

400400
async def update(
@@ -537,7 +537,7 @@ async def create_multiple(
537537
extra_query: Query | None = None,
538538
extra_body: Body | None = None,
539539
timeout: float | httpx.Timeout | None | NotGiven = not_given,
540-
) -> RegistryUserCreated:
540+
) -> RegistryUserCreate:
541541
"""
542542
Create multiple users for accessing the container registry in a single request.
543543
@@ -562,7 +562,7 @@ async def create_multiple(
562562
options=make_request_options(
563563
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
564564
),
565-
cast_to=RegistryUserCreated,
565+
cast_to=RegistryUserCreate,
566566
)
567567

568568
async def refresh_secret(

src/gcore/resources/cloud/ssh_keys.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from ...types.cloud import ssh_key_list_params, ssh_key_create_params, ssh_key_update_params
2121
from ..._base_client import AsyncPaginator, make_request_options
2222
from ...types.cloud.ssh_key import SSHKey
23-
from ...types.cloud.ssh_key_created import SSHKeyCreated
23+
from ...types.cloud.ssh_key_create import SSHKeyCreate
2424

2525
__all__ = ["SSHKeysResource", "AsyncSSHKeysResource"]
2626

@@ -58,7 +58,7 @@ def create(
5858
extra_query: Query | None = None,
5959
extra_body: Body | None = None,
6060
timeout: float | httpx.Timeout | None | NotGiven = not_given,
61-
) -> SSHKeyCreated:
61+
) -> SSHKeyCreate:
6262
"""
6363
To generate a key, omit the `public_key` parameter from the request body
6464
@@ -102,7 +102,7 @@ def create(
102102
options=make_request_options(
103103
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
104104
),
105-
cast_to=SSHKeyCreated,
105+
cast_to=SSHKeyCreate,
106106
)
107107

108108
def update(
@@ -325,7 +325,7 @@ async def create(
325325
extra_query: Query | None = None,
326326
extra_body: Body | None = None,
327327
timeout: float | httpx.Timeout | None | NotGiven = not_given,
328-
) -> SSHKeyCreated:
328+
) -> SSHKeyCreate:
329329
"""
330330
To generate a key, omit the `public_key` parameter from the request body
331331
@@ -369,7 +369,7 @@ async def create(
369369
options=make_request_options(
370370
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
371371
),
372-
cast_to=SSHKeyCreated,
372+
cast_to=SSHKeyCreate,
373373
)
374374

375375
async def update(

src/gcore/types/cloud/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
from .gpu_image_list import GPUImageList as GPUImageList
4242
from .health_monitor import HealthMonitor as HealthMonitor
4343
from .security_group import SecurityGroup as SecurityGroup
44+
from .ssh_key_create import SSHKeyCreate as SSHKeyCreate
4445
from .audit_log_entry import AuditLogEntry as AuditLogEntry
4546
from .listener_status import ListenerStatus as ListenerStatus
4647
from .network_details import NetworkDetails as NetworkDetails
4748
from .placement_group import PlacementGroup as PlacementGroup
48-
from .ssh_key_created import SSHKeyCreated as SSHKeyCreated
4949
from .baremetal_flavor import BaremetalFlavor as BaremetalFlavor
5050
from .floating_address import FloatingAddress as FloatingAddress
5151
from .lb_pool_protocol import LbPoolProtocol as LbPoolProtocol

src/gcore/types/cloud/registries/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .user_create_params import UserCreateParams as UserCreateParams
99
from .user_update_params import UserUpdateParams as UserUpdateParams
1010
from .registry_repository import RegistryRepository as RegistryRepository
11-
from .registry_user_created import RegistryUserCreated as RegistryUserCreated
11+
from .registry_user_create import RegistryUserCreate as RegistryUserCreate
1212
from .registry_artifact_list import RegistryArtifactList as RegistryArtifactList
1313
from .registry_repository_list import RegistryRepositoryList as RegistryRepositoryList
1414
from .user_create_multiple_params import UserCreateMultipleParams as UserCreateMultipleParams

src/gcore/types/cloud/registries/registry_user_created.py renamed to src/gcore/types/cloud/registries/registry_user_create.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
from ...._models import BaseModel
77

8-
__all__ = ["RegistryUserCreated"]
8+
__all__ = ["RegistryUserCreate"]
99

1010

11-
class RegistryUserCreated(BaseModel):
11+
class RegistryUserCreate(BaseModel):
1212
id: int
1313
"""User ID"""
1414

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
from ..._models import BaseModel
88

9-
__all__ = ["SSHKeyCreated"]
9+
__all__ = ["SSHKeyCreate"]
1010

1111

12-
class SSHKeyCreated(BaseModel):
12+
class SSHKeyCreate(BaseModel):
1313
id: str
1414
"""SSH key ID"""
1515

tests/api_resources/cloud/registries/test_users.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from gcore.types.cloud.registries import (
1313
RegistryUser,
1414
RegistryUserList,
15-
RegistryUserCreated,
15+
RegistryUserCreate,
1616
UserRefreshSecretResponse,
1717
)
1818

@@ -31,7 +31,7 @@ def test_method_create(self, client: Gcore) -> None:
3131
duration=14,
3232
name="user1",
3333
)
34-
assert_matches_type(RegistryUserCreated, user, path=["response"])
34+
assert_matches_type(RegistryUserCreate, user, path=["response"])
3535

3636
@parametrize
3737
def test_method_create_with_all_params(self, client: Gcore) -> None:
@@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Gcore) -> None:
4444
read_only=False,
4545
secret="secret",
4646
)
47-
assert_matches_type(RegistryUserCreated, user, path=["response"])
47+
assert_matches_type(RegistryUserCreate, user, path=["response"])
4848

4949
@parametrize
5050
def test_raw_response_create(self, client: Gcore) -> None:
@@ -59,7 +59,7 @@ def test_raw_response_create(self, client: Gcore) -> None:
5959
assert response.is_closed is True
6060
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
6161
user = response.parse()
62-
assert_matches_type(RegistryUserCreated, user, path=["response"])
62+
assert_matches_type(RegistryUserCreate, user, path=["response"])
6363

6464
@parametrize
6565
def test_streaming_response_create(self, client: Gcore) -> None:
@@ -74,7 +74,7 @@ def test_streaming_response_create(self, client: Gcore) -> None:
7474
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
7575

7676
user = response.parse()
77-
assert_matches_type(RegistryUserCreated, user, path=["response"])
77+
assert_matches_type(RegistryUserCreate, user, path=["response"])
7878

7979
assert cast(Any, response.is_closed) is True
8080

@@ -223,7 +223,7 @@ def test_method_create_multiple(self, client: Gcore) -> None:
223223
}
224224
],
225225
)
226-
assert_matches_type(RegistryUserCreated, user, path=["response"])
226+
assert_matches_type(RegistryUserCreate, user, path=["response"])
227227

228228
@parametrize
229229
def test_raw_response_create_multiple(self, client: Gcore) -> None:
@@ -242,7 +242,7 @@ def test_raw_response_create_multiple(self, client: Gcore) -> None:
242242
assert response.is_closed is True
243243
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
244244
user = response.parse()
245-
assert_matches_type(RegistryUserCreated, user, path=["response"])
245+
assert_matches_type(RegistryUserCreate, user, path=["response"])
246246

247247
@parametrize
248248
def test_streaming_response_create_multiple(self, client: Gcore) -> None:
@@ -261,7 +261,7 @@ def test_streaming_response_create_multiple(self, client: Gcore) -> None:
261261
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
262262

263263
user = response.parse()
264-
assert_matches_type(RegistryUserCreated, user, path=["response"])
264+
assert_matches_type(RegistryUserCreate, user, path=["response"])
265265

266266
assert cast(Any, response.is_closed) is True
267267

@@ -320,7 +320,7 @@ async def test_method_create(self, async_client: AsyncGcore) -> None:
320320
duration=14,
321321
name="user1",
322322
)
323-
assert_matches_type(RegistryUserCreated, user, path=["response"])
323+
assert_matches_type(RegistryUserCreate, user, path=["response"])
324324

325325
@parametrize
326326
async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> None:
@@ -333,7 +333,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGcore) ->
333333
read_only=False,
334334
secret="secret",
335335
)
336-
assert_matches_type(RegistryUserCreated, user, path=["response"])
336+
assert_matches_type(RegistryUserCreate, user, path=["response"])
337337

338338
@parametrize
339339
async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
@@ -348,7 +348,7 @@ async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
348348
assert response.is_closed is True
349349
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
350350
user = await response.parse()
351-
assert_matches_type(RegistryUserCreated, user, path=["response"])
351+
assert_matches_type(RegistryUserCreate, user, path=["response"])
352352

353353
@parametrize
354354
async def test_streaming_response_create(self, async_client: AsyncGcore) -> None:
@@ -363,7 +363,7 @@ async def test_streaming_response_create(self, async_client: AsyncGcore) -> None
363363
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
364364

365365
user = await response.parse()
366-
assert_matches_type(RegistryUserCreated, user, path=["response"])
366+
assert_matches_type(RegistryUserCreate, user, path=["response"])
367367

368368
assert cast(Any, response.is_closed) is True
369369

@@ -512,7 +512,7 @@ async def test_method_create_multiple(self, async_client: AsyncGcore) -> None:
512512
}
513513
],
514514
)
515-
assert_matches_type(RegistryUserCreated, user, path=["response"])
515+
assert_matches_type(RegistryUserCreate, user, path=["response"])
516516

517517
@parametrize
518518
async def test_raw_response_create_multiple(self, async_client: AsyncGcore) -> None:
@@ -531,7 +531,7 @@ async def test_raw_response_create_multiple(self, async_client: AsyncGcore) -> N
531531
assert response.is_closed is True
532532
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
533533
user = await response.parse()
534-
assert_matches_type(RegistryUserCreated, user, path=["response"])
534+
assert_matches_type(RegistryUserCreate, user, path=["response"])
535535

536536
@parametrize
537537
async def test_streaming_response_create_multiple(self, async_client: AsyncGcore) -> None:
@@ -550,7 +550,7 @@ async def test_streaming_response_create_multiple(self, async_client: AsyncGcore
550550
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
551551

552552
user = await response.parse()
553-
assert_matches_type(RegistryUserCreated, user, path=["response"])
553+
assert_matches_type(RegistryUserCreate, user, path=["response"])
554554

555555
assert cast(Any, response.is_closed) is True
556556

0 commit comments

Comments
 (0)