Skip to content

Commit d85575b

Browse files
committed
feat(secrets_store): update generated types and methods
1 parent 69dde94 commit d85575b

5 files changed

Lines changed: 66 additions & 6 deletions

File tree

src/cloudflare/resources/secrets_store/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Methods:
1212

1313
- <code title="post /accounts/{account_id}/secrets_store/stores">client.secrets_store.stores.<a href="./src/cloudflare/resources/secrets_store/stores/stores.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/secrets_store/store_create_params.py">params</a>) -> <a href="./src/cloudflare/types/secrets_store/store_create_response.py">Optional[StoreCreateResponse]</a></code>
1414
- <code title="get /accounts/{account_id}/secrets_store/stores">client.secrets_store.stores.<a href="./src/cloudflare/resources/secrets_store/stores/stores.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/secrets_store/store_list_params.py">params</a>) -> <a href="./src/cloudflare/types/secrets_store/store_list_response.py">SyncV4PagePaginationArray[StoreListResponse]</a></code>
15-
- <code title="delete /accounts/{account_id}/secrets_store/stores/{store_id}">client.secrets_store.stores.<a href="./src/cloudflare/resources/secrets_store/stores/stores.py">delete</a>(store_id, \*, account_id) -> object</code>
15+
- <code title="delete /accounts/{account_id}/secrets_store/stores/{store_id}">client.secrets_store.stores.<a href="./src/cloudflare/resources/secrets_store/stores/stores.py">delete</a>(store_id, \*, account_id, \*\*<a href="src/cloudflare/types/secrets_store/store_delete_params.py">params</a>) -> object</code>
1616

1717
### Secrets
1818

src/cloudflare/resources/secrets_store/stores/stores.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from ...._wrappers import ResultWrapper
2929
from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
3030
from ...._base_client import AsyncPaginator, make_request_options
31-
from ....types.secrets_store import store_list_params, store_create_params
31+
from ....types.secrets_store import store_list_params, store_create_params, store_delete_params
3232
from ....types.secrets_store.store_list_response import StoreListResponse
3333
from ....types.secrets_store.store_create_response import StoreCreateResponse
3434

@@ -167,21 +167,30 @@ def delete(
167167
store_id: str,
168168
*,
169169
account_id: str,
170+
force: bool | Omit = omit,
170171
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
171172
# The extra values given here take precedence over values defined on the client or passed to this method.
172173
extra_headers: Headers | None = None,
173174
extra_query: Query | None = None,
174175
extra_body: Body | None = None,
175176
timeout: float | httpx.Timeout | None | NotGiven = not_given,
176177
) -> object:
177-
"""
178-
Deletes a single store
178+
"""Deletes a single store.
179+
180+
By default, a store that still contains secrets cannot
181+
be deleted and returns HTTP 409 (Conflict) with the "store_not_empty" error.
182+
Pass `force=true` to cascade-delete all secrets in the store. Empty stores are
183+
always deleted regardless of the force parameter.
179184
180185
Args:
181186
account_id: Account Identifier
182187
183188
store_id: Store Identifier
184189
190+
force: When true, cascade-deletes all secrets in the store before deleting the store
191+
itself. Required when deleting a non-empty store. Without this parameter,
192+
attempting to delete a non-empty store returns 409.
193+
185194
extra_headers: Send extra headers
186195
187196
extra_query: Add additional query parameters to the request
@@ -203,6 +212,7 @@ def delete(
203212
extra_query=extra_query,
204213
extra_body=extra_body,
205214
timeout=timeout,
215+
query=maybe_transform({"force": force}, store_delete_params.StoreDeleteParams),
206216
post_parser=ResultWrapper[Optional[object]]._unwrapper,
207217
),
208218
cast_to=cast(Type[object], ResultWrapper[object]),
@@ -341,21 +351,30 @@ async def delete(
341351
store_id: str,
342352
*,
343353
account_id: str,
354+
force: bool | Omit = omit,
344355
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
345356
# The extra values given here take precedence over values defined on the client or passed to this method.
346357
extra_headers: Headers | None = None,
347358
extra_query: Query | None = None,
348359
extra_body: Body | None = None,
349360
timeout: float | httpx.Timeout | None | NotGiven = not_given,
350361
) -> object:
351-
"""
352-
Deletes a single store
362+
"""Deletes a single store.
363+
364+
By default, a store that still contains secrets cannot
365+
be deleted and returns HTTP 409 (Conflict) with the "store_not_empty" error.
366+
Pass `force=true` to cascade-delete all secrets in the store. Empty stores are
367+
always deleted regardless of the force parameter.
353368
354369
Args:
355370
account_id: Account Identifier
356371
357372
store_id: Store Identifier
358373
374+
force: When true, cascade-deletes all secrets in the store before deleting the store
375+
itself. Required when deleting a non-empty store. Without this parameter,
376+
attempting to delete a non-empty store returns 409.
377+
359378
extra_headers: Send extra headers
360379
361380
extra_query: Add additional query parameters to the request
@@ -377,6 +396,7 @@ async def delete(
377396
extra_query=extra_query,
378397
extra_body=extra_body,
379398
timeout=timeout,
399+
query=await async_maybe_transform({"force": force}, store_delete_params.StoreDeleteParams),
380400
post_parser=ResultWrapper[Optional[object]]._unwrapper,
381401
),
382402
cast_to=cast(Type[object], ResultWrapper[object]),

src/cloudflare/types/secrets_store/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
from .store_list_params import StoreListParams as StoreListParams
66
from .quota_get_response import QuotaGetResponse as QuotaGetResponse
77
from .store_create_params import StoreCreateParams as StoreCreateParams
8+
from .store_delete_params import StoreDeleteParams as StoreDeleteParams
89
from .store_list_response import StoreListResponse as StoreListResponse
910
from .store_create_response import StoreCreateResponse as StoreCreateResponse
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, TypedDict
6+
7+
__all__ = ["StoreDeleteParams"]
8+
9+
10+
class StoreDeleteParams(TypedDict, total=False):
11+
account_id: Required[str]
12+
"""Account Identifier"""
13+
14+
force: bool
15+
"""
16+
When true, cascade-deletes all secrets in the store before deleting the store
17+
itself. Required when deleting a non-empty store. Without this parameter,
18+
attempting to delete a non-empty store returns 409.
19+
"""

tests/api_resources/secrets_store/test_stores.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ def test_method_delete(self, client: Cloudflare) -> None:
130130
)
131131
assert_matches_type(object, store, path=["response"])
132132

133+
@pytest.mark.skip(reason="SKIP: prism error for 422 Unprocessable Entity")
134+
@parametrize
135+
def test_method_delete_with_all_params(self, client: Cloudflare) -> None:
136+
store = client.secrets_store.stores.delete(
137+
store_id="023e105f4ecef8ad9ca31a8372d0c353",
138+
account_id="985e105f4ecef8ad9ca31a8372d0c353",
139+
force=True,
140+
)
141+
assert_matches_type(object, store, path=["response"])
142+
133143
@pytest.mark.skip(reason="SKIP: prism error for 422 Unprocessable Entity")
134144
@parametrize
135145
def test_raw_response_delete(self, client: Cloudflare) -> None:
@@ -288,6 +298,16 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
288298
)
289299
assert_matches_type(object, store, path=["response"])
290300

301+
@pytest.mark.skip(reason="SKIP: prism error for 422 Unprocessable Entity")
302+
@parametrize
303+
async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None:
304+
store = await async_client.secrets_store.stores.delete(
305+
store_id="023e105f4ecef8ad9ca31a8372d0c353",
306+
account_id="985e105f4ecef8ad9ca31a8372d0c353",
307+
force=True,
308+
)
309+
assert_matches_type(object, store, path=["response"])
310+
291311
@pytest.mark.skip(reason="SKIP: prism error for 422 Unprocessable Entity")
292312
@parametrize
293313
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:

0 commit comments

Comments
 (0)