Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent 5a4d204 commit 55a52b3
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 8 deletions.
27 changes: 26 additions & 1 deletion src/cloudflare/types/zero_trust/access/application.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Union, Optional
from typing import Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal

Expand All @@ -17,6 +17,8 @@
"SaaSApplication",
"SaaSApplicationSaasApp",
"SaaSApplicationSaasAppAccessOIDCSaasApp",
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims",
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource",
"BrowserSSHApplication",
"BrowserVncApplication",
"AppLauncherApplication",
Expand Down Expand Up @@ -154,6 +156,27 @@ class SelfHostedApplication(BaseModel):
updated_at: Optional[datetime] = None


class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource(BaseModel):
name: Optional[str] = None
"""The name of the IdP claim."""


class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims(BaseModel):
name: Optional[str] = None
"""The name of the claim."""

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

required: Optional[bool] = None
"""If the claim is required when building an OIDC token."""

scope: Optional[Literal["groups", "profile", "email", "openid"]] = None
"""The scope of the claim."""

source: Optional[SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource] = None


class SaaSApplicationSaasAppAccessOIDCSaasApp(BaseModel):
app_launcher_url: Optional[str] = None
"""The URL where this applications tile redirects users"""
Expand All @@ -172,6 +195,8 @@ class SaaSApplicationSaasAppAccessOIDCSaasApp(BaseModel):

created_at: Optional[datetime] = None

custom_claims: Optional[SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims] = None

grant_types: Optional[List[Literal["authorization_code", "authorization_code_with_pkce"]]] = None
"""The OIDC flows supported by this application"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Union
from typing import Dict, List, Union
from typing_extensions import Literal, Required, TypedDict

from .allowed_idpsh import AllowedIdpsh
Expand All @@ -17,6 +17,8 @@
"SaaSApplication",
"SaaSApplicationSaasApp",
"SaaSApplicationSaasAppAccessOIDCSaasApp",
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims",
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource",
"BrowserSSHApplication",
"BrowserVncApplication",
"AppLauncherApplication",
Expand Down Expand Up @@ -195,6 +197,27 @@ class SaaSApplication(TypedDict, total=False):
"""The application type."""


class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource(TypedDict, total=False):
name: str
"""The name of the IdP claim."""


class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims(TypedDict, total=False):
name: str
"""The name of the claim."""

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

required: bool
"""If the claim is required when building an OIDC token."""

scope: Literal["groups", "profile", "email", "openid"]
"""The scope of the claim."""

source: SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource


class SaaSApplicationSaasAppAccessOIDCSaasApp(TypedDict, total=False):
app_launcher_url: str
"""The URL where this applications tile redirects users"""
Expand All @@ -211,6 +234,8 @@ class SaaSApplicationSaasAppAccessOIDCSaasApp(TypedDict, total=False):
client_secret: str
"""The application client secret, only returned on POST request."""

custom_claims: SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims

grant_types: List[Literal["authorization_code", "authorization_code_with_pkce"]]
"""The OIDC flows supported by this application"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Union
from typing import Dict, List, Union
from typing_extensions import Literal, Required, TypedDict

from .allowed_idpsh import AllowedIdpsh
Expand All @@ -17,6 +17,8 @@
"SaaSApplication",
"SaaSApplicationSaasApp",
"SaaSApplicationSaasAppAccessOIDCSaasApp",
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims",
"SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource",
"BrowserSSHApplication",
"BrowserVncApplication",
"AppLauncherApplication",
Expand Down Expand Up @@ -195,6 +197,27 @@ class SaaSApplication(TypedDict, total=False):
"""The application type."""


class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource(TypedDict, total=False):
name: str
"""The name of the IdP claim."""


class SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims(TypedDict, total=False):
name: str
"""The name of the claim."""

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

required: bool
"""If the claim is required when building an OIDC token."""

scope: Literal["groups", "profile", "email", "openid"]
"""The scope of the claim."""

source: SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaimsSource


class SaaSApplicationSaasAppAccessOIDCSaasApp(TypedDict, total=False):
app_launcher_url: str
"""The URL where this applications tile redirects users"""
Expand All @@ -211,6 +234,8 @@ class SaaSApplicationSaasAppAccessOIDCSaasApp(TypedDict, total=False):
client_secret: str
"""The application client secret, only returned on POST request."""

custom_claims: SaaSApplicationSaasAppAccessOIDCSaasAppCustomClaims

grant_types: List[Literal["authorization_code", "authorization_code_with_pkce"]]
"""The OIDC flows supported by this application"""

Expand Down
5 changes: 4 additions & 1 deletion src/cloudflare/types/zero_trust/access/saas_app_source.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing import Dict, Optional

from ...._models import BaseModel

Expand All @@ -10,3 +10,6 @@
class SaasAppSource(BaseModel):
name: Optional[str] = None
"""The name of the IdP attribute."""

name_by_idp: Optional[Dict[str, str]] = None
"""A mapping from IdP ID to attribute name."""
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from typing import Dict
from typing_extensions import TypedDict

__all__ = ["SaasAppSourceParam"]
Expand All @@ -10,3 +11,6 @@
class SaasAppSourceParam(TypedDict, total=False):
name: str
"""The name of the IdP attribute."""

name_by_idp: Dict[str, str]
"""A mapping from IdP ID to attribute name."""
6 changes: 6 additions & 0 deletions src/cloudflare/types/zero_trust/access/saml_saas_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@


class CustomAttributes(BaseModel):
friendly_name: Optional[str] = None
"""The SAML FriendlyName of the attribute."""

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

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

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

source: Optional[SaasAppSource] = None


Expand Down
6 changes: 6 additions & 0 deletions src/cloudflare/types/zero_trust/access/saml_saas_app_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@


class CustomAttributes(TypedDict, total=False):
friendly_name: str
"""The SAML FriendlyName of the attribute."""

name: str
"""The name of the attribute."""

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

required: bool
"""If the attribute is required when building a SAML assertion."""

source: SaasAppSourceParam


Expand Down
40 changes: 36 additions & 4 deletions tests/api_resources/zero_trust/access/test_applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,17 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N
"auth_type": "saml",
"consumer_service_url": "https://example.com",
"custom_attributes": {
"friendly_name": "Last Name",
"name": "family_name",
"name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
"source": {"name": "last_name"},
"required": True,
"source": {
"name": "last_name",
"name_by_idp": {
"exampleIdPID1": "AttributeName1",
"exampleIdPID2": "AttributeName2",
},
},
},
"default_relay_state": "https://example.com",
"idp_entity_id": "https://example.cloudflareaccess.com",
Expand Down Expand Up @@ -889,9 +897,17 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N
"auth_type": "saml",
"consumer_service_url": "https://example.com",
"custom_attributes": {
"friendly_name": "Last Name",
"name": "family_name",
"name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
"source": {"name": "last_name"},
"required": True,
"source": {
"name": "last_name",
"name_by_idp": {
"exampleIdPID1": "AttributeName1",
"exampleIdPID2": "AttributeName2",
},
},
},
"default_relay_state": "https://example.com",
"idp_entity_id": "https://example.cloudflareaccess.com",
Expand Down Expand Up @@ -1911,9 +1927,17 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
"auth_type": "saml",
"consumer_service_url": "https://example.com",
"custom_attributes": {
"friendly_name": "Last Name",
"name": "family_name",
"name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
"source": {"name": "last_name"},
"required": True,
"source": {
"name": "last_name",
"name_by_idp": {
"exampleIdPID1": "AttributeName1",
"exampleIdPID2": "AttributeName2",
},
},
},
"default_relay_state": "https://example.com",
"idp_entity_id": "https://example.cloudflareaccess.com",
Expand Down Expand Up @@ -2635,9 +2659,17 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn
"auth_type": "saml",
"consumer_service_url": "https://example.com",
"custom_attributes": {
"friendly_name": "Last Name",
"name": "family_name",
"name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
"source": {"name": "last_name"},
"required": True,
"source": {
"name": "last_name",
"name_by_idp": {
"exampleIdPID1": "AttributeName1",
"exampleIdPID2": "AttributeName2",
},
},
},
"default_relay_state": "https://example.com",
"idp_entity_id": "https://example.cloudflareaccess.com",
Expand Down

0 comments on commit 55a52b3

Please sign in to comment.