Skip to content

Commit

Permalink
feat: generate more types that are used as request bodies (#2263)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Dec 12, 2024
1 parent 72b7def commit acbdc24
Show file tree
Hide file tree
Showing 39 changed files with 1,252 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cloudflare/types/bot_management/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
from .bot_fight_mode_configuration import BotFightModeConfiguration as BotFightModeConfiguration
from .bot_management_update_params import BotManagementUpdateParams as BotManagementUpdateParams
from .bot_management_update_response import BotManagementUpdateResponse as BotManagementUpdateResponse
from .subscription_configuration_param import SubscriptionConfigurationParam as SubscriptionConfigurationParam
from .bot_fight_mode_configuration_param import BotFightModeConfigurationParam as BotFightModeConfigurationParam
from .super_bot_fight_mode_likely_configuration import (
SuperBotFightModeLikelyConfiguration as SuperBotFightModeLikelyConfiguration,
)
from .super_bot_fight_mode_definitely_configuration import (
SuperBotFightModeDefinitelyConfiguration as SuperBotFightModeDefinitelyConfiguration,
)
from .super_bot_fight_mode_likely_configuration_param import (
SuperBotFightModeLikelyConfigurationParam as SuperBotFightModeLikelyConfigurationParam,
)
from .super_bot_fight_mode_definitely_configuration_param import (
SuperBotFightModeDefinitelyConfigurationParam as SuperBotFightModeDefinitelyConfigurationParam,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, TypedDict

__all__ = ["BotFightModeConfigurationParam"]


class BotFightModeConfigurationParam(TypedDict, total=False):
ai_bots_protection: Literal["block", "disabled"]
"""Enable rule to block AI Scrapers and Crawlers."""

enable_js: bool
"""Use lightweight, invisible JavaScript detections to improve Bot Management.
[Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
"""

fight_mode: bool
"""Whether to enable Bot Fight Mode."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, TypedDict

__all__ = ["SubscriptionConfigurationParam"]


class SubscriptionConfigurationParam(TypedDict, total=False):
ai_bots_protection: Literal["block", "disabled"]
"""Enable rule to block AI Scrapers and Crawlers."""

auto_update_model: bool
"""
Automatically update to the newest bot detection models created by Cloudflare as
they are released.
[Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes)
"""

enable_js: bool
"""Use lightweight, invisible JavaScript detections to improve Bot Management.
[Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
"""

suppress_session_score: bool
"""
Whether to disable tracking the highest bot score for a session in the Bot
Management cookie.
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, TypedDict

__all__ = ["SuperBotFightModeDefinitelyConfigurationParam"]


class SuperBotFightModeDefinitelyConfigurationParam(TypedDict, total=False):
ai_bots_protection: Literal["block", "disabled"]
"""Enable rule to block AI Scrapers and Crawlers."""

enable_js: bool
"""Use lightweight, invisible JavaScript detections to improve Bot Management.
[Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
"""

optimize_wordpress: bool
"""Whether to optimize Super Bot Fight Mode protections for Wordpress."""

sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"]
"""Super Bot Fight Mode (SBFM) action to take on definitely automated requests."""

sbfm_static_resource_protection: bool
"""
Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if
static resources on your application need bot protection. Note: Static resource
protection can also result in legitimate traffic being blocked.
"""

sbfm_verified_bots: Literal["allow", "block"]
"""Super Bot Fight Mode (SBFM) action to take on verified bots requests."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, TypedDict

__all__ = ["SuperBotFightModeLikelyConfigurationParam"]


class SuperBotFightModeLikelyConfigurationParam(TypedDict, total=False):
ai_bots_protection: Literal["block", "disabled"]
"""Enable rule to block AI Scrapers and Crawlers."""

enable_js: bool
"""Use lightweight, invisible JavaScript detections to improve Bot Management.
[Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
"""

optimize_wordpress: bool
"""Whether to optimize Super Bot Fight Mode protections for Wordpress."""

sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"]
"""Super Bot Fight Mode (SBFM) action to take on definitely automated requests."""

sbfm_likely_automated: Literal["allow", "block", "managed_challenge"]
"""Super Bot Fight Mode (SBFM) action to take on likely automated requests."""

sbfm_static_resource_protection: bool
"""
Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if
static resources on your application need bot protection. Note: Static resource
protection can also result in legitimate traffic being blocked.
"""

sbfm_verified_bots: Literal["allow", "block"]
"""Super Bot Fight Mode (SBFM) action to take on verified bots requests."""
1 change: 1 addition & 0 deletions src/cloudflare/types/dns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .ds_record import DSRecord as DSRecord
from .mx_record import MXRecord as MXRecord
from .ns_record import NSRecord as NSRecord
from .ttl_param import TTLParam as TTLParam
from .caa_record import CAARecord as CAARecord
from .loc_record import LOCRecord as LOCRecord
from .ptr_record import PTRRecord as PTRRecord
Expand Down
10 changes: 10 additions & 0 deletions src/cloudflare/types/dns/ttl_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Union
from typing_extensions import Literal, TypeAlias

__all__ = ["TTLParam"]

TTLParam: TypeAlias = Union[float, Literal[1]]
2 changes: 2 additions & 0 deletions src/cloudflare/types/zero_trust/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .organization import Organization as Organization
from .everyone_rule import EveryoneRule as EveryoneRule
from .ip_rule_param import IPRuleParam as IPRuleParam
from .azure_ad_param import AzureADParam as AzureADParam
from .email_list_rule import EmailListRule as EmailListRule
from .okta_group_rule import OktaGroupRule as OktaGroupRule
from .saml_group_rule import SAMLGroupRule as SAMLGroupRule
Expand Down Expand Up @@ -56,6 +57,7 @@
from .tunnel_delete_response import TunnelDeleteResponse as TunnelDeleteResponse
from .gateway_create_response import GatewayCreateResponse as GatewayCreateResponse
from .gsuite_group_rule_param import GSuiteGroupRuleParam as GSuiteGroupRuleParam
from .identity_provider_param import IdentityProviderParam as IdentityProviderParam
from .external_evaluation_rule import ExternalEvaluationRule as ExternalEvaluationRule
from .github_organization_rule import GitHubOrganizationRule as GitHubOrganizationRule
from .service_token_rule_param import ServiceTokenRuleParam as ServiceTokenRuleParam
Expand Down
72 changes: 72 additions & 0 deletions src/cloudflare/types/zero_trust/azure_ad_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

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

from .identity_provider_type import IdentityProviderType
from .identity_provider_scim_config_param import IdentityProviderSCIMConfigParam

__all__ = ["AzureADParam", "Config"]


class Config(TypedDict, total=False):
claims: List[str]
"""Custom claims"""

client_id: str
"""Your OAuth Client ID"""

client_secret: str
"""Your OAuth Client Secret"""

conditional_access_enabled: bool
"""Should Cloudflare try to load authentication contexts from your account"""

directory_id: str
"""Your Azure directory uuid"""

email_claim_name: str
"""The claim name for email in the id_token response."""

prompt: Literal["login", "select_account", "none"]
"""Indicates the type of user interaction that is required.
prompt=login forces the user to enter their credentials on that request,
negating single-sign on. prompt=none is the opposite. It ensures that the user
isn't presented with any interactive prompt. If the request can't be completed
silently by using single-sign on, the Microsoft identity platform returns an
interaction_required error. prompt=select_account interrupts single sign-on
providing account selection experience listing all the accounts either in
session or any remembered account or an option to choose to use a different
account altogether.
"""

support_groups: bool
"""Should Cloudflare try to load groups from your account"""


class AzureADParam(TypedDict, total=False):
config: Required[Config]
"""The configuration parameters for the identity provider.
To view the required parameters for a specific provider, refer to our
[developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
"""

name: Required[str]
"""The name of the identity provider, shown to users on the login page."""

type: Required[IdentityProviderType]
"""The type of identity provider.
To determine the value for a specific provider, refer to our
[developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
"""

scim_config: IdentityProviderSCIMConfigParam
"""
The configuration settings for enabling a System for Cross-Domain Identity
Management (SCIM) with the identity provider.
"""
Loading

0 comments on commit acbdc24

Please sign in to comment.