Skip to content

Commit f36b1b3

Browse files
feat(api): api update
1 parent 5312e1e commit f36b1b3

7 files changed

Lines changed: 114 additions & 57 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: 1782
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a42d6c77ba1caf82fc785a2c8e1297a649ac14796ad0ed3d1ebc07b8fc034ea8.yml
3-
openapi_spec_hash: 0bf44e518946f028fab4b1a88e981e0f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2bf95334cf3f1af41a97db60a94ad12c0af730ad744c13d83982bc6daf92b6e7.yml
3+
openapi_spec_hash: 0d843a9d846c2e6d6eb0a6538bc66f8d
44
config_hash: eda5b3d9487ce675d1fadf88153b457d

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

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def list(
110110
order: Literal["name", "comment", "created", "modified", "status"] | NotGiven = NOT_GIVEN,
111111
page: int | NotGiven = NOT_GIVEN,
112112
per_page: int | NotGiven = NOT_GIVEN,
113+
scopes: Iterable[List[str]] | NotGiven = NOT_GIVEN,
113114
search: str | NotGiven = NOT_GIVEN,
114115
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
115116
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -134,6 +135,8 @@ def list(
134135
135136
per_page: Number of objects to return per page
136137
138+
scopes: Only secrets with the given scopes will be returned
139+
137140
search: Search secrets using a filter string, filtering across name and comment
138141
139142
extra_headers: Send extra headers
@@ -162,6 +165,7 @@ def list(
162165
"order": order,
163166
"page": page,
164167
"per_page": per_page,
168+
"scopes": scopes,
165169
"search": search,
166170
},
167171
secret_list_params.SecretListParams,
@@ -268,6 +272,8 @@ def duplicate(
268272
account_id: str,
269273
store_id: str,
270274
name: str,
275+
scopes: List[str],
276+
comment: str | NotGiven = NOT_GIVEN,
271277
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
272278
# The extra values given here take precedence over values defined on the client or passed to this method.
273279
extra_headers: Headers | None = None,
@@ -287,6 +293,10 @@ def duplicate(
287293
288294
name: The name of the secret
289295
296+
scopes: The list of services that can use this secret.
297+
298+
comment: Freeform text describing the secret
299+
290300
extra_headers: Send extra headers
291301
292302
extra_query: Add additional query parameters to the request
@@ -303,7 +313,14 @@ def duplicate(
303313
raise ValueError(f"Expected a non-empty value for `secret_id` but received {secret_id!r}")
304314
return self._post(
305315
f"/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}/duplicate",
306-
body=maybe_transform({"name": name}, secret_duplicate_params.SecretDuplicateParams),
316+
body=maybe_transform(
317+
{
318+
"name": name,
319+
"scopes": scopes,
320+
"comment": comment,
321+
},
322+
secret_duplicate_params.SecretDuplicateParams,
323+
),
307324
options=make_request_options(
308325
extra_headers=extra_headers,
309326
extra_query=extra_query,
@@ -320,9 +337,8 @@ def edit(
320337
*,
321338
account_id: str,
322339
store_id: str,
323-
name: str,
340+
comment: str | NotGiven = NOT_GIVEN,
324341
scopes: List[str] | NotGiven = NOT_GIVEN,
325-
value: str | NotGiven = NOT_GIVEN,
326342
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
327343
# The extra values given here take precedence over values defined on the client or passed to this method.
328344
extra_headers: Headers | None = None,
@@ -340,13 +356,10 @@ def edit(
340356
341357
secret_id: Secret identifier tag.
342358
343-
name: The name of the secret
359+
comment: Freeform text describing the secret
344360
345361
scopes: The list of services that can use this secret.
346362
347-
value: The value of the secret. Note that this is 'write only' - no API reponse will
348-
provide this value, it is only used to create/modify secrets.
349-
350363
extra_headers: Send extra headers
351364
352365
extra_query: Add additional query parameters to the request
@@ -365,9 +378,8 @@ def edit(
365378
f"/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}",
366379
body=maybe_transform(
367380
{
368-
"name": name,
381+
"comment": comment,
369382
"scopes": scopes,
370-
"value": value,
371383
},
372384
secret_edit_params.SecretEditParams,
373385
),
@@ -504,6 +516,7 @@ def list(
504516
order: Literal["name", "comment", "created", "modified", "status"] | NotGiven = NOT_GIVEN,
505517
page: int | NotGiven = NOT_GIVEN,
506518
per_page: int | NotGiven = NOT_GIVEN,
519+
scopes: Iterable[List[str]] | NotGiven = NOT_GIVEN,
507520
search: str | NotGiven = NOT_GIVEN,
508521
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
509522
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -528,6 +541,8 @@ def list(
528541
529542
per_page: Number of objects to return per page
530543
544+
scopes: Only secrets with the given scopes will be returned
545+
531546
search: Search secrets using a filter string, filtering across name and comment
532547
533548
extra_headers: Send extra headers
@@ -556,6 +571,7 @@ def list(
556571
"order": order,
557572
"page": page,
558573
"per_page": per_page,
574+
"scopes": scopes,
559575
"search": search,
560576
},
561577
secret_list_params.SecretListParams,
@@ -662,6 +678,8 @@ async def duplicate(
662678
account_id: str,
663679
store_id: str,
664680
name: str,
681+
scopes: List[str],
682+
comment: str | NotGiven = NOT_GIVEN,
665683
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
666684
# The extra values given here take precedence over values defined on the client or passed to this method.
667685
extra_headers: Headers | None = None,
@@ -681,6 +699,10 @@ async def duplicate(
681699
682700
name: The name of the secret
683701
702+
scopes: The list of services that can use this secret.
703+
704+
comment: Freeform text describing the secret
705+
684706
extra_headers: Send extra headers
685707
686708
extra_query: Add additional query parameters to the request
@@ -697,7 +719,14 @@ async def duplicate(
697719
raise ValueError(f"Expected a non-empty value for `secret_id` but received {secret_id!r}")
698720
return await self._post(
699721
f"/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}/duplicate",
700-
body=await async_maybe_transform({"name": name}, secret_duplicate_params.SecretDuplicateParams),
722+
body=await async_maybe_transform(
723+
{
724+
"name": name,
725+
"scopes": scopes,
726+
"comment": comment,
727+
},
728+
secret_duplicate_params.SecretDuplicateParams,
729+
),
701730
options=make_request_options(
702731
extra_headers=extra_headers,
703732
extra_query=extra_query,
@@ -714,9 +743,8 @@ async def edit(
714743
*,
715744
account_id: str,
716745
store_id: str,
717-
name: str,
746+
comment: str | NotGiven = NOT_GIVEN,
718747
scopes: List[str] | NotGiven = NOT_GIVEN,
719-
value: str | NotGiven = NOT_GIVEN,
720748
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
721749
# The extra values given here take precedence over values defined on the client or passed to this method.
722750
extra_headers: Headers | None = None,
@@ -734,13 +762,10 @@ async def edit(
734762
735763
secret_id: Secret identifier tag.
736764
737-
name: The name of the secret
765+
comment: Freeform text describing the secret
738766
739767
scopes: The list of services that can use this secret.
740768
741-
value: The value of the secret. Note that this is 'write only' - no API reponse will
742-
provide this value, it is only used to create/modify secrets.
743-
744769
extra_headers: Send extra headers
745770
746771
extra_query: Add additional query parameters to the request
@@ -759,9 +784,8 @@ async def edit(
759784
f"/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}",
760785
body=await async_maybe_transform(
761786
{
762-
"name": name,
787+
"comment": comment,
763788
"scopes": scopes,
764-
"value": value,
765789
},
766790
secret_edit_params.SecretEditParams,
767791
),

src/cloudflare/types/secrets_store/stores/secret_create_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ class Body(TypedDict, total=False):
2828
Note that this is 'write only' - no API reponse will provide this value, it is
2929
only used to create/modify secrets.
3030
"""
31+
32+
comment: str
33+
"""Freeform text describing the secret"""

src/cloudflare/types/secrets_store/stores/secret_duplicate_params.py

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

33
from __future__ import annotations
44

5+
from typing import List
56
from typing_extensions import Required, TypedDict
67

78
__all__ = ["SecretDuplicateParams"]
@@ -16,3 +17,9 @@ class SecretDuplicateParams(TypedDict, total=False):
1617

1718
name: Required[str]
1819
"""The name of the secret"""
20+
21+
scopes: Required[List[str]]
22+
"""The list of services that can use this secret."""
23+
24+
comment: str
25+
"""Freeform text describing the secret"""

src/cloudflare/types/secrets_store/stores/secret_edit_params.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,8 @@ class SecretEditParams(TypedDict, total=False):
1515
store_id: Required[str]
1616
"""Store Identifier"""
1717

18-
name: Required[str]
19-
"""The name of the secret"""
18+
comment: str
19+
"""Freeform text describing the secret"""
2020

2121
scopes: List[str]
2222
"""The list of services that can use this secret."""
23-
24-
value: str
25-
"""The value of the secret.
26-
27-
Note that this is 'write only' - no API reponse will provide this value, it is
28-
only used to create/modify secrets.
29-
"""

src/cloudflare/types/secrets_store/stores/secret_list_params.py

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

33
from __future__ import annotations
44

5+
from typing import List, Iterable
56
from typing_extensions import Literal, Required, TypedDict
67

78
__all__ = ["SecretListParams"]
@@ -23,5 +24,8 @@ class SecretListParams(TypedDict, total=False):
2324
per_page: int
2425
"""Number of objects to return per page"""
2526

27+
scopes: Iterable[List[str]]
28+
"""Only secrets with the given scopes will be returned"""
29+
2630
search: str
2731
"""Search secrets using a filter string, filtering across name and comment"""

0 commit comments

Comments
 (0)