Skip to content

Commit 2c780f3

Browse files
feat(api): aggregated API specs update
1 parent 44b1a56 commit 2c780f3

File tree

9 files changed

+24
-69
lines changed

9 files changed

+24
-69
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 618
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-03327bc118eb0ed98401ef3a157dc7e41173f62114095077f3f49247af7b62a5.yml
3-
openapi_spec_hash: 446c1f8864f2d965b3eece233c5a6b22
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-c358b756aa348a1c6a982fa7af3c5134289f9951a0b2e348d5c5d796cd68a9b9.yml
3+
openapi_spec_hash: 8f53b4d77c357ba5d34d47ec447ec57b
44
config_hash: db560bc3873a6441828babf34ae5f184

src/gcore/resources/storage/credentials.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,6 @@ def recreate(
6262
password for SFTP storage).
6363
6464
Args:
65-
delete_sftp_password: Remove the SFTP password, disabling password authentication. Only applicable to
66-
SFTP storage type.
67-
68-
generate_s3_keys: Generate new S3 access and secret keys for S3 storage. Only applicable to S3
69-
storage type.
70-
71-
generate_sftp_password: Generate a new random password for SFTP access. Only applicable to SFTP storage
72-
type.
73-
74-
reset_sftp_keys: Reset/remove all SSH keys associated with the SFTP storage. Only applicable to
75-
SFTP storage type.
76-
77-
sftp_password: Set a custom password for SFTP access. Only applicable to SFTP storage type.
78-
7965
extra_headers: Send extra headers
8066
8167
extra_query: Add additional query parameters to the request
@@ -144,20 +130,6 @@ async def recreate(
144130
password for SFTP storage).
145131
146132
Args:
147-
delete_sftp_password: Remove the SFTP password, disabling password authentication. Only applicable to
148-
SFTP storage type.
149-
150-
generate_s3_keys: Generate new S3 access and secret keys for S3 storage. Only applicable to S3
151-
storage type.
152-
153-
generate_sftp_password: Generate a new random password for SFTP access. Only applicable to SFTP storage
154-
type.
155-
156-
reset_sftp_keys: Reset/remove all SSH keys associated with the SFTP storage. Only applicable to
157-
SFTP storage type.
158-
159-
sftp_password: Set a custom password for SFTP access. Only applicable to SFTP storage type.
160-
161133
extra_headers: Send extra headers
162134
163135
extra_query: Add additional query parameters to the request

src/gcore/resources/storage/storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def with_streaming_response(self) -> StorageResourceWithStreamingResponse:
9595
def create(
9696
self,
9797
*,
98-
location: Literal["s-ed1", "s-drc2", "s-sgc1", "s-nhn2", "s-darz", "s-ws1", "ams", "sin", "fra", "mia"],
98+
location: str,
9999
name: str,
100100
type: Literal["sftp", "s3"],
101101
generate_sftp_password: bool | Omit = omit,
@@ -499,7 +499,7 @@ def with_streaming_response(self) -> AsyncStorageResourceWithStreamingResponse:
499499
async def create(
500500
self,
501501
*,
502-
location: Literal["s-ed1", "s-drc2", "s-sgc1", "s-nhn2", "s-darz", "s-ws1", "ams", "sin", "fra", "mia"],
502+
location: str,
503503
name: str,
504504
type: Literal["sftp", "s3"],
505505
generate_sftp_password: bool | Omit = omit,

src/gcore/types/storage/credential_recreate_params.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,11 @@
99

1010
class CredentialRecreateParams(TypedDict, total=False):
1111
delete_sftp_password: bool
12-
"""Remove the SFTP password, disabling password authentication.
13-
14-
Only applicable to SFTP storage type.
15-
"""
1612

1713
generate_s3_keys: bool
18-
"""Generate new S3 access and secret keys for S3 storage.
19-
20-
Only applicable to S3 storage type.
21-
"""
2214

2315
generate_sftp_password: bool
24-
"""Generate a new random password for SFTP access.
25-
26-
Only applicable to SFTP storage type.
27-
"""
2816

2917
reset_sftp_keys: bool
30-
"""Reset/remove all SSH keys associated with the SFTP storage.
31-
32-
Only applicable to SFTP storage type.
33-
"""
3418

3519
sftp_password: str
36-
"""Set a custom password for SFTP access. Only applicable to SFTP storage type."""

src/gcore/types/storage/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Storage(BaseModel):
5353
created_at: str
5454
"""ISO 8601 timestamp when the storage was created"""
5555

56-
location: Literal["s-ed1", "s-drc2", "s-sgc1", "s-nhn2", "s-darz", "s-ws1", "ams", "sin", "fra", "mia"]
56+
location: str
5757
"""Geographic location code where the storage is provisioned"""
5858

5959
name: str

src/gcore/types/storage/storage_create_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
class StorageCreateParams(TypedDict, total=False):
11-
location: Required[Literal["s-ed1", "s-drc2", "s-sgc1", "s-nhn2", "s-darz", "s-ws1", "ams", "sin", "fra", "mia"]]
11+
location: Required[str]
1212
"""Geographic location where the storage will be provisioned.
1313
1414
Each location represents a specific data center region.

tests/api_resources/storage/test_credentials.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ def test_method_recreate(self, client: Gcore) -> None:
2828
def test_method_recreate_with_all_params(self, client: Gcore) -> None:
2929
credential = client.storage.credentials.recreate(
3030
storage_id=0,
31-
delete_sftp_password=False,
31+
delete_sftp_password=True,
3232
generate_s3_keys=True,
3333
generate_sftp_password=True,
34-
reset_sftp_keys=False,
35-
sftp_password="MyNewSecurePassword123",
34+
reset_sftp_keys=True,
35+
sftp_password="sftp_password",
3636
)
3737
assert_matches_type(Storage, credential, path=["response"])
3838

@@ -77,11 +77,11 @@ async def test_method_recreate(self, async_client: AsyncGcore) -> None:
7777
async def test_method_recreate_with_all_params(self, async_client: AsyncGcore) -> None:
7878
credential = await async_client.storage.credentials.recreate(
7979
storage_id=0,
80-
delete_sftp_password=False,
80+
delete_sftp_password=True,
8181
generate_s3_keys=True,
8282
generate_sftp_password=True,
83-
reset_sftp_keys=False,
84-
sftp_password="MyNewSecurePassword123",
83+
reset_sftp_keys=True,
84+
sftp_password="sftp_password",
8585
)
8686
assert_matches_type(Storage, credential, path=["response"])
8787

tests/api_resources/storage/test_statistics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_method_get_usage_aggregated(self, client: Gcore) -> None:
2929
def test_method_get_usage_aggregated_with_all_params(self, client: Gcore) -> None:
3030
statistic = client.storage.statistics.get_usage_aggregated(
3131
from_="2006-01-02",
32-
locations=["s-ed1", "s-drc2", "s-sgc1"],
32+
locations=["s-region-1", "s-region-2"],
3333
storages=["123-myStorage"],
3434
to="2006-01-02",
3535
)
@@ -65,7 +65,7 @@ def test_method_get_usage_series_with_all_params(self, client: Gcore) -> None:
6565
statistic = client.storage.statistics.get_usage_series(
6666
from_="2006-01-02",
6767
granularity="12h",
68-
locations=["s-ed1", "s-drc2", "s-sgc1"],
68+
locations=["s-region-1", "s-region-2"],
6969
source=0,
7070
storages=["123-myStorage"],
7171
to="2006-01-02",
@@ -108,7 +108,7 @@ async def test_method_get_usage_aggregated(self, async_client: AsyncGcore) -> No
108108
async def test_method_get_usage_aggregated_with_all_params(self, async_client: AsyncGcore) -> None:
109109
statistic = await async_client.storage.statistics.get_usage_aggregated(
110110
from_="2006-01-02",
111-
locations=["s-ed1", "s-drc2", "s-sgc1"],
111+
locations=["s-region-1", "s-region-2"],
112112
storages=["123-myStorage"],
113113
to="2006-01-02",
114114
)
@@ -144,7 +144,7 @@ async def test_method_get_usage_series_with_all_params(self, async_client: Async
144144
statistic = await async_client.storage.statistics.get_usage_series(
145145
from_="2006-01-02",
146146
granularity="12h",
147-
locations=["s-ed1", "s-drc2", "s-sgc1"],
147+
locations=["s-region-1", "s-region-2"],
148148
source=0,
149149
storages=["123-myStorage"],
150150
to="2006-01-02",

tests/api_resources/test_storage.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TestStorage:
2323
@parametrize
2424
def test_method_create(self, client: Gcore) -> None:
2525
storage = client.storage.create(
26-
location="s-ed1",
26+
location="s-region-1",
2727
name="my-storage-prod",
2828
type="s3",
2929
)
@@ -32,7 +32,7 @@ def test_method_create(self, client: Gcore) -> None:
3232
@parametrize
3333
def test_method_create_with_all_params(self, client: Gcore) -> None:
3434
storage = client.storage.create(
35-
location="s-ed1",
35+
location="s-region-1",
3636
name="my-storage-prod",
3737
type="s3",
3838
generate_sftp_password=True,
@@ -43,7 +43,7 @@ def test_method_create_with_all_params(self, client: Gcore) -> None:
4343
@parametrize
4444
def test_raw_response_create(self, client: Gcore) -> None:
4545
response = client.storage.with_raw_response.create(
46-
location="s-ed1",
46+
location="s-region-1",
4747
name="my-storage-prod",
4848
type="s3",
4949
)
@@ -56,7 +56,7 @@ def test_raw_response_create(self, client: Gcore) -> None:
5656
@parametrize
5757
def test_streaming_response_create(self, client: Gcore) -> None:
5858
with client.storage.with_streaming_response.create(
59-
location="s-ed1",
59+
location="s-region-1",
6060
name="my-storage-prod",
6161
type="s3",
6262
) as response:
@@ -327,7 +327,7 @@ class TestAsyncStorage:
327327
@parametrize
328328
async def test_method_create(self, async_client: AsyncGcore) -> None:
329329
storage = await async_client.storage.create(
330-
location="s-ed1",
330+
location="s-region-1",
331331
name="my-storage-prod",
332332
type="s3",
333333
)
@@ -336,7 +336,7 @@ async def test_method_create(self, async_client: AsyncGcore) -> None:
336336
@parametrize
337337
async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> None:
338338
storage = await async_client.storage.create(
339-
location="s-ed1",
339+
location="s-region-1",
340340
name="my-storage-prod",
341341
type="s3",
342342
generate_sftp_password=True,
@@ -347,7 +347,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGcore) ->
347347
@parametrize
348348
async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
349349
response = await async_client.storage.with_raw_response.create(
350-
location="s-ed1",
350+
location="s-region-1",
351351
name="my-storage-prod",
352352
type="s3",
353353
)
@@ -360,7 +360,7 @@ async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
360360
@parametrize
361361
async def test_streaming_response_create(self, async_client: AsyncGcore) -> None:
362362
async with async_client.storage.with_streaming_response.create(
363-
location="s-ed1",
363+
location="s-region-1",
364364
name="my-storage-prod",
365365
type="s3",
366366
) as response:

0 commit comments

Comments
 (0)