From d6c27c4d3f9c42105eadb101f83a25126fa0adbc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:36:10 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#240) --- api.md | 33 +++--- .../resources/load_balancers/pools/pools.py | 2 +- .../resources/user/load_balancers/pools.py | 2 +- src/cloudflare/types/accounts/__init__.py | 2 +- .../accounts/{roles.py => member_roles.py} | 4 +- src/cloudflare/types/firewall/__init__.py | 10 +- .../access_rule_cidr_configuration.py | 24 ++++ ...> access_rule_cidr_configuration_param.py} | 12 +- .../firewall/access_rule_create_params.py | 8 +- .../types/firewall/access_rule_edit_params.py | 8 +- .../firewall/access_rule_ip_configuration.py | 22 ++++ ... => access_rule_ip_configuration_param.py} | 7 +- .../types/firewall/configuration.py | 6 +- .../types/firewall/configuration_param.py | 6 +- ...tion.py => lockdown_cidr_configuration.py} | 4 +- ...ration.py => lockdown_ip_configuration.py} | 4 +- src/cloudflare/types/membership.py | 4 +- .../firewall/access_rule_create_params.py | 8 +- .../types/user/firewall/firewall_rule.py | 12 +- .../types/user/load_balancers/__init__.py | 1 - .../types/user/load_balancers/pool.py | 107 ------------------ .../types/zero_trust/dlp/__init__.py | 2 - .../types/zero_trust/dlp/custom_profile.py | 7 -- .../zero_trust/dlp/predefined_profile.py | 7 -- .../zero_trust/dlp/profiles/custom_profile.py | 4 +- .../dlp/profiles/predefined_profile.py | 4 +- .../load_balancers/test_pools.py | 2 +- .../user/load_balancers/test_pools.py | 2 +- 28 files changed, 123 insertions(+), 191 deletions(-) rename src/cloudflare/types/accounts/{roles.py => member_roles.py} (69%) create mode 100644 src/cloudflare/types/firewall/access_rule_cidr_configuration.py rename src/cloudflare/types/firewall/{cidr_configuration_param.py => access_rule_cidr_configuration_param.py} (53%) create mode 100644 src/cloudflare/types/firewall/access_rule_ip_configuration.py rename src/cloudflare/types/firewall/{ip_configuration_param.py => access_rule_ip_configuration_param.py} (78%) rename src/cloudflare/types/firewall/{cidr_configuration.py => lockdown_cidr_configuration.py} (85%) rename src/cloudflare/types/firewall/{ip_configuration.py => lockdown_ip_configuration.py} (86%) delete mode 100644 src/cloudflare/types/user/load_balancers/pool.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/custom_profile.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/predefined_profile.py diff --git a/api.md b/api.md index a23cb9c1d4ad..bc13908c4858 100644 --- a/api.md +++ b/api.md @@ -38,8 +38,8 @@ Types: ```python from cloudflare.types.accounts import ( Member, + MemberRoles, MemberWithInviteCode, - Roles, MemberListResponse, MemberDeleteResponse, ) @@ -214,7 +214,6 @@ Types: ```python from cloudflare.types.user.load_balancers import ( - Pool, PoolDeleteResponse, PoolHealthResponse, PoolPreviewResponse, @@ -224,12 +223,12 @@ from cloudflare.types.user.load_balancers import ( Methods: -- client.user.load_balancers.pools.create(\*\*params) -> Pool -- client.user.load_balancers.pools.update(pool_id, \*\*params) -> Pool -- client.user.load_balancers.pools.list(\*\*params) -> SyncSinglePage[Pool] +- client.user.load_balancers.pools.create(\*\*params) -> Pool +- client.user.load_balancers.pools.update(pool_id, \*\*params) -> Pool +- client.user.load_balancers.pools.list(\*\*params) -> SyncSinglePage[Pool] - client.user.load_balancers.pools.delete(pool_id, \*\*params) -> PoolDeleteResponse -- client.user.load_balancers.pools.edit(pool_id, \*\*params) -> Pool -- client.user.load_balancers.pools.get(pool_id) -> Pool +- client.user.load_balancers.pools.edit(pool_id, \*\*params) -> Pool +- client.user.load_balancers.pools.get(pool_id) -> Pool - client.user.load_balancers.pools.health(pool_id) -> PoolHealthResponse - client.user.load_balancers.pools.preview(pool_id, \*\*params) -> PoolPreviewResponse - client.user.load_balancers.pools.references(pool_id) -> Optional @@ -1173,12 +1172,12 @@ from cloudflare.types.load_balancers import Pool, PoolDeleteResponse Methods: -- client.load_balancers.pools.create(\*, account_id, \*\*params) -> Pool -- client.load_balancers.pools.update(pool_id, \*, account_id, \*\*params) -> Pool -- client.load_balancers.pools.list(\*, account_id, \*\*params) -> SyncSinglePage[Pool] +- client.load_balancers.pools.create(\*, account_id, \*\*params) -> Pool +- client.load_balancers.pools.update(pool_id, \*, account_id, \*\*params) -> Pool +- client.load_balancers.pools.list(\*, account_id, \*\*params) -> SyncSinglePage[Pool] - client.load_balancers.pools.delete(pool_id, \*, account_id, \*\*params) -> PoolDeleteResponse -- client.load_balancers.pools.edit(pool_id, \*, account_id, \*\*params) -> Pool -- client.load_balancers.pools.get(pool_id, \*, account_id) -> Pool +- client.load_balancers.pools.edit(pool_id, \*, account_id, \*\*params) -> Pool +- client.load_balancers.pools.get(pool_id, \*, account_id) -> Pool ### Health @@ -1834,10 +1833,10 @@ Types: ```python from cloudflare.types.firewall import ( - CIDRConfiguration, Configuration, - IPConfiguration, Lockdown, + LockdownCIDRConfiguration, + LockdownIPConfiguration, URLsItem, LockdownDeleteResponse, ) @@ -1880,10 +1879,10 @@ Types: ```python from cloudflare.types.firewall import ( + AccessRuleCIDRConfiguration, + AccessRuleIPConfiguration, ASNConfiguration, - CIDRConfiguration, CountryConfiguration, - IPConfiguration, IPV6Configuration, AccessRuleListResponse, AccessRuleDeleteResponse, @@ -5584,8 +5583,6 @@ Types: ```python from cloudflare.types.zero_trust.dlp import ( ContextAwareness, - CustomProfile, - PredefinedProfile, Profile, SkipConfiguration, ProfileGetResponse, diff --git a/src/cloudflare/resources/load_balancers/pools/pools.py b/src/cloudflare/resources/load_balancers/pools/pools.py index 9c4f01c48c6c..a2ff1ad74643 100644 --- a/src/cloudflare/resources/load_balancers/pools/pools.py +++ b/src/cloudflare/resources/load_balancers/pools/pools.py @@ -49,6 +49,7 @@ make_request_options, ) from ....types.load_balancers import ( + Pool, PoolDeleteResponse, pool_edit_params, pool_list_params, @@ -56,7 +57,6 @@ pool_delete_params, pool_update_params, ) -from ....types.user.load_balancers import Pool __all__ = ["Pools", "AsyncPools"] diff --git a/src/cloudflare/resources/user/load_balancers/pools.py b/src/cloudflare/resources/user/load_balancers/pools.py index 0df03ddaf739..58b1f9643069 100644 --- a/src/cloudflare/resources/user/load_balancers/pools.py +++ b/src/cloudflare/resources/user/load_balancers/pools.py @@ -33,8 +33,8 @@ AsyncPaginator, make_request_options, ) +from ....types.load_balancers import Pool from ....types.user.load_balancers import ( - Pool, PoolDeleteResponse, PoolHealthResponse, PoolPreviewResponse, diff --git a/src/cloudflare/types/accounts/__init__.py b/src/cloudflare/types/accounts/__init__.py index 13bc27e78526..d78d60fb1c3a 100644 --- a/src/cloudflare/types/accounts/__init__.py +++ b/src/cloudflare/types/accounts/__init__.py @@ -3,8 +3,8 @@ from __future__ import annotations from .role import Role as Role -from .roles import Roles as Roles from .member import Member as Member +from .member_roles import MemberRoles as MemberRoles from .permission_grant import PermissionGrant as PermissionGrant from .member_list_params import MemberListParams as MemberListParams from .member_create_params import MemberCreateParams as MemberCreateParams diff --git a/src/cloudflare/types/accounts/roles.py b/src/cloudflare/types/accounts/member_roles.py similarity index 69% rename from src/cloudflare/types/accounts/roles.py rename to src/cloudflare/types/accounts/member_roles.py index 6c91f06326eb..642965ef1300 100644 --- a/src/cloudflare/types/accounts/roles.py +++ b/src/cloudflare/types/accounts/member_roles.py @@ -2,6 +2,6 @@ from typing import List -__all__ = ["Roles"] +__all__ = ["MemberRoles"] -Roles = List[str] +MemberRoles = List[str] diff --git a/src/cloudflare/types/firewall/__init__.py b/src/cloudflare/types/firewall/__init__.py index ce0140ee7d3d..c9b9ba892622 100644 --- a/src/cloudflare/types/firewall/__init__.py +++ b/src/cloudflare/types/firewall/__init__.py @@ -9,11 +9,9 @@ from .products_item import ProductsItem as ProductsItem from .deleted_filter import DeletedFilter as DeletedFilter from .rule_get_params import RuleGetParams as RuleGetParams -from .ip_configuration import IPConfiguration as IPConfiguration from .rule_edit_params import RuleEditParams as RuleEditParams from .rule_list_params import RuleListParams as RuleListParams from .asn_configuration import ASNConfiguration as ASNConfiguration -from .cidr_configuration import CIDRConfiguration as CIDRConfiguration from .ipv6_configuration import IPV6Configuration as IPV6Configuration from .rule_create_params import RuleCreateParams as RuleCreateParams from .rule_delete_params import RuleDeleteParams as RuleDeleteParams @@ -28,7 +26,6 @@ from .ua_rule_delete_params import UARuleDeleteParams as UARuleDeleteParams from .ua_rule_list_response import UARuleListResponse as UARuleListResponse from .ua_rule_update_params import UARuleUpdateParams as UARuleUpdateParams -from .ip_configuration_param import IPConfigurationParam as IPConfigurationParam from .lockdown_create_params import LockdownCreateParams as LockdownCreateParams from .lockdown_delete_params import LockdownDeleteParams as LockdownDeleteParams from .lockdown_update_params import LockdownUpdateParams as LockdownUpdateParams @@ -36,10 +33,15 @@ from .access_rule_list_params import AccessRuleListParams as AccessRuleListParams from .asn_configuration_param import ASNConfigurationParam as ASNConfigurationParam from .ua_rule_delete_response import UARuleDeleteResponse as UARuleDeleteResponse -from .cidr_configuration_param import CIDRConfigurationParam as CIDRConfigurationParam from .ipv6_configuration_param import IPV6ConfigurationParam as IPV6ConfigurationParam from .lockdown_delete_response import LockdownDeleteResponse as LockdownDeleteResponse from .access_rule_create_params import AccessRuleCreateParams as AccessRuleCreateParams from .access_rule_delete_params import AccessRuleDeleteParams as AccessRuleDeleteParams +from .lockdown_ip_configuration import LockdownIPConfiguration as LockdownIPConfiguration from .access_rule_delete_response import AccessRuleDeleteResponse as AccessRuleDeleteResponse from .country_configuration_param import CountryConfigurationParam as CountryConfigurationParam +from .lockdown_cidr_configuration import LockdownCIDRConfiguration as LockdownCIDRConfiguration +from .access_rule_ip_configuration import AccessRuleIPConfiguration as AccessRuleIPConfiguration +from .access_rule_cidr_configuration import AccessRuleCIDRConfiguration as AccessRuleCIDRConfiguration +from .access_rule_ip_configuration_param import AccessRuleIPConfigurationParam as AccessRuleIPConfigurationParam +from .access_rule_cidr_configuration_param import AccessRuleCIDRConfigurationParam as AccessRuleCIDRConfigurationParam diff --git a/src/cloudflare/types/firewall/access_rule_cidr_configuration.py b/src/cloudflare/types/firewall/access_rule_cidr_configuration.py new file mode 100644 index 000000000000..7a88829b2728 --- /dev/null +++ b/src/cloudflare/types/firewall/access_rule_cidr_configuration.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["AccessRuleCIDRConfiguration"] + + +class AccessRuleCIDRConfiguration(BaseModel): + target: Optional[Literal["ip_range"]] = None + """The configuration target. + + You must set the target to `ip_range` when specifying an IP address range in the + rule. + """ + + value: Optional[str] = None + """The IP address range to match. + + You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix + lengths `/32`, `/48`, and `/64` for IPv6 ranges. + """ diff --git a/src/cloudflare/types/firewall/cidr_configuration_param.py b/src/cloudflare/types/firewall/access_rule_cidr_configuration_param.py similarity index 53% rename from src/cloudflare/types/firewall/cidr_configuration_param.py rename to src/cloudflare/types/firewall/access_rule_cidr_configuration_param.py index 5db8c8a5edaa..963ff0df81b3 100644 --- a/src/cloudflare/types/firewall/cidr_configuration_param.py +++ b/src/cloudflare/types/firewall/access_rule_cidr_configuration_param.py @@ -4,16 +4,20 @@ from typing_extensions import Literal, TypedDict -__all__ = ["CIDRConfigurationParam"] +__all__ = ["AccessRuleCIDRConfigurationParam"] -class CIDRConfigurationParam(TypedDict, total=False): +class AccessRuleCIDRConfigurationParam(TypedDict, total=False): target: Literal["ip_range"] """The configuration target. You must set the target to `ip_range` when specifying an IP address range in the - Zone Lockdown rule. + rule. """ value: str - """The IP address range to match. You can only use prefix lengths `/16` and `/24`.""" + """The IP address range to match. + + You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix + lengths `/32`, `/48`, and `/64` for IPv6 ranges. + """ diff --git a/src/cloudflare/types/firewall/access_rule_create_params.py b/src/cloudflare/types/firewall/access_rule_create_params.py index 5f0219761cc2..b33d495b8b12 100644 --- a/src/cloudflare/types/firewall/access_rule_create_params.py +++ b/src/cloudflare/types/firewall/access_rule_create_params.py @@ -5,11 +5,11 @@ from typing import Union from typing_extensions import Literal, Required, TypedDict -from .ip_configuration_param import IPConfigurationParam from .asn_configuration_param import ASNConfigurationParam -from .cidr_configuration_param import CIDRConfigurationParam from .ipv6_configuration_param import IPV6ConfigurationParam from .country_configuration_param import CountryConfigurationParam +from .access_rule_ip_configuration_param import AccessRuleIPConfigurationParam +from .access_rule_cidr_configuration_param import AccessRuleCIDRConfigurationParam __all__ = ["AccessRuleCreateParams", "Configuration"] @@ -34,9 +34,9 @@ class AccessRuleCreateParams(TypedDict, total=False): Configuration = Union[ - IPConfigurationParam, + AccessRuleIPConfigurationParam, IPV6ConfigurationParam, - CIDRConfigurationParam, + AccessRuleCIDRConfigurationParam, ASNConfigurationParam, CountryConfigurationParam, ] diff --git a/src/cloudflare/types/firewall/access_rule_edit_params.py b/src/cloudflare/types/firewall/access_rule_edit_params.py index b6c61131b92a..8a7d69b38ea9 100644 --- a/src/cloudflare/types/firewall/access_rule_edit_params.py +++ b/src/cloudflare/types/firewall/access_rule_edit_params.py @@ -5,11 +5,11 @@ from typing import Union from typing_extensions import Literal, Required, TypedDict -from .ip_configuration_param import IPConfigurationParam from .asn_configuration_param import ASNConfigurationParam -from .cidr_configuration_param import CIDRConfigurationParam from .ipv6_configuration_param import IPV6ConfigurationParam from .country_configuration_param import CountryConfigurationParam +from .access_rule_ip_configuration_param import AccessRuleIPConfigurationParam +from .access_rule_cidr_configuration_param import AccessRuleCIDRConfigurationParam __all__ = ["AccessRuleEditParams", "Configuration"] @@ -34,9 +34,9 @@ class AccessRuleEditParams(TypedDict, total=False): Configuration = Union[ - IPConfigurationParam, + AccessRuleIPConfigurationParam, IPV6ConfigurationParam, - CIDRConfigurationParam, + AccessRuleCIDRConfigurationParam, ASNConfigurationParam, CountryConfigurationParam, ] diff --git a/src/cloudflare/types/firewall/access_rule_ip_configuration.py b/src/cloudflare/types/firewall/access_rule_ip_configuration.py new file mode 100644 index 000000000000..bb5ced460e56 --- /dev/null +++ b/src/cloudflare/types/firewall/access_rule_ip_configuration.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["AccessRuleIPConfiguration"] + + +class AccessRuleIPConfiguration(BaseModel): + target: Optional[Literal["ip"]] = None + """The configuration target. + + You must set the target to `ip` when specifying an IP address in the rule. + """ + + value: Optional[str] = None + """The IP address to match. + + This address will be compared to the IP address of incoming requests. + """ diff --git a/src/cloudflare/types/firewall/ip_configuration_param.py b/src/cloudflare/types/firewall/access_rule_ip_configuration_param.py similarity index 78% rename from src/cloudflare/types/firewall/ip_configuration_param.py rename to src/cloudflare/types/firewall/access_rule_ip_configuration_param.py index 4e0e6cc2ea5a..fecf55cc1a15 100644 --- a/src/cloudflare/types/firewall/ip_configuration_param.py +++ b/src/cloudflare/types/firewall/access_rule_ip_configuration_param.py @@ -4,15 +4,14 @@ from typing_extensions import Literal, TypedDict -__all__ = ["IPConfigurationParam"] +__all__ = ["AccessRuleIPConfigurationParam"] -class IPConfigurationParam(TypedDict, total=False): +class AccessRuleIPConfigurationParam(TypedDict, total=False): target: Literal["ip"] """The configuration target. - You must set the target to `ip` when specifying an IP address in the Zone - Lockdown rule. + You must set the target to `ip` when specifying an IP address in the rule. """ value: str diff --git a/src/cloudflare/types/firewall/configuration.py b/src/cloudflare/types/firewall/configuration.py index edf0ec8773df..c795db49b4f7 100644 --- a/src/cloudflare/types/firewall/configuration.py +++ b/src/cloudflare/types/firewall/configuration.py @@ -2,9 +2,9 @@ from typing import Union -from .ip_configuration import IPConfiguration -from .cidr_configuration import CIDRConfiguration +from .lockdown_ip_configuration import LockdownIPConfiguration +from .lockdown_cidr_configuration import LockdownCIDRConfiguration __all__ = ["Configuration"] -Configuration = Union[IPConfiguration, CIDRConfiguration] +Configuration = Union[LockdownIPConfiguration, LockdownCIDRConfiguration] diff --git a/src/cloudflare/types/firewall/configuration_param.py b/src/cloudflare/types/firewall/configuration_param.py index e1b0abe9f468..ffedb3978c2f 100644 --- a/src/cloudflare/types/firewall/configuration_param.py +++ b/src/cloudflare/types/firewall/configuration_param.py @@ -4,9 +4,9 @@ from typing import Union -from .ip_configuration_param import IPConfigurationParam -from .cidr_configuration_param import CIDRConfigurationParam +from .lockdown_ip_configuration import LockdownIPConfiguration +from .lockdown_cidr_configuration import LockdownCIDRConfiguration __all__ = ["ConfigurationParam"] -ConfigurationParam = Union[IPConfigurationParam, CIDRConfigurationParam] +ConfigurationParam = Union[LockdownIPConfiguration, LockdownCIDRConfiguration] diff --git a/src/cloudflare/types/firewall/cidr_configuration.py b/src/cloudflare/types/firewall/lockdown_cidr_configuration.py similarity index 85% rename from src/cloudflare/types/firewall/cidr_configuration.py rename to src/cloudflare/types/firewall/lockdown_cidr_configuration.py index 928eeb86bbee..0380319616c2 100644 --- a/src/cloudflare/types/firewall/cidr_configuration.py +++ b/src/cloudflare/types/firewall/lockdown_cidr_configuration.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["CIDRConfiguration"] +__all__ = ["LockdownCIDRConfiguration"] -class CIDRConfiguration(BaseModel): +class LockdownCIDRConfiguration(BaseModel): target: Optional[Literal["ip_range"]] = None """The configuration target. diff --git a/src/cloudflare/types/firewall/ip_configuration.py b/src/cloudflare/types/firewall/lockdown_ip_configuration.py similarity index 86% rename from src/cloudflare/types/firewall/ip_configuration.py rename to src/cloudflare/types/firewall/lockdown_ip_configuration.py index a6ab1f0305c9..5961692c88ff 100644 --- a/src/cloudflare/types/firewall/ip_configuration.py +++ b/src/cloudflare/types/firewall/lockdown_ip_configuration.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["IPConfiguration"] +__all__ = ["LockdownIPConfiguration"] -class IPConfiguration(BaseModel): +class LockdownIPConfiguration(BaseModel): target: Optional[Literal["ip"]] = None """The configuration target. diff --git a/src/cloudflare/types/membership.py b/src/cloudflare/types/membership.py index bc953b671741..3c8187de1201 100644 --- a/src/cloudflare/types/membership.py +++ b/src/cloudflare/types/membership.py @@ -5,7 +5,7 @@ from .account import Account from .._models import BaseModel -from .accounts import Roles +from .accounts import MemberRoles from .user.tokens import Permission __all__ = ["Membership"] @@ -30,7 +30,7 @@ class Membership(BaseModel): permissions: Optional[Permission] = None """All access permissions for the user at the account.""" - roles: Optional[Roles] = None + roles: Optional[MemberRoles] = None """List of role names for the user at the account.""" status: Optional[Literal["accepted", "pending", "rejected"]] = None diff --git a/src/cloudflare/types/user/firewall/access_rule_create_params.py b/src/cloudflare/types/user/firewall/access_rule_create_params.py index 7f5c81af6110..b78d6dab8a06 100644 --- a/src/cloudflare/types/user/firewall/access_rule_create_params.py +++ b/src/cloudflare/types/user/firewall/access_rule_create_params.py @@ -6,11 +6,11 @@ from typing_extensions import Literal, Required, TypedDict from ...firewall import ( - IPConfigurationParam, ASNConfigurationParam, - CIDRConfigurationParam, IPV6ConfigurationParam, CountryConfigurationParam, + AccessRuleIPConfigurationParam, + AccessRuleCIDRConfigurationParam, ) __all__ = ["AccessRuleCreateParams", "Configuration"] @@ -30,9 +30,9 @@ class AccessRuleCreateParams(TypedDict, total=False): Configuration = Union[ - IPConfigurationParam, + AccessRuleIPConfigurationParam, IPV6ConfigurationParam, - CIDRConfigurationParam, + AccessRuleCIDRConfigurationParam, ASNConfigurationParam, CountryConfigurationParam, ] diff --git a/src/cloudflare/types/user/firewall/firewall_rule.py b/src/cloudflare/types/user/firewall/firewall_rule.py index e1ff81ac1f6a..855e80ca74cb 100644 --- a/src/cloudflare/types/user/firewall/firewall_rule.py +++ b/src/cloudflare/types/user/firewall/firewall_rule.py @@ -5,11 +5,19 @@ from typing_extensions import Literal from ...._models import BaseModel -from ...firewall import IPConfiguration, ASNConfiguration, CIDRConfiguration, IPV6Configuration, CountryConfiguration +from ...firewall import ( + ASNConfiguration, + IPV6Configuration, + CountryConfiguration, + AccessRuleIPConfiguration, + AccessRuleCIDRConfiguration, +) __all__ = ["FirewallRule", "Configuration"] -Configuration = Union[IPConfiguration, IPV6Configuration, CIDRConfiguration, ASNConfiguration, CountryConfiguration] +Configuration = Union[ + AccessRuleIPConfiguration, IPV6Configuration, AccessRuleCIDRConfiguration, ASNConfiguration, CountryConfiguration +] class FirewallRule(BaseModel): diff --git a/src/cloudflare/types/user/load_balancers/__init__.py b/src/cloudflare/types/user/load_balancers/__init__.py index 99f7696aa51f..48873b0a4e73 100644 --- a/src/cloudflare/types/user/load_balancers/__init__.py +++ b/src/cloudflare/types/user/load_balancers/__init__.py @@ -2,7 +2,6 @@ from __future__ import annotations -from .pool import Pool as Pool from .preview import Preview as Preview from .analytics import Analytics as Analytics from .pool_edit_params import PoolEditParams as PoolEditParams diff --git a/src/cloudflare/types/user/load_balancers/pool.py b/src/cloudflare/types/user/load_balancers/pool.py deleted file mode 100644 index 4083c2a11578..000000000000 --- a/src/cloudflare/types/user/load_balancers/pool.py +++ /dev/null @@ -1,107 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from ...origin import Origin -from ...._models import BaseModel -from ...check_region import CheckRegion -from ...load_shedding import LoadShedding -from ...origin_steering import OriginSteering -from ...notification_filter import NotificationFilter - -__all__ = ["Pool"] - - -class Pool(BaseModel): - id: Optional[str] = None - - check_regions: Optional[List[CheckRegion]] = None - """A list of regions from which to run health checks. - - Null means every Cloudflare data center. - """ - - created_on: Optional[datetime] = None - - description: Optional[str] = None - """A human-readable description of the pool.""" - - disabled_at: Optional[datetime] = None - """This field shows up only if the pool is disabled. - - This field is set with the time the pool was disabled at. - """ - - enabled: Optional[bool] = None - """Whether to enable (the default) or disable this pool. - - Disabled pools will not receive traffic and are excluded from health checks. - Disabling a pool will cause any load balancers using it to failover to the next - pool (if any). - """ - - latitude: Optional[float] = None - """ - The latitude of the data center containing the origins used in this pool in - decimal degrees. If this is set, longitude must also be set. - """ - - load_shedding: Optional[LoadShedding] = None - """Configures load shedding policies and percentages for the pool.""" - - longitude: Optional[float] = None - """ - The longitude of the data center containing the origins used in this pool in - decimal degrees. If this is set, latitude must also be set. - """ - - minimum_origins: Optional[int] = None - """ - The minimum number of origins that must be healthy for this pool to serve - traffic. If the number of healthy origins falls below this number, the pool will - be marked unhealthy and will failover to the next available pool. - """ - - modified_on: Optional[datetime] = None - - monitor: Optional[object] = None - """ - The ID of the Monitor to use for checking the health of origins within this - pool. - """ - - name: Optional[str] = None - """A short name (tag) for the pool. - - Only alphanumeric characters, hyphens, and underscores are allowed. - """ - - notification_email: Optional[str] = None - """This field is now deprecated. - - It has been moved to Cloudflare's Centralized Notification service - https://developers.cloudflare.com/fundamentals/notifications/. The email address - to send health status notifications to. This can be an individual mailbox or a - mailing list. Multiple emails can be supplied as a comma delimited list. - """ - - notification_filter: Optional[NotificationFilter] = None - """Filter pool and origin health notifications by resource type or health status. - - Use null to reset. - """ - - origin_steering: Optional[OriginSteering] = None - """Configures origin steering for the pool. - - Controls how origins are selected for new sessions and traffic without session - affinity. - """ - - origins: Optional[List[Origin]] = None - """The list of origins within this pool. - - Traffic directed at this pool is balanced across all currently healthy origins, - provided the pool itself is healthy. - """ diff --git a/src/cloudflare/types/zero_trust/dlp/__init__.py b/src/cloudflare/types/zero_trust/dlp/__init__.py index 382dcc7a2d04..15ad89dc6398 100644 --- a/src/cloudflare/types/zero_trust/dlp/__init__.py +++ b/src/cloudflare/types/zero_trust/dlp/__init__.py @@ -5,10 +5,8 @@ from .dataset import Dataset as Dataset from .profile import Profile as Profile from .dataset_array import DatasetArray as DatasetArray -from .custom_profile import CustomProfile as CustomProfile from .dataset_creation import DatasetCreation as DatasetCreation from .context_awareness import ContextAwareness as ContextAwareness -from .predefined_profile import PredefinedProfile as PredefinedProfile from .skip_configuration import SkipConfiguration as SkipConfiguration from .profile_get_response import ProfileGetResponse as ProfileGetResponse from .dataset_create_params import DatasetCreateParams as DatasetCreateParams diff --git a/src/cloudflare/types/zero_trust/dlp/custom_profile.py b/src/cloudflare/types/zero_trust/dlp/custom_profile.py deleted file mode 100644 index 42724f2fcc60..000000000000 --- a/src/cloudflare/types/zero_trust/dlp/custom_profile.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -__all__ = ["CustomProfile"] - -CustomProfile = Literal["custom"] diff --git a/src/cloudflare/types/zero_trust/dlp/predefined_profile.py b/src/cloudflare/types/zero_trust/dlp/predefined_profile.py deleted file mode 100644 index 91019533571d..000000000000 --- a/src/cloudflare/types/zero_trust/dlp/predefined_profile.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -__all__ = ["PredefinedProfile"] - -PredefinedProfile = Literal["predefined"] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_profile.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_profile.py index 5ac9be1eec04..b098fae97664 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_profile.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_profile.py @@ -2,8 +2,8 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal -from . import custom_profile from .pattern import Pattern from ....._models import BaseModel from ..context_awareness import ContextAwareness @@ -59,7 +59,7 @@ class CustomProfile(BaseModel): ocr_enabled: Optional[bool] = None """If true, scan images via OCR to determine if any text present matches filters.""" - type: Optional[custom_profile.CustomProfile] = None + type: Optional[Literal["custom"]] = None """The type of the profile.""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py index 284922e764a9..6796888383a1 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal -from . import predefined_profile from ....._models import BaseModel from ..context_awareness import ContextAwareness @@ -45,5 +45,5 @@ class PredefinedProfile(BaseModel): ocr_enabled: Optional[bool] = None """If true, scan images via OCR to determine if any text present matches filters.""" - type: Optional[predefined_profile.PredefinedProfile] = None + type: Optional[Literal["predefined"]] = None """The type of the profile.""" diff --git a/tests/api_resources/load_balancers/test_pools.py b/tests/api_resources/load_balancers/test_pools.py index 75d188bc9436..da5c771f17bd 100644 --- a/tests/api_resources/load_balancers/test_pools.py +++ b/tests/api_resources/load_balancers/test_pools.py @@ -11,9 +11,9 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.load_balancers import ( + Pool, PoolDeleteResponse, ) -from cloudflare.types.user.load_balancers import Pool base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/user/load_balancers/test_pools.py b/tests/api_resources/user/load_balancers/test_pools.py index 32c46bceded2..4875ba28f5e7 100644 --- a/tests/api_resources/user/load_balancers/test_pools.py +++ b/tests/api_resources/user/load_balancers/test_pools.py @@ -10,8 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.load_balancers import Pool from cloudflare.types.user.load_balancers import ( - Pool, PoolDeleteResponse, PoolHealthResponse, PoolPreviewResponse,