Skip to content

Commit ff2f5dc

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#2129)
1 parent dae1150 commit ff2f5dc

18 files changed

+260
-232
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
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-66874390672543889c6f739266ab0e815d7c6a65deb464a2c41c965b45d3e24a.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb646c11ed31a9e0730c5860d58b7ed8757c84c20012ea4e7d4a4750c8e908f2.yml

api.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5059,9 +5059,7 @@ from cloudflare.types.zero_trust.access import (
50595059
CORSHeaders,
50605060
Decision,
50615061
OIDCSaaSApp,
5062-
SaaSAppNameFormat,
50635062
SaaSAppNameIDFormat,
5064-
SaaSAppSource,
50655063
SAMLSaaSApp,
50665064
SCIMConfigAuthenticationHTTPBasic,
50675065
SCIMConfigAuthenticationOAuthBearerToken,
@@ -5091,20 +5089,15 @@ Methods:
50915089
Types:
50925090

50935091
```python
5094-
from cloudflare.types.zero_trust.access.applications import (
5095-
CA,
5096-
CACreateResponse,
5097-
CADeleteResponse,
5098-
CAGetResponse,
5099-
)
5092+
from cloudflare.types.zero_trust.access.applications import CA, CADeleteResponse
51005093
```
51015094

51025095
Methods:
51035096

5104-
- <code title="post /{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/ca">client.zero_trust.access.applications.cas.<a href="./src/cloudflare/resources/zero_trust/access/applications/cas.py">create</a>(app_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/applications/ca_create_response.py">object</a></code>
5097+
- <code title="post /{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/ca">client.zero_trust.access.applications.cas.<a href="./src/cloudflare/resources/zero_trust/access/applications/cas.py">create</a>(app_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/applications/ca.py">Optional</a></code>
51055098
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/apps/ca">client.zero_trust.access.applications.cas.<a href="./src/cloudflare/resources/zero_trust/access/applications/cas.py">list</a>(\*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/applications/ca.py">SyncSinglePage[CA]</a></code>
51065099
- <code title="delete /{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/ca">client.zero_trust.access.applications.cas.<a href="./src/cloudflare/resources/zero_trust/access/applications/cas.py">delete</a>(app_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/applications/ca_delete_response.py">Optional</a></code>
5107-
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/ca">client.zero_trust.access.applications.cas.<a href="./src/cloudflare/resources/zero_trust/access/applications/cas.py">get</a>(app_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/applications/ca_get_response.py">object</a></code>
5100+
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/ca">client.zero_trust.access.applications.cas.<a href="./src/cloudflare/resources/zero_trust/access/applications/cas.py">get</a>(app_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/applications/ca.py">Optional</a></code>
51085101

51095102
#### UserPolicyChecks
51105103

src/cloudflare/resources/zero_trust/access/applications/cas.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def create(
5656
extra_query: Query | None = None,
5757
extra_body: Body | None = None,
5858
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
59-
) -> object:
59+
) -> Optional[CA]:
6060
"""
6161
Generates a new short-lived certificate CA and public key.
6262
@@ -96,9 +96,9 @@ def create(
9696
extra_query=extra_query,
9797
extra_body=extra_body,
9898
timeout=timeout,
99-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
99+
post_parser=ResultWrapper[Optional[CA]]._unwrapper,
100100
),
101-
cast_to=cast(Type[object], ResultWrapper[object]),
101+
cast_to=cast(Type[Optional[CA]], ResultWrapper[CA]),
102102
)
103103

104104
def list(
@@ -219,7 +219,7 @@ def get(
219219
extra_query: Query | None = None,
220220
extra_body: Body | None = None,
221221
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
222-
) -> object:
222+
) -> Optional[CA]:
223223
"""
224224
Fetches a short-lived certificate CA and its public key.
225225
@@ -259,9 +259,9 @@ def get(
259259
extra_query=extra_query,
260260
extra_body=extra_body,
261261
timeout=timeout,
262-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
262+
post_parser=ResultWrapper[Optional[CA]]._unwrapper,
263263
),
264-
cast_to=cast(Type[object], ResultWrapper[object]),
264+
cast_to=cast(Type[Optional[CA]], ResultWrapper[CA]),
265265
)
266266

267267

@@ -297,7 +297,7 @@ async def create(
297297
extra_query: Query | None = None,
298298
extra_body: Body | None = None,
299299
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
300-
) -> object:
300+
) -> Optional[CA]:
301301
"""
302302
Generates a new short-lived certificate CA and public key.
303303
@@ -337,9 +337,9 @@ async def create(
337337
extra_query=extra_query,
338338
extra_body=extra_body,
339339
timeout=timeout,
340-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
340+
post_parser=ResultWrapper[Optional[CA]]._unwrapper,
341341
),
342-
cast_to=cast(Type[object], ResultWrapper[object]),
342+
cast_to=cast(Type[Optional[CA]], ResultWrapper[CA]),
343343
)
344344

345345
def list(
@@ -460,7 +460,7 @@ async def get(
460460
extra_query: Query | None = None,
461461
extra_body: Body | None = None,
462462
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
463-
) -> object:
463+
) -> Optional[CA]:
464464
"""
465465
Fetches a short-lived certificate CA and its public key.
466466
@@ -500,9 +500,9 @@ async def get(
500500
extra_query=extra_query,
501501
extra_body=extra_body,
502502
timeout=timeout,
503-
post_parser=ResultWrapper[Optional[object]]._unwrapper,
503+
post_parser=ResultWrapper[Optional[CA]]._unwrapper,
504504
),
505-
cast_to=cast(Type[object], ResultWrapper[object]),
505+
cast_to=cast(Type[Optional[CA]], ResultWrapper[CA]),
506506
)
507507

508508

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def create(
5353
self,
5454
*,
5555
account_id: str,
56-
body: str,
56+
name: str | NotGiven = NOT_GIVEN,
5757
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5858
# The extra values given here take precedence over values defined on the client or passed to this method.
5959
extra_headers: Headers | None = None,
@@ -67,7 +67,7 @@ def create(
6767
Args:
6868
account_id: Identifier
6969
70-
body: The name of the tag
70+
name: The name of the tag
7171
7272
extra_headers: Send extra headers
7373
@@ -81,7 +81,7 @@ def create(
8181
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
8282
return self._post(
8383
f"/accounts/{account_id}/access/tags",
84-
body=maybe_transform(body, tag_create_params.TagCreateParams),
84+
body=maybe_transform({"name": name}, tag_create_params.TagCreateParams),
8585
options=make_request_options(
8686
extra_headers=extra_headers,
8787
extra_query=extra_query,
@@ -289,7 +289,7 @@ async def create(
289289
self,
290290
*,
291291
account_id: str,
292-
body: str,
292+
name: str | NotGiven = NOT_GIVEN,
293293
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
294294
# The extra values given here take precedence over values defined on the client or passed to this method.
295295
extra_headers: Headers | None = None,
@@ -303,7 +303,7 @@ async def create(
303303
Args:
304304
account_id: Identifier
305305
306-
body: The name of the tag
306+
name: The name of the tag
307307
308308
extra_headers: Send extra headers
309309
@@ -317,7 +317,7 @@ async def create(
317317
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
318318
return await self._post(
319319
f"/accounts/{account_id}/access/tags",
320-
body=await async_maybe_transform(body, tag_create_params.TagCreateParams),
320+
body=await async_maybe_transform({"name": name}, tag_create_params.TagCreateParams),
321321
options=make_request_options(
322322
extra_headers=extra_headers,
323323
extra_query=extra_query,

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from .allowed_headers import AllowedHeaders as AllowedHeaders
1818
from .allowed_methods import AllowedMethods as AllowedMethods
1919
from .allowed_origins import AllowedOrigins as AllowedOrigins
20-
from .saas_app_source import SaaSAppSource as SaaSAppSource
2120
from .application_type import ApplicationType as ApplicationType
2221
from .key_get_response import KeyGetResponse as KeyGetResponse
2322
from .zero_trust_group import ZeroTrustGroup as ZeroTrustGroup
@@ -41,9 +40,7 @@
4140
from .policy_create_params import PolicyCreateParams as PolicyCreateParams
4241
from .policy_list_response import PolicyListResponse as PolicyListResponse
4342
from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams
44-
from .saas_app_name_format import SaaSAppNameFormat as SaaSAppNameFormat
4543
from .group_delete_response import GroupDeleteResponse as GroupDeleteResponse
46-
from .saas_app_source_param import SaaSAppSourceParam as SaaSAppSourceParam
4744
from .bookmark_create_params import BookmarkCreateParams as BookmarkCreateParams
4845
from .bookmark_update_params import BookmarkUpdateParams as BookmarkUpdateParams
4946
from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse

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

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

77
from ...._models import BaseModel
88

9-
__all__ = ["OIDCSaaSApp", "CustomClaims", "CustomClaimsSource", "HybridAndImplicitOptions", "RefreshTokenOptions"]
9+
__all__ = ["OIDCSaaSApp", "CustomClaim", "CustomClaimSource", "HybridAndImplicitOptions", "RefreshTokenOptions"]
1010

1111

12-
class CustomClaimsSource(BaseModel):
12+
class CustomClaimSource(BaseModel):
1313
name: Optional[str] = None
1414
"""The name of the IdP claim."""
1515

1616
name_by_idp: Optional[Dict[str, str]] = None
1717
"""A mapping from IdP ID to claim name."""
1818

1919

20-
class CustomClaims(BaseModel):
20+
class CustomClaim(BaseModel):
2121
name: Optional[str] = None
2222
"""The name of the claim."""
2323

@@ -27,7 +27,7 @@ class CustomClaims(BaseModel):
2727
scope: Optional[Literal["groups", "profile", "email", "openid"]] = None
2828
"""The scope of the claim."""
2929

30-
source: Optional[CustomClaimsSource] = None
30+
source: Optional[CustomClaimSource] = None
3131

3232

3333
class HybridAndImplicitOptions(BaseModel):
@@ -77,7 +77,7 @@ class OIDCSaaSApp(BaseModel):
7777

7878
created_at: Optional[datetime] = None
7979

80-
custom_claims: Optional[CustomClaims] = None
80+
custom_claims: Optional[List[CustomClaim]] = None
8181

8282
grant_types: Optional[
8383
List[Literal["authorization_code", "authorization_code_with_pkce", "refresh_tokens", "hybrid", "implicit"]]

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

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

33
from __future__ import annotations
44

5-
from typing import Dict, List
5+
from typing import Dict, List, Iterable
66
from typing_extensions import Literal, TypedDict
77

8-
__all__ = ["OIDCSaaSAppParam", "CustomClaims", "CustomClaimsSource", "HybridAndImplicitOptions", "RefreshTokenOptions"]
8+
__all__ = ["OIDCSaaSAppParam", "CustomClaim", "CustomClaimSource", "HybridAndImplicitOptions", "RefreshTokenOptions"]
99

1010

11-
class CustomClaimsSource(TypedDict, total=False):
11+
class CustomClaimSource(TypedDict, total=False):
1212
name: str
1313
"""The name of the IdP claim."""
1414

1515
name_by_idp: Dict[str, str]
1616
"""A mapping from IdP ID to claim name."""
1717

1818

19-
class CustomClaims(TypedDict, total=False):
19+
class CustomClaim(TypedDict, total=False):
2020
name: str
2121
"""The name of the claim."""
2222

@@ -26,7 +26,7 @@ class CustomClaims(TypedDict, total=False):
2626
scope: Literal["groups", "profile", "email", "openid"]
2727
"""The scope of the claim."""
2828

29-
source: CustomClaimsSource
29+
source: CustomClaimSource
3030

3131

3232
class HybridAndImplicitOptions(TypedDict, total=False):
@@ -74,7 +74,7 @@ class OIDCSaaSAppParam(TypedDict, total=False):
7474
client_secret: str
7575
"""The application client secret, only returned on POST request."""
7676

77-
custom_claims: CustomClaims
77+
custom_claims: Iterable[CustomClaim]
7878

7979
grant_types: List[
8080
Literal["authorization_code", "authorization_code_with_pkce", "refresh_tokens", "hybrid", "implicit"]

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

Lines changed: 0 additions & 11 deletions
This file was deleted.

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

Lines changed: 0 additions & 15 deletions
This file was deleted.

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

Lines changed: 0 additions & 16 deletions
This file was deleted.

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,43 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import Dict, List, Optional
44
from datetime import datetime
55
from typing_extensions import Literal
66

77
from ...._models import BaseModel
8-
from .saas_app_source import SaaSAppSource
9-
from .saas_app_name_format import SaaSAppNameFormat
108
from .saas_app_name_id_format import SaaSAppNameIDFormat
119

12-
__all__ = ["SAMLSaaSApp", "CustomAttributes"]
10+
__all__ = ["SAMLSaaSApp", "CustomAttribute", "CustomAttributeSource"]
1311

1412

15-
class CustomAttributes(BaseModel):
13+
class CustomAttributeSource(BaseModel):
14+
name: Optional[str] = None
15+
"""The name of the IdP attribute."""
16+
17+
name_by_idp: Optional[Dict[str, str]] = None
18+
"""A mapping from IdP ID to attribute name."""
19+
20+
21+
class CustomAttribute(BaseModel):
1622
friendly_name: Optional[str] = None
1723
"""The SAML FriendlyName of the attribute."""
1824

1925
name: Optional[str] = None
2026
"""The name of the attribute."""
2127

22-
name_format: Optional[SaaSAppNameFormat] = None
28+
name_format: Optional[
29+
Literal[
30+
"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
31+
"urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
32+
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri",
33+
]
34+
] = None
2335
"""A globally unique name for an identity or service provider."""
2436

2537
required: Optional[bool] = None
2638
"""If the attribute is required when building a SAML assertion."""
2739

28-
source: Optional[SaaSAppSource] = None
40+
source: Optional[CustomAttributeSource] = None
2941

3042

3143
class SAMLSaaSApp(BaseModel):
@@ -44,7 +56,7 @@ class SAMLSaaSApp(BaseModel):
4456

4557
created_at: Optional[datetime] = None
4658

47-
custom_attributes: Optional[CustomAttributes] = None
59+
custom_attributes: Optional[List[CustomAttribute]] = None
4860

4961
default_relay_state: Optional[str] = None
5062
"""

0 commit comments

Comments
 (0)