diff --git a/.stats.yml b/.stats.yml index 96071d514cc..374bd14fc90 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1408 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9482a52799bf82c48325ec6462f86b2c70ade8214816411c9b104620ac94f73e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e1b0a84e75d7d2eb973ab4f14ecab9f77bd39c49ebc14fdd54066e72aa43a5be.yml diff --git a/src/cloudflare/types/pagerules/page_rule.py b/src/cloudflare/types/pagerules/page_rule.py index 198378298e6..a8d30133f49 100644 --- a/src/cloudflare/types/pagerules/page_rule.py +++ b/src/cloudflare/types/pagerules/page_rule.py @@ -1,16 +1,261 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, Annotated, TypeAlias from .target import Target +from ..._utils import PropertyInfo from ..._models import BaseModel +from ..zones.ssl import SSL +from ..zones.waf import WAF +from ..zones.mirage import Mirage +from ..zones.polish import Polish +from ..zones.cache_level import CacheLevel +from ..zones.browser_check import BrowserCheck +from ..zones.rocket_loader import RocketLoader +from ..zones.ip_geolocation import IPGeolocation +from ..zones.security_level import SecurityLevel +from ..zones.always_use_https import AlwaysUseHTTPS +from ..zones.development_mode import DevelopmentMode +from ..zones.browser_cache_ttl import BrowserCacheTTL +from ..zones.email_obfuscation import EmailObfuscation +from ..zones.hotlink_protection import HotlinkProtection +from ..zones.response_buffering import ResponseBuffering +from ..zones.server_side_excludes import ServerSideExcludes +from ..zones.true_client_ip_header import TrueClientIPHeader +from ..zones.automatic_https_rewrites import AutomaticHTTPSRewrites +from ..zones.opportunistic_encryption import OpportunisticEncryption +from ..zones.origin_error_page_pass_thru import OriginErrorPagePassThru +from ..zones.sort_query_string_for_cache import SortQueryStringForCache -__all__ = ["PageRule", "Action", "ActionValue"] +__all__ = [ + "PageRule", + "Action", + "ActionBypassCacheOnCookie", + "ActionCacheByDeviceType", + "ActionCacheDeceptionArmor", + "ActionCacheKey", + "ActionCacheKeyValue", + "ActionCacheKeyValueCookie", + "ActionCacheKeyValueHeader", + "ActionCacheKeyValueHost", + "ActionCacheKeyValueQueryString", + "ActionCacheKeyValueUser", + "ActionCacheKeyFields", + "ActionCacheOnCookie", + "ActionCacheTTLByStatus", + "ActionDDoSProtection", + "ActionDisableApps", + "ActionDisablePerformance", + "ActionDisableSecurity", + "ActionDisableZaraz", + "ActionEdgeCacheTTL", + "ActionExplicitCacheControl", + "ActionForwardingURL", + "ActionForwardingURLValue", + "ActionHostHeaderOverride", + "ActionMinify", + "ActionPurgeByPageRule", + "ActionResolveOverride", + "ActionResolveOverrideValue", + "ActionRespectStrongEtag", +] -class ActionValue(BaseModel): +class ActionBypassCacheOnCookie(BaseModel): + id: Optional[Literal["bypass_cache_on_cookie"]] = None + """ + Bypass cache and fetch resources from the origin server if a regular expression + matches against a cookie name present in the request. + """ + + value: Optional[str] = None + """The regular expression to use for matching cookie names in the request. + + Refer to + [Bypass Cache on Cookie setting](https://developers.cloudflare.com/rules/page-rules/reference/additional-reference/#bypass-cache-on-cookie-setting) + to learn about limited regular expression support. + """ + + +class ActionCacheByDeviceType(BaseModel): + id: Optional[Literal["cache_by_device_type"]] = None + """Separate cached content based on the visitor's device type.""" + + value: Optional[Literal["on", "off"]] = None + """The status of Cache By Device Type.""" + + +class ActionCacheDeceptionArmor(BaseModel): + id: Optional[Literal["cache_deception_armor"]] = None + """ + Protect from web cache deception attacks while still allowing static assets to + be cached. This setting verifies that the URL's extension matches the returned + `Content-Type`. + """ + + value: Optional[Literal["on", "off"]] = None + """The status of Cache Deception Armor.""" + + +class ActionCacheKeyValueCookie(BaseModel): + check_presence: Optional[List[str]] = None + """ + A list of cookies to check for the presence of, without including their actual + values. + """ + + include: Optional[List[str]] = None + """A list of cookies to include.""" + + +class ActionCacheKeyValueHeader(BaseModel): + check_presence: Optional[List[str]] = None + """ + A list of headers to check for the presence of, without including their actual + values. + """ + + exclude: Optional[List[str]] = None + """A list of headers to ignore.""" + + include: Optional[List[str]] = None + """A list of headers to include.""" + + +class ActionCacheKeyValueHost(BaseModel): + resolved: Optional[bool] = None + """Whether to include the Host header in the HTTP request sent to the origin.""" + + +class ActionCacheKeyValueQueryString(BaseModel): + exclude: Union[Literal["*"], List[str], None] = None + """Ignore all query string parameters.""" + + include: Union[Literal["*"], List[str], None] = None + """Include all query string parameters.""" + + +class ActionCacheKeyValueUser(BaseModel): + device_type: Optional[bool] = None + """ + Classifies a request as `mobile`, `desktop`, or `tablet` based on the User + Agent. + """ + + geo: Optional[bool] = None + """Includes the client's country, derived from the IP address.""" + + lang: Optional[bool] = None + """ + Includes the first language code contained in the `Accept-Language` header sent + by the client. + """ + + +class ActionCacheKeyValue(BaseModel): + cookie: Optional[ActionCacheKeyValueCookie] = None + """Controls which cookies appear in the Cache Key.""" + + header: Optional[ActionCacheKeyValueHeader] = None + """Controls which headers go into the Cache Key. + + Exactly one of `include` or `exclude` is expected. + """ + + host: Optional[ActionCacheKeyValueHost] = None + """Determines which host header to include in the Cache Key.""" + + query_string: Optional[ActionCacheKeyValueQueryString] = None + """Controls which URL query string parameters go into the Cache Key. + + Exactly one of `include` or `exclude` is expected. + """ + + user: Optional[ActionCacheKeyValueUser] = None + """Feature fields to add features about the end-user (client) into the Cache Key.""" + + +class ActionCacheKey(BaseModel): + id: Optional[Literal["cache_key"]] = None + """ + Control specifically what variables to include when deciding which resources to + cache. This allows customers to determine what to cache based on something other + than just the URL. + """ + + value: Optional[ActionCacheKeyValue] = None + + +class ActionCacheKeyFields(BaseModel): + id: Optional[Literal["cache_key_fields"]] = None + + +class ActionCacheOnCookie(BaseModel): + id: Optional[Literal["cache_on_cookie"]] = None + + +class ActionCacheTTLByStatus(BaseModel): + id: Optional[Literal["cache_ttl_by_status"]] = None + + +class ActionDDoSProtection(BaseModel): + id: Optional[Literal["ddos_protection"]] = None + + +class ActionDisableApps(BaseModel): + id: Optional[Literal["disable_apps"]] = None + """ + Turn off all active + [Cloudflare Apps](https://developers.cloudflare.com/support/more-dashboard-apps/cloudflare-apps/) + (deprecated). + """ + + +class ActionDisablePerformance(BaseModel): + id: Optional[Literal["disable_performance"]] = None + """ + Turn off + [Rocket Loader](https://developers.cloudflare.com/speed/optimization/content/rocket-loader/), + [Mirage](https://developers.cloudflare.com/speed/optimization/images/mirage/), + and [Polish](https://developers.cloudflare.com/images/polish/). + """ + + +class ActionDisableSecurity(BaseModel): + id: Optional[Literal["disable_security"]] = None + """ + Turn off + [Email Obfuscation](https://developers.cloudflare.com/waf/tools/scrape-shield/email-address-obfuscation/), + [Rate Limiting (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-rate-limiting/), + [Scrape Shield](https://developers.cloudflare.com/waf/tools/scrape-shield/), + [URL (Zone) Lockdown](https://developers.cloudflare.com/waf/tools/zone-lockdown/), + and + [WAF managed rules (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-waf-managed-rules/). + """ + + +class ActionDisableZaraz(BaseModel): + id: Optional[Literal["disable_zaraz"]] = None + """Turn off [Zaraz](https://developers.cloudflare.com/zaraz/).""" + + +class ActionEdgeCacheTTL(BaseModel): + id: Optional[Literal["edge_cache_ttl"]] = None + """Specify how long to cache a resource in the Cloudflare global network. + + _Edge Cache TTL_ is not visible in response headers. + """ + + value: Optional[int] = None + + +class ActionExplicitCacheControl(BaseModel): + id: Optional[Literal["explicit_cache_control"]] = None + + +class ActionForwardingURLValue(BaseModel): status_code: Optional[Literal[301, 302]] = None """The status code to use for the URL redirect. @@ -24,7 +269,7 @@ class ActionValue(BaseModel): """ -class Action(BaseModel): +class ActionForwardingURL(BaseModel): id: Optional[Literal["forwarding_url"]] = None """Redirects one URL to another using an `HTTP 301/302` redirect. @@ -32,7 +277,94 @@ class Action(BaseModel): [Wildcard matching and referencing](https://developers.cloudflare.com/rules/page-rules/reference/wildcard-matching/). """ - value: Optional[ActionValue] = None + value: Optional[ActionForwardingURLValue] = None + + +class ActionHostHeaderOverride(BaseModel): + id: Optional[Literal["host_header_override"]] = None + """Apply a specific host header.""" + + value: Optional[str] = None + """The hostname to use in the `Host` header""" + + +class ActionMinify(BaseModel): + id: Optional[Literal["minify"]] = None + + +class ActionPurgeByPageRule(BaseModel): + id: Optional[Literal["purge_by_page_rule"]] = None + + +class ActionResolveOverrideValue(BaseModel): + value: Optional[str] = None + """The origin address you want to override with.""" + + +class ActionResolveOverride(BaseModel): + id: Optional[Literal["resolve_override"]] = None + """Change the origin address to the value specified in this setting.""" + + value: Optional[ActionResolveOverrideValue] = None + + +class ActionRespectStrongEtag(BaseModel): + id: Optional[Literal["respect_strong_etag"]] = None + """ + Turn on or off byte-for-byte equivalency checks between the Cloudflare cache and + the origin server. + """ + + value: Optional[Literal["on", "off"]] = None + """The status of Respect Strong ETags""" + + +Action: TypeAlias = Annotated[ + Union[ + AlwaysUseHTTPS, + AutomaticHTTPSRewrites, + BrowserCacheTTL, + BrowserCheck, + ActionBypassCacheOnCookie, + ActionCacheByDeviceType, + ActionCacheDeceptionArmor, + ActionCacheKey, + ActionCacheKeyFields, + CacheLevel, + ActionCacheOnCookie, + ActionCacheTTLByStatus, + ActionDDoSProtection, + DevelopmentMode, + ActionDisableApps, + ActionDisablePerformance, + ActionDisableSecurity, + ActionDisableZaraz, + ActionEdgeCacheTTL, + EmailObfuscation, + ActionExplicitCacheControl, + ActionForwardingURL, + ActionHostHeaderOverride, + HotlinkProtection, + IPGeolocation, + ActionMinify, + Mirage, + OpportunisticEncryption, + OriginErrorPagePassThru, + Polish, + ActionPurgeByPageRule, + ActionResolveOverride, + ActionRespectStrongEtag, + ResponseBuffering, + RocketLoader, + SecurityLevel, + ServerSideExcludes, + SortQueryStringForCache, + SSL, + TrueClientIPHeader, + WAF, + ], + PropertyInfo(discriminator="id"), +] class PageRule(BaseModel): diff --git a/src/cloudflare/types/pagerules/pagerule_create_params.py b/src/cloudflare/types/pagerules/pagerule_create_params.py index 1a554231d3a..805b38d7e00 100644 --- a/src/cloudflare/types/pagerules/pagerule_create_params.py +++ b/src/cloudflare/types/pagerules/pagerule_create_params.py @@ -2,12 +2,64 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Literal, Required, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .target_param import TargetParam +from ..zones.ssl_param import SSLParam +from ..zones.waf_param import WAFParam +from ..zones.mirage_param import MirageParam +from ..zones.polish_param import PolishParam +from ..zones.cache_level_param import CacheLevelParam +from ..zones.browser_check_param import BrowserCheckParam +from ..zones.rocket_loader_param import RocketLoaderParam +from ..zones.ip_geolocation_param import IPGeolocationParam +from ..zones.security_level_param import SecurityLevelParam +from ..zones.always_use_https_param import AlwaysUseHTTPSParam +from ..zones.development_mode_param import DevelopmentModeParam +from ..zones.browser_cache_ttl_param import BrowserCacheTTLParam +from ..zones.email_obfuscation_param import EmailObfuscationParam +from ..zones.hotlink_protection_param import HotlinkProtectionParam +from ..zones.response_buffering_param import ResponseBufferingParam +from ..zones.server_side_excludes_param import ServerSideExcludesParam +from ..zones.true_client_ip_header_param import TrueClientIPHeaderParam +from ..zones.automatic_https_rewrites_param import AutomaticHTTPSRewritesParam +from ..zones.opportunistic_encryption_param import OpportunisticEncryptionParam +from ..zones.origin_error_page_pass_thru_param import OriginErrorPagePassThruParam +from ..zones.sort_query_string_for_cache_param import SortQueryStringForCacheParam -__all__ = ["PageruleCreateParams", "Action", "ActionValue"] +__all__ = [ + "PageruleCreateParams", + "Action", + "ActionBypassCacheOnCookie", + "ActionCacheByDeviceType", + "ActionCacheDeceptionArmor", + "ActionCacheKey", + "ActionCacheKeyValue", + "ActionCacheKeyValueCookie", + "ActionCacheKeyValueHeader", + "ActionCacheKeyValueHost", + "ActionCacheKeyValueQueryString", + "ActionCacheKeyValueUser", + "ActionCacheKeyFields", + "ActionCacheOnCookie", + "ActionCacheTTLByStatus", + "ActionDDoSProtection", + "ActionDisableApps", + "ActionDisablePerformance", + "ActionDisableSecurity", + "ActionDisableZaraz", + "ActionEdgeCacheTTL", + "ActionExplicitCacheControl", + "ActionForwardingURL", + "ActionForwardingURLValue", + "ActionHostHeaderOverride", + "ActionMinify", + "ActionPurgeByPageRule", + "ActionResolveOverride", + "ActionResolveOverrideValue", + "ActionRespectStrongEtag", +] class PageruleCreateParams(TypedDict, total=False): @@ -36,7 +88,199 @@ class PageruleCreateParams(TypedDict, total=False): """The status of the Page Rule.""" -class ActionValue(TypedDict, total=False): +class ActionBypassCacheOnCookie(TypedDict, total=False): + id: Literal["bypass_cache_on_cookie"] + """ + Bypass cache and fetch resources from the origin server if a regular expression + matches against a cookie name present in the request. + """ + + value: str + """The regular expression to use for matching cookie names in the request. + + Refer to + [Bypass Cache on Cookie setting](https://developers.cloudflare.com/rules/page-rules/reference/additional-reference/#bypass-cache-on-cookie-setting) + to learn about limited regular expression support. + """ + + +class ActionCacheByDeviceType(TypedDict, total=False): + id: Literal["cache_by_device_type"] + """Separate cached content based on the visitor's device type.""" + + value: Literal["on", "off"] + """The status of Cache By Device Type.""" + + +class ActionCacheDeceptionArmor(TypedDict, total=False): + id: Literal["cache_deception_armor"] + """ + Protect from web cache deception attacks while still allowing static assets to + be cached. This setting verifies that the URL's extension matches the returned + `Content-Type`. + """ + + value: Literal["on", "off"] + """The status of Cache Deception Armor.""" + + +class ActionCacheKeyValueCookie(TypedDict, total=False): + check_presence: List[str] + """ + A list of cookies to check for the presence of, without including their actual + values. + """ + + include: List[str] + """A list of cookies to include.""" + + +class ActionCacheKeyValueHeader(TypedDict, total=False): + check_presence: List[str] + """ + A list of headers to check for the presence of, without including their actual + values. + """ + + exclude: List[str] + """A list of headers to ignore.""" + + include: List[str] + """A list of headers to include.""" + + +class ActionCacheKeyValueHost(TypedDict, total=False): + resolved: bool + """Whether to include the Host header in the HTTP request sent to the origin.""" + + +class ActionCacheKeyValueQueryString(TypedDict, total=False): + exclude: Union[Literal["*"], List[str]] + """Ignore all query string parameters.""" + + include: Union[Literal["*"], List[str]] + """Include all query string parameters.""" + + +class ActionCacheKeyValueUser(TypedDict, total=False): + device_type: bool + """ + Classifies a request as `mobile`, `desktop`, or `tablet` based on the User + Agent. + """ + + geo: bool + """Includes the client's country, derived from the IP address.""" + + lang: bool + """ + Includes the first language code contained in the `Accept-Language` header sent + by the client. + """ + + +class ActionCacheKeyValue(TypedDict, total=False): + cookie: ActionCacheKeyValueCookie + """Controls which cookies appear in the Cache Key.""" + + header: ActionCacheKeyValueHeader + """Controls which headers go into the Cache Key. + + Exactly one of `include` or `exclude` is expected. + """ + + host: ActionCacheKeyValueHost + """Determines which host header to include in the Cache Key.""" + + query_string: ActionCacheKeyValueQueryString + """Controls which URL query string parameters go into the Cache Key. + + Exactly one of `include` or `exclude` is expected. + """ + + user: ActionCacheKeyValueUser + """Feature fields to add features about the end-user (client) into the Cache Key.""" + + +class ActionCacheKey(TypedDict, total=False): + id: Literal["cache_key"] + """ + Control specifically what variables to include when deciding which resources to + cache. This allows customers to determine what to cache based on something other + than just the URL. + """ + + value: ActionCacheKeyValue + + +class ActionCacheKeyFields(TypedDict, total=False): + id: Literal["cache_key_fields"] + + +class ActionCacheOnCookie(TypedDict, total=False): + id: Literal["cache_on_cookie"] + + +class ActionCacheTTLByStatus(TypedDict, total=False): + id: Literal["cache_ttl_by_status"] + + +class ActionDDoSProtection(TypedDict, total=False): + id: Literal["ddos_protection"] + + +class ActionDisableApps(TypedDict, total=False): + id: Literal["disable_apps"] + """ + Turn off all active + [Cloudflare Apps](https://developers.cloudflare.com/support/more-dashboard-apps/cloudflare-apps/) + (deprecated). + """ + + +class ActionDisablePerformance(TypedDict, total=False): + id: Literal["disable_performance"] + """ + Turn off + [Rocket Loader](https://developers.cloudflare.com/speed/optimization/content/rocket-loader/), + [Mirage](https://developers.cloudflare.com/speed/optimization/images/mirage/), + and [Polish](https://developers.cloudflare.com/images/polish/). + """ + + +class ActionDisableSecurity(TypedDict, total=False): + id: Literal["disable_security"] + """ + Turn off + [Email Obfuscation](https://developers.cloudflare.com/waf/tools/scrape-shield/email-address-obfuscation/), + [Rate Limiting (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-rate-limiting/), + [Scrape Shield](https://developers.cloudflare.com/waf/tools/scrape-shield/), + [URL (Zone) Lockdown](https://developers.cloudflare.com/waf/tools/zone-lockdown/), + and + [WAF managed rules (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-waf-managed-rules/). + """ + + +class ActionDisableZaraz(TypedDict, total=False): + id: Literal["disable_zaraz"] + """Turn off [Zaraz](https://developers.cloudflare.com/zaraz/).""" + + +class ActionEdgeCacheTTL(TypedDict, total=False): + id: Literal["edge_cache_ttl"] + """Specify how long to cache a resource in the Cloudflare global network. + + _Edge Cache TTL_ is not visible in response headers. + """ + + value: int + + +class ActionExplicitCacheControl(TypedDict, total=False): + id: Literal["explicit_cache_control"] + + +class ActionForwardingURLValue(TypedDict, total=False): status_code: Literal[301, 302] """The status code to use for the URL redirect. @@ -50,7 +294,7 @@ class ActionValue(TypedDict, total=False): """ -class Action(TypedDict, total=False): +class ActionForwardingURL(TypedDict, total=False): id: Literal["forwarding_url"] """Redirects one URL to another using an `HTTP 301/302` redirect. @@ -58,4 +302,88 @@ class Action(TypedDict, total=False): [Wildcard matching and referencing](https://developers.cloudflare.com/rules/page-rules/reference/wildcard-matching/). """ - value: ActionValue + value: ActionForwardingURLValue + + +class ActionHostHeaderOverride(TypedDict, total=False): + id: Literal["host_header_override"] + """Apply a specific host header.""" + + value: str + """The hostname to use in the `Host` header""" + + +class ActionMinify(TypedDict, total=False): + id: Literal["minify"] + + +class ActionPurgeByPageRule(TypedDict, total=False): + id: Literal["purge_by_page_rule"] + + +class ActionResolveOverrideValue(TypedDict, total=False): + value: str + """The origin address you want to override with.""" + + +class ActionResolveOverride(TypedDict, total=False): + id: Literal["resolve_override"] + """Change the origin address to the value specified in this setting.""" + + value: ActionResolveOverrideValue + + +class ActionRespectStrongEtag(TypedDict, total=False): + id: Literal["respect_strong_etag"] + """ + Turn on or off byte-for-byte equivalency checks between the Cloudflare cache and + the origin server. + """ + + value: Literal["on", "off"] + """The status of Respect Strong ETags""" + + +Action: TypeAlias = Union[ + AlwaysUseHTTPSParam, + AutomaticHTTPSRewritesParam, + BrowserCacheTTLParam, + BrowserCheckParam, + ActionBypassCacheOnCookie, + ActionCacheByDeviceType, + ActionCacheDeceptionArmor, + ActionCacheKey, + ActionCacheKeyFields, + CacheLevelParam, + ActionCacheOnCookie, + ActionCacheTTLByStatus, + ActionDDoSProtection, + DevelopmentModeParam, + ActionDisableApps, + ActionDisablePerformance, + ActionDisableSecurity, + ActionDisableZaraz, + ActionEdgeCacheTTL, + EmailObfuscationParam, + ActionExplicitCacheControl, + ActionForwardingURL, + ActionHostHeaderOverride, + HotlinkProtectionParam, + IPGeolocationParam, + ActionMinify, + MirageParam, + OpportunisticEncryptionParam, + OriginErrorPagePassThruParam, + PolishParam, + ActionPurgeByPageRule, + ActionResolveOverride, + ActionRespectStrongEtag, + ResponseBufferingParam, + RocketLoaderParam, + SecurityLevelParam, + ServerSideExcludesParam, + SortQueryStringForCacheParam, + SSLParam, + TrueClientIPHeaderParam, + WAFParam, +] diff --git a/src/cloudflare/types/pagerules/pagerule_edit_params.py b/src/cloudflare/types/pagerules/pagerule_edit_params.py index e785a2c36c0..e7efd955291 100644 --- a/src/cloudflare/types/pagerules/pagerule_edit_params.py +++ b/src/cloudflare/types/pagerules/pagerule_edit_params.py @@ -2,12 +2,64 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Literal, Required, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .target_param import TargetParam +from ..zones.ssl_param import SSLParam +from ..zones.waf_param import WAFParam +from ..zones.mirage_param import MirageParam +from ..zones.polish_param import PolishParam +from ..zones.cache_level_param import CacheLevelParam +from ..zones.browser_check_param import BrowserCheckParam +from ..zones.rocket_loader_param import RocketLoaderParam +from ..zones.ip_geolocation_param import IPGeolocationParam +from ..zones.security_level_param import SecurityLevelParam +from ..zones.always_use_https_param import AlwaysUseHTTPSParam +from ..zones.development_mode_param import DevelopmentModeParam +from ..zones.browser_cache_ttl_param import BrowserCacheTTLParam +from ..zones.email_obfuscation_param import EmailObfuscationParam +from ..zones.hotlink_protection_param import HotlinkProtectionParam +from ..zones.response_buffering_param import ResponseBufferingParam +from ..zones.server_side_excludes_param import ServerSideExcludesParam +from ..zones.true_client_ip_header_param import TrueClientIPHeaderParam +from ..zones.automatic_https_rewrites_param import AutomaticHTTPSRewritesParam +from ..zones.opportunistic_encryption_param import OpportunisticEncryptionParam +from ..zones.origin_error_page_pass_thru_param import OriginErrorPagePassThruParam +from ..zones.sort_query_string_for_cache_param import SortQueryStringForCacheParam -__all__ = ["PageruleEditParams", "Action", "ActionValue"] +__all__ = [ + "PageruleEditParams", + "Action", + "ActionBypassCacheOnCookie", + "ActionCacheByDeviceType", + "ActionCacheDeceptionArmor", + "ActionCacheKey", + "ActionCacheKeyValue", + "ActionCacheKeyValueCookie", + "ActionCacheKeyValueHeader", + "ActionCacheKeyValueHost", + "ActionCacheKeyValueQueryString", + "ActionCacheKeyValueUser", + "ActionCacheKeyFields", + "ActionCacheOnCookie", + "ActionCacheTTLByStatus", + "ActionDDoSProtection", + "ActionDisableApps", + "ActionDisablePerformance", + "ActionDisableSecurity", + "ActionDisableZaraz", + "ActionEdgeCacheTTL", + "ActionExplicitCacheControl", + "ActionForwardingURL", + "ActionForwardingURLValue", + "ActionHostHeaderOverride", + "ActionMinify", + "ActionPurgeByPageRule", + "ActionResolveOverride", + "ActionResolveOverrideValue", + "ActionRespectStrongEtag", +] class PageruleEditParams(TypedDict, total=False): @@ -36,7 +88,199 @@ class PageruleEditParams(TypedDict, total=False): """The rule targets to evaluate on each request.""" -class ActionValue(TypedDict, total=False): +class ActionBypassCacheOnCookie(TypedDict, total=False): + id: Literal["bypass_cache_on_cookie"] + """ + Bypass cache and fetch resources from the origin server if a regular expression + matches against a cookie name present in the request. + """ + + value: str + """The regular expression to use for matching cookie names in the request. + + Refer to + [Bypass Cache on Cookie setting](https://developers.cloudflare.com/rules/page-rules/reference/additional-reference/#bypass-cache-on-cookie-setting) + to learn about limited regular expression support. + """ + + +class ActionCacheByDeviceType(TypedDict, total=False): + id: Literal["cache_by_device_type"] + """Separate cached content based on the visitor's device type.""" + + value: Literal["on", "off"] + """The status of Cache By Device Type.""" + + +class ActionCacheDeceptionArmor(TypedDict, total=False): + id: Literal["cache_deception_armor"] + """ + Protect from web cache deception attacks while still allowing static assets to + be cached. This setting verifies that the URL's extension matches the returned + `Content-Type`. + """ + + value: Literal["on", "off"] + """The status of Cache Deception Armor.""" + + +class ActionCacheKeyValueCookie(TypedDict, total=False): + check_presence: List[str] + """ + A list of cookies to check for the presence of, without including their actual + values. + """ + + include: List[str] + """A list of cookies to include.""" + + +class ActionCacheKeyValueHeader(TypedDict, total=False): + check_presence: List[str] + """ + A list of headers to check for the presence of, without including their actual + values. + """ + + exclude: List[str] + """A list of headers to ignore.""" + + include: List[str] + """A list of headers to include.""" + + +class ActionCacheKeyValueHost(TypedDict, total=False): + resolved: bool + """Whether to include the Host header in the HTTP request sent to the origin.""" + + +class ActionCacheKeyValueQueryString(TypedDict, total=False): + exclude: Union[Literal["*"], List[str]] + """Ignore all query string parameters.""" + + include: Union[Literal["*"], List[str]] + """Include all query string parameters.""" + + +class ActionCacheKeyValueUser(TypedDict, total=False): + device_type: bool + """ + Classifies a request as `mobile`, `desktop`, or `tablet` based on the User + Agent. + """ + + geo: bool + """Includes the client's country, derived from the IP address.""" + + lang: bool + """ + Includes the first language code contained in the `Accept-Language` header sent + by the client. + """ + + +class ActionCacheKeyValue(TypedDict, total=False): + cookie: ActionCacheKeyValueCookie + """Controls which cookies appear in the Cache Key.""" + + header: ActionCacheKeyValueHeader + """Controls which headers go into the Cache Key. + + Exactly one of `include` or `exclude` is expected. + """ + + host: ActionCacheKeyValueHost + """Determines which host header to include in the Cache Key.""" + + query_string: ActionCacheKeyValueQueryString + """Controls which URL query string parameters go into the Cache Key. + + Exactly one of `include` or `exclude` is expected. + """ + + user: ActionCacheKeyValueUser + """Feature fields to add features about the end-user (client) into the Cache Key.""" + + +class ActionCacheKey(TypedDict, total=False): + id: Literal["cache_key"] + """ + Control specifically what variables to include when deciding which resources to + cache. This allows customers to determine what to cache based on something other + than just the URL. + """ + + value: ActionCacheKeyValue + + +class ActionCacheKeyFields(TypedDict, total=False): + id: Literal["cache_key_fields"] + + +class ActionCacheOnCookie(TypedDict, total=False): + id: Literal["cache_on_cookie"] + + +class ActionCacheTTLByStatus(TypedDict, total=False): + id: Literal["cache_ttl_by_status"] + + +class ActionDDoSProtection(TypedDict, total=False): + id: Literal["ddos_protection"] + + +class ActionDisableApps(TypedDict, total=False): + id: Literal["disable_apps"] + """ + Turn off all active + [Cloudflare Apps](https://developers.cloudflare.com/support/more-dashboard-apps/cloudflare-apps/) + (deprecated). + """ + + +class ActionDisablePerformance(TypedDict, total=False): + id: Literal["disable_performance"] + """ + Turn off + [Rocket Loader](https://developers.cloudflare.com/speed/optimization/content/rocket-loader/), + [Mirage](https://developers.cloudflare.com/speed/optimization/images/mirage/), + and [Polish](https://developers.cloudflare.com/images/polish/). + """ + + +class ActionDisableSecurity(TypedDict, total=False): + id: Literal["disable_security"] + """ + Turn off + [Email Obfuscation](https://developers.cloudflare.com/waf/tools/scrape-shield/email-address-obfuscation/), + [Rate Limiting (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-rate-limiting/), + [Scrape Shield](https://developers.cloudflare.com/waf/tools/scrape-shield/), + [URL (Zone) Lockdown](https://developers.cloudflare.com/waf/tools/zone-lockdown/), + and + [WAF managed rules (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-waf-managed-rules/). + """ + + +class ActionDisableZaraz(TypedDict, total=False): + id: Literal["disable_zaraz"] + """Turn off [Zaraz](https://developers.cloudflare.com/zaraz/).""" + + +class ActionEdgeCacheTTL(TypedDict, total=False): + id: Literal["edge_cache_ttl"] + """Specify how long to cache a resource in the Cloudflare global network. + + _Edge Cache TTL_ is not visible in response headers. + """ + + value: int + + +class ActionExplicitCacheControl(TypedDict, total=False): + id: Literal["explicit_cache_control"] + + +class ActionForwardingURLValue(TypedDict, total=False): status_code: Literal[301, 302] """The status code to use for the URL redirect. @@ -50,7 +294,7 @@ class ActionValue(TypedDict, total=False): """ -class Action(TypedDict, total=False): +class ActionForwardingURL(TypedDict, total=False): id: Literal["forwarding_url"] """Redirects one URL to another using an `HTTP 301/302` redirect. @@ -58,4 +302,88 @@ class Action(TypedDict, total=False): [Wildcard matching and referencing](https://developers.cloudflare.com/rules/page-rules/reference/wildcard-matching/). """ - value: ActionValue + value: ActionForwardingURLValue + + +class ActionHostHeaderOverride(TypedDict, total=False): + id: Literal["host_header_override"] + """Apply a specific host header.""" + + value: str + """The hostname to use in the `Host` header""" + + +class ActionMinify(TypedDict, total=False): + id: Literal["minify"] + + +class ActionPurgeByPageRule(TypedDict, total=False): + id: Literal["purge_by_page_rule"] + + +class ActionResolveOverrideValue(TypedDict, total=False): + value: str + """The origin address you want to override with.""" + + +class ActionResolveOverride(TypedDict, total=False): + id: Literal["resolve_override"] + """Change the origin address to the value specified in this setting.""" + + value: ActionResolveOverrideValue + + +class ActionRespectStrongEtag(TypedDict, total=False): + id: Literal["respect_strong_etag"] + """ + Turn on or off byte-for-byte equivalency checks between the Cloudflare cache and + the origin server. + """ + + value: Literal["on", "off"] + """The status of Respect Strong ETags""" + + +Action: TypeAlias = Union[ + AlwaysUseHTTPSParam, + AutomaticHTTPSRewritesParam, + BrowserCacheTTLParam, + BrowserCheckParam, + ActionBypassCacheOnCookie, + ActionCacheByDeviceType, + ActionCacheDeceptionArmor, + ActionCacheKey, + ActionCacheKeyFields, + CacheLevelParam, + ActionCacheOnCookie, + ActionCacheTTLByStatus, + ActionDDoSProtection, + DevelopmentModeParam, + ActionDisableApps, + ActionDisablePerformance, + ActionDisableSecurity, + ActionDisableZaraz, + ActionEdgeCacheTTL, + EmailObfuscationParam, + ActionExplicitCacheControl, + ActionForwardingURL, + ActionHostHeaderOverride, + HotlinkProtectionParam, + IPGeolocationParam, + ActionMinify, + MirageParam, + OpportunisticEncryptionParam, + OriginErrorPagePassThruParam, + PolishParam, + ActionPurgeByPageRule, + ActionResolveOverride, + ActionRespectStrongEtag, + ResponseBufferingParam, + RocketLoaderParam, + SecurityLevelParam, + ServerSideExcludesParam, + SortQueryStringForCacheParam, + SSLParam, + TrueClientIPHeaderParam, + WAFParam, +] diff --git a/src/cloudflare/types/pagerules/pagerule_update_params.py b/src/cloudflare/types/pagerules/pagerule_update_params.py index 88e80a5b5a7..5177c102917 100644 --- a/src/cloudflare/types/pagerules/pagerule_update_params.py +++ b/src/cloudflare/types/pagerules/pagerule_update_params.py @@ -2,12 +2,64 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Literal, Required, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .target_param import TargetParam +from ..zones.ssl_param import SSLParam +from ..zones.waf_param import WAFParam +from ..zones.mirage_param import MirageParam +from ..zones.polish_param import PolishParam +from ..zones.cache_level_param import CacheLevelParam +from ..zones.browser_check_param import BrowserCheckParam +from ..zones.rocket_loader_param import RocketLoaderParam +from ..zones.ip_geolocation_param import IPGeolocationParam +from ..zones.security_level_param import SecurityLevelParam +from ..zones.always_use_https_param import AlwaysUseHTTPSParam +from ..zones.development_mode_param import DevelopmentModeParam +from ..zones.browser_cache_ttl_param import BrowserCacheTTLParam +from ..zones.email_obfuscation_param import EmailObfuscationParam +from ..zones.hotlink_protection_param import HotlinkProtectionParam +from ..zones.response_buffering_param import ResponseBufferingParam +from ..zones.server_side_excludes_param import ServerSideExcludesParam +from ..zones.true_client_ip_header_param import TrueClientIPHeaderParam +from ..zones.automatic_https_rewrites_param import AutomaticHTTPSRewritesParam +from ..zones.opportunistic_encryption_param import OpportunisticEncryptionParam +from ..zones.origin_error_page_pass_thru_param import OriginErrorPagePassThruParam +from ..zones.sort_query_string_for_cache_param import SortQueryStringForCacheParam -__all__ = ["PageruleUpdateParams", "Action", "ActionValue"] +__all__ = [ + "PageruleUpdateParams", + "Action", + "ActionBypassCacheOnCookie", + "ActionCacheByDeviceType", + "ActionCacheDeceptionArmor", + "ActionCacheKey", + "ActionCacheKeyValue", + "ActionCacheKeyValueCookie", + "ActionCacheKeyValueHeader", + "ActionCacheKeyValueHost", + "ActionCacheKeyValueQueryString", + "ActionCacheKeyValueUser", + "ActionCacheKeyFields", + "ActionCacheOnCookie", + "ActionCacheTTLByStatus", + "ActionDDoSProtection", + "ActionDisableApps", + "ActionDisablePerformance", + "ActionDisableSecurity", + "ActionDisableZaraz", + "ActionEdgeCacheTTL", + "ActionExplicitCacheControl", + "ActionForwardingURL", + "ActionForwardingURLValue", + "ActionHostHeaderOverride", + "ActionMinify", + "ActionPurgeByPageRule", + "ActionResolveOverride", + "ActionResolveOverrideValue", + "ActionRespectStrongEtag", +] class PageruleUpdateParams(TypedDict, total=False): @@ -36,7 +88,199 @@ class PageruleUpdateParams(TypedDict, total=False): """The status of the Page Rule.""" -class ActionValue(TypedDict, total=False): +class ActionBypassCacheOnCookie(TypedDict, total=False): + id: Literal["bypass_cache_on_cookie"] + """ + Bypass cache and fetch resources from the origin server if a regular expression + matches against a cookie name present in the request. + """ + + value: str + """The regular expression to use for matching cookie names in the request. + + Refer to + [Bypass Cache on Cookie setting](https://developers.cloudflare.com/rules/page-rules/reference/additional-reference/#bypass-cache-on-cookie-setting) + to learn about limited regular expression support. + """ + + +class ActionCacheByDeviceType(TypedDict, total=False): + id: Literal["cache_by_device_type"] + """Separate cached content based on the visitor's device type.""" + + value: Literal["on", "off"] + """The status of Cache By Device Type.""" + + +class ActionCacheDeceptionArmor(TypedDict, total=False): + id: Literal["cache_deception_armor"] + """ + Protect from web cache deception attacks while still allowing static assets to + be cached. This setting verifies that the URL's extension matches the returned + `Content-Type`. + """ + + value: Literal["on", "off"] + """The status of Cache Deception Armor.""" + + +class ActionCacheKeyValueCookie(TypedDict, total=False): + check_presence: List[str] + """ + A list of cookies to check for the presence of, without including their actual + values. + """ + + include: List[str] + """A list of cookies to include.""" + + +class ActionCacheKeyValueHeader(TypedDict, total=False): + check_presence: List[str] + """ + A list of headers to check for the presence of, without including their actual + values. + """ + + exclude: List[str] + """A list of headers to ignore.""" + + include: List[str] + """A list of headers to include.""" + + +class ActionCacheKeyValueHost(TypedDict, total=False): + resolved: bool + """Whether to include the Host header in the HTTP request sent to the origin.""" + + +class ActionCacheKeyValueQueryString(TypedDict, total=False): + exclude: Union[Literal["*"], List[str]] + """Ignore all query string parameters.""" + + include: Union[Literal["*"], List[str]] + """Include all query string parameters.""" + + +class ActionCacheKeyValueUser(TypedDict, total=False): + device_type: bool + """ + Classifies a request as `mobile`, `desktop`, or `tablet` based on the User + Agent. + """ + + geo: bool + """Includes the client's country, derived from the IP address.""" + + lang: bool + """ + Includes the first language code contained in the `Accept-Language` header sent + by the client. + """ + + +class ActionCacheKeyValue(TypedDict, total=False): + cookie: ActionCacheKeyValueCookie + """Controls which cookies appear in the Cache Key.""" + + header: ActionCacheKeyValueHeader + """Controls which headers go into the Cache Key. + + Exactly one of `include` or `exclude` is expected. + """ + + host: ActionCacheKeyValueHost + """Determines which host header to include in the Cache Key.""" + + query_string: ActionCacheKeyValueQueryString + """Controls which URL query string parameters go into the Cache Key. + + Exactly one of `include` or `exclude` is expected. + """ + + user: ActionCacheKeyValueUser + """Feature fields to add features about the end-user (client) into the Cache Key.""" + + +class ActionCacheKey(TypedDict, total=False): + id: Literal["cache_key"] + """ + Control specifically what variables to include when deciding which resources to + cache. This allows customers to determine what to cache based on something other + than just the URL. + """ + + value: ActionCacheKeyValue + + +class ActionCacheKeyFields(TypedDict, total=False): + id: Literal["cache_key_fields"] + + +class ActionCacheOnCookie(TypedDict, total=False): + id: Literal["cache_on_cookie"] + + +class ActionCacheTTLByStatus(TypedDict, total=False): + id: Literal["cache_ttl_by_status"] + + +class ActionDDoSProtection(TypedDict, total=False): + id: Literal["ddos_protection"] + + +class ActionDisableApps(TypedDict, total=False): + id: Literal["disable_apps"] + """ + Turn off all active + [Cloudflare Apps](https://developers.cloudflare.com/support/more-dashboard-apps/cloudflare-apps/) + (deprecated). + """ + + +class ActionDisablePerformance(TypedDict, total=False): + id: Literal["disable_performance"] + """ + Turn off + [Rocket Loader](https://developers.cloudflare.com/speed/optimization/content/rocket-loader/), + [Mirage](https://developers.cloudflare.com/speed/optimization/images/mirage/), + and [Polish](https://developers.cloudflare.com/images/polish/). + """ + + +class ActionDisableSecurity(TypedDict, total=False): + id: Literal["disable_security"] + """ + Turn off + [Email Obfuscation](https://developers.cloudflare.com/waf/tools/scrape-shield/email-address-obfuscation/), + [Rate Limiting (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-rate-limiting/), + [Scrape Shield](https://developers.cloudflare.com/waf/tools/scrape-shield/), + [URL (Zone) Lockdown](https://developers.cloudflare.com/waf/tools/zone-lockdown/), + and + [WAF managed rules (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-waf-managed-rules/). + """ + + +class ActionDisableZaraz(TypedDict, total=False): + id: Literal["disable_zaraz"] + """Turn off [Zaraz](https://developers.cloudflare.com/zaraz/).""" + + +class ActionEdgeCacheTTL(TypedDict, total=False): + id: Literal["edge_cache_ttl"] + """Specify how long to cache a resource in the Cloudflare global network. + + _Edge Cache TTL_ is not visible in response headers. + """ + + value: int + + +class ActionExplicitCacheControl(TypedDict, total=False): + id: Literal["explicit_cache_control"] + + +class ActionForwardingURLValue(TypedDict, total=False): status_code: Literal[301, 302] """The status code to use for the URL redirect. @@ -50,7 +294,7 @@ class ActionValue(TypedDict, total=False): """ -class Action(TypedDict, total=False): +class ActionForwardingURL(TypedDict, total=False): id: Literal["forwarding_url"] """Redirects one URL to another using an `HTTP 301/302` redirect. @@ -58,4 +302,88 @@ class Action(TypedDict, total=False): [Wildcard matching and referencing](https://developers.cloudflare.com/rules/page-rules/reference/wildcard-matching/). """ - value: ActionValue + value: ActionForwardingURLValue + + +class ActionHostHeaderOverride(TypedDict, total=False): + id: Literal["host_header_override"] + """Apply a specific host header.""" + + value: str + """The hostname to use in the `Host` header""" + + +class ActionMinify(TypedDict, total=False): + id: Literal["minify"] + + +class ActionPurgeByPageRule(TypedDict, total=False): + id: Literal["purge_by_page_rule"] + + +class ActionResolveOverrideValue(TypedDict, total=False): + value: str + """The origin address you want to override with.""" + + +class ActionResolveOverride(TypedDict, total=False): + id: Literal["resolve_override"] + """Change the origin address to the value specified in this setting.""" + + value: ActionResolveOverrideValue + + +class ActionRespectStrongEtag(TypedDict, total=False): + id: Literal["respect_strong_etag"] + """ + Turn on or off byte-for-byte equivalency checks between the Cloudflare cache and + the origin server. + """ + + value: Literal["on", "off"] + """The status of Respect Strong ETags""" + + +Action: TypeAlias = Union[ + AlwaysUseHTTPSParam, + AutomaticHTTPSRewritesParam, + BrowserCacheTTLParam, + BrowserCheckParam, + ActionBypassCacheOnCookie, + ActionCacheByDeviceType, + ActionCacheDeceptionArmor, + ActionCacheKey, + ActionCacheKeyFields, + CacheLevelParam, + ActionCacheOnCookie, + ActionCacheTTLByStatus, + ActionDDoSProtection, + DevelopmentModeParam, + ActionDisableApps, + ActionDisablePerformance, + ActionDisableSecurity, + ActionDisableZaraz, + ActionEdgeCacheTTL, + EmailObfuscationParam, + ActionExplicitCacheControl, + ActionForwardingURL, + ActionHostHeaderOverride, + HotlinkProtectionParam, + IPGeolocationParam, + ActionMinify, + MirageParam, + OpportunisticEncryptionParam, + OriginErrorPagePassThruParam, + PolishParam, + ActionPurgeByPageRule, + ActionResolveOverride, + ActionRespectStrongEtag, + ResponseBufferingParam, + RocketLoaderParam, + SecurityLevelParam, + ServerSideExcludesParam, + SortQueryStringForCacheParam, + SSLParam, + TrueClientIPHeaderParam, + WAFParam, +] diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py index b8e90f5ed1f..656aeb26d5b 100644 --- a/src/cloudflare/types/zones/__init__.py +++ b/src/cloudflare/types/zones/__init__.py @@ -17,11 +17,15 @@ from .ciphers import Ciphers as Ciphers from .tls_1_3 import TLS1_3 as TLS1_3 from .zero_rtt import ZeroRTT as ZeroRTT +from .ssl_param import SSLParam as SSLParam +from .waf_param import WAFParam as WAFParam from .websocket import Websocket as Websocket from .zone_hold import ZoneHold as ZoneHold from .cache_level import CacheLevel as CacheLevel from .early_hints import EarlyHints as EarlyHints from .pseudo_ipv4 import PseudoIPV4 as PseudoIPV4 +from .mirage_param import MirageParam as MirageParam +from .polish_param import PolishParam as PolishParam from .advanced_ddos import AdvancedDDoS as AdvancedDDoS from .always_online import AlwaysOnline as AlwaysOnline from .browser_check import BrowserCheck as BrowserCheck @@ -41,6 +45,7 @@ from .zone_edit_params import ZoneEditParams as ZoneEditParams from .zone_list_params import ZoneListParams as ZoneListParams from .browser_cache_ttl import BrowserCacheTTL as BrowserCacheTTL +from .cache_level_param import CacheLevelParam as CacheLevelParam from .email_obfuscation import EmailObfuscation as EmailObfuscation from .h2_prioritization import H2Prioritization as H2Prioritization from .hold_create_params import HoldCreateParams as HoldCreateParams @@ -50,29 +55,45 @@ from .response_buffering import ResponseBuffering as ResponseBuffering from .zone_create_params import ZoneCreateParams as ZoneCreateParams from .available_rate_plan import AvailableRatePlan as AvailableRatePlan +from .browser_check_param import BrowserCheckParam as BrowserCheckParam from .opportunistic_onion import OpportunisticOnion as OpportunisticOnion +from .rocket_loader_param import RocketLoaderParam as RocketLoaderParam from .setting_edit_params import SettingEditParams as SettingEditParams +from .ip_geolocation_param import IPGeolocationParam as IPGeolocationParam +from .security_level_param import SecurityLevelParam as SecurityLevelParam from .server_side_excludes import ServerSideExcludes as ServerSideExcludes from .setting_get_response import SettingGetResponse as SettingGetResponse from .zone_delete_response import ZoneDeleteResponse as ZoneDeleteResponse from .setting_edit_response import SettingEditResponse as SettingEditResponse from .true_client_ip_header import TrueClientIPHeader as TrueClientIPHeader +from .always_use_https_param import AlwaysUseHTTPSParam as AlwaysUseHTTPSParam +from .development_mode_param import DevelopmentModeParam as DevelopmentModeParam from .rate_plan_get_response import RatePlanGetResponse as RatePlanGetResponse +from .browser_cache_ttl_param import BrowserCacheTTLParam as BrowserCacheTTLParam +from .email_obfuscation_param import EmailObfuscationParam as EmailObfuscationParam from .origin_max_http_version import OriginMaxHTTPVersion as OriginMaxHTTPVersion from .automatic_https_rewrites import AutomaticHTTPSRewrites as AutomaticHTTPSRewrites +from .hotlink_protection_param import HotlinkProtectionParam as HotlinkProtectionParam from .opportunistic_encryption import OpportunisticEncryption as OpportunisticEncryption +from .response_buffering_param import ResponseBufferingParam as ResponseBufferingParam from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse +from .server_side_excludes_param import ServerSideExcludesParam as ServerSideExcludesParam from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams from .origin_error_page_pass_thru import OriginErrorPagePassThru as OriginErrorPagePassThru from .sort_query_string_for_cache import SortQueryStringForCache as SortQueryStringForCache +from .true_client_ip_header_param import TrueClientIPHeaderParam as TrueClientIPHeaderParam from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse from .subscription_update_response import SubscriptionUpdateResponse as SubscriptionUpdateResponse +from .automatic_https_rewrites_param import AutomaticHTTPSRewritesParam as AutomaticHTTPSRewritesParam from .custom_nameserver_get_response import CustomNameserverGetResponse as CustomNameserverGetResponse +from .opportunistic_encryption_param import OpportunisticEncryptionParam as OpportunisticEncryptionParam from .automatic_platform_optimization import AutomaticPlatformOptimization as AutomaticPlatformOptimization from .custom_nameserver_update_params import CustomNameserverUpdateParams as CustomNameserverUpdateParams from .activation_check_trigger_response import ActivationCheckTriggerResponse as ActivationCheckTriggerResponse from .custom_nameserver_update_response import CustomNameserverUpdateResponse as CustomNameserverUpdateResponse +from .origin_error_page_pass_thru_param import OriginErrorPagePassThruParam as OriginErrorPagePassThruParam +from .sort_query_string_for_cache_param import SortQueryStringForCacheParam as SortQueryStringForCacheParam from .automatic_platform_optimization_param import ( AutomaticPlatformOptimizationParam as AutomaticPlatformOptimizationParam, ) diff --git a/src/cloudflare/types/zones/always_use_https.py b/src/cloudflare/types/zones/always_use_https.py index 78f176711aa..5adb357001b 100644 --- a/src/cloudflare/types/zones/always_use_https.py +++ b/src/cloudflare/types/zones/always_use_https.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,8 @@ class AlwaysUseHTTPS(BaseModel): - id: Literal["always_use_https"] - """ID of the zone setting.""" - - value: Literal["on", "off"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None + id: Optional[Literal["always_use_https"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + If enabled, any ` http://`` URL is converted to `https://` through a 301 + redirect. """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" diff --git a/src/cloudflare/types/zones/always_use_https_param.py b/src/cloudflare/types/zones/always_use_https_param.py new file mode 100644 index 00000000000..9853d49bf7d --- /dev/null +++ b/src/cloudflare/types/zones/always_use_https_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["AlwaysUseHTTPSParam"] + + +class AlwaysUseHTTPSParam(TypedDict, total=False): + id: Literal["always_use_https"] + """ + If enabled, any ` http://`` URL is converted to `https://` through a 301 + redirect. + """ diff --git a/src/cloudflare/types/zones/automatic_https_rewrites.py b/src/cloudflare/types/zones/automatic_https_rewrites.py index ced7a3e50f5..9ca12b86aa3 100644 --- a/src/cloudflare/types/zones/automatic_https_rewrites.py +++ b/src/cloudflare/types/zones/automatic_https_rewrites.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,4 @@ class AutomaticHTTPSRewrites(BaseModel): - id: Literal["automatic_https_rewrites"] - """ID of the zone setting.""" - - value: Literal["on", "off"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + id: Optional[Literal["automatic_https_rewrites"]] = None diff --git a/src/cloudflare/types/zones/automatic_https_rewrites_param.py b/src/cloudflare/types/zones/automatic_https_rewrites_param.py new file mode 100644 index 00000000000..2435ed975b2 --- /dev/null +++ b/src/cloudflare/types/zones/automatic_https_rewrites_param.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["AutomaticHTTPSRewritesParam"] + + +class AutomaticHTTPSRewritesParam(TypedDict, total=False): + id: Literal["automatic_https_rewrites"] diff --git a/src/cloudflare/types/zones/browser_cache_ttl.py b/src/cloudflare/types/zones/browser_cache_ttl.py index 77393c400dc..35d15b7fabf 100644 --- a/src/cloudflare/types/zones/browser_cache_ttl.py +++ b/src/cloudflare/types/zones/browser_cache_ttl.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,46 +9,11 @@ class BrowserCacheTTL(BaseModel): - id: Literal["browser_cache_ttl"] - """ID of the zone setting.""" + id: Optional[Literal["browser_cache_ttl"]] = None + """Control how long resources cached by client browsers remain valid.""" - value: Literal[ - 0, - 30, - 60, - 120, - 300, - 1200, - 1800, - 3600, - 7200, - 10800, - 14400, - 18000, - 28800, - 43200, - 57600, - 72000, - 86400, - 172800, - 259200, - 345600, - 432000, - 691200, - 1382400, - 2073600, - 2678400, - 5356800, - 16070400, - 31536000, - ] - """Current value of the zone setting.""" + value: Optional[int] = None + """The number of seconds to cache resources for. - editable: Optional[Literal[True, False]] = None + The API prohibits setting this to 0 for non-Enterprise domains. """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" diff --git a/src/cloudflare/types/zones/browser_cache_ttl_param.py b/src/cloudflare/types/zones/browser_cache_ttl_param.py new file mode 100644 index 00000000000..acf9e43b4ec --- /dev/null +++ b/src/cloudflare/types/zones/browser_cache_ttl_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["BrowserCacheTTLParam"] + + +class BrowserCacheTTLParam(TypedDict, total=False): + id: Literal["browser_cache_ttl"] + """Control how long resources cached by client browsers remain valid.""" + + value: int + """The number of seconds to cache resources for. + + The API prohibits setting this to 0 for non-Enterprise domains. + """ diff --git a/src/cloudflare/types/zones/browser_check.py b/src/cloudflare/types/zones/browser_check.py index 9de5013bcaa..79c5d1e6a8b 100644 --- a/src/cloudflare/types/zones/browser_check.py +++ b/src/cloudflare/types/zones/browser_check.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,11 @@ class BrowserCheck(BaseModel): - id: Literal["browser_check"] - """ID of the zone setting.""" - - value: Literal["on", "off"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None + id: Optional[Literal["browser_check"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + Inspect the visitor's browser for headers commonly associated with spammers and + certain bots. """ - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Literal["on", "off"]] = None + """The status of Browser Integrity Check.""" diff --git a/src/cloudflare/types/zones/browser_check_param.py b/src/cloudflare/types/zones/browser_check_param.py new file mode 100644 index 00000000000..ffe14ebb557 --- /dev/null +++ b/src/cloudflare/types/zones/browser_check_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["BrowserCheckParam"] + + +class BrowserCheckParam(TypedDict, total=False): + id: Literal["browser_check"] + """ + Inspect the visitor's browser for headers commonly associated with spammers and + certain bots. + """ + + value: Literal["on", "off"] + """The status of Browser Integrity Check.""" diff --git a/src/cloudflare/types/zones/cache_level.py b/src/cloudflare/types/zones/cache_level.py index 7aaf4433499..06e02c2fb2d 100644 --- a/src/cloudflare/types/zones/cache_level.py +++ b/src/cloudflare/types/zones/cache_level.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,17 @@ class CacheLevel(BaseModel): - id: Literal["cache_level"] - """ID of the zone setting.""" + id: Optional[Literal["cache_level"]] = None + """Apply custom caching based on the option selected.""" - value: Literal["aggressive", "basic", "simplified"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None + value: Optional[Literal["bypass", "basic", "simplified", "aggressive", "cache_everything"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + - `bypass`: Cloudflare does not cache. + - `basic`: Delivers resources from cache when there is no query string. + - `simplified`: Delivers the same resource to everyone independent of the query + string. + - `aggressive`: Caches all static content that has a query string. + - `cache_everything`: Treats all content as static and caches all file types + beyond the + [Cloudflare default cached content](https://developers.cloudflare.com/cache/concepts/default-cache-behavior/#default-cached-file-extensions). """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" diff --git a/src/cloudflare/types/zones/cache_level_param.py b/src/cloudflare/types/zones/cache_level_param.py new file mode 100644 index 00000000000..daa1406ae4b --- /dev/null +++ b/src/cloudflare/types/zones/cache_level_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["CacheLevelParam"] + + +class CacheLevelParam(TypedDict, total=False): + id: Literal["cache_level"] + """Apply custom caching based on the option selected.""" + + value: Literal["bypass", "basic", "simplified", "aggressive", "cache_everything"] + """ + - `bypass`: Cloudflare does not cache. + - `basic`: Delivers resources from cache when there is no query string. + - `simplified`: Delivers the same resource to everyone independent of the query + string. + - `aggressive`: Caches all static content that has a query string. + - `cache_everything`: Treats all content as static and caches all file types + beyond the + [Cloudflare default cached content](https://developers.cloudflare.com/cache/concepts/default-cache-behavior/#default-cached-file-extensions). + """ diff --git a/src/cloudflare/types/zones/development_mode.py b/src/cloudflare/types/zones/development_mode.py index 06c81d58b5f..f529e46ab04 100644 --- a/src/cloudflare/types/zones/development_mode.py +++ b/src/cloudflare/types/zones/development_mode.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,24 +9,4 @@ class DevelopmentMode(BaseModel): - id: Literal["development_mode"] - """ID of the zone setting.""" - - value: Literal["on", "off"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" - - time_remaining: Optional[float] = None - """ - Value of the zone setting. Notes: The interval (in seconds) from when - development mode expires (positive integer) or last expired (negative integer) - for the domain. If development mode has never been enabled, this value is false. - """ + id: Optional[Literal["development_mode"]] = None diff --git a/src/cloudflare/types/zones/development_mode_param.py b/src/cloudflare/types/zones/development_mode_param.py new file mode 100644 index 00000000000..83e95df5c1c --- /dev/null +++ b/src/cloudflare/types/zones/development_mode_param.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["DevelopmentModeParam"] + + +class DevelopmentModeParam(TypedDict, total=False): + id: Literal["development_mode"] diff --git a/src/cloudflare/types/zones/email_obfuscation.py b/src/cloudflare/types/zones/email_obfuscation.py index 37ecaca46de..07ff01d4431 100644 --- a/src/cloudflare/types/zones/email_obfuscation.py +++ b/src/cloudflare/types/zones/email_obfuscation.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,8 @@ class EmailObfuscation(BaseModel): - id: Literal["email_obfuscation"] - """ID of the zone setting.""" + id: Optional[Literal["email_obfuscation"]] = None + """Turn on or off **Email Obfuscation**.""" - value: Literal["on", "off"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Literal["on", "off"]] = None + """The status of Email Obfuscation.""" diff --git a/src/cloudflare/types/zones/email_obfuscation_param.py b/src/cloudflare/types/zones/email_obfuscation_param.py new file mode 100644 index 00000000000..e983e18c207 --- /dev/null +++ b/src/cloudflare/types/zones/email_obfuscation_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["EmailObfuscationParam"] + + +class EmailObfuscationParam(TypedDict, total=False): + id: Literal["email_obfuscation"] + """Turn on or off **Email Obfuscation**.""" + + value: Literal["on", "off"] + """The status of Email Obfuscation.""" diff --git a/src/cloudflare/types/zones/hotlink_protection.py b/src/cloudflare/types/zones/hotlink_protection.py index 45d990193de..54e60d05aab 100644 --- a/src/cloudflare/types/zones/hotlink_protection.py +++ b/src/cloudflare/types/zones/hotlink_protection.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,4 @@ class HotlinkProtection(BaseModel): - id: Literal["hotlink_protection"] - """ID of the zone setting.""" - - value: Literal["on", "off"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + id: Optional[Literal["hotlink_protection"]] = None diff --git a/src/cloudflare/types/zones/hotlink_protection_param.py b/src/cloudflare/types/zones/hotlink_protection_param.py new file mode 100644 index 00000000000..cffd76c7102 --- /dev/null +++ b/src/cloudflare/types/zones/hotlink_protection_param.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["HotlinkProtectionParam"] + + +class HotlinkProtectionParam(TypedDict, total=False): + id: Literal["hotlink_protection"] diff --git a/src/cloudflare/types/zones/ip_geolocation.py b/src/cloudflare/types/zones/ip_geolocation.py index 0c378a4acc9..058549a5597 100644 --- a/src/cloudflare/types/zones/ip_geolocation.py +++ b/src/cloudflare/types/zones/ip_geolocation.py @@ -1,26 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["IPGeolocation"] +__all__ = ["IPGeolocation", "Value"] -class IPGeolocation(BaseModel): - id: Literal["ip_geolocation"] - """ID of the zone setting.""" +class Value(BaseModel): + value: Optional[Literal["on", "off"]] = None + """The status of adding the IP Geolocation Header.""" - value: Literal["on", "off"] - """Current value of the zone setting.""" - editable: Optional[Literal[True, False]] = None +class IPGeolocation(BaseModel): + id: Optional[Literal["ip_geolocation"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + Cloudflare adds a CF-IPCountry HTTP header containing the country code that + corresponds to the visitor. """ - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Value] = None diff --git a/src/cloudflare/types/zones/ip_geolocation_param.py b/src/cloudflare/types/zones/ip_geolocation_param.py new file mode 100644 index 00000000000..66cfd4f605e --- /dev/null +++ b/src/cloudflare/types/zones/ip_geolocation_param.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["IPGeolocationParam", "Value"] + + +class Value(TypedDict, total=False): + value: Literal["on", "off"] + """The status of adding the IP Geolocation Header.""" + + +class IPGeolocationParam(TypedDict, total=False): + id: Literal["ip_geolocation"] + """ + Cloudflare adds a CF-IPCountry HTTP header containing the country code that + corresponds to the visitor. + """ + + value: Value diff --git a/src/cloudflare/types/zones/mirage.py b/src/cloudflare/types/zones/mirage.py index 4679cc48ebb..51f593c6dea 100644 --- a/src/cloudflare/types/zones/mirage.py +++ b/src/cloudflare/types/zones/mirage.py @@ -1,26 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["Mirage"] +__all__ = ["Mirage", "Value"] -class Mirage(BaseModel): - id: Literal["mirage"] - """ID of the zone setting.""" +class Value(BaseModel): + value: Optional[Literal["on", "off"]] = None + """The status of Mirage.""" - value: Literal["on", "off"] - """Current value of the zone setting.""" - editable: Optional[Literal[True, False]] = None +class Mirage(BaseModel): + id: Optional[Literal["mirage"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + Cloudflare Mirage reduces bandwidth used by images in mobile browsers. It can + accelerate loading of image-heavy websites on very slow mobile connections and + HTTP/1. """ - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Value] = None diff --git a/src/cloudflare/types/zones/mirage_param.py b/src/cloudflare/types/zones/mirage_param.py new file mode 100644 index 00000000000..f9614642524 --- /dev/null +++ b/src/cloudflare/types/zones/mirage_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["MirageParam", "Value"] + + +class Value(TypedDict, total=False): + value: Literal["on", "off"] + """The status of Mirage.""" + + +class MirageParam(TypedDict, total=False): + id: Literal["mirage"] + """ + Cloudflare Mirage reduces bandwidth used by images in mobile browsers. It can + accelerate loading of image-heavy websites on very slow mobile connections and + HTTP/1. + """ + + value: Value diff --git a/src/cloudflare/types/zones/opportunistic_encryption.py b/src/cloudflare/types/zones/opportunistic_encryption.py index 7ab0d1e8275..fb1d5f99bb4 100644 --- a/src/cloudflare/types/zones/opportunistic_encryption.py +++ b/src/cloudflare/types/zones/opportunistic_encryption.py @@ -1,26 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["OpportunisticEncryption"] +__all__ = ["OpportunisticEncryption", "Value"] -class OpportunisticEncryption(BaseModel): - id: Literal["opportunistic_encryption"] - """ID of the zone setting.""" +class Value(BaseModel): + value: Optional[Literal["on", "off"]] = None + """The status of Opportunistic Encryption.""" - value: Literal["on", "off"] - """Current value of the zone setting.""" - editable: Optional[Literal[True, False]] = None +class OpportunisticEncryption(BaseModel): + id: Optional[Literal["opportunistic_encryption"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + Opportunistic Encryption allows browsers to access HTTP URIs over an encrypted + TLS channel. It's not a substitute for HTTPS, but provides additional security + for otherwise vulnerable requests. """ - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Value] = None diff --git a/src/cloudflare/types/zones/opportunistic_encryption_param.py b/src/cloudflare/types/zones/opportunistic_encryption_param.py new file mode 100644 index 00000000000..389ee32da9c --- /dev/null +++ b/src/cloudflare/types/zones/opportunistic_encryption_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["OpportunisticEncryptionParam", "Value"] + + +class Value(TypedDict, total=False): + value: Literal["on", "off"] + """The status of Opportunistic Encryption.""" + + +class OpportunisticEncryptionParam(TypedDict, total=False): + id: Literal["opportunistic_encryption"] + """ + Opportunistic Encryption allows browsers to access HTTP URIs over an encrypted + TLS channel. It's not a substitute for HTTPS, but provides additional security + for otherwise vulnerable requests. + """ + + value: Value diff --git a/src/cloudflare/types/zones/origin_error_page_pass_thru.py b/src/cloudflare/types/zones/origin_error_page_pass_thru.py index 24cd47f546b..66f907452ef 100644 --- a/src/cloudflare/types/zones/origin_error_page_pass_thru.py +++ b/src/cloudflare/types/zones/origin_error_page_pass_thru.py @@ -1,26 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["OriginErrorPagePassThru"] +__all__ = ["OriginErrorPagePassThru", "Value"] -class OriginErrorPagePassThru(BaseModel): - id: Literal["origin_error_page_pass_thru"] - """ID of the zone setting.""" +class Value(BaseModel): + value: Optional[Literal["on", "off"]] = None + """The status of Origin Error Page Passthru.""" - value: Literal["on", "off"] - """Current value of the zone setting.""" - editable: Optional[Literal[True, False]] = None +class OriginErrorPagePassThru(BaseModel): + id: Optional[Literal["origin_error_page_pass_thru"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + Turn on or off Cloudflare error pages generated from issues sent from the origin + server. If enabled, this setting triggers error pages issued by the origin. """ - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Value] = None diff --git a/src/cloudflare/types/zones/origin_error_page_pass_thru_param.py b/src/cloudflare/types/zones/origin_error_page_pass_thru_param.py new file mode 100644 index 00000000000..d423939e37a --- /dev/null +++ b/src/cloudflare/types/zones/origin_error_page_pass_thru_param.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["OriginErrorPagePassThruParam", "Value"] + + +class Value(TypedDict, total=False): + value: Literal["on", "off"] + """The status of Origin Error Page Passthru.""" + + +class OriginErrorPagePassThruParam(TypedDict, total=False): + id: Literal["origin_error_page_pass_thru"] + """ + Turn on or off Cloudflare error pages generated from issues sent from the origin + server. If enabled, this setting triggers error pages issued by the origin. + """ + + value: Value diff --git a/src/cloudflare/types/zones/polish.py b/src/cloudflare/types/zones/polish.py index c75f4c9c129..46687b3e389 100644 --- a/src/cloudflare/types/zones/polish.py +++ b/src/cloudflare/types/zones/polish.py @@ -1,26 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["Polish"] +__all__ = ["Polish", "Value"] -class Polish(BaseModel): - id: Literal["polish"] - """ID of the zone setting.""" +class Value(BaseModel): + value: Optional[Literal["off", "lossless", "lossy"]] = None + """The level of Polish you want applied to your origin.""" - value: Literal["off", "lossless", "lossy"] - """Current value of the zone setting.""" - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ +class Polish(BaseModel): + id: Optional[Literal["polish"]] = None + """Apply options from the Polish feature of the Cloudflare Speed app.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Value] = None diff --git a/src/cloudflare/types/zones/polish_param.py b/src/cloudflare/types/zones/polish_param.py new file mode 100644 index 00000000000..a24804b5132 --- /dev/null +++ b/src/cloudflare/types/zones/polish_param.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["PolishParam", "Value"] + + +class Value(TypedDict, total=False): + value: Literal["off", "lossless", "lossy"] + """The level of Polish you want applied to your origin.""" + + +class PolishParam(TypedDict, total=False): + id: Literal["polish"] + """Apply options from the Polish feature of the Cloudflare Speed app.""" + + value: Value diff --git a/src/cloudflare/types/zones/response_buffering.py b/src/cloudflare/types/zones/response_buffering.py index cee36587e1a..840d27c0b0b 100644 --- a/src/cloudflare/types/zones/response_buffering.py +++ b/src/cloudflare/types/zones/response_buffering.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,12 @@ class ResponseBuffering(BaseModel): - id: Literal["response_buffering"] - """ID of the zone setting.""" - - value: Literal["on", "off"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None + id: Optional[Literal["response_buffering"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + Turn on or off whether Cloudflare should wait for an entire file from the origin + server before forwarding it to the site visitor. By default, Cloudflare sends + packets to the client as they arrive from the origin server. """ - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Literal["on", "off"]] = None + """The status of Response Buffering""" diff --git a/src/cloudflare/types/zones/response_buffering_param.py b/src/cloudflare/types/zones/response_buffering_param.py new file mode 100644 index 00000000000..b144afd1917 --- /dev/null +++ b/src/cloudflare/types/zones/response_buffering_param.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["ResponseBufferingParam"] + + +class ResponseBufferingParam(TypedDict, total=False): + id: Literal["response_buffering"] + """ + Turn on or off whether Cloudflare should wait for an entire file from the origin + server before forwarding it to the site visitor. By default, Cloudflare sends + packets to the client as they arrive from the origin server. + """ + + value: Literal["on", "off"] + """The status of Response Buffering""" diff --git a/src/cloudflare/types/zones/rocket_loader.py b/src/cloudflare/types/zones/rocket_loader.py index 1fcbbd08bea..4ca3fff374a 100644 --- a/src/cloudflare/types/zones/rocket_loader.py +++ b/src/cloudflare/types/zones/rocket_loader.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,8 @@ class RocketLoader(BaseModel): - id: Literal["rocket_loader"] - """ID of the zone setting.""" + id: Optional[Literal["rocket_loader"]] = None + """Turn on or off Rocket Loader in the Cloudflare Speed app.""" - value: Literal["on", "off"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Literal["on", "off"]] = None + """The status of Rocket Loader""" diff --git a/src/cloudflare/types/zones/rocket_loader_param.py b/src/cloudflare/types/zones/rocket_loader_param.py new file mode 100644 index 00000000000..385afbda75f --- /dev/null +++ b/src/cloudflare/types/zones/rocket_loader_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["RocketLoaderParam"] + + +class RocketLoaderParam(TypedDict, total=False): + id: Literal["rocket_loader"] + """Turn on or off Rocket Loader in the Cloudflare Speed app.""" + + value: Literal["on", "off"] + """The status of Rocket Loader""" diff --git a/src/cloudflare/types/zones/security_level.py b/src/cloudflare/types/zones/security_level.py index 93dfddc12ef..0adbeedbaaf 100644 --- a/src/cloudflare/types/zones/security_level.py +++ b/src/cloudflare/types/zones/security_level.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,7 @@ class SecurityLevel(BaseModel): - id: Literal["security_level"] - """ID of the zone setting.""" + id: Optional[Literal["security_level"]] = None + """Control options for the **Security Level** feature from the **Security** app.""" - value: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Literal["off", "essentially_off", "low", "medium", "high", "under_attack"]] = None diff --git a/src/cloudflare/types/zones/security_level_param.py b/src/cloudflare/types/zones/security_level_param.py new file mode 100644 index 00000000000..ce4d8a4e0aa --- /dev/null +++ b/src/cloudflare/types/zones/security_level_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["SecurityLevelParam"] + + +class SecurityLevelParam(TypedDict, total=False): + id: Literal["security_level"] + """Control options for the **Security Level** feature from the **Security** app.""" + + value: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"] diff --git a/src/cloudflare/types/zones/server_side_excludes.py b/src/cloudflare/types/zones/server_side_excludes.py index 2630a01b631..22a52497396 100644 --- a/src/cloudflare/types/zones/server_side_excludes.py +++ b/src/cloudflare/types/zones/server_side_excludes.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,17 +9,4 @@ class ServerSideExcludes(BaseModel): - id: Literal["server_side_exclude"] - """ID of the zone setting.""" - - value: Literal["on", "off"] - """Current value of the zone setting.""" - - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ - - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + id: Optional[Literal["server_side_exclude"]] = None diff --git a/src/cloudflare/types/zones/server_side_excludes_param.py b/src/cloudflare/types/zones/server_side_excludes_param.py new file mode 100644 index 00000000000..1b0b716b61a --- /dev/null +++ b/src/cloudflare/types/zones/server_side_excludes_param.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["ServerSideExcludesParam"] + + +class ServerSideExcludesParam(TypedDict, total=False): + id: Literal["server_side_exclude"] diff --git a/src/cloudflare/types/zones/setting_edit_params.py b/src/cloudflare/types/zones/setting_edit_params.py index d42008fcbf6..c8225843385 100644 --- a/src/cloudflare/types/zones/setting_edit_params.py +++ b/src/cloudflare/types/zones/setting_edit_params.py @@ -12,57 +12,57 @@ "ZeroRTT", "AdvancedDDoS", "AlwaysOnline", - "AlwaysUseHTTPS", - "AutomaticHTTPSRewrites", + "ZonesSchemasAlwaysUseHTTPS", + "ZonesSchemasAutomaticHTTPSRewrites", "Brotli", - "BrowserCacheTTL", - "BrowserCheck", - "CacheLevel", + "ZonesSchemasBrowserCacheTTL", + "ZonesSchemasBrowserCheck", + "ZonesSchemasCacheLevel", "ChallengeTTL", "Ciphers", "ZonesCNAMEFlattening", - "DevelopmentMode", + "ZonesSchemasDevelopmentMode", "EarlyHints", - "ZonesEdgeCacheTTL", - "EmailObfuscation", + "ZonesSchemasEdgeCacheTTL", + "ZonesSchemasEmailObfuscation", "H2Prioritization", - "HotlinkProtection", + "ZonesSchemasHotlinkProtection", "HTTP2", "HTTP3", "ImageResizing", - "IPGeolocation", + "ZonesSchemasIPGeolocation", "IPV6", "ZonesMaxUpload", "MinTLSVersion", - "Mirage", + "ZonesSchemasMirage", "NEL", "NELValue", - "OpportunisticEncryption", + "ZonesSchemasOpportunisticEncryption", "OpportunisticOnion", "OrangeToOrange", - "OriginErrorPagePassThru", - "Polish", + "ZonesSchemasOriginErrorPagePassThru", + "ZonesSchemasPolish", "PrefetchPreload", "ProxyReadTimeout", "PseudoIPV4", "ZonesReplaceInsecureJS", - "ResponseBuffering", - "RocketLoader", + "ZonesSchemasResponseBuffering", + "ZonesSchemasRocketLoader", "ZonesSchemasAutomaticPlatformOptimization", "SecurityHeaders", "SecurityHeadersValue", "SecurityHeadersValueStrictTransportSecurity", - "SecurityLevel", - "ServerSideExcludes", + "ZonesSchemasSecurityLevel", + "ZonesSchemasServerSideExclude", "ZonesSha1Support", - "SortQueryStringForCache", - "SSL", + "ZonesSchemasSortQueryStringForCache", + "ZonesSchemasSSL", "SSLRecommender", "ZonesTLS1_2Only", "TLS1_3", "TLSClientAuth", - "TrueClientIPHeader", - "WAF", + "ZonesSchemasTrueClientIPHeader", + "ZonesSchemasWAF", "WebP", "Websocket", ] @@ -101,7 +101,7 @@ class AlwaysOnline(TypedDict, total=False): """Current value of the zone setting.""" -class AlwaysUseHTTPS(TypedDict, total=False): +class ZonesSchemasAlwaysUseHTTPS(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -112,7 +112,7 @@ class AlwaysUseHTTPS(TypedDict, total=False): """Current value of the zone setting.""" -class AutomaticHTTPSRewrites(TypedDict, total=False): +class ZonesSchemasAutomaticHTTPSRewrites(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -134,7 +134,7 @@ class Brotli(TypedDict, total=False): """Current value of the zone setting.""" -class BrowserCacheTTL(TypedDict, total=False): +class ZonesSchemasBrowserCacheTTL(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -176,7 +176,7 @@ class BrowserCacheTTL(TypedDict, total=False): """Current value of the zone setting.""" -class BrowserCheck(TypedDict, total=False): +class ZonesSchemasBrowserCheck(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -187,7 +187,7 @@ class BrowserCheck(TypedDict, total=False): """Current value of the zone setting.""" -class CacheLevel(TypedDict, total=False): +class ZonesSchemasCacheLevel(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -233,7 +233,7 @@ class ZonesCNAMEFlattening(TypedDict, total=False): """Current value of the zone setting.""" -class DevelopmentMode(TypedDict, total=False): +class ZonesSchemasDevelopmentMode(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -255,7 +255,7 @@ class EarlyHints(TypedDict, total=False): """Current value of the zone setting.""" -class ZonesEdgeCacheTTL(TypedDict, total=False): +class ZonesSchemasEdgeCacheTTL(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -290,7 +290,7 @@ class ZonesEdgeCacheTTL(TypedDict, total=False): """Current value of the zone setting.""" -class EmailObfuscation(TypedDict, total=False): +class ZonesSchemasEmailObfuscation(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -312,7 +312,7 @@ class H2Prioritization(TypedDict, total=False): """Current value of the zone setting.""" -class HotlinkProtection(TypedDict, total=False): +class ZonesSchemasHotlinkProtection(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -356,7 +356,7 @@ class ImageResizing(TypedDict, total=False): """Current value of the zone setting.""" -class IPGeolocation(TypedDict, total=False): +class ZonesSchemasIPGeolocation(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -400,7 +400,7 @@ class MinTLSVersion(TypedDict, total=False): """Current value of the zone setting.""" -class Mirage(TypedDict, total=False): +class ZonesSchemasMirage(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -426,7 +426,7 @@ class NELValue(TypedDict, total=False): enabled: bool -class OpportunisticEncryption(TypedDict, total=False): +class ZonesSchemasOpportunisticEncryption(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -459,7 +459,7 @@ class OrangeToOrange(TypedDict, total=False): """Current value of the zone setting.""" -class OriginErrorPagePassThru(TypedDict, total=False): +class ZonesSchemasOriginErrorPagePassThru(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -470,7 +470,7 @@ class OriginErrorPagePassThru(TypedDict, total=False): """Current value of the zone setting.""" -class Polish(TypedDict, total=False): +class ZonesSchemasPolish(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -525,7 +525,7 @@ class ZonesReplaceInsecureJS(TypedDict, total=False): """Current value of the zone setting.""" -class ResponseBuffering(TypedDict, total=False): +class ZonesSchemasResponseBuffering(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -536,7 +536,7 @@ class ResponseBuffering(TypedDict, total=False): """Current value of the zone setting.""" -class RocketLoader(TypedDict, total=False): +class ZonesSchemasRocketLoader(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -591,7 +591,7 @@ class SecurityHeadersValue(TypedDict, total=False): """Strict Transport Security.""" -class SecurityLevel(TypedDict, total=False): +class ZonesSchemasSecurityLevel(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -602,7 +602,7 @@ class SecurityLevel(TypedDict, total=False): """Current value of the zone setting.""" -class ServerSideExcludes(TypedDict, total=False): +class ZonesSchemasServerSideExclude(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -624,7 +624,7 @@ class ZonesSha1Support(TypedDict, total=False): """Current value of the zone setting.""" -class SortQueryStringForCache(TypedDict, total=False): +class ZonesSchemasSortQueryStringForCache(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -635,7 +635,7 @@ class SortQueryStringForCache(TypedDict, total=False): """Current value of the zone setting.""" -class SSL(TypedDict, total=False): +class ZonesSchemasSSL(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -690,7 +690,7 @@ class TLSClientAuth(TypedDict, total=False): """Current value of the zone setting.""" -class TrueClientIPHeader(TypedDict, total=False): +class ZonesSchemasTrueClientIPHeader(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -701,7 +701,7 @@ class TrueClientIPHeader(TypedDict, total=False): """Current value of the zone setting.""" -class WAF(TypedDict, total=False): +class ZonesSchemasWAF(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -738,54 +738,54 @@ class Websocket(TypedDict, total=False): ZeroRTT, AdvancedDDoS, AlwaysOnline, - AlwaysUseHTTPS, - AutomaticHTTPSRewrites, + ZonesSchemasAlwaysUseHTTPS, + ZonesSchemasAutomaticHTTPSRewrites, Brotli, - BrowserCacheTTL, - BrowserCheck, - CacheLevel, + ZonesSchemasBrowserCacheTTL, + ZonesSchemasBrowserCheck, + ZonesSchemasCacheLevel, ChallengeTTL, Ciphers, ZonesCNAMEFlattening, - DevelopmentMode, + ZonesSchemasDevelopmentMode, EarlyHints, - ZonesEdgeCacheTTL, - EmailObfuscation, + ZonesSchemasEdgeCacheTTL, + ZonesSchemasEmailObfuscation, H2Prioritization, - HotlinkProtection, + ZonesSchemasHotlinkProtection, HTTP2, HTTP3, ImageResizing, - IPGeolocation, + ZonesSchemasIPGeolocation, IPV6, ZonesMaxUpload, MinTLSVersion, - Mirage, + ZonesSchemasMirage, NEL, - OpportunisticEncryption, + ZonesSchemasOpportunisticEncryption, OpportunisticOnion, OrangeToOrange, - OriginErrorPagePassThru, - Polish, + ZonesSchemasOriginErrorPagePassThru, + ZonesSchemasPolish, PrefetchPreload, ProxyReadTimeout, PseudoIPV4, ZonesReplaceInsecureJS, - ResponseBuffering, - RocketLoader, + ZonesSchemasResponseBuffering, + ZonesSchemasRocketLoader, ZonesSchemasAutomaticPlatformOptimization, SecurityHeaders, - SecurityLevel, - ServerSideExcludes, + ZonesSchemasSecurityLevel, + ZonesSchemasServerSideExclude, ZonesSha1Support, - SortQueryStringForCache, - SSL, + ZonesSchemasSortQueryStringForCache, + ZonesSchemasSSL, SSLRecommender, ZonesTLS1_2Only, TLS1_3, TLSClientAuth, - TrueClientIPHeader, - WAF, + ZonesSchemasTrueClientIPHeader, + ZonesSchemasWAF, WebP, Websocket, ] diff --git a/src/cloudflare/types/zones/setting_edit_response.py b/src/cloudflare/types/zones/setting_edit_response.py index 974838573d0..06b20495575 100644 --- a/src/cloudflare/types/zones/setting_edit_response.py +++ b/src/cloudflare/types/zones/setting_edit_response.py @@ -5,66 +5,180 @@ from typing_extensions import Literal, TypeAlias from .nel import NEL -from .ssl import SSL -from .waf import WAF from .ipv6 import IPV6 from .webp import WebP from .http2 import HTTP2 from .http3 import HTTP3 from .brotli import Brotli -from .mirage import Mirage -from .polish import Polish from .ciphers import Ciphers from .tls_1_3 import TLS1_3 from .zero_rtt import ZeroRTT from ..._models import BaseModel from .websocket import Websocket -from .cache_level import CacheLevel from .early_hints import EarlyHints from .pseudo_ipv4 import PseudoIPV4 from .advanced_ddos import AdvancedDDoS from .always_online import AlwaysOnline -from .browser_check import BrowserCheck from .challenge_ttl import ChallengeTTL -from .rocket_loader import RocketLoader from .image_resizing import ImageResizing -from .ip_geolocation import IPGeolocation -from .security_level import SecurityLevel from .min_tls_version import MinTLSVersion from .ssl_recommender import SSLRecommender from .tls_client_auth import TLSClientAuth -from .always_use_https import AlwaysUseHTTPS -from .development_mode import DevelopmentMode from .orange_to_orange import OrangeToOrange from .prefetch_preload import PrefetchPreload from .security_headers import SecurityHeaders -from .browser_cache_ttl import BrowserCacheTTL -from .email_obfuscation import EmailObfuscation from .h2_prioritization import H2Prioritization -from .hotlink_protection import HotlinkProtection from .proxy_read_timeout import ProxyReadTimeout -from .response_buffering import ResponseBuffering from .opportunistic_onion import OpportunisticOnion -from .server_side_excludes import ServerSideExcludes -from .true_client_ip_header import TrueClientIPHeader -from .automatic_https_rewrites import AutomaticHTTPSRewrites -from .opportunistic_encryption import OpportunisticEncryption -from .origin_error_page_pass_thru import OriginErrorPagePassThru -from .sort_query_string_for_cache import SortQueryStringForCache from .automatic_platform_optimization import AutomaticPlatformOptimization __all__ = [ "SettingEditResponse", + "ZonesSchemasAlwaysUseHTTPS", + "ZonesSchemasAutomaticHTTPSRewrites", + "ZonesSchemasBrowserCacheTTL", + "ZonesSchemasBrowserCheck", + "ZonesSchemasCacheLevel", "ZonesCNAMEFlattening", - "ZonesEdgeCacheTTL", + "ZonesSchemasDevelopmentMode", + "ZonesSchemasEdgeCacheTTL", + "ZonesSchemasEmailObfuscation", + "ZonesSchemasHotlinkProtection", + "ZonesSchemasIPGeolocation", "ZonesMaxUpload", + "ZonesSchemasMirage", + "ZonesSchemasOpportunisticEncryption", + "ZonesSchemasOriginErrorPagePassThru", + "ZonesSchemasPolish", "ZonesReplaceInsecureJS", + "ZonesSchemasResponseBuffering", + "ZonesSchemasRocketLoader", "ZonesSchemasAutomaticPlatformOptimization", + "ZonesSchemasSecurityLevel", + "ZonesSchemasServerSideExclude", "ZonesSha1Support", + "ZonesSchemasSortQueryStringForCache", + "ZonesSchemasSSL", "ZonesTLS1_2Only", + "ZonesSchemasTrueClientIPHeader", + "ZonesSchemasWAF", ] +class ZonesSchemasAlwaysUseHTTPS(BaseModel): + id: Literal["always_use_https"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasAutomaticHTTPSRewrites(BaseModel): + id: Literal["automatic_https_rewrites"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasBrowserCacheTTL(BaseModel): + id: Literal["browser_cache_ttl"] + """ID of the zone setting.""" + + value: Literal[ + 0, + 30, + 60, + 120, + 300, + 1200, + 1800, + 3600, + 7200, + 10800, + 14400, + 18000, + 28800, + 43200, + 57600, + 72000, + 86400, + 172800, + 259200, + 345600, + 432000, + 691200, + 1382400, + 2073600, + 2678400, + 5356800, + 16070400, + 31536000, + ] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasBrowserCheck(BaseModel): + id: Literal["browser_check"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasCacheLevel(BaseModel): + id: Literal["cache_level"] + """ID of the zone setting.""" + + value: Literal["aggressive", "basic", "simplified"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesCNAMEFlattening(BaseModel): id: Literal["cname_flattening"] """How to flatten the cname destination.""" @@ -82,7 +196,31 @@ class ZonesCNAMEFlattening(BaseModel): """last time this setting was modified.""" -class ZonesEdgeCacheTTL(BaseModel): +class ZonesSchemasDevelopmentMode(BaseModel): + id: Literal["development_mode"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + time_remaining: Optional[float] = None + """ + Value of the zone setting. Notes: The interval (in seconds) from when + development mode expires (positive integer) or last expired (negative integer) + for the domain. If development mode has never been enabled, this value is false. + """ + + +class ZonesSchemasEdgeCacheTTL(BaseModel): id: Literal["edge_cache_ttl"] """ID of the zone setting.""" @@ -121,6 +259,57 @@ class ZonesEdgeCacheTTL(BaseModel): """last time this setting was modified.""" +class ZonesSchemasEmailObfuscation(BaseModel): + id: Literal["email_obfuscation"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasHotlinkProtection(BaseModel): + id: Literal["hotlink_protection"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasIPGeolocation(BaseModel): + id: Literal["ip_geolocation"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesMaxUpload(BaseModel): id: Literal["max_upload"] """identifier of the zone setting.""" @@ -138,6 +327,74 @@ class ZonesMaxUpload(BaseModel): """last time this setting was modified.""" +class ZonesSchemasMirage(BaseModel): + id: Literal["mirage"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasOpportunisticEncryption(BaseModel): + id: Literal["opportunistic_encryption"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasOriginErrorPagePassThru(BaseModel): + id: Literal["origin_error_page_pass_thru"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasPolish(BaseModel): + id: Literal["polish"] + """ID of the zone setting.""" + + value: Literal["off", "lossless", "lossy"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesReplaceInsecureJS(BaseModel): id: Literal["replace_insecure_js"] """ID of the zone setting.""" @@ -155,6 +412,40 @@ class ZonesReplaceInsecureJS(BaseModel): """last time this setting was modified.""" +class ZonesSchemasResponseBuffering(BaseModel): + id: Literal["response_buffering"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasRocketLoader(BaseModel): + id: Literal["rocket_loader"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesSchemasAutomaticPlatformOptimization(BaseModel): id: Literal["automatic_platform_optimization"] """ID of the zone setting.""" @@ -172,6 +463,40 @@ class ZonesSchemasAutomaticPlatformOptimization(BaseModel): """last time this setting was modified.""" +class ZonesSchemasSecurityLevel(BaseModel): + id: Literal["security_level"] + """ID of the zone setting.""" + + value: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasServerSideExclude(BaseModel): + id: Literal["server_side_exclude"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesSha1Support(BaseModel): id: Literal["sha1_support"] """Zone setting identifier.""" @@ -189,6 +514,40 @@ class ZonesSha1Support(BaseModel): """last time this setting was modified.""" +class ZonesSchemasSortQueryStringForCache(BaseModel): + id: Literal["sort_query_string_for_cache"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasSSL(BaseModel): + id: Literal["ssl"] + """ID of the zone setting.""" + + value: Literal["off", "flexible", "full", "strict"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesTLS1_2Only(BaseModel): id: Literal["tls_1_2_only"] """Zone setting identifier.""" @@ -206,58 +565,92 @@ class ZonesTLS1_2Only(BaseModel): """last time this setting was modified.""" +class ZonesSchemasTrueClientIPHeader(BaseModel): + id: Literal["true_client_ip_header"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasWAF(BaseModel): + id: Literal["waf"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + SettingEditResponse: TypeAlias = Union[ ZeroRTT, AdvancedDDoS, AlwaysOnline, - AlwaysUseHTTPS, - AutomaticHTTPSRewrites, + ZonesSchemasAlwaysUseHTTPS, + ZonesSchemasAutomaticHTTPSRewrites, Brotli, - BrowserCacheTTL, - BrowserCheck, - CacheLevel, + ZonesSchemasBrowserCacheTTL, + ZonesSchemasBrowserCheck, + ZonesSchemasCacheLevel, ChallengeTTL, Ciphers, ZonesCNAMEFlattening, - DevelopmentMode, + ZonesSchemasDevelopmentMode, EarlyHints, - ZonesEdgeCacheTTL, - EmailObfuscation, + ZonesSchemasEdgeCacheTTL, + ZonesSchemasEmailObfuscation, H2Prioritization, - HotlinkProtection, + ZonesSchemasHotlinkProtection, HTTP2, HTTP3, ImageResizing, - IPGeolocation, + ZonesSchemasIPGeolocation, IPV6, ZonesMaxUpload, MinTLSVersion, - Mirage, + ZonesSchemasMirage, NEL, - OpportunisticEncryption, + ZonesSchemasOpportunisticEncryption, OpportunisticOnion, OrangeToOrange, - OriginErrorPagePassThru, - Polish, + ZonesSchemasOriginErrorPagePassThru, + ZonesSchemasPolish, PrefetchPreload, ProxyReadTimeout, PseudoIPV4, ZonesReplaceInsecureJS, - ResponseBuffering, - RocketLoader, + ZonesSchemasResponseBuffering, + ZonesSchemasRocketLoader, ZonesSchemasAutomaticPlatformOptimization, SecurityHeaders, - SecurityLevel, - ServerSideExcludes, + ZonesSchemasSecurityLevel, + ZonesSchemasServerSideExclude, ZonesSha1Support, - SortQueryStringForCache, - SSL, + ZonesSchemasSortQueryStringForCache, + ZonesSchemasSSL, SSLRecommender, ZonesTLS1_2Only, TLS1_3, TLSClientAuth, - TrueClientIPHeader, - WAF, + ZonesSchemasTrueClientIPHeader, + ZonesSchemasWAF, WebP, Websocket, ] diff --git a/src/cloudflare/types/zones/setting_get_response.py b/src/cloudflare/types/zones/setting_get_response.py index f7550d15ce9..b6f4930c618 100644 --- a/src/cloudflare/types/zones/setting_get_response.py +++ b/src/cloudflare/types/zones/setting_get_response.py @@ -5,66 +5,180 @@ from typing_extensions import Literal, TypeAlias from .nel import NEL -from .ssl import SSL -from .waf import WAF from .ipv6 import IPV6 from .webp import WebP from .http2 import HTTP2 from .http3 import HTTP3 from .brotli import Brotli -from .mirage import Mirage -from .polish import Polish from .ciphers import Ciphers from .tls_1_3 import TLS1_3 from .zero_rtt import ZeroRTT from ..._models import BaseModel from .websocket import Websocket -from .cache_level import CacheLevel from .early_hints import EarlyHints from .pseudo_ipv4 import PseudoIPV4 from .advanced_ddos import AdvancedDDoS from .always_online import AlwaysOnline -from .browser_check import BrowserCheck from .challenge_ttl import ChallengeTTL -from .rocket_loader import RocketLoader from .image_resizing import ImageResizing -from .ip_geolocation import IPGeolocation -from .security_level import SecurityLevel from .min_tls_version import MinTLSVersion from .ssl_recommender import SSLRecommender from .tls_client_auth import TLSClientAuth -from .always_use_https import AlwaysUseHTTPS -from .development_mode import DevelopmentMode from .orange_to_orange import OrangeToOrange from .prefetch_preload import PrefetchPreload from .security_headers import SecurityHeaders -from .browser_cache_ttl import BrowserCacheTTL -from .email_obfuscation import EmailObfuscation from .h2_prioritization import H2Prioritization -from .hotlink_protection import HotlinkProtection from .proxy_read_timeout import ProxyReadTimeout -from .response_buffering import ResponseBuffering from .opportunistic_onion import OpportunisticOnion -from .server_side_excludes import ServerSideExcludes -from .true_client_ip_header import TrueClientIPHeader -from .automatic_https_rewrites import AutomaticHTTPSRewrites -from .opportunistic_encryption import OpportunisticEncryption -from .origin_error_page_pass_thru import OriginErrorPagePassThru -from .sort_query_string_for_cache import SortQueryStringForCache from .automatic_platform_optimization import AutomaticPlatformOptimization __all__ = [ "SettingGetResponse", + "ZonesSchemasAlwaysUseHTTPS", + "ZonesSchemasAutomaticHTTPSRewrites", + "ZonesSchemasBrowserCacheTTL", + "ZonesSchemasBrowserCheck", + "ZonesSchemasCacheLevel", "ZonesCNAMEFlattening", - "ZonesEdgeCacheTTL", + "ZonesSchemasDevelopmentMode", + "ZonesSchemasEdgeCacheTTL", + "ZonesSchemasEmailObfuscation", + "ZonesSchemasHotlinkProtection", + "ZonesSchemasIPGeolocation", "ZonesMaxUpload", + "ZonesSchemasMirage", + "ZonesSchemasOpportunisticEncryption", + "ZonesSchemasOriginErrorPagePassThru", + "ZonesSchemasPolish", "ZonesReplaceInsecureJS", + "ZonesSchemasResponseBuffering", + "ZonesSchemasRocketLoader", "ZonesSchemasAutomaticPlatformOptimization", + "ZonesSchemasSecurityLevel", + "ZonesSchemasServerSideExclude", "ZonesSha1Support", + "ZonesSchemasSortQueryStringForCache", + "ZonesSchemasSSL", "ZonesTLS1_2Only", + "ZonesSchemasTrueClientIPHeader", + "ZonesSchemasWAF", ] +class ZonesSchemasAlwaysUseHTTPS(BaseModel): + id: Literal["always_use_https"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasAutomaticHTTPSRewrites(BaseModel): + id: Literal["automatic_https_rewrites"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasBrowserCacheTTL(BaseModel): + id: Literal["browser_cache_ttl"] + """ID of the zone setting.""" + + value: Literal[ + 0, + 30, + 60, + 120, + 300, + 1200, + 1800, + 3600, + 7200, + 10800, + 14400, + 18000, + 28800, + 43200, + 57600, + 72000, + 86400, + 172800, + 259200, + 345600, + 432000, + 691200, + 1382400, + 2073600, + 2678400, + 5356800, + 16070400, + 31536000, + ] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasBrowserCheck(BaseModel): + id: Literal["browser_check"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasCacheLevel(BaseModel): + id: Literal["cache_level"] + """ID of the zone setting.""" + + value: Literal["aggressive", "basic", "simplified"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesCNAMEFlattening(BaseModel): id: Literal["cname_flattening"] """How to flatten the cname destination.""" @@ -82,7 +196,31 @@ class ZonesCNAMEFlattening(BaseModel): """last time this setting was modified.""" -class ZonesEdgeCacheTTL(BaseModel): +class ZonesSchemasDevelopmentMode(BaseModel): + id: Literal["development_mode"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + time_remaining: Optional[float] = None + """ + Value of the zone setting. Notes: The interval (in seconds) from when + development mode expires (positive integer) or last expired (negative integer) + for the domain. If development mode has never been enabled, this value is false. + """ + + +class ZonesSchemasEdgeCacheTTL(BaseModel): id: Literal["edge_cache_ttl"] """ID of the zone setting.""" @@ -121,6 +259,57 @@ class ZonesEdgeCacheTTL(BaseModel): """last time this setting was modified.""" +class ZonesSchemasEmailObfuscation(BaseModel): + id: Literal["email_obfuscation"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasHotlinkProtection(BaseModel): + id: Literal["hotlink_protection"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasIPGeolocation(BaseModel): + id: Literal["ip_geolocation"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesMaxUpload(BaseModel): id: Literal["max_upload"] """identifier of the zone setting.""" @@ -138,6 +327,74 @@ class ZonesMaxUpload(BaseModel): """last time this setting was modified.""" +class ZonesSchemasMirage(BaseModel): + id: Literal["mirage"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasOpportunisticEncryption(BaseModel): + id: Literal["opportunistic_encryption"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasOriginErrorPagePassThru(BaseModel): + id: Literal["origin_error_page_pass_thru"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasPolish(BaseModel): + id: Literal["polish"] + """ID of the zone setting.""" + + value: Literal["off", "lossless", "lossy"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesReplaceInsecureJS(BaseModel): id: Literal["replace_insecure_js"] """ID of the zone setting.""" @@ -155,6 +412,40 @@ class ZonesReplaceInsecureJS(BaseModel): """last time this setting was modified.""" +class ZonesSchemasResponseBuffering(BaseModel): + id: Literal["response_buffering"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasRocketLoader(BaseModel): + id: Literal["rocket_loader"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesSchemasAutomaticPlatformOptimization(BaseModel): id: Literal["automatic_platform_optimization"] """ID of the zone setting.""" @@ -172,6 +463,40 @@ class ZonesSchemasAutomaticPlatformOptimization(BaseModel): """last time this setting was modified.""" +class ZonesSchemasSecurityLevel(BaseModel): + id: Literal["security_level"] + """ID of the zone setting.""" + + value: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasServerSideExclude(BaseModel): + id: Literal["server_side_exclude"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesSha1Support(BaseModel): id: Literal["sha1_support"] """Zone setting identifier.""" @@ -189,6 +514,40 @@ class ZonesSha1Support(BaseModel): """last time this setting was modified.""" +class ZonesSchemasSortQueryStringForCache(BaseModel): + id: Literal["sort_query_string_for_cache"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasSSL(BaseModel): + id: Literal["ssl"] + """ID of the zone setting.""" + + value: Literal["off", "flexible", "full", "strict"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesTLS1_2Only(BaseModel): id: Literal["tls_1_2_only"] """Zone setting identifier.""" @@ -206,58 +565,92 @@ class ZonesTLS1_2Only(BaseModel): """last time this setting was modified.""" +class ZonesSchemasTrueClientIPHeader(BaseModel): + id: Literal["true_client_ip_header"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + +class ZonesSchemasWAF(BaseModel): + id: Literal["waf"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + SettingGetResponse: TypeAlias = Union[ ZeroRTT, AdvancedDDoS, AlwaysOnline, - AlwaysUseHTTPS, - AutomaticHTTPSRewrites, + ZonesSchemasAlwaysUseHTTPS, + ZonesSchemasAutomaticHTTPSRewrites, Brotli, - BrowserCacheTTL, - BrowserCheck, - CacheLevel, + ZonesSchemasBrowserCacheTTL, + ZonesSchemasBrowserCheck, + ZonesSchemasCacheLevel, ChallengeTTL, Ciphers, ZonesCNAMEFlattening, - DevelopmentMode, + ZonesSchemasDevelopmentMode, EarlyHints, - ZonesEdgeCacheTTL, - EmailObfuscation, + ZonesSchemasEdgeCacheTTL, + ZonesSchemasEmailObfuscation, H2Prioritization, - HotlinkProtection, + ZonesSchemasHotlinkProtection, HTTP2, HTTP3, ImageResizing, - IPGeolocation, + ZonesSchemasIPGeolocation, IPV6, ZonesMaxUpload, MinTLSVersion, - Mirage, + ZonesSchemasMirage, NEL, - OpportunisticEncryption, + ZonesSchemasOpportunisticEncryption, OpportunisticOnion, OrangeToOrange, - OriginErrorPagePassThru, - Polish, + ZonesSchemasOriginErrorPagePassThru, + ZonesSchemasPolish, PrefetchPreload, ProxyReadTimeout, PseudoIPV4, ZonesReplaceInsecureJS, - ResponseBuffering, - RocketLoader, + ZonesSchemasResponseBuffering, + ZonesSchemasRocketLoader, ZonesSchemasAutomaticPlatformOptimization, SecurityHeaders, - SecurityLevel, - ServerSideExcludes, + ZonesSchemasSecurityLevel, + ZonesSchemasServerSideExclude, ZonesSha1Support, - SortQueryStringForCache, - SSL, + ZonesSchemasSortQueryStringForCache, + ZonesSchemasSSL, SSLRecommender, ZonesTLS1_2Only, TLS1_3, TLSClientAuth, - TrueClientIPHeader, - WAF, + ZonesSchemasTrueClientIPHeader, + ZonesSchemasWAF, WebP, Websocket, ] diff --git a/src/cloudflare/types/zones/sort_query_string_for_cache.py b/src/cloudflare/types/zones/sort_query_string_for_cache.py index ca2fea8aaac..859d57fdc89 100644 --- a/src/cloudflare/types/zones/sort_query_string_for_cache.py +++ b/src/cloudflare/types/zones/sort_query_string_for_cache.py @@ -1,26 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["SortQueryStringForCache"] +__all__ = ["SortQueryStringForCache", "Value"] -class SortQueryStringForCache(BaseModel): - id: Literal["sort_query_string_for_cache"] - """ID of the zone setting.""" +class Value(BaseModel): + value: Optional[Literal["on", "off"]] = None + """The status of Query String Sort""" - value: Literal["on", "off"] - """Current value of the zone setting.""" - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). +class SortQueryStringForCache(BaseModel): + id: Optional[Literal["sort_query_string_for_cache"]] = None + """Turn on or off the reordering of query strings. + + When query strings have the same structure, caching improves. """ - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Value] = None diff --git a/src/cloudflare/types/zones/sort_query_string_for_cache_param.py b/src/cloudflare/types/zones/sort_query_string_for_cache_param.py new file mode 100644 index 00000000000..e859871e639 --- /dev/null +++ b/src/cloudflare/types/zones/sort_query_string_for_cache_param.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["SortQueryStringForCacheParam", "Value"] + + +class Value(TypedDict, total=False): + value: Literal["on", "off"] + """The status of Query String Sort""" + + +class SortQueryStringForCacheParam(TypedDict, total=False): + id: Literal["sort_query_string_for_cache"] + """Turn on or off the reordering of query strings. + + When query strings have the same structure, caching improves. + """ + + value: Value diff --git a/src/cloudflare/types/zones/ssl.py b/src/cloudflare/types/zones/ssl.py index 720c4eaa01b..61fbed293d0 100644 --- a/src/cloudflare/types/zones/ssl.py +++ b/src/cloudflare/types/zones/ssl.py @@ -1,26 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["SSL"] +__all__ = ["SSL", "Value"] -class SSL(BaseModel): - id: Literal["ssl"] - """ID of the zone setting.""" +class Value(BaseModel): + value: Optional[Literal["off", "flexible", "full", "strict", "origin_pull"]] = None + """The encryption mode that Cloudflare uses to connect to your origin server.""" - value: Literal["off", "flexible", "full", "strict"] - """Current value of the zone setting.""" - editable: Optional[Literal[True, False]] = None +class SSL(BaseModel): + id: Optional[Literal["ssl"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + Control options for the SSL feature of the Edge Certificates tab in the + Cloudflare SSL/TLS app. """ - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Value] = None diff --git a/src/cloudflare/types/zones/ssl_param.py b/src/cloudflare/types/zones/ssl_param.py new file mode 100644 index 00000000000..41455617b98 --- /dev/null +++ b/src/cloudflare/types/zones/ssl_param.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["SSLParam", "Value"] + + +class Value(TypedDict, total=False): + value: Literal["off", "flexible", "full", "strict", "origin_pull"] + """The encryption mode that Cloudflare uses to connect to your origin server.""" + + +class SSLParam(TypedDict, total=False): + id: Literal["ssl"] + """ + Control options for the SSL feature of the Edge Certificates tab in the + Cloudflare SSL/TLS app. + """ + + value: Value diff --git a/src/cloudflare/types/zones/true_client_ip_header.py b/src/cloudflare/types/zones/true_client_ip_header.py index c81c57535bf..203b23235c7 100644 --- a/src/cloudflare/types/zones/true_client_ip_header.py +++ b/src/cloudflare/types/zones/true_client_ip_header.py @@ -1,26 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["TrueClientIPHeader"] +__all__ = ["TrueClientIPHeader", "Value"] -class TrueClientIPHeader(BaseModel): - id: Literal["true_client_ip_header"] - """ID of the zone setting.""" +class Value(BaseModel): + value: Optional[Literal["on", "off"]] = None + """The status of True Client IP Header.""" - value: Literal["on", "off"] - """Current value of the zone setting.""" - editable: Optional[Literal[True, False]] = None - """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). - """ +class TrueClientIPHeader(BaseModel): + id: Optional[Literal["true_client_ip_header"]] = None + """Turn on or off the True-Client-IP Header feature of the Cloudflare Network app.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Value] = None diff --git a/src/cloudflare/types/zones/true_client_ip_header_param.py b/src/cloudflare/types/zones/true_client_ip_header_param.py new file mode 100644 index 00000000000..e7508a5b53a --- /dev/null +++ b/src/cloudflare/types/zones/true_client_ip_header_param.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["TrueClientIPHeaderParam", "Value"] + + +class Value(TypedDict, total=False): + value: Literal["on", "off"] + """The status of True Client IP Header.""" + + +class TrueClientIPHeaderParam(TypedDict, total=False): + id: Literal["true_client_ip_header"] + """Turn on or off the True-Client-IP Header feature of the Cloudflare Network app.""" + + value: Value diff --git a/src/cloudflare/types/zones/waf.py b/src/cloudflare/types/zones/waf.py index d5f4c0d363d..898cbdfee90 100644 --- a/src/cloudflare/types/zones/waf.py +++ b/src/cloudflare/types/zones/waf.py @@ -1,26 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["WAF"] +__all__ = ["WAF", "Value"] -class WAF(BaseModel): - id: Literal["waf"] - """ID of the zone setting.""" +class Value(BaseModel): + value: Optional[Literal["on", "off"]] = None + """The status of WAF managed rules (previous version).""" - value: Literal["on", "off"] - """Current value of the zone setting.""" - editable: Optional[Literal[True, False]] = None +class WAF(BaseModel): + id: Optional[Literal["waf"]] = None """ - Whether or not this setting can be modified for this zone (based on your - Cloudflare plan level). + Turn on or off + [WAF managed rules (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-waf-managed-rules/). + You cannot enable or disable individual WAF managed rules via Page Rules. """ - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + value: Optional[Value] = None diff --git a/src/cloudflare/types/zones/waf_param.py b/src/cloudflare/types/zones/waf_param.py new file mode 100644 index 00000000000..8cefb453562 --- /dev/null +++ b/src/cloudflare/types/zones/waf_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["WAFParam", "Value"] + + +class Value(TypedDict, total=False): + value: Literal["on", "off"] + """The status of WAF managed rules (previous version).""" + + +class WAFParam(TypedDict, total=False): + id: Literal["waf"] + """ + Turn on or off + [WAF managed rules (previous version, deprecated)](https://developers.cloudflare.com/waf/reference/legacy/old-waf-managed-rules/). + You cannot enable or disable individual WAF managed rules via Page Rules. + """ + + value: Value diff --git a/tests/api_resources/test_pagerules.py b/tests/api_resources/test_pagerules.py index 7759cea316d..15c52b336a1 100644 --- a/tests/api_resources/test_pagerules.py +++ b/tests/api_resources/test_pagerules.py @@ -49,11 +49,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[ { - "id": "forwarding_url", - "value": { - "status_code": 301, - "url": "http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3", - }, + "id": "browser_check", + "value": "on", } ], targets=[ @@ -163,11 +160,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[ { - "id": "forwarding_url", - "value": { - "status_code": 301, - "url": "http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3", - }, + "id": "browser_check", + "value": "on", } ], targets=[ @@ -395,11 +389,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[ { - "id": "forwarding_url", - "value": { - "status_code": 301, - "url": "http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3", - }, + "id": "browser_check", + "value": "on", } ], priority=0, @@ -543,11 +534,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[ { - "id": "forwarding_url", - "value": { - "status_code": 301, - "url": "http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3", - }, + "id": "browser_check", + "value": "on", } ], targets=[ @@ -657,11 +645,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[ { - "id": "forwarding_url", - "value": { - "status_code": 301, - "url": "http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3", - }, + "id": "browser_check", + "value": "on", } ], targets=[ @@ -889,11 +874,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[ { - "id": "forwarding_url", - "value": { - "status_code": 301, - "url": "http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3", - }, + "id": "browser_check", + "value": "on", } ], priority=0,