Skip to content

Commit bbcbd88

Browse files
feat(api): api update (#2136)
1 parent fdbb473 commit bbcbd88

File tree

10 files changed

+93
-16
lines changed

10 files changed

+93
-16
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1397
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f5305b253841aee001bed9bf486562184b70df73d31313774fd5b00bc2e7f8e1.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1f3a5920b5590a1e7f4df129cc299fe3d4aaa7bf4ef6915b015dd898b1a1813c.yml

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5225,7 +5225,7 @@ Methods:
52255225

52265226
- <code title="post /{account_or_zone}/{account_or_zone_id}/access/service_tokens">client.zero_trust.access.service_tokens.<a href="./src/cloudflare/resources/zero_trust/access/service_tokens.py">create</a>(\*, account_id, zone_id, \*\*<a href="src/cloudflare/types/zero_trust/access/service_token_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/service_token_create_response.py">Optional</a></code>
52275227
- <code title="put /{account_or_zone}/{account_or_zone_id}/access/service_tokens/{service_token_id}">client.zero_trust.access.service_tokens.<a href="./src/cloudflare/resources/zero_trust/access/service_tokens.py">update</a>(service_token_id, \*, account_id, zone_id, \*\*<a href="src/cloudflare/types/zero_trust/access/service_token_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/service_token.py">Optional</a></code>
5228-
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/service_tokens">client.zero_trust.access.service_tokens.<a href="./src/cloudflare/resources/zero_trust/access/service_tokens.py">list</a>(\*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/service_token.py">SyncSinglePage[ServiceToken]</a></code>
5228+
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/service_tokens">client.zero_trust.access.service_tokens.<a href="./src/cloudflare/resources/zero_trust/access/service_tokens.py">list</a>(\*, account_id, zone_id, \*\*<a href="src/cloudflare/types/zero_trust/access/service_token_list_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/service_token.py">SyncSinglePage[ServiceToken]</a></code>
52295229
- <code title="delete /{account_or_zone}/{account_or_zone_id}/access/service_tokens/{service_token_id}">client.zero_trust.access.service_tokens.<a href="./src/cloudflare/resources/zero_trust/access/service_tokens.py">delete</a>(service_token_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/service_token.py">Optional</a></code>
52305230
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/service_tokens/{service_token_id}">client.zero_trust.access.service_tokens.<a href="./src/cloudflare/resources/zero_trust/access/service_tokens.py">get</a>(service_token_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/service_token.py">Optional</a></code>
52315231
- <code title="post /accounts/{account_id}/access/service_tokens/{service_token_id}/refresh">client.zero_trust.access.service_tokens.<a href="./src/cloudflare/resources/zero_trust/access/service_tokens.py">refresh</a>(service_token_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/access/service_token.py">Optional</a></code>

src/cloudflare/resources/zero_trust/access/service_tokens.py

+39-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
from ...._wrappers import ResultWrapper
2323
from ....pagination import SyncSinglePage, AsyncSinglePage
2424
from ...._base_client import AsyncPaginator, make_request_options
25-
from ....types.zero_trust.access import service_token_create_params, service_token_update_params
25+
from ....types.zero_trust.access import (
26+
service_token_list_params,
27+
service_token_create_params,
28+
service_token_update_params,
29+
)
2630
from ....types.zero_trust.access.service_token import ServiceToken
2731
from ....types.zero_trust.access.service_token_create_response import ServiceTokenCreateResponse
2832
from ....types.zero_trust.access.service_token_rotate_response import ServiceTokenRotateResponse
@@ -197,6 +201,8 @@ def list(
197201
*,
198202
account_id: str | NotGiven = NOT_GIVEN,
199203
zone_id: str | NotGiven = NOT_GIVEN,
204+
name: str | NotGiven = NOT_GIVEN,
205+
search: str | NotGiven = NOT_GIVEN,
200206
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
201207
# The extra values given here take precedence over values defined on the client or passed to this method.
202208
extra_headers: Headers | None = None,
@@ -212,6 +218,10 @@ def list(
212218
213219
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
214220
221+
name: The name of the service token.
222+
223+
search: Search for service tokens by other listed query parameters.
224+
215225
extra_headers: Send extra headers
216226
217227
extra_query: Add additional query parameters to the request
@@ -236,7 +246,17 @@ def list(
236246
f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens",
237247
page=SyncSinglePage[ServiceToken],
238248
options=make_request_options(
239-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
249+
extra_headers=extra_headers,
250+
extra_query=extra_query,
251+
extra_body=extra_body,
252+
timeout=timeout,
253+
query=maybe_transform(
254+
{
255+
"name": name,
256+
"search": search,
257+
},
258+
service_token_list_params.ServiceTokenListParams,
259+
),
240260
),
241261
model=ServiceToken,
242262
)
@@ -611,6 +631,8 @@ def list(
611631
*,
612632
account_id: str | NotGiven = NOT_GIVEN,
613633
zone_id: str | NotGiven = NOT_GIVEN,
634+
name: str | NotGiven = NOT_GIVEN,
635+
search: str | NotGiven = NOT_GIVEN,
614636
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
615637
# The extra values given here take precedence over values defined on the client or passed to this method.
616638
extra_headers: Headers | None = None,
@@ -626,6 +648,10 @@ def list(
626648
627649
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
628650
651+
name: The name of the service token.
652+
653+
search: Search for service tokens by other listed query parameters.
654+
629655
extra_headers: Send extra headers
630656
631657
extra_query: Add additional query parameters to the request
@@ -650,7 +676,17 @@ def list(
650676
f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens",
651677
page=AsyncSinglePage[ServiceToken],
652678
options=make_request_options(
653-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
679+
extra_headers=extra_headers,
680+
extra_query=extra_query,
681+
extra_body=extra_body,
682+
timeout=timeout,
683+
query=maybe_transform(
684+
{
685+
"name": name,
686+
"search": search,
687+
},
688+
service_token_list_params.ServiceTokenListParams,
689+
),
654690
),
655691
model=ServiceToken,
656692
)

src/cloudflare/resources/zero_trust/identity_providers.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ def create(
687687
def create(
688688
self,
689689
*,
690-
config: object,
690+
config: identity_provider_create_params.AccessOnetimepinConfig,
691691
name: str,
692692
type: IdentityProviderType,
693693
account_id: str | NotGiven = NOT_GIVEN,
@@ -745,7 +745,7 @@ def create(
745745
| identity_provider_create_params.AccessOneloginConfig
746746
| identity_provider_create_params.AccessPingoneConfig
747747
| identity_provider_create_params.AccessSAMLConfig
748-
| object,
748+
| identity_provider_create_params.AccessOnetimepinConfig,
749749
name: str,
750750
type: IdentityProviderType,
751751
account_id: str | NotGiven = NOT_GIVEN,
@@ -1464,7 +1464,7 @@ def update(
14641464
self,
14651465
identity_provider_id: str,
14661466
*,
1467-
config: object,
1467+
config: identity_provider_update_params.AccessOnetimepinConfig,
14681468
name: str,
14691469
type: IdentityProviderType,
14701470
account_id: str | NotGiven = NOT_GIVEN,
@@ -1525,7 +1525,7 @@ def update(
15251525
| identity_provider_update_params.AccessOneloginConfig
15261526
| identity_provider_update_params.AccessPingoneConfig
15271527
| identity_provider_update_params.AccessSAMLConfig
1528-
| object,
1528+
| identity_provider_update_params.AccessOnetimepinConfig,
15291529
name: str,
15301530
type: IdentityProviderType,
15311531
account_id: str | NotGiven = NOT_GIVEN,
@@ -2403,7 +2403,7 @@ async def create(
24032403
async def create(
24042404
self,
24052405
*,
2406-
config: object,
2406+
config: identity_provider_create_params.AccessOnetimepinConfig,
24072407
name: str,
24082408
type: IdentityProviderType,
24092409
account_id: str | NotGiven = NOT_GIVEN,
@@ -2461,7 +2461,7 @@ async def create(
24612461
| identity_provider_create_params.AccessOneloginConfig
24622462
| identity_provider_create_params.AccessPingoneConfig
24632463
| identity_provider_create_params.AccessSAMLConfig
2464-
| object,
2464+
| identity_provider_create_params.AccessOnetimepinConfig,
24652465
name: str,
24662466
type: IdentityProviderType,
24672467
account_id: str | NotGiven = NOT_GIVEN,
@@ -3180,7 +3180,7 @@ async def update(
31803180
self,
31813181
identity_provider_id: str,
31823182
*,
3183-
config: object,
3183+
config: identity_provider_update_params.AccessOnetimepinConfig,
31843184
name: str,
31853185
type: IdentityProviderType,
31863186
account_id: str | NotGiven = NOT_GIVEN,
@@ -3241,7 +3241,7 @@ async def update(
32413241
| identity_provider_update_params.AccessOneloginConfig
32423242
| identity_provider_update_params.AccessPingoneConfig
32433243
| identity_provider_update_params.AccessSAMLConfig
3244-
| object,
3244+
| identity_provider_update_params.AccessOnetimepinConfig,
32453245
name: str,
32463246
type: IdentityProviderType,
32473247
account_id: str | NotGiven = NOT_GIVEN,

src/cloudflare/types/zero_trust/access/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
from .custom_page_create_params import CustomPageCreateParams as CustomPageCreateParams
5959
from .custom_page_update_params import CustomPageUpdateParams as CustomPageUpdateParams
6060
from .scim_config_mapping_param import SCIMConfigMappingParam as SCIMConfigMappingParam
61+
from .service_token_list_params import ServiceTokenListParams as ServiceTokenListParams
6162
from .application_create_response import ApplicationCreateResponse as ApplicationCreateResponse
6263
from .application_delete_response import ApplicationDeleteResponse as ApplicationDeleteResponse
6364
from .application_update_response import ApplicationUpdateResponse as ApplicationUpdateResponse
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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 TypedDict
6+
7+
__all__ = ["ServiceTokenListParams"]
8+
9+
10+
class ServiceTokenListParams(TypedDict, total=False):
11+
account_id: str
12+
"""The Account ID to use for this endpoint. Mutually exclusive with the Zone ID."""
13+
14+
zone_id: str
15+
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
16+
17+
name: str
18+
"""The name of the service token."""
19+
20+
search: str
21+
"""Search for service tokens by other listed query parameters."""

src/cloudflare/types/zero_trust/identity_provider.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"AccessSAMLConfigHeaderAttribute",
3434
"AccessYandex",
3535
"AccessOnetimepin",
36+
"AccessOnetimepinConfig",
3637
]
3738

3839

@@ -543,8 +544,12 @@ class AccessYandex(BaseModel):
543544
"""
544545

545546

547+
class AccessOnetimepinConfig(BaseModel):
548+
redirect_url: Optional[str] = None
549+
550+
546551
class AccessOnetimepin(BaseModel):
547-
config: object
552+
config: AccessOnetimepinConfig
548553
"""The configuration parameters for the identity provider.
549554
550555
To view the required parameters for a specific provider, refer to our

src/cloudflare/types/zero_trust/identity_provider_create_params.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"AccessSAMLConfigHeaderAttribute",
3636
"AccessYandex",
3737
"AccessOnetimepin",
38+
"AccessOnetimepinConfig",
3839
]
3940

4041

@@ -649,7 +650,7 @@ class AccessYandex(TypedDict, total=False):
649650

650651

651652
class AccessOnetimepin(TypedDict, total=False):
652-
config: Required[object]
653+
config: Required[AccessOnetimepinConfig]
653654
"""The configuration parameters for the identity provider.
654655
655656
To view the required parameters for a specific provider, refer to our
@@ -679,6 +680,10 @@ class AccessOnetimepin(TypedDict, total=False):
679680
"""
680681

681682

683+
class AccessOnetimepinConfig(TypedDict, total=False):
684+
pass
685+
686+
682687
IdentityProviderCreateParams: TypeAlias = Union[
683688
AzureAD,
684689
AccessCentrify,

src/cloudflare/types/zero_trust/identity_provider_update_params.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"AccessSAMLConfigHeaderAttribute",
3636
"AccessYandex",
3737
"AccessOnetimepin",
38+
"AccessOnetimepinConfig",
3839
]
3940

4041

@@ -649,7 +650,7 @@ class AccessYandex(TypedDict, total=False):
649650

650651

651652
class AccessOnetimepin(TypedDict, total=False):
652-
config: Required[object]
653+
config: Required[AccessOnetimepinConfig]
653654
"""The configuration parameters for the identity provider.
654655
655656
To view the required parameters for a specific provider, refer to our
@@ -679,6 +680,10 @@ class AccessOnetimepin(TypedDict, total=False):
679680
"""
680681

681682

683+
class AccessOnetimepinConfig(TypedDict, total=False):
684+
pass
685+
686+
682687
IdentityProviderUpdateParams: TypeAlias = Union[
683688
AzureAD,
684689
AccessCentrify,

tests/api_resources/zero_trust/access/test_service_tokens.py

+4
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ def test_method_list(self, client: Cloudflare) -> None:
166166
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
167167
service_token = client.zero_trust.access.service_tokens.list(
168168
account_id="account_id",
169+
name="name",
170+
search="search",
169171
)
170172
assert_matches_type(SyncSinglePage[ServiceToken], service_token, path=["response"])
171173

@@ -586,6 +588,8 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
586588
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
587589
service_token = await async_client.zero_trust.access.service_tokens.list(
588590
account_id="account_id",
591+
name="name",
592+
search="search",
589593
)
590594
assert_matches_type(AsyncSinglePage[ServiceToken], service_token, path=["response"])
591595

0 commit comments

Comments
 (0)