Skip to content

Commit

Permalink
feat(api): api update (#2129)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 7, 2024
1 parent dae1150 commit ff2f5dc
Show file tree
Hide file tree
Showing 18 changed files with 260 additions and 232 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1397
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-66874390672543889c6f739266ab0e815d7c6a65deb464a2c41c965b45d3e24a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb646c11ed31a9e0730c5860d58b7ed8757c84c20012ea4e7d4a4750c8e908f2.yml
13 changes: 3 additions & 10 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5059,9 +5059,7 @@ from cloudflare.types.zero_trust.access import (
CORSHeaders,
Decision,
OIDCSaaSApp,
SaaSAppNameFormat,
SaaSAppNameIDFormat,
SaaSAppSource,
SAMLSaaSApp,
SCIMConfigAuthenticationHTTPBasic,
SCIMConfigAuthenticationOAuthBearerToken,
Expand Down Expand Up @@ -5091,20 +5089,15 @@ Methods:
Types:

```python
from cloudflare.types.zero_trust.access.applications import (
CA,
CACreateResponse,
CADeleteResponse,
CAGetResponse,
)
from cloudflare.types.zero_trust.access.applications import CA, CADeleteResponse
```

Methods:

- <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>
- <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>
- <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>
- <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>
- <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>
- <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>

#### UserPolicyChecks

Expand Down
24 changes: 12 additions & 12 deletions src/cloudflare/resources/zero_trust/access/applications/cas.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
) -> Optional[CA]:
"""
Generates a new short-lived certificate CA and public key.
Expand Down Expand Up @@ -96,9 +96,9 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[object]]._unwrapper,
post_parser=ResultWrapper[Optional[CA]]._unwrapper,
),
cast_to=cast(Type[object], ResultWrapper[object]),
cast_to=cast(Type[Optional[CA]], ResultWrapper[CA]),
)

def list(
Expand Down Expand Up @@ -219,7 +219,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
) -> Optional[CA]:
"""
Fetches a short-lived certificate CA and its public key.
Expand Down Expand Up @@ -259,9 +259,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[object]]._unwrapper,
post_parser=ResultWrapper[Optional[CA]]._unwrapper,
),
cast_to=cast(Type[object], ResultWrapper[object]),
cast_to=cast(Type[Optional[CA]], ResultWrapper[CA]),
)


Expand Down Expand Up @@ -297,7 +297,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
) -> Optional[CA]:
"""
Generates a new short-lived certificate CA and public key.
Expand Down Expand Up @@ -337,9 +337,9 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[object]]._unwrapper,
post_parser=ResultWrapper[Optional[CA]]._unwrapper,
),
cast_to=cast(Type[object], ResultWrapper[object]),
cast_to=cast(Type[Optional[CA]], ResultWrapper[CA]),
)

def list(
Expand Down Expand Up @@ -460,7 +460,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
) -> Optional[CA]:
"""
Fetches a short-lived certificate CA and its public key.
Expand Down Expand Up @@ -500,9 +500,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[object]]._unwrapper,
post_parser=ResultWrapper[Optional[CA]]._unwrapper,
),
cast_to=cast(Type[object], ResultWrapper[object]),
cast_to=cast(Type[Optional[CA]], ResultWrapper[CA]),
)


Expand Down
12 changes: 6 additions & 6 deletions src/cloudflare/resources/zero_trust/access/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def create(
self,
*,
account_id: str,
body: str,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -67,7 +67,7 @@ def create(
Args:
account_id: Identifier
body: The name of the tag
name: The name of the tag
extra_headers: Send extra headers
Expand All @@ -81,7 +81,7 @@ def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._post(
f"/accounts/{account_id}/access/tags",
body=maybe_transform(body, tag_create_params.TagCreateParams),
body=maybe_transform({"name": name}, tag_create_params.TagCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -289,7 +289,7 @@ async def create(
self,
*,
account_id: str,
body: str,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -303,7 +303,7 @@ async def create(
Args:
account_id: Identifier
body: The name of the tag
name: The name of the tag
extra_headers: Send extra headers
Expand All @@ -317,7 +317,7 @@ async def create(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return await self._post(
f"/accounts/{account_id}/access/tags",
body=await async_maybe_transform(body, tag_create_params.TagCreateParams),
body=await async_maybe_transform({"name": name}, tag_create_params.TagCreateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down
3 changes: 0 additions & 3 deletions src/cloudflare/types/zero_trust/access/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from .allowed_headers import AllowedHeaders as AllowedHeaders
from .allowed_methods import AllowedMethods as AllowedMethods
from .allowed_origins import AllowedOrigins as AllowedOrigins
from .saas_app_source import SaaSAppSource as SaaSAppSource
from .application_type import ApplicationType as ApplicationType
from .key_get_response import KeyGetResponse as KeyGetResponse
from .zero_trust_group import ZeroTrustGroup as ZeroTrustGroup
Expand All @@ -41,9 +40,7 @@
from .policy_create_params import PolicyCreateParams as PolicyCreateParams
from .policy_list_response import PolicyListResponse as PolicyListResponse
from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams
from .saas_app_name_format import SaaSAppNameFormat as SaaSAppNameFormat
from .group_delete_response import GroupDeleteResponse as GroupDeleteResponse
from .saas_app_source_param import SaaSAppSourceParam as SaaSAppSourceParam
from .bookmark_create_params import BookmarkCreateParams as BookmarkCreateParams
from .bookmark_update_params import BookmarkUpdateParams as BookmarkUpdateParams
from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse
Expand Down
10 changes: 5 additions & 5 deletions src/cloudflare/types/zero_trust/access/oidc_saas_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

from ...._models import BaseModel

__all__ = ["OIDCSaaSApp", "CustomClaims", "CustomClaimsSource", "HybridAndImplicitOptions", "RefreshTokenOptions"]
__all__ = ["OIDCSaaSApp", "CustomClaim", "CustomClaimSource", "HybridAndImplicitOptions", "RefreshTokenOptions"]


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

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


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

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

source: Optional[CustomClaimsSource] = None
source: Optional[CustomClaimSource] = None


class HybridAndImplicitOptions(BaseModel):
Expand Down Expand Up @@ -77,7 +77,7 @@ class OIDCSaaSApp(BaseModel):

created_at: Optional[datetime] = None

custom_claims: Optional[CustomClaims] = None
custom_claims: Optional[List[CustomClaim]] = None

grant_types: Optional[
List[Literal["authorization_code", "authorization_code_with_pkce", "refresh_tokens", "hybrid", "implicit"]]
Expand Down
12 changes: 6 additions & 6 deletions src/cloudflare/types/zero_trust/access/oidc_saas_app_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

from __future__ import annotations

from typing import Dict, List
from typing import Dict, List, Iterable
from typing_extensions import Literal, TypedDict

__all__ = ["OIDCSaaSAppParam", "CustomClaims", "CustomClaimsSource", "HybridAndImplicitOptions", "RefreshTokenOptions"]
__all__ = ["OIDCSaaSAppParam", "CustomClaim", "CustomClaimSource", "HybridAndImplicitOptions", "RefreshTokenOptions"]


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

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


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

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

source: CustomClaimsSource
source: CustomClaimSource


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

custom_claims: CustomClaims
custom_claims: Iterable[CustomClaim]

grant_types: List[
Literal["authorization_code", "authorization_code_with_pkce", "refresh_tokens", "hybrid", "implicit"]
Expand Down
11 changes: 0 additions & 11 deletions src/cloudflare/types/zero_trust/access/saas_app_name_format.py

This file was deleted.

15 changes: 0 additions & 15 deletions src/cloudflare/types/zero_trust/access/saas_app_source.py

This file was deleted.

16 changes: 0 additions & 16 deletions src/cloudflare/types/zero_trust/access/saas_app_source_param.py

This file was deleted.

28 changes: 20 additions & 8 deletions src/cloudflare/types/zero_trust/access/saml_saas_app.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

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

from ...._models import BaseModel
from .saas_app_source import SaaSAppSource
from .saas_app_name_format import SaaSAppNameFormat
from .saas_app_name_id_format import SaaSAppNameIDFormat

__all__ = ["SAMLSaaSApp", "CustomAttributes"]
__all__ = ["SAMLSaaSApp", "CustomAttribute", "CustomAttributeSource"]


class CustomAttributes(BaseModel):
class CustomAttributeSource(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."""


class CustomAttribute(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
name_format: Optional[
Literal[
"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
"urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri",
]
] = 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
source: Optional[CustomAttributeSource] = None


class SAMLSaaSApp(BaseModel):
Expand All @@ -44,7 +56,7 @@ class SAMLSaaSApp(BaseModel):

created_at: Optional[datetime] = None

custom_attributes: Optional[CustomAttributes] = None
custom_attributes: Optional[List[CustomAttribute]] = None

default_relay_state: Optional[str] = None
"""
Expand Down
Loading

0 comments on commit ff2f5dc

Please sign in to comment.