Skip to content

Commit 55a52b3

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#350)
1 parent 5a4d204 commit 55a52b3

File tree

8 files changed

+134
-8
lines changed

8 files changed

+134
-8
lines changed

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

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

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

@@ -17,6 +17,8 @@
1717
"SaaSApplication",
1818
"SaaSApplicationSaasApp",
1919
"SaaSApplicationSaasAppAccessOIDCSaasApp",
20+
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims",
21+
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource",
2022
"BrowserSSHApplication",
2123
"BrowserVncApplication",
2224
"AppLauncherApplication",
@@ -154,6 +156,27 @@ class SelfHostedApplication(BaseModel):
154156
updated_at: Optional[datetime] = None
155157

156158

159+
class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource(BaseModel):
160+
name: Optional[str] = None
161+
"""The name of the IdP claim."""
162+
163+
164+
class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims(BaseModel):
165+
name: Optional[str] = None
166+
"""The name of the claim."""
167+
168+
name_by_idp: Optional[Dict[str, str]] = None
169+
"""A mapping from IdP ID to claim name."""
170+
171+
required: Optional[bool] = None
172+
"""If the claim is required when building an OIDC token."""
173+
174+
scope: Optional[Literal["groups", "profile", "email", "openid"]] = None
175+
"""The scope of the claim."""
176+
177+
source: Optional[SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource] = None
178+
179+
157180
class SaaSApplicationSaasAppAccessOIDCSaasApp(BaseModel):
158181
app_launcher_url: Optional[str] = None
159182
"""The URL where this applications tile redirects users"""
@@ -172,6 +195,8 @@ class SaaSApplicationSaasAppAccessOIDCSaasApp(BaseModel):
172195

173196
created_at: Optional[datetime] = None
174197

198+
custom_claims: Optional[SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims] = None
199+
175200
grant_types: Optional[List[Literal["authorization_code", "authorization_code_with_pkce"]]] = None
176201
"""The OIDC flows supported by this application"""
177202

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

+26-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

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

88
from .allowed_idpsh import AllowedIdpsh
@@ -17,6 +17,8 @@
1717
"SaaSApplication",
1818
"SaaSApplicationSaasApp",
1919
"SaaSApplicationSaasAppAccessOIDCSaasApp",
20+
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims",
21+
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource",
2022
"BrowserSSHApplication",
2123
"BrowserVncApplication",
2224
"AppLauncherApplication",
@@ -195,6 +197,27 @@ class SaaSApplication(TypedDict, total=False):
195197
"""The application type."""
196198

197199

200+
class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource(TypedDict, total=False):
201+
name: str
202+
"""The name of the IdP claim."""
203+
204+
205+
class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims(TypedDict, total=False):
206+
name: str
207+
"""The name of the claim."""
208+
209+
name_by_idp: Dict[str, str]
210+
"""A mapping from IdP ID to claim name."""
211+
212+
required: bool
213+
"""If the claim is required when building an OIDC token."""
214+
215+
scope: Literal["groups", "profile", "email", "openid"]
216+
"""The scope of the claim."""
217+
218+
source: SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource
219+
220+
198221
class SaaSApplicationSaasAppAccessOIDCSaasApp(TypedDict, total=False):
199222
app_launcher_url: str
200223
"""The URL where this applications tile redirects users"""
@@ -211,6 +234,8 @@ class SaaSApplicationSaasAppAccessOIDCSaasApp(TypedDict, total=False):
211234
client_secret: str
212235
"""The application client secret, only returned on POST request."""
213236

237+
custom_claims: SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims
238+
214239
grant_types: List[Literal["authorization_code", "authorization_code_with_pkce"]]
215240
"""The OIDC flows supported by this application"""
216241

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

+26-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

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

88
from .allowed_idpsh import AllowedIdpsh
@@ -17,6 +17,8 @@
1717
"SaaSApplication",
1818
"SaaSApplicationSaasApp",
1919
"SaaSApplicationSaasAppAccessOIDCSaasApp",
20+
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims",
21+
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource",
2022
"BrowserSSHApplication",
2123
"BrowserVncApplication",
2224
"AppLauncherApplication",
@@ -195,6 +197,27 @@ class SaaSApplication(TypedDict, total=False):
195197
"""The application type."""
196198

197199

200+
class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource(TypedDict, total=False):
201+
name: str
202+
"""The name of the IdP claim."""
203+
204+
205+
class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims(TypedDict, total=False):
206+
name: str
207+
"""The name of the claim."""
208+
209+
name_by_idp: Dict[str, str]
210+
"""A mapping from IdP ID to claim name."""
211+
212+
required: bool
213+
"""If the claim is required when building an OIDC token."""
214+
215+
scope: Literal["groups", "profile", "email", "openid"]
216+
"""The scope of the claim."""
217+
218+
source: SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource
219+
220+
198221
class SaaSApplicationSaasAppAccessOIDCSaasApp(TypedDict, total=False):
199222
app_launcher_url: str
200223
"""The URL where this applications tile redirects users"""
@@ -211,6 +234,8 @@ class SaaSApplicationSaasAppAccessOIDCSaasApp(TypedDict, total=False):
211234
client_secret: str
212235
"""The application client secret, only returned on POST request."""
213236

237+
custom_claims: SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims
238+
214239
grant_types: List[Literal["authorization_code", "authorization_code_with_pkce"]]
215240
"""The OIDC flows supported by this application"""
216241

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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, Optional
44

55
from ...._models import BaseModel
66

@@ -10,3 +10,6 @@
1010
class SaasAppSource(BaseModel):
1111
name: Optional[str] = None
1212
"""The name of the IdP attribute."""
13+
14+
name_by_idp: Optional[Dict[str, str]] = None
15+
"""A mapping from IdP ID to attribute name."""

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

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Dict
56
from typing_extensions import TypedDict
67

78
__all__ = ["SaasAppSourceParam"]
@@ -10,3 +11,6 @@
1011
class SaasAppSourceParam(TypedDict, total=False):
1112
name: str
1213
"""The name of the IdP attribute."""
14+
15+
name_by_idp: Dict[str, str]
16+
"""A mapping from IdP ID to attribute name."""

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

+6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@
1313

1414

1515
class CustomAttributes(BaseModel):
16+
friendly_name: Optional[str] = None
17+
"""The SAML FriendlyName of the attribute."""
18+
1619
name: Optional[str] = None
1720
"""The name of the attribute."""
1821

1922
name_format: Optional[SaasAppNameFormat] = None
2023
"""A globally unique name for an identity or service provider."""
2124

25+
required: Optional[bool] = None
26+
"""If the attribute is required when building a SAML assertion."""
27+
2228
source: Optional[SaasAppSource] = None
2329

2430

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

+6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@
1212

1313

1414
class CustomAttributes(TypedDict, total=False):
15+
friendly_name: str
16+
"""The SAML FriendlyName of the attribute."""
17+
1518
name: str
1619
"""The name of the attribute."""
1720

1821
name_format: SaasAppNameFormat
1922
"""A globally unique name for an identity or service provider."""
2023

24+
required: bool
25+
"""If the attribute is required when building a SAML assertion."""
26+
2127
source: SaasAppSourceParam
2228

2329

tests/api_resources/zero_trust/access/test_applications.py

+36-4
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,17 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N
165165
"auth_type": "saml",
166166
"consumer_service_url": "https://example.com",
167167
"custom_attributes": {
168+
"friendly_name": "Last Name",
168169
"name": "family_name",
169170
"name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
170-
"source": {"name": "last_name"},
171+
"required": True,
172+
"source": {
173+
"name": "last_name",
174+
"name_by_idp": {
175+
"exampleIdPID1": "AttributeName1",
176+
"exampleIdPID2": "AttributeName2",
177+
},
178+
},
171179
},
172180
"default_relay_state": "https://example.com",
173181
"idp_entity_id": "https://example.cloudflareaccess.com",
@@ -889,9 +897,17 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N
889897
"auth_type": "saml",
890898
"consumer_service_url": "https://example.com",
891899
"custom_attributes": {
900+
"friendly_name": "Last Name",
892901
"name": "family_name",
893902
"name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
894-
"source": {"name": "last_name"},
903+
"required": True,
904+
"source": {
905+
"name": "last_name",
906+
"name_by_idp": {
907+
"exampleIdPID1": "AttributeName1",
908+
"exampleIdPID2": "AttributeName2",
909+
},
910+
},
895911
},
896912
"default_relay_state": "https://example.com",
897913
"idp_entity_id": "https://example.cloudflareaccess.com",
@@ -1911,9 +1927,17 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
19111927
"auth_type": "saml",
19121928
"consumer_service_url": "https://example.com",
19131929
"custom_attributes": {
1930+
"friendly_name": "Last Name",
19141931
"name": "family_name",
19151932
"name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
1916-
"source": {"name": "last_name"},
1933+
"required": True,
1934+
"source": {
1935+
"name": "last_name",
1936+
"name_by_idp": {
1937+
"exampleIdPID1": "AttributeName1",
1938+
"exampleIdPID2": "AttributeName2",
1939+
},
1940+
},
19171941
},
19181942
"default_relay_state": "https://example.com",
19191943
"idp_entity_id": "https://example.cloudflareaccess.com",
@@ -2635,9 +2659,17 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn
26352659
"auth_type": "saml",
26362660
"consumer_service_url": "https://example.com",
26372661
"custom_attributes": {
2662+
"friendly_name": "Last Name",
26382663
"name": "family_name",
26392664
"name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
2640-
"source": {"name": "last_name"},
2665+
"required": True,
2666+
"source": {
2667+
"name": "last_name",
2668+
"name_by_idp": {
2669+
"exampleIdPID1": "AttributeName1",
2670+
"exampleIdPID2": "AttributeName2",
2671+
},
2672+
},
26412673
},
26422674
"default_relay_state": "https://example.com",
26432675
"idp_entity_id": "https://example.cloudflareaccess.com",

0 commit comments

Comments
 (0)