mirror of
https://github.com/cloudflare/cloudflare-python.git
synced 2026-01-16 23:01:03 +00:00
feat(api): OpenAPI spec update via Stainless API (#1145)
This commit is contained in:
parent
ea3c6dc3a3
commit
c4f5a69ca8
161 changed files with 7 additions and 26341 deletions
|
|
@ -1,2 +1,2 @@
|
|||
configured_endpoints: 1353
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cd837fea75977564d3cf39f8e1799785f77785a6fcc538d9c2471156a6d309b1.yml
|
||||
configured_endpoints: 1256
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dbe283789a3023e23b1cae66d3cd8f4bdde2422ce3e8d3f88c42bf8a0791e622.yml
|
||||
|
|
|
|||
244
api.md
244
api.md
|
|
@ -315,11 +315,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import ZeroRTT
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/0rtt">client.zones.settings.zero_rtt.<a href="./src/cloudflare/resources/zones/settings/zero_rtt.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/zero_rtt_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/zero_rtt.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/0rtt">client.zones.settings.zero_rtt.<a href="./src/cloudflare/resources/zones/settings/zero_rtt.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/zero_rtt.py">Optional</a></code>
|
||||
|
||||
### AdvancedDDoS
|
||||
|
||||
Types:
|
||||
|
|
@ -328,10 +323,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import AdvancedDDoS
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="get /zones/{zone_id}/settings/advanced_ddos">client.zones.settings.advanced_ddos.<a href="./src/cloudflare/resources/zones/settings/advanced_ddos.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/advanced_ddos.py">Optional</a></code>
|
||||
|
||||
### AlwaysOnline
|
||||
|
||||
Types:
|
||||
|
|
@ -340,11 +331,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import AlwaysOnline
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/always_online">client.zones.settings.always_online.<a href="./src/cloudflare/resources/zones/settings/always_online.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/always_online_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/always_online.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/always_online">client.zones.settings.always_online.<a href="./src/cloudflare/resources/zones/settings/always_online.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/always_online.py">Optional</a></code>
|
||||
|
||||
### AlwaysUseHTTPS
|
||||
|
||||
Types:
|
||||
|
|
@ -353,11 +339,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import AlwaysUseHTTPS
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/always_use_https">client.zones.settings.always_use_https.<a href="./src/cloudflare/resources/zones/settings/always_use_https.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/always_use_https_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/always_use_https.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/always_use_https">client.zones.settings.always_use_https.<a href="./src/cloudflare/resources/zones/settings/always_use_https.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/always_use_https.py">Optional</a></code>
|
||||
|
||||
### AutomaticHTTPSRewrites
|
||||
|
||||
Types:
|
||||
|
|
@ -366,11 +347,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import AutomaticHTTPSRewrites
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/automatic_https_rewrites">client.zones.settings.automatic_https_rewrites.<a href="./src/cloudflare/resources/zones/settings/automatic_https_rewrites.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/automatic_https_rewrite_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/automatic_https_rewrites.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/automatic_https_rewrites">client.zones.settings.automatic_https_rewrites.<a href="./src/cloudflare/resources/zones/settings/automatic_https_rewrites.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/automatic_https_rewrites.py">Optional</a></code>
|
||||
|
||||
### AutomaticPlatformOptimization
|
||||
|
||||
Types:
|
||||
|
|
@ -379,11 +355,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import AutomaticPlatformOptimization
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/automatic_platform_optimization">client.zones.settings.automatic_platform_optimization.<a href="./src/cloudflare/resources/zones/settings/automatic_platform_optimization.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/automatic_platform_optimization_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/automatic_platform_optimization.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/automatic_platform_optimization">client.zones.settings.automatic_platform_optimization.<a href="./src/cloudflare/resources/zones/settings/automatic_platform_optimization.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/automatic_platform_optimization.py">Optional</a></code>
|
||||
|
||||
### Brotli
|
||||
|
||||
Types:
|
||||
|
|
@ -392,11 +363,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import Brotli
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/brotli">client.zones.settings.brotli.<a href="./src/cloudflare/resources/zones/settings/brotli.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/brotli_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/brotli.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/brotli">client.zones.settings.brotli.<a href="./src/cloudflare/resources/zones/settings/brotli.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/brotli.py">Optional</a></code>
|
||||
|
||||
### BrowserCacheTTL
|
||||
|
||||
Types:
|
||||
|
|
@ -405,11 +371,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import BrowserCacheTTL
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/browser_cache_ttl">client.zones.settings.browser_cache_ttl.<a href="./src/cloudflare/resources/zones/settings/browser_cache_ttl.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/browser_cache_ttl_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/browser_cache_ttl.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/browser_cache_ttl">client.zones.settings.browser_cache_ttl.<a href="./src/cloudflare/resources/zones/settings/browser_cache_ttl.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/browser_cache_ttl.py">Optional</a></code>
|
||||
|
||||
### BrowserCheck
|
||||
|
||||
Types:
|
||||
|
|
@ -418,11 +379,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import BrowserCheck
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/browser_check">client.zones.settings.browser_check.<a href="./src/cloudflare/resources/zones/settings/browser_check.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/browser_check_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/browser_check.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/browser_check">client.zones.settings.browser_check.<a href="./src/cloudflare/resources/zones/settings/browser_check.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/browser_check.py">Optional</a></code>
|
||||
|
||||
### CacheLevel
|
||||
|
||||
Types:
|
||||
|
|
@ -431,11 +387,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import CacheLevel
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/cache_level">client.zones.settings.cache_level.<a href="./src/cloudflare/resources/zones/settings/cache_level.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/cache_level_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/cache_level.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/cache_level">client.zones.settings.cache_level.<a href="./src/cloudflare/resources/zones/settings/cache_level.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/cache_level.py">Optional</a></code>
|
||||
|
||||
### ChallengeTTL
|
||||
|
||||
Types:
|
||||
|
|
@ -444,11 +395,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import ChallengeTTL
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/challenge_ttl">client.zones.settings.challenge_ttl.<a href="./src/cloudflare/resources/zones/settings/challenge_ttl.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/challenge_ttl_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/challenge_ttl.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/challenge_ttl">client.zones.settings.challenge_ttl.<a href="./src/cloudflare/resources/zones/settings/challenge_ttl.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/challenge_ttl.py">Optional</a></code>
|
||||
|
||||
### Ciphers
|
||||
|
||||
Types:
|
||||
|
|
@ -457,11 +403,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import Ciphers
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/ciphers">client.zones.settings.ciphers.<a href="./src/cloudflare/resources/zones/settings/ciphers.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/cipher_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/ciphers.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/ciphers">client.zones.settings.ciphers.<a href="./src/cloudflare/resources/zones/settings/ciphers.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/ciphers.py">Optional</a></code>
|
||||
|
||||
### DevelopmentMode
|
||||
|
||||
Types:
|
||||
|
|
@ -470,11 +411,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import DevelopmentMode
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/development_mode">client.zones.settings.development_mode.<a href="./src/cloudflare/resources/zones/settings/development_mode.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/development_mode_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/development_mode.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/development_mode">client.zones.settings.development_mode.<a href="./src/cloudflare/resources/zones/settings/development_mode.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/development_mode.py">Optional</a></code>
|
||||
|
||||
### EarlyHints
|
||||
|
||||
Types:
|
||||
|
|
@ -483,11 +419,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import EarlyHints
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/early_hints">client.zones.settings.early_hints.<a href="./src/cloudflare/resources/zones/settings/early_hints.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/early_hint_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/early_hints.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/early_hints">client.zones.settings.early_hints.<a href="./src/cloudflare/resources/zones/settings/early_hints.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/early_hints.py">Optional</a></code>
|
||||
|
||||
### EmailObfuscation
|
||||
|
||||
Types:
|
||||
|
|
@ -496,11 +427,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import EmailObfuscation
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/email_obfuscation">client.zones.settings.email_obfuscation.<a href="./src/cloudflare/resources/zones/settings/email_obfuscation.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/email_obfuscation_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/email_obfuscation.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/email_obfuscation">client.zones.settings.email_obfuscation.<a href="./src/cloudflare/resources/zones/settings/email_obfuscation.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/email_obfuscation.py">Optional</a></code>
|
||||
|
||||
### H2Prioritization
|
||||
|
||||
Types:
|
||||
|
|
@ -509,11 +435,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import H2Prioritization
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/h2_prioritization">client.zones.settings.h2_prioritization.<a href="./src/cloudflare/resources/zones/settings/h2_prioritization.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/h2_prioritization_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/h2_prioritization.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/h2_prioritization">client.zones.settings.h2_prioritization.<a href="./src/cloudflare/resources/zones/settings/h2_prioritization.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/h2_prioritization.py">Optional</a></code>
|
||||
|
||||
### HotlinkProtection
|
||||
|
||||
Types:
|
||||
|
|
@ -522,11 +443,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import HotlinkProtection
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/hotlink_protection">client.zones.settings.hotlink_protection.<a href="./src/cloudflare/resources/zones/settings/hotlink_protection.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/hotlink_protection_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/hotlink_protection.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/hotlink_protection">client.zones.settings.hotlink_protection.<a href="./src/cloudflare/resources/zones/settings/hotlink_protection.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/hotlink_protection.py">Optional</a></code>
|
||||
|
||||
### HTTP2
|
||||
|
||||
Types:
|
||||
|
|
@ -535,11 +451,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import HTTP2
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/http2">client.zones.settings.http2.<a href="./src/cloudflare/resources/zones/settings/http2.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/http2_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/http2.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/http2">client.zones.settings.http2.<a href="./src/cloudflare/resources/zones/settings/http2.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/http2.py">Optional</a></code>
|
||||
|
||||
### HTTP3
|
||||
|
||||
Types:
|
||||
|
|
@ -548,11 +459,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import HTTP3
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/http3">client.zones.settings.http3.<a href="./src/cloudflare/resources/zones/settings/http3.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/http3_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/http3.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/http3">client.zones.settings.http3.<a href="./src/cloudflare/resources/zones/settings/http3.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/http3.py">Optional</a></code>
|
||||
|
||||
### ImageResizing
|
||||
|
||||
Types:
|
||||
|
|
@ -561,11 +467,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import ImageResizing
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/image_resizing">client.zones.settings.image_resizing.<a href="./src/cloudflare/resources/zones/settings/image_resizing.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/image_resizing_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/image_resizing.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/image_resizing">client.zones.settings.image_resizing.<a href="./src/cloudflare/resources/zones/settings/image_resizing.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/image_resizing.py">Optional</a></code>
|
||||
|
||||
### IPGeolocation
|
||||
|
||||
Types:
|
||||
|
|
@ -574,11 +475,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import IPGeolocation
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/ip_geolocation">client.zones.settings.ip_geolocation.<a href="./src/cloudflare/resources/zones/settings/ip_geolocation.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/ip_geolocation_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/ip_geolocation.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/ip_geolocation">client.zones.settings.ip_geolocation.<a href="./src/cloudflare/resources/zones/settings/ip_geolocation.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/ip_geolocation.py">Optional</a></code>
|
||||
|
||||
### IPV6
|
||||
|
||||
Types:
|
||||
|
|
@ -587,11 +483,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import IPV6
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/ipv6">client.zones.settings.ipv6.<a href="./src/cloudflare/resources/zones/settings/ipv6.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/ipv6_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/ipv6.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/ipv6">client.zones.settings.ipv6.<a href="./src/cloudflare/resources/zones/settings/ipv6.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/ipv6.py">Optional</a></code>
|
||||
|
||||
### MinTLSVersion
|
||||
|
||||
Types:
|
||||
|
|
@ -600,11 +491,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import MinTLSVersion
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/min_tls_version">client.zones.settings.min_tls_version.<a href="./src/cloudflare/resources/zones/settings/min_tls_version.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/min_tls_version_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/min_tls_version.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/min_tls_version">client.zones.settings.min_tls_version.<a href="./src/cloudflare/resources/zones/settings/min_tls_version.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/min_tls_version.py">Optional</a></code>
|
||||
|
||||
### Minify
|
||||
|
||||
Types:
|
||||
|
|
@ -613,11 +499,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import Minify
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/minify">client.zones.settings.minify.<a href="./src/cloudflare/resources/zones/settings/minify.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/minify_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/minify.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/minify">client.zones.settings.minify.<a href="./src/cloudflare/resources/zones/settings/minify.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/minify.py">Optional</a></code>
|
||||
|
||||
### Mirage
|
||||
|
||||
Types:
|
||||
|
|
@ -626,11 +507,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import Mirage
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/mirage">client.zones.settings.mirage.<a href="./src/cloudflare/resources/zones/settings/mirage.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/mirage_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/mirage.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/mirage">client.zones.settings.mirage.<a href="./src/cloudflare/resources/zones/settings/mirage.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/mirage.py">Optional</a></code>
|
||||
|
||||
### MobileRedirect
|
||||
|
||||
Types:
|
||||
|
|
@ -639,11 +515,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import MobileRedirect
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/mobile_redirect">client.zones.settings.mobile_redirect.<a href="./src/cloudflare/resources/zones/settings/mobile_redirect.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/mobile_redirect_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/mobile_redirect.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/mobile_redirect">client.zones.settings.mobile_redirect.<a href="./src/cloudflare/resources/zones/settings/mobile_redirect.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/mobile_redirect.py">Optional</a></code>
|
||||
|
||||
### NEL
|
||||
|
||||
Types:
|
||||
|
|
@ -652,11 +523,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import NEL
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/nel">client.zones.settings.nel.<a href="./src/cloudflare/resources/zones/settings/nel.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/nel_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/nel.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/nel">client.zones.settings.nel.<a href="./src/cloudflare/resources/zones/settings/nel.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/nel.py">Optional</a></code>
|
||||
|
||||
### OpportunisticEncryption
|
||||
|
||||
Types:
|
||||
|
|
@ -665,11 +531,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import OpportunisticEncryption
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/opportunistic_encryption">client.zones.settings.opportunistic_encryption.<a href="./src/cloudflare/resources/zones/settings/opportunistic_encryption.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/opportunistic_encryption_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/opportunistic_encryption.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/opportunistic_encryption">client.zones.settings.opportunistic_encryption.<a href="./src/cloudflare/resources/zones/settings/opportunistic_encryption.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/opportunistic_encryption.py">Optional</a></code>
|
||||
|
||||
### OpportunisticOnion
|
||||
|
||||
Types:
|
||||
|
|
@ -678,11 +539,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import OpportunisticOnion
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/opportunistic_onion">client.zones.settings.opportunistic_onion.<a href="./src/cloudflare/resources/zones/settings/opportunistic_onion.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/opportunistic_onion_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/opportunistic_onion.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/opportunistic_onion">client.zones.settings.opportunistic_onion.<a href="./src/cloudflare/resources/zones/settings/opportunistic_onion.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/opportunistic_onion.py">Optional</a></code>
|
||||
|
||||
### OrangeToOrange
|
||||
|
||||
Types:
|
||||
|
|
@ -691,11 +547,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import OrangeToOrange
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/orange_to_orange">client.zones.settings.orange_to_orange.<a href="./src/cloudflare/resources/zones/settings/orange_to_orange.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/orange_to_orange_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/orange_to_orange.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/orange_to_orange">client.zones.settings.orange_to_orange.<a href="./src/cloudflare/resources/zones/settings/orange_to_orange.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/orange_to_orange.py">Optional</a></code>
|
||||
|
||||
### OriginErrorPagePassThru
|
||||
|
||||
Types:
|
||||
|
|
@ -704,11 +555,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import OriginErrorPagePassThru
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/origin_error_page_pass_thru">client.zones.settings.origin_error_page_pass_thru.<a href="./src/cloudflare/resources/zones/settings/origin_error_page_pass_thru.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/origin_error_page_pass_thru_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/origin_error_page_pass_thru.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/origin_error_page_pass_thru">client.zones.settings.origin_error_page_pass_thru.<a href="./src/cloudflare/resources/zones/settings/origin_error_page_pass_thru.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/origin_error_page_pass_thru.py">Optional</a></code>
|
||||
|
||||
### OriginMaxHTTPVersion
|
||||
|
||||
Types:
|
||||
|
|
@ -734,11 +580,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import Polish
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/polish">client.zones.settings.polish.<a href="./src/cloudflare/resources/zones/settings/polish.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/polish_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/polish.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/polish">client.zones.settings.polish.<a href="./src/cloudflare/resources/zones/settings/polish.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/polish.py">Optional</a></code>
|
||||
|
||||
### PrefetchPreload
|
||||
|
||||
Types:
|
||||
|
|
@ -747,11 +588,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import PrefetchPreload
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/prefetch_preload">client.zones.settings.prefetch_preload.<a href="./src/cloudflare/resources/zones/settings/prefetch_preload.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/prefetch_preload_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/prefetch_preload.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/prefetch_preload">client.zones.settings.prefetch_preload.<a href="./src/cloudflare/resources/zones/settings/prefetch_preload.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/prefetch_preload.py">Optional</a></code>
|
||||
|
||||
### ProxyReadTimeout
|
||||
|
||||
Types:
|
||||
|
|
@ -760,11 +596,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import ProxyReadTimeout
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/proxy_read_timeout">client.zones.settings.proxy_read_timeout.<a href="./src/cloudflare/resources/zones/settings/proxy_read_timeout.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/proxy_read_timeout_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/proxy_read_timeout.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/proxy_read_timeout">client.zones.settings.proxy_read_timeout.<a href="./src/cloudflare/resources/zones/settings/proxy_read_timeout.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/proxy_read_timeout.py">Optional</a></code>
|
||||
|
||||
### PseudoIPV4
|
||||
|
||||
Types:
|
||||
|
|
@ -773,11 +604,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import PseudoIPV4
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/pseudo_ipv4">client.zones.settings.pseudo_ipv4.<a href="./src/cloudflare/resources/zones/settings/pseudo_ipv4.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/pseudo_ipv4_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/pseudo_ipv4.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/pseudo_ipv4">client.zones.settings.pseudo_ipv4.<a href="./src/cloudflare/resources/zones/settings/pseudo_ipv4.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/pseudo_ipv4.py">Optional</a></code>
|
||||
|
||||
### ResponseBuffering
|
||||
|
||||
Types:
|
||||
|
|
@ -786,11 +612,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import ResponseBuffering
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/response_buffering">client.zones.settings.response_buffering.<a href="./src/cloudflare/resources/zones/settings/response_buffering.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/response_buffering_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/response_buffering.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/response_buffering">client.zones.settings.response_buffering.<a href="./src/cloudflare/resources/zones/settings/response_buffering.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/response_buffering.py">Optional</a></code>
|
||||
|
||||
### RocketLoader
|
||||
|
||||
Types:
|
||||
|
|
@ -799,11 +620,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import RocketLoader
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/rocket_loader">client.zones.settings.rocket_loader.<a href="./src/cloudflare/resources/zones/settings/rocket_loader.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/rocket_loader_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/rocket_loader.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/rocket_loader">client.zones.settings.rocket_loader.<a href="./src/cloudflare/resources/zones/settings/rocket_loader.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/rocket_loader.py">Optional</a></code>
|
||||
|
||||
### SecurityHeaders
|
||||
|
||||
Types:
|
||||
|
|
@ -812,11 +628,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import SecurityHeaders
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/security_header">client.zones.settings.security_headers.<a href="./src/cloudflare/resources/zones/settings/security_headers.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/security_header_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/security_headers.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/security_header">client.zones.settings.security_headers.<a href="./src/cloudflare/resources/zones/settings/security_headers.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/security_headers.py">Optional</a></code>
|
||||
|
||||
### SecurityLevel
|
||||
|
||||
Types:
|
||||
|
|
@ -825,11 +636,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import SecurityLevel
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/security_level">client.zones.settings.security_level.<a href="./src/cloudflare/resources/zones/settings/security_level.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/security_level_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/security_level.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/security_level">client.zones.settings.security_level.<a href="./src/cloudflare/resources/zones/settings/security_level.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/security_level.py">Optional</a></code>
|
||||
|
||||
### ServerSideExcludes
|
||||
|
||||
Types:
|
||||
|
|
@ -838,11 +644,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import ServerSideExcludes
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/server_side_exclude">client.zones.settings.server_side_excludes.<a href="./src/cloudflare/resources/zones/settings/server_side_excludes.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/server_side_exclude_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/server_side_excludes.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/server_side_exclude">client.zones.settings.server_side_excludes.<a href="./src/cloudflare/resources/zones/settings/server_side_excludes.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/server_side_excludes.py">Optional</a></code>
|
||||
|
||||
### SortQueryStringForCache
|
||||
|
||||
Types:
|
||||
|
|
@ -851,11 +652,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import SortQueryStringForCache
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/sort_query_string_for_cache">client.zones.settings.sort_query_string_for_cache.<a href="./src/cloudflare/resources/zones/settings/sort_query_string_for_cache.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/sort_query_string_for_cache_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/sort_query_string_for_cache.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/sort_query_string_for_cache">client.zones.settings.sort_query_string_for_cache.<a href="./src/cloudflare/resources/zones/settings/sort_query_string_for_cache.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/sort_query_string_for_cache.py">Optional</a></code>
|
||||
|
||||
### SSL
|
||||
|
||||
Types:
|
||||
|
|
@ -864,11 +660,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import SSL
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/ssl">client.zones.settings.ssl.<a href="./src/cloudflare/resources/zones/settings/ssl.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/ssl_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/ssl.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/ssl">client.zones.settings.ssl.<a href="./src/cloudflare/resources/zones/settings/ssl.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/ssl.py">Optional</a></code>
|
||||
|
||||
### SSLRecommender
|
||||
|
||||
Types:
|
||||
|
|
@ -877,11 +668,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import SSLRecommender
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/ssl_recommender">client.zones.settings.ssl_recommender.<a href="./src/cloudflare/resources/zones/settings/ssl_recommender.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/ssl_recommender_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/ssl_recommender.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/ssl_recommender">client.zones.settings.ssl_recommender.<a href="./src/cloudflare/resources/zones/settings/ssl_recommender.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/ssl_recommender.py">Optional</a></code>
|
||||
|
||||
### TLS1_3
|
||||
|
||||
Types:
|
||||
|
|
@ -890,11 +676,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import TLS1_3
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/tls_1_3">client.zones.settings.tls_1_3.<a href="./src/cloudflare/resources/zones/settings/tls_1_3.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/tls_1_3_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/tls_1_3.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/tls_1_3">client.zones.settings.tls_1_3.<a href="./src/cloudflare/resources/zones/settings/tls_1_3.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/tls_1_3.py">Optional</a></code>
|
||||
|
||||
### TLSClientAuth
|
||||
|
||||
Types:
|
||||
|
|
@ -903,11 +684,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import TLSClientAuth
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/tls_client_auth">client.zones.settings.tls_client_auth.<a href="./src/cloudflare/resources/zones/settings/tls_client_auth.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/tls_client_auth_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/tls_client_auth.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/tls_client_auth">client.zones.settings.tls_client_auth.<a href="./src/cloudflare/resources/zones/settings/tls_client_auth.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/tls_client_auth.py">Optional</a></code>
|
||||
|
||||
### TrueClientIPHeader
|
||||
|
||||
Types:
|
||||
|
|
@ -916,11 +692,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import TrueClientIPHeader
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/true_client_ip_header">client.zones.settings.true_client_ip_header.<a href="./src/cloudflare/resources/zones/settings/true_client_ip_header.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/true_client_ip_header_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/true_client_ip_header.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/true_client_ip_header">client.zones.settings.true_client_ip_header.<a href="./src/cloudflare/resources/zones/settings/true_client_ip_header.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/true_client_ip_header.py">Optional</a></code>
|
||||
|
||||
### WAF
|
||||
|
||||
Types:
|
||||
|
|
@ -929,11 +700,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import WAF
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/waf">client.zones.settings.waf.<a href="./src/cloudflare/resources/zones/settings/waf.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/waf_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/waf.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/waf">client.zones.settings.waf.<a href="./src/cloudflare/resources/zones/settings/waf.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/waf.py">Optional</a></code>
|
||||
|
||||
### WebP
|
||||
|
||||
Types:
|
||||
|
|
@ -942,11 +708,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import WebP
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/webp">client.zones.settings.webp.<a href="./src/cloudflare/resources/zones/settings/webp.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/webp_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/webp.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/webp">client.zones.settings.webp.<a href="./src/cloudflare/resources/zones/settings/webp.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/webp.py">Optional</a></code>
|
||||
|
||||
### Websocket
|
||||
|
||||
Types:
|
||||
|
|
@ -955,11 +716,6 @@ Types:
|
|||
from cloudflare.types.zones.settings import Websocket
|
||||
```
|
||||
|
||||
Methods:
|
||||
|
||||
- <code title="patch /zones/{zone_id}/settings/websockets">client.zones.settings.websocket.<a href="./src/cloudflare/resources/zones/settings/websocket.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/zones/settings/websocket_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zones/settings/websocket.py">Optional</a></code>
|
||||
- <code title="get /zones/{zone_id}/settings/websockets">client.zones.settings.websocket.<a href="./src/cloudflare/resources/zones/settings/websocket.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/settings/websocket.py">Optional</a></code>
|
||||
|
||||
### FontSettings
|
||||
|
||||
Types:
|
||||
|
|
|
|||
|
|
@ -1,109 +1,5 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from .nel import (
|
||||
NELResource,
|
||||
AsyncNELResource,
|
||||
NELResourceWithRawResponse,
|
||||
AsyncNELResourceWithRawResponse,
|
||||
NELResourceWithStreamingResponse,
|
||||
AsyncNELResourceWithStreamingResponse,
|
||||
)
|
||||
from .ssl import (
|
||||
SSLResource,
|
||||
AsyncSSLResource,
|
||||
SSLResourceWithRawResponse,
|
||||
AsyncSSLResourceWithRawResponse,
|
||||
SSLResourceWithStreamingResponse,
|
||||
AsyncSSLResourceWithStreamingResponse,
|
||||
)
|
||||
from .waf import (
|
||||
WAFResource,
|
||||
AsyncWAFResource,
|
||||
WAFResourceWithRawResponse,
|
||||
AsyncWAFResourceWithRawResponse,
|
||||
WAFResourceWithStreamingResponse,
|
||||
AsyncWAFResourceWithStreamingResponse,
|
||||
)
|
||||
from .ipv6 import (
|
||||
IPV6Resource,
|
||||
AsyncIPV6Resource,
|
||||
IPV6ResourceWithRawResponse,
|
||||
AsyncIPV6ResourceWithRawResponse,
|
||||
IPV6ResourceWithStreamingResponse,
|
||||
AsyncIPV6ResourceWithStreamingResponse,
|
||||
)
|
||||
from .webp import (
|
||||
WebPResource,
|
||||
AsyncWebPResource,
|
||||
WebPResourceWithRawResponse,
|
||||
AsyncWebPResourceWithRawResponse,
|
||||
WebPResourceWithStreamingResponse,
|
||||
AsyncWebPResourceWithStreamingResponse,
|
||||
)
|
||||
from .http2 import (
|
||||
HTTP2Resource,
|
||||
AsyncHTTP2Resource,
|
||||
HTTP2ResourceWithRawResponse,
|
||||
AsyncHTTP2ResourceWithRawResponse,
|
||||
HTTP2ResourceWithStreamingResponse,
|
||||
AsyncHTTP2ResourceWithStreamingResponse,
|
||||
)
|
||||
from .http3 import (
|
||||
HTTP3Resource,
|
||||
AsyncHTTP3Resource,
|
||||
HTTP3ResourceWithRawResponse,
|
||||
AsyncHTTP3ResourceWithRawResponse,
|
||||
HTTP3ResourceWithStreamingResponse,
|
||||
AsyncHTTP3ResourceWithStreamingResponse,
|
||||
)
|
||||
from .brotli import (
|
||||
BrotliResource,
|
||||
AsyncBrotliResource,
|
||||
BrotliResourceWithRawResponse,
|
||||
AsyncBrotliResourceWithRawResponse,
|
||||
BrotliResourceWithStreamingResponse,
|
||||
AsyncBrotliResourceWithStreamingResponse,
|
||||
)
|
||||
from .minify import (
|
||||
MinifyResource,
|
||||
AsyncMinifyResource,
|
||||
MinifyResourceWithRawResponse,
|
||||
AsyncMinifyResourceWithRawResponse,
|
||||
MinifyResourceWithStreamingResponse,
|
||||
AsyncMinifyResourceWithStreamingResponse,
|
||||
)
|
||||
from .mirage import (
|
||||
MirageResource,
|
||||
AsyncMirageResource,
|
||||
MirageResourceWithRawResponse,
|
||||
AsyncMirageResourceWithRawResponse,
|
||||
MirageResourceWithStreamingResponse,
|
||||
AsyncMirageResourceWithStreamingResponse,
|
||||
)
|
||||
from .polish import (
|
||||
PolishResource,
|
||||
AsyncPolishResource,
|
||||
PolishResourceWithRawResponse,
|
||||
AsyncPolishResourceWithRawResponse,
|
||||
PolishResourceWithStreamingResponse,
|
||||
AsyncPolishResourceWithStreamingResponse,
|
||||
)
|
||||
from .ciphers import (
|
||||
CiphersResource,
|
||||
AsyncCiphersResource,
|
||||
CiphersResourceWithRawResponse,
|
||||
AsyncCiphersResourceWithRawResponse,
|
||||
CiphersResourceWithStreamingResponse,
|
||||
AsyncCiphersResourceWithStreamingResponse,
|
||||
)
|
||||
from .tls_1_3 import (
|
||||
TLS1_3Resource,
|
||||
AsyncTLS1_3Resource,
|
||||
TLS1_3ResourceWithRawResponse,
|
||||
AsyncTLS1_3ResourceWithRawResponse,
|
||||
TLS1_3ResourceWithStreamingResponse,
|
||||
AsyncTLS1_3ResourceWithStreamingResponse,
|
||||
)
|
||||
from .settings import (
|
||||
SettingsResource,
|
||||
AsyncSettingsResource,
|
||||
|
|
@ -112,78 +8,6 @@ from .settings import (
|
|||
SettingsResourceWithStreamingResponse,
|
||||
AsyncSettingsResourceWithStreamingResponse,
|
||||
)
|
||||
from .zero_rtt import (
|
||||
ZeroRTTResource,
|
||||
AsyncZeroRTTResource,
|
||||
ZeroRTTResourceWithRawResponse,
|
||||
AsyncZeroRTTResourceWithRawResponse,
|
||||
ZeroRTTResourceWithStreamingResponse,
|
||||
AsyncZeroRTTResourceWithStreamingResponse,
|
||||
)
|
||||
from .websocket import (
|
||||
WebsocketResource,
|
||||
AsyncWebsocketResource,
|
||||
WebsocketResourceWithRawResponse,
|
||||
AsyncWebsocketResourceWithRawResponse,
|
||||
WebsocketResourceWithStreamingResponse,
|
||||
AsyncWebsocketResourceWithStreamingResponse,
|
||||
)
|
||||
from .cache_level import (
|
||||
CacheLevelResource,
|
||||
AsyncCacheLevelResource,
|
||||
CacheLevelResourceWithRawResponse,
|
||||
AsyncCacheLevelResourceWithRawResponse,
|
||||
CacheLevelResourceWithStreamingResponse,
|
||||
AsyncCacheLevelResourceWithStreamingResponse,
|
||||
)
|
||||
from .early_hints import (
|
||||
EarlyHintsResource,
|
||||
AsyncEarlyHintsResource,
|
||||
EarlyHintsResourceWithRawResponse,
|
||||
AsyncEarlyHintsResourceWithRawResponse,
|
||||
EarlyHintsResourceWithStreamingResponse,
|
||||
AsyncEarlyHintsResourceWithStreamingResponse,
|
||||
)
|
||||
from .pseudo_ipv4 import (
|
||||
PseudoIPV4Resource,
|
||||
AsyncPseudoIPV4Resource,
|
||||
PseudoIPV4ResourceWithRawResponse,
|
||||
AsyncPseudoIPV4ResourceWithRawResponse,
|
||||
PseudoIPV4ResourceWithStreamingResponse,
|
||||
AsyncPseudoIPV4ResourceWithStreamingResponse,
|
||||
)
|
||||
from .advanced_ddos import (
|
||||
AdvancedDDoSResource,
|
||||
AsyncAdvancedDDoSResource,
|
||||
AdvancedDDoSResourceWithRawResponse,
|
||||
AsyncAdvancedDDoSResourceWithRawResponse,
|
||||
AdvancedDDoSResourceWithStreamingResponse,
|
||||
AsyncAdvancedDDoSResourceWithStreamingResponse,
|
||||
)
|
||||
from .always_online import (
|
||||
AlwaysOnlineResource,
|
||||
AsyncAlwaysOnlineResource,
|
||||
AlwaysOnlineResourceWithRawResponse,
|
||||
AsyncAlwaysOnlineResourceWithRawResponse,
|
||||
AlwaysOnlineResourceWithStreamingResponse,
|
||||
AsyncAlwaysOnlineResourceWithStreamingResponse,
|
||||
)
|
||||
from .browser_check import (
|
||||
BrowserCheckResource,
|
||||
AsyncBrowserCheckResource,
|
||||
BrowserCheckResourceWithRawResponse,
|
||||
AsyncBrowserCheckResourceWithRawResponse,
|
||||
BrowserCheckResourceWithStreamingResponse,
|
||||
AsyncBrowserCheckResourceWithStreamingResponse,
|
||||
)
|
||||
from .challenge_ttl import (
|
||||
ChallengeTTLResource,
|
||||
AsyncChallengeTTLResource,
|
||||
ChallengeTTLResourceWithRawResponse,
|
||||
AsyncChallengeTTLResourceWithRawResponse,
|
||||
ChallengeTTLResourceWithStreamingResponse,
|
||||
AsyncChallengeTTLResourceWithStreamingResponse,
|
||||
)
|
||||
from .font_settings import (
|
||||
FontSettingsResource,
|
||||
AsyncFontSettingsResource,
|
||||
|
|
@ -192,182 +16,6 @@ from .font_settings import (
|
|||
FontSettingsResourceWithStreamingResponse,
|
||||
AsyncFontSettingsResourceWithStreamingResponse,
|
||||
)
|
||||
from .rocket_loader import (
|
||||
RocketLoaderResource,
|
||||
AsyncRocketLoaderResource,
|
||||
RocketLoaderResourceWithRawResponse,
|
||||
AsyncRocketLoaderResourceWithRawResponse,
|
||||
RocketLoaderResourceWithStreamingResponse,
|
||||
AsyncRocketLoaderResourceWithStreamingResponse,
|
||||
)
|
||||
from .image_resizing import (
|
||||
ImageResizingResource,
|
||||
AsyncImageResizingResource,
|
||||
ImageResizingResourceWithRawResponse,
|
||||
AsyncImageResizingResourceWithRawResponse,
|
||||
ImageResizingResourceWithStreamingResponse,
|
||||
AsyncImageResizingResourceWithStreamingResponse,
|
||||
)
|
||||
from .ip_geolocation import (
|
||||
IPGeolocationResource,
|
||||
AsyncIPGeolocationResource,
|
||||
IPGeolocationResourceWithRawResponse,
|
||||
AsyncIPGeolocationResourceWithRawResponse,
|
||||
IPGeolocationResourceWithStreamingResponse,
|
||||
AsyncIPGeolocationResourceWithStreamingResponse,
|
||||
)
|
||||
from .security_level import (
|
||||
SecurityLevelResource,
|
||||
AsyncSecurityLevelResource,
|
||||
SecurityLevelResourceWithRawResponse,
|
||||
AsyncSecurityLevelResourceWithRawResponse,
|
||||
SecurityLevelResourceWithStreamingResponse,
|
||||
AsyncSecurityLevelResourceWithStreamingResponse,
|
||||
)
|
||||
from .min_tls_version import (
|
||||
MinTLSVersionResource,
|
||||
AsyncMinTLSVersionResource,
|
||||
MinTLSVersionResourceWithRawResponse,
|
||||
AsyncMinTLSVersionResourceWithRawResponse,
|
||||
MinTLSVersionResourceWithStreamingResponse,
|
||||
AsyncMinTLSVersionResourceWithStreamingResponse,
|
||||
)
|
||||
from .mobile_redirect import (
|
||||
MobileRedirectResource,
|
||||
AsyncMobileRedirectResource,
|
||||
MobileRedirectResourceWithRawResponse,
|
||||
AsyncMobileRedirectResourceWithRawResponse,
|
||||
MobileRedirectResourceWithStreamingResponse,
|
||||
AsyncMobileRedirectResourceWithStreamingResponse,
|
||||
)
|
||||
from .ssl_recommender import (
|
||||
SSLRecommenderResource,
|
||||
AsyncSSLRecommenderResource,
|
||||
SSLRecommenderResourceWithRawResponse,
|
||||
AsyncSSLRecommenderResourceWithRawResponse,
|
||||
SSLRecommenderResourceWithStreamingResponse,
|
||||
AsyncSSLRecommenderResourceWithStreamingResponse,
|
||||
)
|
||||
from .tls_client_auth import (
|
||||
TLSClientAuthResource,
|
||||
AsyncTLSClientAuthResource,
|
||||
TLSClientAuthResourceWithRawResponse,
|
||||
AsyncTLSClientAuthResourceWithRawResponse,
|
||||
TLSClientAuthResourceWithStreamingResponse,
|
||||
AsyncTLSClientAuthResourceWithStreamingResponse,
|
||||
)
|
||||
from .always_use_https import (
|
||||
AlwaysUseHTTPSResource,
|
||||
AsyncAlwaysUseHTTPSResource,
|
||||
AlwaysUseHTTPSResourceWithRawResponse,
|
||||
AsyncAlwaysUseHTTPSResourceWithRawResponse,
|
||||
AlwaysUseHTTPSResourceWithStreamingResponse,
|
||||
AsyncAlwaysUseHTTPSResourceWithStreamingResponse,
|
||||
)
|
||||
from .development_mode import (
|
||||
DevelopmentModeResource,
|
||||
AsyncDevelopmentModeResource,
|
||||
DevelopmentModeResourceWithRawResponse,
|
||||
AsyncDevelopmentModeResourceWithRawResponse,
|
||||
DevelopmentModeResourceWithStreamingResponse,
|
||||
AsyncDevelopmentModeResourceWithStreamingResponse,
|
||||
)
|
||||
from .orange_to_orange import (
|
||||
OrangeToOrangeResource,
|
||||
AsyncOrangeToOrangeResource,
|
||||
OrangeToOrangeResourceWithRawResponse,
|
||||
AsyncOrangeToOrangeResourceWithRawResponse,
|
||||
OrangeToOrangeResourceWithStreamingResponse,
|
||||
AsyncOrangeToOrangeResourceWithStreamingResponse,
|
||||
)
|
||||
from .prefetch_preload import (
|
||||
PrefetchPreloadResource,
|
||||
AsyncPrefetchPreloadResource,
|
||||
PrefetchPreloadResourceWithRawResponse,
|
||||
AsyncPrefetchPreloadResourceWithRawResponse,
|
||||
PrefetchPreloadResourceWithStreamingResponse,
|
||||
AsyncPrefetchPreloadResourceWithStreamingResponse,
|
||||
)
|
||||
from .security_headers import (
|
||||
SecurityHeadersResource,
|
||||
AsyncSecurityHeadersResource,
|
||||
SecurityHeadersResourceWithRawResponse,
|
||||
AsyncSecurityHeadersResourceWithRawResponse,
|
||||
SecurityHeadersResourceWithStreamingResponse,
|
||||
AsyncSecurityHeadersResourceWithStreamingResponse,
|
||||
)
|
||||
from .browser_cache_ttl import (
|
||||
BrowserCacheTTLResource,
|
||||
AsyncBrowserCacheTTLResource,
|
||||
BrowserCacheTTLResourceWithRawResponse,
|
||||
AsyncBrowserCacheTTLResourceWithRawResponse,
|
||||
BrowserCacheTTLResourceWithStreamingResponse,
|
||||
AsyncBrowserCacheTTLResourceWithStreamingResponse,
|
||||
)
|
||||
from .email_obfuscation import (
|
||||
EmailObfuscationResource,
|
||||
AsyncEmailObfuscationResource,
|
||||
EmailObfuscationResourceWithRawResponse,
|
||||
AsyncEmailObfuscationResourceWithRawResponse,
|
||||
EmailObfuscationResourceWithStreamingResponse,
|
||||
AsyncEmailObfuscationResourceWithStreamingResponse,
|
||||
)
|
||||
from .h2_prioritization import (
|
||||
H2PrioritizationResource,
|
||||
AsyncH2PrioritizationResource,
|
||||
H2PrioritizationResourceWithRawResponse,
|
||||
AsyncH2PrioritizationResourceWithRawResponse,
|
||||
H2PrioritizationResourceWithStreamingResponse,
|
||||
AsyncH2PrioritizationResourceWithStreamingResponse,
|
||||
)
|
||||
from .hotlink_protection import (
|
||||
HotlinkProtectionResource,
|
||||
AsyncHotlinkProtectionResource,
|
||||
HotlinkProtectionResourceWithRawResponse,
|
||||
AsyncHotlinkProtectionResourceWithRawResponse,
|
||||
HotlinkProtectionResourceWithStreamingResponse,
|
||||
AsyncHotlinkProtectionResourceWithStreamingResponse,
|
||||
)
|
||||
from .proxy_read_timeout import (
|
||||
ProxyReadTimeoutResource,
|
||||
AsyncProxyReadTimeoutResource,
|
||||
ProxyReadTimeoutResourceWithRawResponse,
|
||||
AsyncProxyReadTimeoutResourceWithRawResponse,
|
||||
ProxyReadTimeoutResourceWithStreamingResponse,
|
||||
AsyncProxyReadTimeoutResourceWithStreamingResponse,
|
||||
)
|
||||
from .response_buffering import (
|
||||
ResponseBufferingResource,
|
||||
AsyncResponseBufferingResource,
|
||||
ResponseBufferingResourceWithRawResponse,
|
||||
AsyncResponseBufferingResourceWithRawResponse,
|
||||
ResponseBufferingResourceWithStreamingResponse,
|
||||
AsyncResponseBufferingResourceWithStreamingResponse,
|
||||
)
|
||||
from .opportunistic_onion import (
|
||||
OpportunisticOnionResource,
|
||||
AsyncOpportunisticOnionResource,
|
||||
OpportunisticOnionResourceWithRawResponse,
|
||||
AsyncOpportunisticOnionResourceWithRawResponse,
|
||||
OpportunisticOnionResourceWithStreamingResponse,
|
||||
AsyncOpportunisticOnionResourceWithStreamingResponse,
|
||||
)
|
||||
from .server_side_excludes import (
|
||||
ServerSideExcludesResource,
|
||||
AsyncServerSideExcludesResource,
|
||||
ServerSideExcludesResourceWithRawResponse,
|
||||
AsyncServerSideExcludesResourceWithRawResponse,
|
||||
ServerSideExcludesResourceWithStreamingResponse,
|
||||
AsyncServerSideExcludesResourceWithStreamingResponse,
|
||||
)
|
||||
from .true_client_ip_header import (
|
||||
TrueClientIPHeaderResource,
|
||||
AsyncTrueClientIPHeaderResource,
|
||||
TrueClientIPHeaderResourceWithRawResponse,
|
||||
AsyncTrueClientIPHeaderResourceWithRawResponse,
|
||||
TrueClientIPHeaderResourceWithStreamingResponse,
|
||||
AsyncTrueClientIPHeaderResourceWithStreamingResponse,
|
||||
)
|
||||
from .origin_max_http_version import (
|
||||
OriginMaxHTTPVersionResource,
|
||||
AsyncOriginMaxHTTPVersionResource,
|
||||
|
|
@ -376,348 +24,14 @@ from .origin_max_http_version import (
|
|||
OriginMaxHTTPVersionResourceWithStreamingResponse,
|
||||
AsyncOriginMaxHTTPVersionResourceWithStreamingResponse,
|
||||
)
|
||||
from .automatic_https_rewrites import (
|
||||
AutomaticHTTPSRewritesResource,
|
||||
AsyncAutomaticHTTPSRewritesResource,
|
||||
AutomaticHTTPSRewritesResourceWithRawResponse,
|
||||
AsyncAutomaticHTTPSRewritesResourceWithRawResponse,
|
||||
AutomaticHTTPSRewritesResourceWithStreamingResponse,
|
||||
AsyncAutomaticHTTPSRewritesResourceWithStreamingResponse,
|
||||
)
|
||||
from .opportunistic_encryption import (
|
||||
OpportunisticEncryptionResource,
|
||||
AsyncOpportunisticEncryptionResource,
|
||||
OpportunisticEncryptionResourceWithRawResponse,
|
||||
AsyncOpportunisticEncryptionResourceWithRawResponse,
|
||||
OpportunisticEncryptionResourceWithStreamingResponse,
|
||||
AsyncOpportunisticEncryptionResourceWithStreamingResponse,
|
||||
)
|
||||
from .origin_error_page_pass_thru import (
|
||||
OriginErrorPagePassThruResource,
|
||||
AsyncOriginErrorPagePassThruResource,
|
||||
OriginErrorPagePassThruResourceWithRawResponse,
|
||||
AsyncOriginErrorPagePassThruResourceWithRawResponse,
|
||||
OriginErrorPagePassThruResourceWithStreamingResponse,
|
||||
AsyncOriginErrorPagePassThruResourceWithStreamingResponse,
|
||||
)
|
||||
from .sort_query_string_for_cache import (
|
||||
SortQueryStringForCacheResource,
|
||||
AsyncSortQueryStringForCacheResource,
|
||||
SortQueryStringForCacheResourceWithRawResponse,
|
||||
AsyncSortQueryStringForCacheResourceWithRawResponse,
|
||||
SortQueryStringForCacheResourceWithStreamingResponse,
|
||||
AsyncSortQueryStringForCacheResourceWithStreamingResponse,
|
||||
)
|
||||
from .automatic_platform_optimization import (
|
||||
AutomaticPlatformOptimizationResource,
|
||||
AsyncAutomaticPlatformOptimizationResource,
|
||||
AutomaticPlatformOptimizationResourceWithRawResponse,
|
||||
AsyncAutomaticPlatformOptimizationResourceWithRawResponse,
|
||||
AutomaticPlatformOptimizationResourceWithStreamingResponse,
|
||||
AsyncAutomaticPlatformOptimizationResourceWithStreamingResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"ZeroRTTResource",
|
||||
"AsyncZeroRTTResource",
|
||||
"ZeroRTTResourceWithRawResponse",
|
||||
"AsyncZeroRTTResourceWithRawResponse",
|
||||
"ZeroRTTResourceWithStreamingResponse",
|
||||
"AsyncZeroRTTResourceWithStreamingResponse",
|
||||
"AdvancedDDoSResource",
|
||||
"AsyncAdvancedDDoSResource",
|
||||
"AdvancedDDoSResourceWithRawResponse",
|
||||
"AsyncAdvancedDDoSResourceWithRawResponse",
|
||||
"AdvancedDDoSResourceWithStreamingResponse",
|
||||
"AsyncAdvancedDDoSResourceWithStreamingResponse",
|
||||
"AlwaysOnlineResource",
|
||||
"AsyncAlwaysOnlineResource",
|
||||
"AlwaysOnlineResourceWithRawResponse",
|
||||
"AsyncAlwaysOnlineResourceWithRawResponse",
|
||||
"AlwaysOnlineResourceWithStreamingResponse",
|
||||
"AsyncAlwaysOnlineResourceWithStreamingResponse",
|
||||
"AlwaysUseHTTPSResource",
|
||||
"AsyncAlwaysUseHTTPSResource",
|
||||
"AlwaysUseHTTPSResourceWithRawResponse",
|
||||
"AsyncAlwaysUseHTTPSResourceWithRawResponse",
|
||||
"AlwaysUseHTTPSResourceWithStreamingResponse",
|
||||
"AsyncAlwaysUseHTTPSResourceWithStreamingResponse",
|
||||
"AutomaticHTTPSRewritesResource",
|
||||
"AsyncAutomaticHTTPSRewritesResource",
|
||||
"AutomaticHTTPSRewritesResourceWithRawResponse",
|
||||
"AsyncAutomaticHTTPSRewritesResourceWithRawResponse",
|
||||
"AutomaticHTTPSRewritesResourceWithStreamingResponse",
|
||||
"AsyncAutomaticHTTPSRewritesResourceWithStreamingResponse",
|
||||
"AutomaticPlatformOptimizationResource",
|
||||
"AsyncAutomaticPlatformOptimizationResource",
|
||||
"AutomaticPlatformOptimizationResourceWithRawResponse",
|
||||
"AsyncAutomaticPlatformOptimizationResourceWithRawResponse",
|
||||
"AutomaticPlatformOptimizationResourceWithStreamingResponse",
|
||||
"AsyncAutomaticPlatformOptimizationResourceWithStreamingResponse",
|
||||
"BrotliResource",
|
||||
"AsyncBrotliResource",
|
||||
"BrotliResourceWithRawResponse",
|
||||
"AsyncBrotliResourceWithRawResponse",
|
||||
"BrotliResourceWithStreamingResponse",
|
||||
"AsyncBrotliResourceWithStreamingResponse",
|
||||
"BrowserCacheTTLResource",
|
||||
"AsyncBrowserCacheTTLResource",
|
||||
"BrowserCacheTTLResourceWithRawResponse",
|
||||
"AsyncBrowserCacheTTLResourceWithRawResponse",
|
||||
"BrowserCacheTTLResourceWithStreamingResponse",
|
||||
"AsyncBrowserCacheTTLResourceWithStreamingResponse",
|
||||
"BrowserCheckResource",
|
||||
"AsyncBrowserCheckResource",
|
||||
"BrowserCheckResourceWithRawResponse",
|
||||
"AsyncBrowserCheckResourceWithRawResponse",
|
||||
"BrowserCheckResourceWithStreamingResponse",
|
||||
"AsyncBrowserCheckResourceWithStreamingResponse",
|
||||
"CacheLevelResource",
|
||||
"AsyncCacheLevelResource",
|
||||
"CacheLevelResourceWithRawResponse",
|
||||
"AsyncCacheLevelResourceWithRawResponse",
|
||||
"CacheLevelResourceWithStreamingResponse",
|
||||
"AsyncCacheLevelResourceWithStreamingResponse",
|
||||
"ChallengeTTLResource",
|
||||
"AsyncChallengeTTLResource",
|
||||
"ChallengeTTLResourceWithRawResponse",
|
||||
"AsyncChallengeTTLResourceWithRawResponse",
|
||||
"ChallengeTTLResourceWithStreamingResponse",
|
||||
"AsyncChallengeTTLResourceWithStreamingResponse",
|
||||
"CiphersResource",
|
||||
"AsyncCiphersResource",
|
||||
"CiphersResourceWithRawResponse",
|
||||
"AsyncCiphersResourceWithRawResponse",
|
||||
"CiphersResourceWithStreamingResponse",
|
||||
"AsyncCiphersResourceWithStreamingResponse",
|
||||
"DevelopmentModeResource",
|
||||
"AsyncDevelopmentModeResource",
|
||||
"DevelopmentModeResourceWithRawResponse",
|
||||
"AsyncDevelopmentModeResourceWithRawResponse",
|
||||
"DevelopmentModeResourceWithStreamingResponse",
|
||||
"AsyncDevelopmentModeResourceWithStreamingResponse",
|
||||
"EarlyHintsResource",
|
||||
"AsyncEarlyHintsResource",
|
||||
"EarlyHintsResourceWithRawResponse",
|
||||
"AsyncEarlyHintsResourceWithRawResponse",
|
||||
"EarlyHintsResourceWithStreamingResponse",
|
||||
"AsyncEarlyHintsResourceWithStreamingResponse",
|
||||
"EmailObfuscationResource",
|
||||
"AsyncEmailObfuscationResource",
|
||||
"EmailObfuscationResourceWithRawResponse",
|
||||
"AsyncEmailObfuscationResourceWithRawResponse",
|
||||
"EmailObfuscationResourceWithStreamingResponse",
|
||||
"AsyncEmailObfuscationResourceWithStreamingResponse",
|
||||
"H2PrioritizationResource",
|
||||
"AsyncH2PrioritizationResource",
|
||||
"H2PrioritizationResourceWithRawResponse",
|
||||
"AsyncH2PrioritizationResourceWithRawResponse",
|
||||
"H2PrioritizationResourceWithStreamingResponse",
|
||||
"AsyncH2PrioritizationResourceWithStreamingResponse",
|
||||
"HotlinkProtectionResource",
|
||||
"AsyncHotlinkProtectionResource",
|
||||
"HotlinkProtectionResourceWithRawResponse",
|
||||
"AsyncHotlinkProtectionResourceWithRawResponse",
|
||||
"HotlinkProtectionResourceWithStreamingResponse",
|
||||
"AsyncHotlinkProtectionResourceWithStreamingResponse",
|
||||
"HTTP2Resource",
|
||||
"AsyncHTTP2Resource",
|
||||
"HTTP2ResourceWithRawResponse",
|
||||
"AsyncHTTP2ResourceWithRawResponse",
|
||||
"HTTP2ResourceWithStreamingResponse",
|
||||
"AsyncHTTP2ResourceWithStreamingResponse",
|
||||
"HTTP3Resource",
|
||||
"AsyncHTTP3Resource",
|
||||
"HTTP3ResourceWithRawResponse",
|
||||
"AsyncHTTP3ResourceWithRawResponse",
|
||||
"HTTP3ResourceWithStreamingResponse",
|
||||
"AsyncHTTP3ResourceWithStreamingResponse",
|
||||
"ImageResizingResource",
|
||||
"AsyncImageResizingResource",
|
||||
"ImageResizingResourceWithRawResponse",
|
||||
"AsyncImageResizingResourceWithRawResponse",
|
||||
"ImageResizingResourceWithStreamingResponse",
|
||||
"AsyncImageResizingResourceWithStreamingResponse",
|
||||
"IPGeolocationResource",
|
||||
"AsyncIPGeolocationResource",
|
||||
"IPGeolocationResourceWithRawResponse",
|
||||
"AsyncIPGeolocationResourceWithRawResponse",
|
||||
"IPGeolocationResourceWithStreamingResponse",
|
||||
"AsyncIPGeolocationResourceWithStreamingResponse",
|
||||
"IPV6Resource",
|
||||
"AsyncIPV6Resource",
|
||||
"IPV6ResourceWithRawResponse",
|
||||
"AsyncIPV6ResourceWithRawResponse",
|
||||
"IPV6ResourceWithStreamingResponse",
|
||||
"AsyncIPV6ResourceWithStreamingResponse",
|
||||
"MinTLSVersionResource",
|
||||
"AsyncMinTLSVersionResource",
|
||||
"MinTLSVersionResourceWithRawResponse",
|
||||
"AsyncMinTLSVersionResourceWithRawResponse",
|
||||
"MinTLSVersionResourceWithStreamingResponse",
|
||||
"AsyncMinTLSVersionResourceWithStreamingResponse",
|
||||
"MinifyResource",
|
||||
"AsyncMinifyResource",
|
||||
"MinifyResourceWithRawResponse",
|
||||
"AsyncMinifyResourceWithRawResponse",
|
||||
"MinifyResourceWithStreamingResponse",
|
||||
"AsyncMinifyResourceWithStreamingResponse",
|
||||
"MirageResource",
|
||||
"AsyncMirageResource",
|
||||
"MirageResourceWithRawResponse",
|
||||
"AsyncMirageResourceWithRawResponse",
|
||||
"MirageResourceWithStreamingResponse",
|
||||
"AsyncMirageResourceWithStreamingResponse",
|
||||
"MobileRedirectResource",
|
||||
"AsyncMobileRedirectResource",
|
||||
"MobileRedirectResourceWithRawResponse",
|
||||
"AsyncMobileRedirectResourceWithRawResponse",
|
||||
"MobileRedirectResourceWithStreamingResponse",
|
||||
"AsyncMobileRedirectResourceWithStreamingResponse",
|
||||
"NELResource",
|
||||
"AsyncNELResource",
|
||||
"NELResourceWithRawResponse",
|
||||
"AsyncNELResourceWithRawResponse",
|
||||
"NELResourceWithStreamingResponse",
|
||||
"AsyncNELResourceWithStreamingResponse",
|
||||
"OpportunisticEncryptionResource",
|
||||
"AsyncOpportunisticEncryptionResource",
|
||||
"OpportunisticEncryptionResourceWithRawResponse",
|
||||
"AsyncOpportunisticEncryptionResourceWithRawResponse",
|
||||
"OpportunisticEncryptionResourceWithStreamingResponse",
|
||||
"AsyncOpportunisticEncryptionResourceWithStreamingResponse",
|
||||
"OpportunisticOnionResource",
|
||||
"AsyncOpportunisticOnionResource",
|
||||
"OpportunisticOnionResourceWithRawResponse",
|
||||
"AsyncOpportunisticOnionResourceWithRawResponse",
|
||||
"OpportunisticOnionResourceWithStreamingResponse",
|
||||
"AsyncOpportunisticOnionResourceWithStreamingResponse",
|
||||
"OrangeToOrangeResource",
|
||||
"AsyncOrangeToOrangeResource",
|
||||
"OrangeToOrangeResourceWithRawResponse",
|
||||
"AsyncOrangeToOrangeResourceWithRawResponse",
|
||||
"OrangeToOrangeResourceWithStreamingResponse",
|
||||
"AsyncOrangeToOrangeResourceWithStreamingResponse",
|
||||
"OriginErrorPagePassThruResource",
|
||||
"AsyncOriginErrorPagePassThruResource",
|
||||
"OriginErrorPagePassThruResourceWithRawResponse",
|
||||
"AsyncOriginErrorPagePassThruResourceWithRawResponse",
|
||||
"OriginErrorPagePassThruResourceWithStreamingResponse",
|
||||
"AsyncOriginErrorPagePassThruResourceWithStreamingResponse",
|
||||
"OriginMaxHTTPVersionResource",
|
||||
"AsyncOriginMaxHTTPVersionResource",
|
||||
"OriginMaxHTTPVersionResourceWithRawResponse",
|
||||
"AsyncOriginMaxHTTPVersionResourceWithRawResponse",
|
||||
"OriginMaxHTTPVersionResourceWithStreamingResponse",
|
||||
"AsyncOriginMaxHTTPVersionResourceWithStreamingResponse",
|
||||
"PolishResource",
|
||||
"AsyncPolishResource",
|
||||
"PolishResourceWithRawResponse",
|
||||
"AsyncPolishResourceWithRawResponse",
|
||||
"PolishResourceWithStreamingResponse",
|
||||
"AsyncPolishResourceWithStreamingResponse",
|
||||
"PrefetchPreloadResource",
|
||||
"AsyncPrefetchPreloadResource",
|
||||
"PrefetchPreloadResourceWithRawResponse",
|
||||
"AsyncPrefetchPreloadResourceWithRawResponse",
|
||||
"PrefetchPreloadResourceWithStreamingResponse",
|
||||
"AsyncPrefetchPreloadResourceWithStreamingResponse",
|
||||
"ProxyReadTimeoutResource",
|
||||
"AsyncProxyReadTimeoutResource",
|
||||
"ProxyReadTimeoutResourceWithRawResponse",
|
||||
"AsyncProxyReadTimeoutResourceWithRawResponse",
|
||||
"ProxyReadTimeoutResourceWithStreamingResponse",
|
||||
"AsyncProxyReadTimeoutResourceWithStreamingResponse",
|
||||
"PseudoIPV4Resource",
|
||||
"AsyncPseudoIPV4Resource",
|
||||
"PseudoIPV4ResourceWithRawResponse",
|
||||
"AsyncPseudoIPV4ResourceWithRawResponse",
|
||||
"PseudoIPV4ResourceWithStreamingResponse",
|
||||
"AsyncPseudoIPV4ResourceWithStreamingResponse",
|
||||
"ResponseBufferingResource",
|
||||
"AsyncResponseBufferingResource",
|
||||
"ResponseBufferingResourceWithRawResponse",
|
||||
"AsyncResponseBufferingResourceWithRawResponse",
|
||||
"ResponseBufferingResourceWithStreamingResponse",
|
||||
"AsyncResponseBufferingResourceWithStreamingResponse",
|
||||
"RocketLoaderResource",
|
||||
"AsyncRocketLoaderResource",
|
||||
"RocketLoaderResourceWithRawResponse",
|
||||
"AsyncRocketLoaderResourceWithRawResponse",
|
||||
"RocketLoaderResourceWithStreamingResponse",
|
||||
"AsyncRocketLoaderResourceWithStreamingResponse",
|
||||
"SecurityHeadersResource",
|
||||
"AsyncSecurityHeadersResource",
|
||||
"SecurityHeadersResourceWithRawResponse",
|
||||
"AsyncSecurityHeadersResourceWithRawResponse",
|
||||
"SecurityHeadersResourceWithStreamingResponse",
|
||||
"AsyncSecurityHeadersResourceWithStreamingResponse",
|
||||
"SecurityLevelResource",
|
||||
"AsyncSecurityLevelResource",
|
||||
"SecurityLevelResourceWithRawResponse",
|
||||
"AsyncSecurityLevelResourceWithRawResponse",
|
||||
"SecurityLevelResourceWithStreamingResponse",
|
||||
"AsyncSecurityLevelResourceWithStreamingResponse",
|
||||
"ServerSideExcludesResource",
|
||||
"AsyncServerSideExcludesResource",
|
||||
"ServerSideExcludesResourceWithRawResponse",
|
||||
"AsyncServerSideExcludesResourceWithRawResponse",
|
||||
"ServerSideExcludesResourceWithStreamingResponse",
|
||||
"AsyncServerSideExcludesResourceWithStreamingResponse",
|
||||
"SortQueryStringForCacheResource",
|
||||
"AsyncSortQueryStringForCacheResource",
|
||||
"SortQueryStringForCacheResourceWithRawResponse",
|
||||
"AsyncSortQueryStringForCacheResourceWithRawResponse",
|
||||
"SortQueryStringForCacheResourceWithStreamingResponse",
|
||||
"AsyncSortQueryStringForCacheResourceWithStreamingResponse",
|
||||
"SSLResource",
|
||||
"AsyncSSLResource",
|
||||
"SSLResourceWithRawResponse",
|
||||
"AsyncSSLResourceWithRawResponse",
|
||||
"SSLResourceWithStreamingResponse",
|
||||
"AsyncSSLResourceWithStreamingResponse",
|
||||
"SSLRecommenderResource",
|
||||
"AsyncSSLRecommenderResource",
|
||||
"SSLRecommenderResourceWithRawResponse",
|
||||
"AsyncSSLRecommenderResourceWithRawResponse",
|
||||
"SSLRecommenderResourceWithStreamingResponse",
|
||||
"AsyncSSLRecommenderResourceWithStreamingResponse",
|
||||
"TLS1_3Resource",
|
||||
"AsyncTLS1_3Resource",
|
||||
"TLS1_3ResourceWithRawResponse",
|
||||
"AsyncTLS1_3ResourceWithRawResponse",
|
||||
"TLS1_3ResourceWithStreamingResponse",
|
||||
"AsyncTLS1_3ResourceWithStreamingResponse",
|
||||
"TLSClientAuthResource",
|
||||
"AsyncTLSClientAuthResource",
|
||||
"TLSClientAuthResourceWithRawResponse",
|
||||
"AsyncTLSClientAuthResourceWithRawResponse",
|
||||
"TLSClientAuthResourceWithStreamingResponse",
|
||||
"AsyncTLSClientAuthResourceWithStreamingResponse",
|
||||
"TrueClientIPHeaderResource",
|
||||
"AsyncTrueClientIPHeaderResource",
|
||||
"TrueClientIPHeaderResourceWithRawResponse",
|
||||
"AsyncTrueClientIPHeaderResourceWithRawResponse",
|
||||
"TrueClientIPHeaderResourceWithStreamingResponse",
|
||||
"AsyncTrueClientIPHeaderResourceWithStreamingResponse",
|
||||
"WAFResource",
|
||||
"AsyncWAFResource",
|
||||
"WAFResourceWithRawResponse",
|
||||
"AsyncWAFResourceWithRawResponse",
|
||||
"WAFResourceWithStreamingResponse",
|
||||
"AsyncWAFResourceWithStreamingResponse",
|
||||
"WebPResource",
|
||||
"AsyncWebPResource",
|
||||
"WebPResourceWithRawResponse",
|
||||
"AsyncWebPResourceWithRawResponse",
|
||||
"WebPResourceWithStreamingResponse",
|
||||
"AsyncWebPResourceWithStreamingResponse",
|
||||
"WebsocketResource",
|
||||
"AsyncWebsocketResource",
|
||||
"WebsocketResourceWithRawResponse",
|
||||
"AsyncWebsocketResourceWithRawResponse",
|
||||
"WebsocketResourceWithStreamingResponse",
|
||||
"AsyncWebsocketResourceWithStreamingResponse",
|
||||
"FontSettingsResource",
|
||||
"AsyncFontSettingsResource",
|
||||
"FontSettingsResourceWithRawResponse",
|
||||
|
|
|
|||
|
|
@ -1,162 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings.advanced_ddos import AdvancedDDoS
|
||||
|
||||
__all__ = ["AdvancedDDoSResource", "AsyncAdvancedDDoSResource"]
|
||||
|
||||
|
||||
class AdvancedDDoSResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AdvancedDDoSResourceWithRawResponse:
|
||||
return AdvancedDDoSResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AdvancedDDoSResourceWithStreamingResponse:
|
||||
return AdvancedDDoSResourceWithStreamingResponse(self)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AdvancedDDoS]:
|
||||
"""
|
||||
Advanced protection from Distributed Denial of Service (DDoS) attacks on your
|
||||
website. This is an uneditable value that is 'on' in the case of Business and
|
||||
Enterprise zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/advanced_ddos",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AdvancedDDoS]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AdvancedDDoS]], ResultWrapper[AdvancedDDoS]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncAdvancedDDoSResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAdvancedDDoSResourceWithRawResponse:
|
||||
return AsyncAdvancedDDoSResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAdvancedDDoSResourceWithStreamingResponse:
|
||||
return AsyncAdvancedDDoSResourceWithStreamingResponse(self)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AdvancedDDoS]:
|
||||
"""
|
||||
Advanced protection from Distributed Denial of Service (DDoS) attacks on your
|
||||
website. This is an uneditable value that is 'on' in the case of Business and
|
||||
Enterprise zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/advanced_ddos",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AdvancedDDoS]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AdvancedDDoS]], ResultWrapper[AdvancedDDoS]),
|
||||
)
|
||||
|
||||
|
||||
class AdvancedDDoSResourceWithRawResponse:
|
||||
def __init__(self, advanced_ddos: AdvancedDDoSResource) -> None:
|
||||
self._advanced_ddos = advanced_ddos
|
||||
|
||||
self.get = to_raw_response_wrapper(
|
||||
advanced_ddos.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAdvancedDDoSResourceWithRawResponse:
|
||||
def __init__(self, advanced_ddos: AsyncAdvancedDDoSResource) -> None:
|
||||
self._advanced_ddos = advanced_ddos
|
||||
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
advanced_ddos.get,
|
||||
)
|
||||
|
||||
|
||||
class AdvancedDDoSResourceWithStreamingResponse:
|
||||
def __init__(self, advanced_ddos: AdvancedDDoSResource) -> None:
|
||||
self._advanced_ddos = advanced_ddos
|
||||
|
||||
self.get = to_streamed_response_wrapper(
|
||||
advanced_ddos.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAdvancedDDoSResourceWithStreamingResponse:
|
||||
def __init__(self, advanced_ddos: AsyncAdvancedDDoSResource) -> None:
|
||||
self._advanced_ddos = advanced_ddos
|
||||
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
advanced_ddos.get,
|
||||
)
|
||||
|
|
@ -1,278 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import always_online_edit_params
|
||||
from ....types.zones.settings.always_online import AlwaysOnline
|
||||
|
||||
__all__ = ["AlwaysOnlineResource", "AsyncAlwaysOnlineResource"]
|
||||
|
||||
|
||||
class AlwaysOnlineResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AlwaysOnlineResourceWithRawResponse:
|
||||
return AlwaysOnlineResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AlwaysOnlineResourceWithStreamingResponse:
|
||||
return AlwaysOnlineResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AlwaysOnline]:
|
||||
"""
|
||||
When enabled, Cloudflare serves limited copies of web pages available from the
|
||||
[Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
|
||||
offline. Refer to
|
||||
[Always Online](https://developers.cloudflare.com/cache/about/always-online) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/always_online",
|
||||
body=maybe_transform({"value": value}, always_online_edit_params.AlwaysOnlineEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AlwaysOnline]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AlwaysOnline]], ResultWrapper[AlwaysOnline]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AlwaysOnline]:
|
||||
"""
|
||||
When enabled, Cloudflare serves limited copies of web pages available from the
|
||||
[Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
|
||||
offline. Refer to
|
||||
[Always Online](https://developers.cloudflare.com/cache/about/always-online) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/always_online",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AlwaysOnline]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AlwaysOnline]], ResultWrapper[AlwaysOnline]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncAlwaysOnlineResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAlwaysOnlineResourceWithRawResponse:
|
||||
return AsyncAlwaysOnlineResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAlwaysOnlineResourceWithStreamingResponse:
|
||||
return AsyncAlwaysOnlineResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AlwaysOnline]:
|
||||
"""
|
||||
When enabled, Cloudflare serves limited copies of web pages available from the
|
||||
[Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
|
||||
offline. Refer to
|
||||
[Always Online](https://developers.cloudflare.com/cache/about/always-online) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/always_online",
|
||||
body=await async_maybe_transform({"value": value}, always_online_edit_params.AlwaysOnlineEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AlwaysOnline]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AlwaysOnline]], ResultWrapper[AlwaysOnline]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AlwaysOnline]:
|
||||
"""
|
||||
When enabled, Cloudflare serves limited copies of web pages available from the
|
||||
[Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
|
||||
offline. Refer to
|
||||
[Always Online](https://developers.cloudflare.com/cache/about/always-online) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/always_online",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AlwaysOnline]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AlwaysOnline]], ResultWrapper[AlwaysOnline]),
|
||||
)
|
||||
|
||||
|
||||
class AlwaysOnlineResourceWithRawResponse:
|
||||
def __init__(self, always_online: AlwaysOnlineResource) -> None:
|
||||
self._always_online = always_online
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
always_online.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
always_online.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAlwaysOnlineResourceWithRawResponse:
|
||||
def __init__(self, always_online: AsyncAlwaysOnlineResource) -> None:
|
||||
self._always_online = always_online
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
always_online.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
always_online.get,
|
||||
)
|
||||
|
||||
|
||||
class AlwaysOnlineResourceWithStreamingResponse:
|
||||
def __init__(self, always_online: AlwaysOnlineResource) -> None:
|
||||
self._always_online = always_online
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
always_online.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
always_online.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAlwaysOnlineResourceWithStreamingResponse:
|
||||
def __init__(self, always_online: AsyncAlwaysOnlineResource) -> None:
|
||||
self._always_online = always_online
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
always_online.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
always_online.get,
|
||||
)
|
||||
|
|
@ -1,270 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import always_use_https_edit_params
|
||||
from ....types.zones.settings.always_use_https import AlwaysUseHTTPS
|
||||
|
||||
__all__ = ["AlwaysUseHTTPSResource", "AsyncAlwaysUseHTTPSResource"]
|
||||
|
||||
|
||||
class AlwaysUseHTTPSResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AlwaysUseHTTPSResourceWithRawResponse:
|
||||
return AlwaysUseHTTPSResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AlwaysUseHTTPSResourceWithStreamingResponse:
|
||||
return AlwaysUseHTTPSResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AlwaysUseHTTPS]:
|
||||
"""
|
||||
Reply to all requests for URLs that use "http" with a 301 redirect to the
|
||||
equivalent "https" URL. If you only want to redirect for a subset of requests,
|
||||
consider creating an "Always use HTTPS" page rule.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/always_use_https",
|
||||
body=maybe_transform({"value": value}, always_use_https_edit_params.AlwaysUseHTTPSEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AlwaysUseHTTPS]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AlwaysUseHTTPS]], ResultWrapper[AlwaysUseHTTPS]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AlwaysUseHTTPS]:
|
||||
"""
|
||||
Reply to all requests for URLs that use "http" with a 301 redirect to the
|
||||
equivalent "https" URL. If you only want to redirect for a subset of requests,
|
||||
consider creating an "Always use HTTPS" page rule.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/always_use_https",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AlwaysUseHTTPS]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AlwaysUseHTTPS]], ResultWrapper[AlwaysUseHTTPS]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncAlwaysUseHTTPSResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAlwaysUseHTTPSResourceWithRawResponse:
|
||||
return AsyncAlwaysUseHTTPSResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAlwaysUseHTTPSResourceWithStreamingResponse:
|
||||
return AsyncAlwaysUseHTTPSResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AlwaysUseHTTPS]:
|
||||
"""
|
||||
Reply to all requests for URLs that use "http" with a 301 redirect to the
|
||||
equivalent "https" URL. If you only want to redirect for a subset of requests,
|
||||
consider creating an "Always use HTTPS" page rule.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/always_use_https",
|
||||
body=await async_maybe_transform({"value": value}, always_use_https_edit_params.AlwaysUseHTTPSEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AlwaysUseHTTPS]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AlwaysUseHTTPS]], ResultWrapper[AlwaysUseHTTPS]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AlwaysUseHTTPS]:
|
||||
"""
|
||||
Reply to all requests for URLs that use "http" with a 301 redirect to the
|
||||
equivalent "https" URL. If you only want to redirect for a subset of requests,
|
||||
consider creating an "Always use HTTPS" page rule.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/always_use_https",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AlwaysUseHTTPS]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AlwaysUseHTTPS]], ResultWrapper[AlwaysUseHTTPS]),
|
||||
)
|
||||
|
||||
|
||||
class AlwaysUseHTTPSResourceWithRawResponse:
|
||||
def __init__(self, always_use_https: AlwaysUseHTTPSResource) -> None:
|
||||
self._always_use_https = always_use_https
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
always_use_https.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
always_use_https.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAlwaysUseHTTPSResourceWithRawResponse:
|
||||
def __init__(self, always_use_https: AsyncAlwaysUseHTTPSResource) -> None:
|
||||
self._always_use_https = always_use_https
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
always_use_https.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
always_use_https.get,
|
||||
)
|
||||
|
||||
|
||||
class AlwaysUseHTTPSResourceWithStreamingResponse:
|
||||
def __init__(self, always_use_https: AlwaysUseHTTPSResource) -> None:
|
||||
self._always_use_https = always_use_https
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
always_use_https.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
always_use_https.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAlwaysUseHTTPSResourceWithStreamingResponse:
|
||||
def __init__(self, always_use_https: AsyncAlwaysUseHTTPSResource) -> None:
|
||||
self._always_use_https = always_use_https
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
always_use_https.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
always_use_https.get,
|
||||
)
|
||||
|
|
@ -1,266 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import automatic_https_rewrite_edit_params
|
||||
from ....types.zones.settings.automatic_https_rewrites import AutomaticHTTPSRewrites
|
||||
|
||||
__all__ = ["AutomaticHTTPSRewritesResource", "AsyncAutomaticHTTPSRewritesResource"]
|
||||
|
||||
|
||||
class AutomaticHTTPSRewritesResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AutomaticHTTPSRewritesResourceWithRawResponse:
|
||||
return AutomaticHTTPSRewritesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AutomaticHTTPSRewritesResourceWithStreamingResponse:
|
||||
return AutomaticHTTPSRewritesResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AutomaticHTTPSRewrites]:
|
||||
"""
|
||||
Enable the Automatic HTTPS Rewrites feature for this zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/automatic_https_rewrites",
|
||||
body=maybe_transform({"value": value}, automatic_https_rewrite_edit_params.AutomaticHTTPSRewriteEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AutomaticHTTPSRewrites]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AutomaticHTTPSRewrites]], ResultWrapper[AutomaticHTTPSRewrites]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AutomaticHTTPSRewrites]:
|
||||
"""
|
||||
Enable the Automatic HTTPS Rewrites feature for this zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/automatic_https_rewrites",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AutomaticHTTPSRewrites]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AutomaticHTTPSRewrites]], ResultWrapper[AutomaticHTTPSRewrites]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncAutomaticHTTPSRewritesResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAutomaticHTTPSRewritesResourceWithRawResponse:
|
||||
return AsyncAutomaticHTTPSRewritesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAutomaticHTTPSRewritesResourceWithStreamingResponse:
|
||||
return AsyncAutomaticHTTPSRewritesResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AutomaticHTTPSRewrites]:
|
||||
"""
|
||||
Enable the Automatic HTTPS Rewrites feature for this zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/automatic_https_rewrites",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, automatic_https_rewrite_edit_params.AutomaticHTTPSRewriteEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AutomaticHTTPSRewrites]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AutomaticHTTPSRewrites]], ResultWrapper[AutomaticHTTPSRewrites]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AutomaticHTTPSRewrites]:
|
||||
"""
|
||||
Enable the Automatic HTTPS Rewrites feature for this zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/automatic_https_rewrites",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AutomaticHTTPSRewrites]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AutomaticHTTPSRewrites]], ResultWrapper[AutomaticHTTPSRewrites]),
|
||||
)
|
||||
|
||||
|
||||
class AutomaticHTTPSRewritesResourceWithRawResponse:
|
||||
def __init__(self, automatic_https_rewrites: AutomaticHTTPSRewritesResource) -> None:
|
||||
self._automatic_https_rewrites = automatic_https_rewrites
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
automatic_https_rewrites.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
automatic_https_rewrites.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAutomaticHTTPSRewritesResourceWithRawResponse:
|
||||
def __init__(self, automatic_https_rewrites: AsyncAutomaticHTTPSRewritesResource) -> None:
|
||||
self._automatic_https_rewrites = automatic_https_rewrites
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
automatic_https_rewrites.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
automatic_https_rewrites.get,
|
||||
)
|
||||
|
||||
|
||||
class AutomaticHTTPSRewritesResourceWithStreamingResponse:
|
||||
def __init__(self, automatic_https_rewrites: AutomaticHTTPSRewritesResource) -> None:
|
||||
self._automatic_https_rewrites = automatic_https_rewrites
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
automatic_https_rewrites.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
automatic_https_rewrites.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAutomaticHTTPSRewritesResourceWithStreamingResponse:
|
||||
def __init__(self, automatic_https_rewrites: AsyncAutomaticHTTPSRewritesResource) -> None:
|
||||
self._automatic_https_rewrites = automatic_https_rewrites
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
automatic_https_rewrites.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
automatic_https_rewrites.get,
|
||||
)
|
||||
|
|
@ -1,270 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import AutomaticPlatformOptimization, automatic_platform_optimization_edit_params
|
||||
from ....types.zones.settings.automatic_platform_optimization import AutomaticPlatformOptimization
|
||||
from ....types.zones.settings.automatic_platform_optimization_param import AutomaticPlatformOptimizationParam
|
||||
|
||||
__all__ = ["AutomaticPlatformOptimizationResource", "AsyncAutomaticPlatformOptimizationResource"]
|
||||
|
||||
|
||||
class AutomaticPlatformOptimizationResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AutomaticPlatformOptimizationResourceWithRawResponse:
|
||||
return AutomaticPlatformOptimizationResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AutomaticPlatformOptimizationResourceWithStreamingResponse:
|
||||
return AutomaticPlatformOptimizationResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: AutomaticPlatformOptimizationParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AutomaticPlatformOptimization]:
|
||||
"""
|
||||
[Automatic Platform Optimization for WordPress](https://developers.cloudflare.com/automatic-platform-optimization/)
|
||||
serves your WordPress site from Cloudflare's edge network and caches third-party
|
||||
fonts.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/automatic_platform_optimization",
|
||||
body=maybe_transform(
|
||||
{"value": value}, automatic_platform_optimization_edit_params.AutomaticPlatformOptimizationEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AutomaticPlatformOptimization]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AutomaticPlatformOptimization]], ResultWrapper[AutomaticPlatformOptimization]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AutomaticPlatformOptimization]:
|
||||
"""
|
||||
[Automatic Platform Optimization for WordPress](https://developers.cloudflare.com/automatic-platform-optimization/)
|
||||
serves your WordPress site from Cloudflare's edge network and caches third-party
|
||||
fonts.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/automatic_platform_optimization",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AutomaticPlatformOptimization]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AutomaticPlatformOptimization]], ResultWrapper[AutomaticPlatformOptimization]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncAutomaticPlatformOptimizationResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncAutomaticPlatformOptimizationResourceWithRawResponse:
|
||||
return AsyncAutomaticPlatformOptimizationResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncAutomaticPlatformOptimizationResourceWithStreamingResponse:
|
||||
return AsyncAutomaticPlatformOptimizationResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: AutomaticPlatformOptimizationParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AutomaticPlatformOptimization]:
|
||||
"""
|
||||
[Automatic Platform Optimization for WordPress](https://developers.cloudflare.com/automatic-platform-optimization/)
|
||||
serves your WordPress site from Cloudflare's edge network and caches third-party
|
||||
fonts.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/automatic_platform_optimization",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, automatic_platform_optimization_edit_params.AutomaticPlatformOptimizationEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AutomaticPlatformOptimization]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AutomaticPlatformOptimization]], ResultWrapper[AutomaticPlatformOptimization]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[AutomaticPlatformOptimization]:
|
||||
"""
|
||||
[Automatic Platform Optimization for WordPress](https://developers.cloudflare.com/automatic-platform-optimization/)
|
||||
serves your WordPress site from Cloudflare's edge network and caches third-party
|
||||
fonts.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/automatic_platform_optimization",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AutomaticPlatformOptimization]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AutomaticPlatformOptimization]], ResultWrapper[AutomaticPlatformOptimization]),
|
||||
)
|
||||
|
||||
|
||||
class AutomaticPlatformOptimizationResourceWithRawResponse:
|
||||
def __init__(self, automatic_platform_optimization: AutomaticPlatformOptimizationResource) -> None:
|
||||
self._automatic_platform_optimization = automatic_platform_optimization
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
automatic_platform_optimization.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
automatic_platform_optimization.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAutomaticPlatformOptimizationResourceWithRawResponse:
|
||||
def __init__(self, automatic_platform_optimization: AsyncAutomaticPlatformOptimizationResource) -> None:
|
||||
self._automatic_platform_optimization = automatic_platform_optimization
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
automatic_platform_optimization.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
automatic_platform_optimization.get,
|
||||
)
|
||||
|
||||
|
||||
class AutomaticPlatformOptimizationResourceWithStreamingResponse:
|
||||
def __init__(self, automatic_platform_optimization: AutomaticPlatformOptimizationResource) -> None:
|
||||
self._automatic_platform_optimization = automatic_platform_optimization
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
automatic_platform_optimization.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
automatic_platform_optimization.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncAutomaticPlatformOptimizationResourceWithStreamingResponse:
|
||||
def __init__(self, automatic_platform_optimization: AsyncAutomaticPlatformOptimizationResource) -> None:
|
||||
self._automatic_platform_optimization = automatic_platform_optimization
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
automatic_platform_optimization.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
automatic_platform_optimization.get,
|
||||
)
|
||||
|
|
@ -1,266 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import brotli_edit_params
|
||||
from ....types.zones.settings.brotli import Brotli
|
||||
|
||||
__all__ = ["BrotliResource", "AsyncBrotliResource"]
|
||||
|
||||
|
||||
class BrotliResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> BrotliResourceWithRawResponse:
|
||||
return BrotliResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> BrotliResourceWithStreamingResponse:
|
||||
return BrotliResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "on"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Brotli]:
|
||||
"""
|
||||
When the client requesting an asset supports the Brotli compression algorithm,
|
||||
Cloudflare will serve a Brotli compressed version of the asset.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/brotli",
|
||||
body=maybe_transform({"value": value}, brotli_edit_params.BrotliEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Brotli]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Brotli]], ResultWrapper[Brotli]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Brotli]:
|
||||
"""
|
||||
When the client requesting an asset supports the Brotli compression algorithm,
|
||||
Cloudflare will serve a Brotli compressed version of the asset.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/brotli",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Brotli]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Brotli]], ResultWrapper[Brotli]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncBrotliResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncBrotliResourceWithRawResponse:
|
||||
return AsyncBrotliResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncBrotliResourceWithStreamingResponse:
|
||||
return AsyncBrotliResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "on"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Brotli]:
|
||||
"""
|
||||
When the client requesting an asset supports the Brotli compression algorithm,
|
||||
Cloudflare will serve a Brotli compressed version of the asset.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/brotli",
|
||||
body=await async_maybe_transform({"value": value}, brotli_edit_params.BrotliEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Brotli]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Brotli]], ResultWrapper[Brotli]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Brotli]:
|
||||
"""
|
||||
When the client requesting an asset supports the Brotli compression algorithm,
|
||||
Cloudflare will serve a Brotli compressed version of the asset.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/brotli",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Brotli]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Brotli]], ResultWrapper[Brotli]),
|
||||
)
|
||||
|
||||
|
||||
class BrotliResourceWithRawResponse:
|
||||
def __init__(self, brotli: BrotliResource) -> None:
|
||||
self._brotli = brotli
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
brotli.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
brotli.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBrotliResourceWithRawResponse:
|
||||
def __init__(self, brotli: AsyncBrotliResource) -> None:
|
||||
self._brotli = brotli
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
brotli.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
brotli.get,
|
||||
)
|
||||
|
||||
|
||||
class BrotliResourceWithStreamingResponse:
|
||||
def __init__(self, brotli: BrotliResource) -> None:
|
||||
self._brotli = brotli
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
brotli.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
brotli.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBrotliResourceWithStreamingResponse:
|
||||
def __init__(self, brotli: AsyncBrotliResource) -> None:
|
||||
self._brotli = brotli
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
brotli.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
brotli.get,
|
||||
)
|
||||
|
|
@ -1,334 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import browser_cache_ttl_edit_params
|
||||
from ....types.zones.settings.browser_cache_ttl import BrowserCacheTTL
|
||||
|
||||
__all__ = ["BrowserCacheTTLResource", "AsyncBrowserCacheTTLResource"]
|
||||
|
||||
|
||||
class BrowserCacheTTLResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> BrowserCacheTTLResourceWithRawResponse:
|
||||
return BrowserCacheTTLResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> BrowserCacheTTLResourceWithStreamingResponse:
|
||||
return BrowserCacheTTLResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
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,
|
||||
],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BrowserCacheTTL]:
|
||||
"""
|
||||
Browser Cache TTL (in seconds) specifies how long Cloudflare-cached resources
|
||||
will remain on your visitors' computers. Cloudflare will honor any larger times
|
||||
specified by your server.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168276).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Setting a TTL of 0 is equivalent to selecting
|
||||
`Respect Existing Headers`
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/browser_cache_ttl",
|
||||
body=maybe_transform({"value": value}, browser_cache_ttl_edit_params.BrowserCacheTTLEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BrowserCacheTTL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BrowserCacheTTL]], ResultWrapper[BrowserCacheTTL]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BrowserCacheTTL]:
|
||||
"""
|
||||
Browser Cache TTL (in seconds) specifies how long Cloudflare-cached resources
|
||||
will remain on your visitors' computers. Cloudflare will honor any larger times
|
||||
specified by your server.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168276).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/browser_cache_ttl",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BrowserCacheTTL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BrowserCacheTTL]], ResultWrapper[BrowserCacheTTL]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncBrowserCacheTTLResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncBrowserCacheTTLResourceWithRawResponse:
|
||||
return AsyncBrowserCacheTTLResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncBrowserCacheTTLResourceWithStreamingResponse:
|
||||
return AsyncBrowserCacheTTLResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
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,
|
||||
],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BrowserCacheTTL]:
|
||||
"""
|
||||
Browser Cache TTL (in seconds) specifies how long Cloudflare-cached resources
|
||||
will remain on your visitors' computers. Cloudflare will honor any larger times
|
||||
specified by your server.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168276).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Setting a TTL of 0 is equivalent to selecting
|
||||
`Respect Existing Headers`
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/browser_cache_ttl",
|
||||
body=await async_maybe_transform({"value": value}, browser_cache_ttl_edit_params.BrowserCacheTTLEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BrowserCacheTTL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BrowserCacheTTL]], ResultWrapper[BrowserCacheTTL]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BrowserCacheTTL]:
|
||||
"""
|
||||
Browser Cache TTL (in seconds) specifies how long Cloudflare-cached resources
|
||||
will remain on your visitors' computers. Cloudflare will honor any larger times
|
||||
specified by your server.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168276).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/browser_cache_ttl",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BrowserCacheTTL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BrowserCacheTTL]], ResultWrapper[BrowserCacheTTL]),
|
||||
)
|
||||
|
||||
|
||||
class BrowserCacheTTLResourceWithRawResponse:
|
||||
def __init__(self, browser_cache_ttl: BrowserCacheTTLResource) -> None:
|
||||
self._browser_cache_ttl = browser_cache_ttl
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
browser_cache_ttl.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
browser_cache_ttl.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBrowserCacheTTLResourceWithRawResponse:
|
||||
def __init__(self, browser_cache_ttl: AsyncBrowserCacheTTLResource) -> None:
|
||||
self._browser_cache_ttl = browser_cache_ttl
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
browser_cache_ttl.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
browser_cache_ttl.get,
|
||||
)
|
||||
|
||||
|
||||
class BrowserCacheTTLResourceWithStreamingResponse:
|
||||
def __init__(self, browser_cache_ttl: BrowserCacheTTLResource) -> None:
|
||||
self._browser_cache_ttl = browser_cache_ttl
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
browser_cache_ttl.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
browser_cache_ttl.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBrowserCacheTTLResourceWithStreamingResponse:
|
||||
def __init__(self, browser_cache_ttl: AsyncBrowserCacheTTLResource) -> None:
|
||||
self._browser_cache_ttl = browser_cache_ttl
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
browser_cache_ttl.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
browser_cache_ttl.get,
|
||||
)
|
||||
|
|
@ -1,278 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import browser_check_edit_params
|
||||
from ....types.zones.settings.browser_check import BrowserCheck
|
||||
|
||||
__all__ = ["BrowserCheckResource", "AsyncBrowserCheckResource"]
|
||||
|
||||
|
||||
class BrowserCheckResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> BrowserCheckResourceWithRawResponse:
|
||||
return BrowserCheckResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> BrowserCheckResourceWithStreamingResponse:
|
||||
return BrowserCheckResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BrowserCheck]:
|
||||
"""
|
||||
Browser Integrity Check is similar to Bad Behavior and looks for common HTTP
|
||||
headers abused most commonly by spammers and denies access to your page. It will
|
||||
also challenge visitors that do not have a user agent or a non standard user
|
||||
agent (also commonly used by abuse bots, crawlers or visitors).
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170086).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/browser_check",
|
||||
body=maybe_transform({"value": value}, browser_check_edit_params.BrowserCheckEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BrowserCheck]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BrowserCheck]], ResultWrapper[BrowserCheck]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BrowserCheck]:
|
||||
"""
|
||||
Browser Integrity Check is similar to Bad Behavior and looks for common HTTP
|
||||
headers abused most commonly by spammers and denies access to your page. It will
|
||||
also challenge visitors that do not have a user agent or a non standard user
|
||||
agent (also commonly used by abuse bots, crawlers or visitors).
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170086).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/browser_check",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BrowserCheck]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BrowserCheck]], ResultWrapper[BrowserCheck]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncBrowserCheckResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncBrowserCheckResourceWithRawResponse:
|
||||
return AsyncBrowserCheckResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncBrowserCheckResourceWithStreamingResponse:
|
||||
return AsyncBrowserCheckResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BrowserCheck]:
|
||||
"""
|
||||
Browser Integrity Check is similar to Bad Behavior and looks for common HTTP
|
||||
headers abused most commonly by spammers and denies access to your page. It will
|
||||
also challenge visitors that do not have a user agent or a non standard user
|
||||
agent (also commonly used by abuse bots, crawlers or visitors).
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170086).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/browser_check",
|
||||
body=await async_maybe_transform({"value": value}, browser_check_edit_params.BrowserCheckEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BrowserCheck]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BrowserCheck]], ResultWrapper[BrowserCheck]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[BrowserCheck]:
|
||||
"""
|
||||
Browser Integrity Check is similar to Bad Behavior and looks for common HTTP
|
||||
headers abused most commonly by spammers and denies access to your page. It will
|
||||
also challenge visitors that do not have a user agent or a non standard user
|
||||
agent (also commonly used by abuse bots, crawlers or visitors).
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170086).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/browser_check",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[BrowserCheck]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[BrowserCheck]], ResultWrapper[BrowserCheck]),
|
||||
)
|
||||
|
||||
|
||||
class BrowserCheckResourceWithRawResponse:
|
||||
def __init__(self, browser_check: BrowserCheckResource) -> None:
|
||||
self._browser_check = browser_check
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
browser_check.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
browser_check.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBrowserCheckResourceWithRawResponse:
|
||||
def __init__(self, browser_check: AsyncBrowserCheckResource) -> None:
|
||||
self._browser_check = browser_check
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
browser_check.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
browser_check.get,
|
||||
)
|
||||
|
||||
|
||||
class BrowserCheckResourceWithStreamingResponse:
|
||||
def __init__(self, browser_check: BrowserCheckResource) -> None:
|
||||
self._browser_check = browser_check
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
browser_check.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
browser_check.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncBrowserCheckResourceWithStreamingResponse:
|
||||
def __init__(self, browser_check: AsyncBrowserCheckResource) -> None:
|
||||
self._browser_check = browser_check
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
browser_check.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
browser_check.get,
|
||||
)
|
||||
|
|
@ -1,282 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import cache_level_edit_params
|
||||
from ....types.zones.settings.cache_level import CacheLevel
|
||||
|
||||
__all__ = ["CacheLevelResource", "AsyncCacheLevelResource"]
|
||||
|
||||
|
||||
class CacheLevelResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> CacheLevelResourceWithRawResponse:
|
||||
return CacheLevelResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> CacheLevelResourceWithStreamingResponse:
|
||||
return CacheLevelResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["aggressive", "basic", "simplified"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[CacheLevel]:
|
||||
"""Cache Level functions based off the setting level.
|
||||
|
||||
The basic setting will cache
|
||||
most static resources (i.e., css, images, and JavaScript). The simplified
|
||||
setting will ignore the query string when delivering a cached resource. The
|
||||
aggressive setting will cache all static resources, including ones with a query
|
||||
string. (https://support.cloudflare.com/hc/en-us/articles/200168256).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/cache_level",
|
||||
body=maybe_transform({"value": value}, cache_level_edit_params.CacheLevelEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[CacheLevel]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[CacheLevel]], ResultWrapper[CacheLevel]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[CacheLevel]:
|
||||
"""Cache Level functions based off the setting level.
|
||||
|
||||
The basic setting will cache
|
||||
most static resources (i.e., css, images, and JavaScript). The simplified
|
||||
setting will ignore the query string when delivering a cached resource. The
|
||||
aggressive setting will cache all static resources, including ones with a query
|
||||
string. (https://support.cloudflare.com/hc/en-us/articles/200168256).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/cache_level",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[CacheLevel]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[CacheLevel]], ResultWrapper[CacheLevel]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncCacheLevelResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncCacheLevelResourceWithRawResponse:
|
||||
return AsyncCacheLevelResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncCacheLevelResourceWithStreamingResponse:
|
||||
return AsyncCacheLevelResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["aggressive", "basic", "simplified"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[CacheLevel]:
|
||||
"""Cache Level functions based off the setting level.
|
||||
|
||||
The basic setting will cache
|
||||
most static resources (i.e., css, images, and JavaScript). The simplified
|
||||
setting will ignore the query string when delivering a cached resource. The
|
||||
aggressive setting will cache all static resources, including ones with a query
|
||||
string. (https://support.cloudflare.com/hc/en-us/articles/200168256).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/cache_level",
|
||||
body=await async_maybe_transform({"value": value}, cache_level_edit_params.CacheLevelEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[CacheLevel]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[CacheLevel]], ResultWrapper[CacheLevel]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[CacheLevel]:
|
||||
"""Cache Level functions based off the setting level.
|
||||
|
||||
The basic setting will cache
|
||||
most static resources (i.e., css, images, and JavaScript). The simplified
|
||||
setting will ignore the query string when delivering a cached resource. The
|
||||
aggressive setting will cache all static resources, including ones with a query
|
||||
string. (https://support.cloudflare.com/hc/en-us/articles/200168256).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/cache_level",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[CacheLevel]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[CacheLevel]], ResultWrapper[CacheLevel]),
|
||||
)
|
||||
|
||||
|
||||
class CacheLevelResourceWithRawResponse:
|
||||
def __init__(self, cache_level: CacheLevelResource) -> None:
|
||||
self._cache_level = cache_level
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
cache_level.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
cache_level.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncCacheLevelResourceWithRawResponse:
|
||||
def __init__(self, cache_level: AsyncCacheLevelResource) -> None:
|
||||
self._cache_level = cache_level
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
cache_level.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
cache_level.get,
|
||||
)
|
||||
|
||||
|
||||
class CacheLevelResourceWithStreamingResponse:
|
||||
def __init__(self, cache_level: CacheLevelResource) -> None:
|
||||
self._cache_level = cache_level
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
cache_level.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
cache_level.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncCacheLevelResourceWithStreamingResponse:
|
||||
def __init__(self, cache_level: AsyncCacheLevelResource) -> None:
|
||||
self._cache_level = cache_level
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
cache_level.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
cache_level.get,
|
||||
)
|
||||
|
|
@ -1,278 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import challenge_ttl_edit_params
|
||||
from ....types.zones.settings.challenge_ttl import ChallengeTTL
|
||||
|
||||
__all__ = ["ChallengeTTLResource", "AsyncChallengeTTLResource"]
|
||||
|
||||
|
||||
class ChallengeTTLResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ChallengeTTLResourceWithRawResponse:
|
||||
return ChallengeTTLResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ChallengeTTLResourceWithStreamingResponse:
|
||||
return ChallengeTTLResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal[300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ChallengeTTL]:
|
||||
"""
|
||||
Specify how long a visitor is allowed access to your site after successfully
|
||||
completing a challenge (such as a CAPTCHA). After the TTL has expired the
|
||||
visitor will have to complete a new challenge. We recommend a 15 - 45 minute
|
||||
setting and will attempt to honor any setting above 45 minutes.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170136).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/challenge_ttl",
|
||||
body=maybe_transform({"value": value}, challenge_ttl_edit_params.ChallengeTTLEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ChallengeTTL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ChallengeTTL]], ResultWrapper[ChallengeTTL]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ChallengeTTL]:
|
||||
"""
|
||||
Specify how long a visitor is allowed access to your site after successfully
|
||||
completing a challenge (such as a CAPTCHA). After the TTL has expired the
|
||||
visitor will have to complete a new challenge. We recommend a 15 - 45 minute
|
||||
setting and will attempt to honor any setting above 45 minutes.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170136).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/challenge_ttl",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ChallengeTTL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ChallengeTTL]], ResultWrapper[ChallengeTTL]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncChallengeTTLResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncChallengeTTLResourceWithRawResponse:
|
||||
return AsyncChallengeTTLResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncChallengeTTLResourceWithStreamingResponse:
|
||||
return AsyncChallengeTTLResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal[300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ChallengeTTL]:
|
||||
"""
|
||||
Specify how long a visitor is allowed access to your site after successfully
|
||||
completing a challenge (such as a CAPTCHA). After the TTL has expired the
|
||||
visitor will have to complete a new challenge. We recommend a 15 - 45 minute
|
||||
setting and will attempt to honor any setting above 45 minutes.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170136).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/challenge_ttl",
|
||||
body=await async_maybe_transform({"value": value}, challenge_ttl_edit_params.ChallengeTTLEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ChallengeTTL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ChallengeTTL]], ResultWrapper[ChallengeTTL]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ChallengeTTL]:
|
||||
"""
|
||||
Specify how long a visitor is allowed access to your site after successfully
|
||||
completing a challenge (such as a CAPTCHA). After the TTL has expired the
|
||||
visitor will have to complete a new challenge. We recommend a 15 - 45 minute
|
||||
setting and will attempt to honor any setting above 45 minutes.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170136).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/challenge_ttl",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ChallengeTTL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ChallengeTTL]], ResultWrapper[ChallengeTTL]),
|
||||
)
|
||||
|
||||
|
||||
class ChallengeTTLResourceWithRawResponse:
|
||||
def __init__(self, challenge_ttl: ChallengeTTLResource) -> None:
|
||||
self._challenge_ttl = challenge_ttl
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
challenge_ttl.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
challenge_ttl.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncChallengeTTLResourceWithRawResponse:
|
||||
def __init__(self, challenge_ttl: AsyncChallengeTTLResource) -> None:
|
||||
self._challenge_ttl = challenge_ttl
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
challenge_ttl.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
challenge_ttl.get,
|
||||
)
|
||||
|
||||
|
||||
class ChallengeTTLResourceWithStreamingResponse:
|
||||
def __init__(self, challenge_ttl: ChallengeTTLResource) -> None:
|
||||
self._challenge_ttl = challenge_ttl
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
challenge_ttl.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
challenge_ttl.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncChallengeTTLResourceWithStreamingResponse:
|
||||
def __init__(self, challenge_ttl: AsyncChallengeTTLResource) -> None:
|
||||
self._challenge_ttl = challenge_ttl
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
challenge_ttl.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
challenge_ttl.get,
|
||||
)
|
||||
|
|
@ -1,261 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import cipher_edit_params
|
||||
from ....types.zones.settings.ciphers import Ciphers
|
||||
|
||||
__all__ = ["CiphersResource", "AsyncCiphersResource"]
|
||||
|
||||
|
||||
class CiphersResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> CiphersResourceWithRawResponse:
|
||||
return CiphersResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> CiphersResourceWithStreamingResponse:
|
||||
return CiphersResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: List[str],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Ciphers]:
|
||||
"""
|
||||
Changes ciphers setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/ciphers",
|
||||
body=maybe_transform({"value": value}, cipher_edit_params.CipherEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Ciphers]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Ciphers]], ResultWrapper[Ciphers]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Ciphers]:
|
||||
"""
|
||||
Gets ciphers setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/ciphers",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Ciphers]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Ciphers]], ResultWrapper[Ciphers]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncCiphersResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncCiphersResourceWithRawResponse:
|
||||
return AsyncCiphersResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncCiphersResourceWithStreamingResponse:
|
||||
return AsyncCiphersResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: List[str],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Ciphers]:
|
||||
"""
|
||||
Changes ciphers setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/ciphers",
|
||||
body=await async_maybe_transform({"value": value}, cipher_edit_params.CipherEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Ciphers]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Ciphers]], ResultWrapper[Ciphers]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Ciphers]:
|
||||
"""
|
||||
Gets ciphers setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/ciphers",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Ciphers]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Ciphers]], ResultWrapper[Ciphers]),
|
||||
)
|
||||
|
||||
|
||||
class CiphersResourceWithRawResponse:
|
||||
def __init__(self, ciphers: CiphersResource) -> None:
|
||||
self._ciphers = ciphers
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
ciphers.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
ciphers.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncCiphersResourceWithRawResponse:
|
||||
def __init__(self, ciphers: AsyncCiphersResource) -> None:
|
||||
self._ciphers = ciphers
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
ciphers.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
ciphers.get,
|
||||
)
|
||||
|
||||
|
||||
class CiphersResourceWithStreamingResponse:
|
||||
def __init__(self, ciphers: CiphersResource) -> None:
|
||||
self._ciphers = ciphers
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
ciphers.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
ciphers.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncCiphersResourceWithStreamingResponse:
|
||||
def __init__(self, ciphers: AsyncCiphersResource) -> None:
|
||||
self._ciphers = ciphers
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
ciphers.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
ciphers.get,
|
||||
)
|
||||
|
|
@ -1,282 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import development_mode_edit_params
|
||||
from ....types.zones.settings.development_mode import DevelopmentMode
|
||||
|
||||
__all__ = ["DevelopmentModeResource", "AsyncDevelopmentModeResource"]
|
||||
|
||||
|
||||
class DevelopmentModeResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> DevelopmentModeResourceWithRawResponse:
|
||||
return DevelopmentModeResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> DevelopmentModeResourceWithStreamingResponse:
|
||||
return DevelopmentModeResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[DevelopmentMode]:
|
||||
"""
|
||||
Development Mode temporarily allows you to enter development mode for your
|
||||
websites if you need to make changes to your site. This will bypass Cloudflare's
|
||||
accelerated cache and slow down your site, but is useful if you are making
|
||||
changes to cacheable content (like images, css, or JavaScript) and would like to
|
||||
see those changes right away. Once entered, development mode will last for 3
|
||||
hours and then automatically toggle off.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/development_mode",
|
||||
body=maybe_transform({"value": value}, development_mode_edit_params.DevelopmentModeEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DevelopmentMode]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DevelopmentMode]], ResultWrapper[DevelopmentMode]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[DevelopmentMode]:
|
||||
"""
|
||||
Development Mode temporarily allows you to enter development mode for your
|
||||
websites if you need to make changes to your site. This will bypass Cloudflare's
|
||||
accelerated cache and slow down your site, but is useful if you are making
|
||||
changes to cacheable content (like images, css, or JavaScript) and would like to
|
||||
see those changes right away. Once entered, development mode will last for 3
|
||||
hours and then automatically toggle off.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/development_mode",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DevelopmentMode]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DevelopmentMode]], ResultWrapper[DevelopmentMode]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncDevelopmentModeResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncDevelopmentModeResourceWithRawResponse:
|
||||
return AsyncDevelopmentModeResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncDevelopmentModeResourceWithStreamingResponse:
|
||||
return AsyncDevelopmentModeResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[DevelopmentMode]:
|
||||
"""
|
||||
Development Mode temporarily allows you to enter development mode for your
|
||||
websites if you need to make changes to your site. This will bypass Cloudflare's
|
||||
accelerated cache and slow down your site, but is useful if you are making
|
||||
changes to cacheable content (like images, css, or JavaScript) and would like to
|
||||
see those changes right away. Once entered, development mode will last for 3
|
||||
hours and then automatically toggle off.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/development_mode",
|
||||
body=await async_maybe_transform({"value": value}, development_mode_edit_params.DevelopmentModeEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DevelopmentMode]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DevelopmentMode]], ResultWrapper[DevelopmentMode]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[DevelopmentMode]:
|
||||
"""
|
||||
Development Mode temporarily allows you to enter development mode for your
|
||||
websites if you need to make changes to your site. This will bypass Cloudflare's
|
||||
accelerated cache and slow down your site, but is useful if you are making
|
||||
changes to cacheable content (like images, css, or JavaScript) and would like to
|
||||
see those changes right away. Once entered, development mode will last for 3
|
||||
hours and then automatically toggle off.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/development_mode",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[DevelopmentMode]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[DevelopmentMode]], ResultWrapper[DevelopmentMode]),
|
||||
)
|
||||
|
||||
|
||||
class DevelopmentModeResourceWithRawResponse:
|
||||
def __init__(self, development_mode: DevelopmentModeResource) -> None:
|
||||
self._development_mode = development_mode
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
development_mode.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
development_mode.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncDevelopmentModeResourceWithRawResponse:
|
||||
def __init__(self, development_mode: AsyncDevelopmentModeResource) -> None:
|
||||
self._development_mode = development_mode
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
development_mode.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
development_mode.get,
|
||||
)
|
||||
|
||||
|
||||
class DevelopmentModeResourceWithStreamingResponse:
|
||||
def __init__(self, development_mode: DevelopmentModeResource) -> None:
|
||||
self._development_mode = development_mode
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
development_mode.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
development_mode.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncDevelopmentModeResourceWithStreamingResponse:
|
||||
def __init__(self, development_mode: AsyncDevelopmentModeResource) -> None:
|
||||
self._development_mode = development_mode
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
development_mode.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
development_mode.get,
|
||||
)
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import early_hint_edit_params
|
||||
from ....types.zones.settings.early_hints import EarlyHints
|
||||
|
||||
__all__ = ["EarlyHintsResource", "AsyncEarlyHintsResource"]
|
||||
|
||||
|
||||
class EarlyHintsResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> EarlyHintsResourceWithRawResponse:
|
||||
return EarlyHintsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> EarlyHintsResourceWithStreamingResponse:
|
||||
return EarlyHintsResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[EarlyHints]:
|
||||
"""
|
||||
When enabled, Cloudflare will attempt to speed up overall page loads by serving
|
||||
`103` responses with `Link` headers from the final response. Refer to
|
||||
[Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/early_hints",
|
||||
body=maybe_transform({"value": value}, early_hint_edit_params.EarlyHintEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EarlyHints]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EarlyHints]], ResultWrapper[EarlyHints]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[EarlyHints]:
|
||||
"""
|
||||
When enabled, Cloudflare will attempt to speed up overall page loads by serving
|
||||
`103` responses with `Link` headers from the final response. Refer to
|
||||
[Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/early_hints",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EarlyHints]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EarlyHints]], ResultWrapper[EarlyHints]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncEarlyHintsResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncEarlyHintsResourceWithRawResponse:
|
||||
return AsyncEarlyHintsResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncEarlyHintsResourceWithStreamingResponse:
|
||||
return AsyncEarlyHintsResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[EarlyHints]:
|
||||
"""
|
||||
When enabled, Cloudflare will attempt to speed up overall page loads by serving
|
||||
`103` responses with `Link` headers from the final response. Refer to
|
||||
[Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/early_hints",
|
||||
body=await async_maybe_transform({"value": value}, early_hint_edit_params.EarlyHintEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EarlyHints]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EarlyHints]], ResultWrapper[EarlyHints]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[EarlyHints]:
|
||||
"""
|
||||
When enabled, Cloudflare will attempt to speed up overall page loads by serving
|
||||
`103` responses with `Link` headers from the final response. Refer to
|
||||
[Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/early_hints",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EarlyHints]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EarlyHints]], ResultWrapper[EarlyHints]),
|
||||
)
|
||||
|
||||
|
||||
class EarlyHintsResourceWithRawResponse:
|
||||
def __init__(self, early_hints: EarlyHintsResource) -> None:
|
||||
self._early_hints = early_hints
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
early_hints.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
early_hints.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncEarlyHintsResourceWithRawResponse:
|
||||
def __init__(self, early_hints: AsyncEarlyHintsResource) -> None:
|
||||
self._early_hints = early_hints
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
early_hints.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
early_hints.get,
|
||||
)
|
||||
|
||||
|
||||
class EarlyHintsResourceWithStreamingResponse:
|
||||
def __init__(self, early_hints: EarlyHintsResource) -> None:
|
||||
self._early_hints = early_hints
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
early_hints.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
early_hints.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncEarlyHintsResourceWithStreamingResponse:
|
||||
def __init__(self, early_hints: AsyncEarlyHintsResource) -> None:
|
||||
self._early_hints = early_hints
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
early_hints.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
early_hints.get,
|
||||
)
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import email_obfuscation_edit_params
|
||||
from ....types.zones.settings.email_obfuscation import EmailObfuscation
|
||||
|
||||
__all__ = ["EmailObfuscationResource", "AsyncEmailObfuscationResource"]
|
||||
|
||||
|
||||
class EmailObfuscationResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> EmailObfuscationResourceWithRawResponse:
|
||||
return EmailObfuscationResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> EmailObfuscationResourceWithStreamingResponse:
|
||||
return EmailObfuscationResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[EmailObfuscation]:
|
||||
"""
|
||||
Encrypt email adresses on your web page from bots, while keeping them visible to
|
||||
humans. (https://support.cloudflare.com/hc/en-us/articles/200170016).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/email_obfuscation",
|
||||
body=maybe_transform({"value": value}, email_obfuscation_edit_params.EmailObfuscationEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EmailObfuscation]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EmailObfuscation]], ResultWrapper[EmailObfuscation]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[EmailObfuscation]:
|
||||
"""
|
||||
Encrypt email adresses on your web page from bots, while keeping them visible to
|
||||
humans. (https://support.cloudflare.com/hc/en-us/articles/200170016).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/email_obfuscation",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EmailObfuscation]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EmailObfuscation]], ResultWrapper[EmailObfuscation]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncEmailObfuscationResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncEmailObfuscationResourceWithRawResponse:
|
||||
return AsyncEmailObfuscationResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncEmailObfuscationResourceWithStreamingResponse:
|
||||
return AsyncEmailObfuscationResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[EmailObfuscation]:
|
||||
"""
|
||||
Encrypt email adresses on your web page from bots, while keeping them visible to
|
||||
humans. (https://support.cloudflare.com/hc/en-us/articles/200170016).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/email_obfuscation",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, email_obfuscation_edit_params.EmailObfuscationEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EmailObfuscation]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EmailObfuscation]], ResultWrapper[EmailObfuscation]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[EmailObfuscation]:
|
||||
"""
|
||||
Encrypt email adresses on your web page from bots, while keeping them visible to
|
||||
humans. (https://support.cloudflare.com/hc/en-us/articles/200170016).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/email_obfuscation",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EmailObfuscation]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EmailObfuscation]], ResultWrapper[EmailObfuscation]),
|
||||
)
|
||||
|
||||
|
||||
class EmailObfuscationResourceWithRawResponse:
|
||||
def __init__(self, email_obfuscation: EmailObfuscationResource) -> None:
|
||||
self._email_obfuscation = email_obfuscation
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
email_obfuscation.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
email_obfuscation.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncEmailObfuscationResourceWithRawResponse:
|
||||
def __init__(self, email_obfuscation: AsyncEmailObfuscationResource) -> None:
|
||||
self._email_obfuscation = email_obfuscation
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
email_obfuscation.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
email_obfuscation.get,
|
||||
)
|
||||
|
||||
|
||||
class EmailObfuscationResourceWithStreamingResponse:
|
||||
def __init__(self, email_obfuscation: EmailObfuscationResource) -> None:
|
||||
self._email_obfuscation = email_obfuscation
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
email_obfuscation.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
email_obfuscation.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncEmailObfuscationResourceWithStreamingResponse:
|
||||
def __init__(self, email_obfuscation: AsyncEmailObfuscationResource) -> None:
|
||||
self._email_obfuscation = email_obfuscation
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
email_obfuscation.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
email_obfuscation.get,
|
||||
)
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import H2Prioritization, h2_prioritization_edit_params
|
||||
from ....types.zones.settings.h2_prioritization import H2Prioritization
|
||||
from ....types.zones.settings.h2_prioritization_param import H2PrioritizationParam
|
||||
|
||||
__all__ = ["H2PrioritizationResource", "AsyncH2PrioritizationResource"]
|
||||
|
||||
|
||||
class H2PrioritizationResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> H2PrioritizationResourceWithRawResponse:
|
||||
return H2PrioritizationResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> H2PrioritizationResourceWithStreamingResponse:
|
||||
return H2PrioritizationResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: H2PrioritizationParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[H2Prioritization]:
|
||||
"""
|
||||
Gets HTTP/2 Edge Prioritization setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: HTTP/2 Edge Prioritization optimises the delivery of resources served through
|
||||
HTTP/2 to improve page load performance. It also supports fine control of
|
||||
content delivery when used in conjunction with Workers.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/h2_prioritization",
|
||||
body=maybe_transform({"value": value}, h2_prioritization_edit_params.H2PrioritizationEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[H2Prioritization]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[H2Prioritization]], ResultWrapper[H2Prioritization]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[H2Prioritization]:
|
||||
"""
|
||||
Gets HTTP/2 Edge Prioritization setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/h2_prioritization",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[H2Prioritization]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[H2Prioritization]], ResultWrapper[H2Prioritization]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncH2PrioritizationResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncH2PrioritizationResourceWithRawResponse:
|
||||
return AsyncH2PrioritizationResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncH2PrioritizationResourceWithStreamingResponse:
|
||||
return AsyncH2PrioritizationResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: H2PrioritizationParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[H2Prioritization]:
|
||||
"""
|
||||
Gets HTTP/2 Edge Prioritization setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: HTTP/2 Edge Prioritization optimises the delivery of resources served through
|
||||
HTTP/2 to improve page load performance. It also supports fine control of
|
||||
content delivery when used in conjunction with Workers.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/h2_prioritization",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, h2_prioritization_edit_params.H2PrioritizationEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[H2Prioritization]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[H2Prioritization]], ResultWrapper[H2Prioritization]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[H2Prioritization]:
|
||||
"""
|
||||
Gets HTTP/2 Edge Prioritization setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/h2_prioritization",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[H2Prioritization]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[H2Prioritization]], ResultWrapper[H2Prioritization]),
|
||||
)
|
||||
|
||||
|
||||
class H2PrioritizationResourceWithRawResponse:
|
||||
def __init__(self, h2_prioritization: H2PrioritizationResource) -> None:
|
||||
self._h2_prioritization = h2_prioritization
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
h2_prioritization.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
h2_prioritization.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncH2PrioritizationResourceWithRawResponse:
|
||||
def __init__(self, h2_prioritization: AsyncH2PrioritizationResource) -> None:
|
||||
self._h2_prioritization = h2_prioritization
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
h2_prioritization.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
h2_prioritization.get,
|
||||
)
|
||||
|
||||
|
||||
class H2PrioritizationResourceWithStreamingResponse:
|
||||
def __init__(self, h2_prioritization: H2PrioritizationResource) -> None:
|
||||
self._h2_prioritization = h2_prioritization
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
h2_prioritization.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
h2_prioritization.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncH2PrioritizationResourceWithStreamingResponse:
|
||||
def __init__(self, h2_prioritization: AsyncH2PrioritizationResource) -> None:
|
||||
self._h2_prioritization = h2_prioritization
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
h2_prioritization.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
h2_prioritization.get,
|
||||
)
|
||||
|
|
@ -1,288 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import hotlink_protection_edit_params
|
||||
from ....types.zones.settings.hotlink_protection import HotlinkProtection
|
||||
|
||||
__all__ = ["HotlinkProtectionResource", "AsyncHotlinkProtectionResource"]
|
||||
|
||||
|
||||
class HotlinkProtectionResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> HotlinkProtectionResourceWithRawResponse:
|
||||
return HotlinkProtectionResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> HotlinkProtectionResourceWithStreamingResponse:
|
||||
return HotlinkProtectionResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HotlinkProtection]:
|
||||
"""
|
||||
When enabled, the Hotlink Protection option ensures that other sites cannot suck
|
||||
up your bandwidth by building pages that use images hosted on your site. Anytime
|
||||
a request for an image on your site hits Cloudflare, we check to ensure that
|
||||
it's not another site requesting them. People will still be able to download and
|
||||
view images from your page, but other sites won't be able to steal them for use
|
||||
on their own pages.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170026).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/hotlink_protection",
|
||||
body=maybe_transform({"value": value}, hotlink_protection_edit_params.HotlinkProtectionEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HotlinkProtection]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HotlinkProtection]], ResultWrapper[HotlinkProtection]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HotlinkProtection]:
|
||||
"""
|
||||
When enabled, the Hotlink Protection option ensures that other sites cannot suck
|
||||
up your bandwidth by building pages that use images hosted on your site. Anytime
|
||||
a request for an image on your site hits Cloudflare, we check to ensure that
|
||||
it's not another site requesting them. People will still be able to download and
|
||||
view images from your page, but other sites won't be able to steal them for use
|
||||
on their own pages.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170026).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/hotlink_protection",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HotlinkProtection]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HotlinkProtection]], ResultWrapper[HotlinkProtection]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncHotlinkProtectionResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncHotlinkProtectionResourceWithRawResponse:
|
||||
return AsyncHotlinkProtectionResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncHotlinkProtectionResourceWithStreamingResponse:
|
||||
return AsyncHotlinkProtectionResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HotlinkProtection]:
|
||||
"""
|
||||
When enabled, the Hotlink Protection option ensures that other sites cannot suck
|
||||
up your bandwidth by building pages that use images hosted on your site. Anytime
|
||||
a request for an image on your site hits Cloudflare, we check to ensure that
|
||||
it's not another site requesting them. People will still be able to download and
|
||||
view images from your page, but other sites won't be able to steal them for use
|
||||
on their own pages.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170026).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/hotlink_protection",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, hotlink_protection_edit_params.HotlinkProtectionEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HotlinkProtection]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HotlinkProtection]], ResultWrapper[HotlinkProtection]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HotlinkProtection]:
|
||||
"""
|
||||
When enabled, the Hotlink Protection option ensures that other sites cannot suck
|
||||
up your bandwidth by building pages that use images hosted on your site. Anytime
|
||||
a request for an image on your site hits Cloudflare, we check to ensure that
|
||||
it's not another site requesting them. People will still be able to download and
|
||||
view images from your page, but other sites won't be able to steal them for use
|
||||
on their own pages.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170026).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/hotlink_protection",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HotlinkProtection]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HotlinkProtection]], ResultWrapper[HotlinkProtection]),
|
||||
)
|
||||
|
||||
|
||||
class HotlinkProtectionResourceWithRawResponse:
|
||||
def __init__(self, hotlink_protection: HotlinkProtectionResource) -> None:
|
||||
self._hotlink_protection = hotlink_protection
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
hotlink_protection.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
hotlink_protection.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncHotlinkProtectionResourceWithRawResponse:
|
||||
def __init__(self, hotlink_protection: AsyncHotlinkProtectionResource) -> None:
|
||||
self._hotlink_protection = hotlink_protection
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
hotlink_protection.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
hotlink_protection.get,
|
||||
)
|
||||
|
||||
|
||||
class HotlinkProtectionResourceWithStreamingResponse:
|
||||
def __init__(self, hotlink_protection: HotlinkProtectionResource) -> None:
|
||||
self._hotlink_protection = hotlink_protection
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
hotlink_protection.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
hotlink_protection.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncHotlinkProtectionResourceWithStreamingResponse:
|
||||
def __init__(self, hotlink_protection: AsyncHotlinkProtectionResource) -> None:
|
||||
self._hotlink_protection = hotlink_protection
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
hotlink_protection.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
hotlink_protection.get,
|
||||
)
|
||||
|
|
@ -1,262 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import http2_edit_params
|
||||
from ....types.zones.settings.http2 import HTTP2
|
||||
|
||||
__all__ = ["HTTP2Resource", "AsyncHTTP2Resource"]
|
||||
|
||||
|
||||
class HTTP2Resource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> HTTP2ResourceWithRawResponse:
|
||||
return HTTP2ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> HTTP2ResourceWithStreamingResponse:
|
||||
return HTTP2ResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HTTP2]:
|
||||
"""
|
||||
Value of the HTTP2 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the HTTP2 setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/http2",
|
||||
body=maybe_transform({"value": value}, http2_edit_params.HTTP2EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HTTP2]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HTTP2]], ResultWrapper[HTTP2]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HTTP2]:
|
||||
"""
|
||||
Value of the HTTP2 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/http2",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HTTP2]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HTTP2]], ResultWrapper[HTTP2]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncHTTP2Resource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncHTTP2ResourceWithRawResponse:
|
||||
return AsyncHTTP2ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncHTTP2ResourceWithStreamingResponse:
|
||||
return AsyncHTTP2ResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HTTP2]:
|
||||
"""
|
||||
Value of the HTTP2 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the HTTP2 setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/http2",
|
||||
body=await async_maybe_transform({"value": value}, http2_edit_params.HTTP2EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HTTP2]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HTTP2]], ResultWrapper[HTTP2]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HTTP2]:
|
||||
"""
|
||||
Value of the HTTP2 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/http2",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HTTP2]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HTTP2]], ResultWrapper[HTTP2]),
|
||||
)
|
||||
|
||||
|
||||
class HTTP2ResourceWithRawResponse:
|
||||
def __init__(self, http2: HTTP2Resource) -> None:
|
||||
self._http2 = http2
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
http2.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
http2.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncHTTP2ResourceWithRawResponse:
|
||||
def __init__(self, http2: AsyncHTTP2Resource) -> None:
|
||||
self._http2 = http2
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
http2.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
http2.get,
|
||||
)
|
||||
|
||||
|
||||
class HTTP2ResourceWithStreamingResponse:
|
||||
def __init__(self, http2: HTTP2Resource) -> None:
|
||||
self._http2 = http2
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
http2.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
http2.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncHTTP2ResourceWithStreamingResponse:
|
||||
def __init__(self, http2: AsyncHTTP2Resource) -> None:
|
||||
self._http2 = http2
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
http2.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
http2.get,
|
||||
)
|
||||
|
|
@ -1,262 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import http3_edit_params
|
||||
from ....types.zones.settings.http3 import HTTP3
|
||||
|
||||
__all__ = ["HTTP3Resource", "AsyncHTTP3Resource"]
|
||||
|
||||
|
||||
class HTTP3Resource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> HTTP3ResourceWithRawResponse:
|
||||
return HTTP3ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> HTTP3ResourceWithStreamingResponse:
|
||||
return HTTP3ResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HTTP3]:
|
||||
"""
|
||||
Value of the HTTP3 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the HTTP3 setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/http3",
|
||||
body=maybe_transform({"value": value}, http3_edit_params.HTTP3EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HTTP3]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HTTP3]], ResultWrapper[HTTP3]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HTTP3]:
|
||||
"""
|
||||
Value of the HTTP3 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/http3",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HTTP3]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HTTP3]], ResultWrapper[HTTP3]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncHTTP3Resource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncHTTP3ResourceWithRawResponse:
|
||||
return AsyncHTTP3ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncHTTP3ResourceWithStreamingResponse:
|
||||
return AsyncHTTP3ResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HTTP3]:
|
||||
"""
|
||||
Value of the HTTP3 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the HTTP3 setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/http3",
|
||||
body=await async_maybe_transform({"value": value}, http3_edit_params.HTTP3EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HTTP3]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HTTP3]], ResultWrapper[HTTP3]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[HTTP3]:
|
||||
"""
|
||||
Value of the HTTP3 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/http3",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[HTTP3]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[HTTP3]], ResultWrapper[HTTP3]),
|
||||
)
|
||||
|
||||
|
||||
class HTTP3ResourceWithRawResponse:
|
||||
def __init__(self, http3: HTTP3Resource) -> None:
|
||||
self._http3 = http3
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
http3.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
http3.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncHTTP3ResourceWithRawResponse:
|
||||
def __init__(self, http3: AsyncHTTP3Resource) -> None:
|
||||
self._http3 = http3
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
http3.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
http3.get,
|
||||
)
|
||||
|
||||
|
||||
class HTTP3ResourceWithStreamingResponse:
|
||||
def __init__(self, http3: HTTP3Resource) -> None:
|
||||
self._http3 = http3
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
http3.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
http3.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncHTTP3ResourceWithStreamingResponse:
|
||||
def __init__(self, http3: AsyncHTTP3Resource) -> None:
|
||||
self._http3 = http3
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
http3.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
http3.get,
|
||||
)
|
||||
|
|
@ -1,280 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import ImageResizing, image_resizing_edit_params
|
||||
from ....types.zones.settings.image_resizing import ImageResizing
|
||||
from ....types.zones.settings.image_resizing_param import ImageResizingParam
|
||||
|
||||
__all__ = ["ImageResizingResource", "AsyncImageResizingResource"]
|
||||
|
||||
|
||||
class ImageResizingResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ImageResizingResourceWithRawResponse:
|
||||
return ImageResizingResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ImageResizingResourceWithStreamingResponse:
|
||||
return ImageResizingResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: ImageResizingParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ImageResizing]:
|
||||
"""
|
||||
Image Resizing provides on-demand resizing, conversion and optimisation for
|
||||
images served through Cloudflare's network. Refer to the
|
||||
[Image Resizing documentation](https://developers.cloudflare.com/images/) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Image Resizing provides on-demand resizing, conversion and optimisation for
|
||||
images served through Cloudflare's network. Refer to the
|
||||
[Image Resizing documentation](https://developers.cloudflare.com/images/) for
|
||||
more information.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/image_resizing",
|
||||
body=maybe_transform({"value": value}, image_resizing_edit_params.ImageResizingEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ImageResizing]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ImageResizing]], ResultWrapper[ImageResizing]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ImageResizing]:
|
||||
"""
|
||||
Image Resizing provides on-demand resizing, conversion and optimisation for
|
||||
images served through Cloudflare's network. Refer to the
|
||||
[Image Resizing documentation](https://developers.cloudflare.com/images/) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/image_resizing",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ImageResizing]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ImageResizing]], ResultWrapper[ImageResizing]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncImageResizingResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncImageResizingResourceWithRawResponse:
|
||||
return AsyncImageResizingResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncImageResizingResourceWithStreamingResponse:
|
||||
return AsyncImageResizingResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: ImageResizingParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ImageResizing]:
|
||||
"""
|
||||
Image Resizing provides on-demand resizing, conversion and optimisation for
|
||||
images served through Cloudflare's network. Refer to the
|
||||
[Image Resizing documentation](https://developers.cloudflare.com/images/) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Image Resizing provides on-demand resizing, conversion and optimisation for
|
||||
images served through Cloudflare's network. Refer to the
|
||||
[Image Resizing documentation](https://developers.cloudflare.com/images/) for
|
||||
more information.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/image_resizing",
|
||||
body=await async_maybe_transform({"value": value}, image_resizing_edit_params.ImageResizingEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ImageResizing]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ImageResizing]], ResultWrapper[ImageResizing]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ImageResizing]:
|
||||
"""
|
||||
Image Resizing provides on-demand resizing, conversion and optimisation for
|
||||
images served through Cloudflare's network. Refer to the
|
||||
[Image Resizing documentation](https://developers.cloudflare.com/images/) for
|
||||
more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/image_resizing",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ImageResizing]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ImageResizing]], ResultWrapper[ImageResizing]),
|
||||
)
|
||||
|
||||
|
||||
class ImageResizingResourceWithRawResponse:
|
||||
def __init__(self, image_resizing: ImageResizingResource) -> None:
|
||||
self._image_resizing = image_resizing
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
image_resizing.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
image_resizing.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncImageResizingResourceWithRawResponse:
|
||||
def __init__(self, image_resizing: AsyncImageResizingResource) -> None:
|
||||
self._image_resizing = image_resizing
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
image_resizing.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
image_resizing.get,
|
||||
)
|
||||
|
||||
|
||||
class ImageResizingResourceWithStreamingResponse:
|
||||
def __init__(self, image_resizing: ImageResizingResource) -> None:
|
||||
self._image_resizing = image_resizing
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
image_resizing.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
image_resizing.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncImageResizingResourceWithStreamingResponse:
|
||||
def __init__(self, image_resizing: AsyncImageResizingResource) -> None:
|
||||
self._image_resizing = image_resizing
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
image_resizing.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
image_resizing.get,
|
||||
)
|
||||
|
|
@ -1,270 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import ip_geolocation_edit_params
|
||||
from ....types.zones.settings.ip_geolocation import IPGeolocation
|
||||
|
||||
__all__ = ["IPGeolocationResource", "AsyncIPGeolocationResource"]
|
||||
|
||||
|
||||
class IPGeolocationResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> IPGeolocationResourceWithRawResponse:
|
||||
return IPGeolocationResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> IPGeolocationResourceWithStreamingResponse:
|
||||
return IPGeolocationResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPGeolocation]:
|
||||
"""
|
||||
Enable IP Geolocation to have Cloudflare geolocate visitors to your website and
|
||||
pass the country code to you.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168236).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/ip_geolocation",
|
||||
body=maybe_transform({"value": value}, ip_geolocation_edit_params.IPGeolocationEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[IPGeolocation]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[IPGeolocation]], ResultWrapper[IPGeolocation]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPGeolocation]:
|
||||
"""
|
||||
Enable IP Geolocation to have Cloudflare geolocate visitors to your website and
|
||||
pass the country code to you.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168236).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/ip_geolocation",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[IPGeolocation]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[IPGeolocation]], ResultWrapper[IPGeolocation]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPGeolocationResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncIPGeolocationResourceWithRawResponse:
|
||||
return AsyncIPGeolocationResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncIPGeolocationResourceWithStreamingResponse:
|
||||
return AsyncIPGeolocationResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPGeolocation]:
|
||||
"""
|
||||
Enable IP Geolocation to have Cloudflare geolocate visitors to your website and
|
||||
pass the country code to you.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168236).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/ip_geolocation",
|
||||
body=await async_maybe_transform({"value": value}, ip_geolocation_edit_params.IPGeolocationEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[IPGeolocation]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[IPGeolocation]], ResultWrapper[IPGeolocation]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPGeolocation]:
|
||||
"""
|
||||
Enable IP Geolocation to have Cloudflare geolocate visitors to your website and
|
||||
pass the country code to you.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168236).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/ip_geolocation",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[IPGeolocation]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[IPGeolocation]], ResultWrapper[IPGeolocation]),
|
||||
)
|
||||
|
||||
|
||||
class IPGeolocationResourceWithRawResponse:
|
||||
def __init__(self, ip_geolocation: IPGeolocationResource) -> None:
|
||||
self._ip_geolocation = ip_geolocation
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
ip_geolocation.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
ip_geolocation.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPGeolocationResourceWithRawResponse:
|
||||
def __init__(self, ip_geolocation: AsyncIPGeolocationResource) -> None:
|
||||
self._ip_geolocation = ip_geolocation
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
ip_geolocation.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
ip_geolocation.get,
|
||||
)
|
||||
|
||||
|
||||
class IPGeolocationResourceWithStreamingResponse:
|
||||
def __init__(self, ip_geolocation: IPGeolocationResource) -> None:
|
||||
self._ip_geolocation = ip_geolocation
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
ip_geolocation.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
ip_geolocation.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPGeolocationResourceWithStreamingResponse:
|
||||
def __init__(self, ip_geolocation: AsyncIPGeolocationResource) -> None:
|
||||
self._ip_geolocation = ip_geolocation
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
ip_geolocation.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
ip_geolocation.get,
|
||||
)
|
||||
|
|
@ -1,266 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import ipv6_edit_params
|
||||
from ....types.zones.settings.ipv6 import IPV6
|
||||
|
||||
__all__ = ["IPV6Resource", "AsyncIPV6Resource"]
|
||||
|
||||
|
||||
class IPV6Resource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> IPV6ResourceWithRawResponse:
|
||||
return IPV6ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> IPV6ResourceWithStreamingResponse:
|
||||
return IPV6ResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "on"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPV6]:
|
||||
"""
|
||||
Enable IPv6 on all subdomains that are Cloudflare enabled.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168586).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/ipv6",
|
||||
body=maybe_transform({"value": value}, ipv6_edit_params.IPV6EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[IPV6]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[IPV6]], ResultWrapper[IPV6]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPV6]:
|
||||
"""
|
||||
Enable IPv6 on all subdomains that are Cloudflare enabled.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168586).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/ipv6",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[IPV6]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[IPV6]], ResultWrapper[IPV6]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPV6Resource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncIPV6ResourceWithRawResponse:
|
||||
return AsyncIPV6ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncIPV6ResourceWithStreamingResponse:
|
||||
return AsyncIPV6ResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "on"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPV6]:
|
||||
"""
|
||||
Enable IPv6 on all subdomains that are Cloudflare enabled.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168586).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/ipv6",
|
||||
body=await async_maybe_transform({"value": value}, ipv6_edit_params.IPV6EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[IPV6]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[IPV6]], ResultWrapper[IPV6]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[IPV6]:
|
||||
"""
|
||||
Enable IPv6 on all subdomains that are Cloudflare enabled.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200168586).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/ipv6",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[IPV6]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[IPV6]], ResultWrapper[IPV6]),
|
||||
)
|
||||
|
||||
|
||||
class IPV6ResourceWithRawResponse:
|
||||
def __init__(self, ipv6: IPV6Resource) -> None:
|
||||
self._ipv6 = ipv6
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
ipv6.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
ipv6.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPV6ResourceWithRawResponse:
|
||||
def __init__(self, ipv6: AsyncIPV6Resource) -> None:
|
||||
self._ipv6 = ipv6
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
ipv6.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
ipv6.get,
|
||||
)
|
||||
|
||||
|
||||
class IPV6ResourceWithStreamingResponse:
|
||||
def __init__(self, ipv6: IPV6Resource) -> None:
|
||||
self._ipv6 = ipv6
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
ipv6.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
ipv6.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncIPV6ResourceWithStreamingResponse:
|
||||
def __init__(self, ipv6: AsyncIPV6Resource) -> None:
|
||||
self._ipv6 = ipv6
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
ipv6.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
ipv6.get,
|
||||
)
|
||||
|
|
@ -1,262 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import min_tls_version_edit_params
|
||||
from ....types.zones.settings.min_tls_version import MinTLSVersion
|
||||
|
||||
__all__ = ["MinTLSVersionResource", "AsyncMinTLSVersionResource"]
|
||||
|
||||
|
||||
class MinTLSVersionResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> MinTLSVersionResourceWithRawResponse:
|
||||
return MinTLSVersionResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> MinTLSVersionResourceWithStreamingResponse:
|
||||
return MinTLSVersionResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["1.0", "1.1", "1.2", "1.3"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[MinTLSVersion]:
|
||||
"""
|
||||
Changes Minimum TLS Version setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/min_tls_version",
|
||||
body=maybe_transform({"value": value}, min_tls_version_edit_params.MinTLSVersionEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[MinTLSVersion]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MinTLSVersion]], ResultWrapper[MinTLSVersion]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[MinTLSVersion]:
|
||||
"""
|
||||
Gets Minimum TLS Version setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/min_tls_version",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[MinTLSVersion]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MinTLSVersion]], ResultWrapper[MinTLSVersion]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncMinTLSVersionResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncMinTLSVersionResourceWithRawResponse:
|
||||
return AsyncMinTLSVersionResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncMinTLSVersionResourceWithStreamingResponse:
|
||||
return AsyncMinTLSVersionResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["1.0", "1.1", "1.2", "1.3"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[MinTLSVersion]:
|
||||
"""
|
||||
Changes Minimum TLS Version setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/min_tls_version",
|
||||
body=await async_maybe_transform({"value": value}, min_tls_version_edit_params.MinTLSVersionEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[MinTLSVersion]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MinTLSVersion]], ResultWrapper[MinTLSVersion]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[MinTLSVersion]:
|
||||
"""
|
||||
Gets Minimum TLS Version setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/min_tls_version",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[MinTLSVersion]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MinTLSVersion]], ResultWrapper[MinTLSVersion]),
|
||||
)
|
||||
|
||||
|
||||
class MinTLSVersionResourceWithRawResponse:
|
||||
def __init__(self, min_tls_version: MinTLSVersionResource) -> None:
|
||||
self._min_tls_version = min_tls_version
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
min_tls_version.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
min_tls_version.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMinTLSVersionResourceWithRawResponse:
|
||||
def __init__(self, min_tls_version: AsyncMinTLSVersionResource) -> None:
|
||||
self._min_tls_version = min_tls_version
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
min_tls_version.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
min_tls_version.get,
|
||||
)
|
||||
|
||||
|
||||
class MinTLSVersionResourceWithStreamingResponse:
|
||||
def __init__(self, min_tls_version: MinTLSVersionResource) -> None:
|
||||
self._min_tls_version = min_tls_version
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
min_tls_version.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
min_tls_version.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMinTLSVersionResourceWithStreamingResponse:
|
||||
def __init__(self, min_tls_version: AsyncMinTLSVersionResource) -> None:
|
||||
self._min_tls_version = min_tls_version
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
min_tls_version.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
min_tls_version.get,
|
||||
)
|
||||
|
|
@ -1,273 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import minify_edit_params
|
||||
from ....types.zones.settings.minify import Minify
|
||||
|
||||
__all__ = ["MinifyResource", "AsyncMinifyResource"]
|
||||
|
||||
|
||||
class MinifyResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> MinifyResourceWithRawResponse:
|
||||
return MinifyResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> MinifyResourceWithStreamingResponse:
|
||||
return MinifyResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: minify_edit_params.Value,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Minify]:
|
||||
"""Automatically minify certain assets for your website.
|
||||
|
||||
Refer to
|
||||
[Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/minify",
|
||||
body=maybe_transform({"value": value}, minify_edit_params.MinifyEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Minify]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Minify]], ResultWrapper[Minify]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Minify]:
|
||||
"""Automatically minify certain assets for your website.
|
||||
|
||||
Refer to
|
||||
[Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/minify",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Minify]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Minify]], ResultWrapper[Minify]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncMinifyResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncMinifyResourceWithRawResponse:
|
||||
return AsyncMinifyResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncMinifyResourceWithStreamingResponse:
|
||||
return AsyncMinifyResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: minify_edit_params.Value,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Minify]:
|
||||
"""Automatically minify certain assets for your website.
|
||||
|
||||
Refer to
|
||||
[Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/minify",
|
||||
body=await async_maybe_transform({"value": value}, minify_edit_params.MinifyEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Minify]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Minify]], ResultWrapper[Minify]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Minify]:
|
||||
"""Automatically minify certain assets for your website.
|
||||
|
||||
Refer to
|
||||
[Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/minify",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Minify]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Minify]], ResultWrapper[Minify]),
|
||||
)
|
||||
|
||||
|
||||
class MinifyResourceWithRawResponse:
|
||||
def __init__(self, minify: MinifyResource) -> None:
|
||||
self._minify = minify
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
minify.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
minify.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMinifyResourceWithRawResponse:
|
||||
def __init__(self, minify: AsyncMinifyResource) -> None:
|
||||
self._minify = minify
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
minify.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
minify.get,
|
||||
)
|
||||
|
||||
|
||||
class MinifyResourceWithStreamingResponse:
|
||||
def __init__(self, minify: MinifyResource) -> None:
|
||||
self._minify = minify
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
minify.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
minify.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMinifyResourceWithStreamingResponse:
|
||||
def __init__(self, minify: AsyncMinifyResource) -> None:
|
||||
self._minify = minify
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
minify.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
minify.get,
|
||||
)
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import mirage_edit_params
|
||||
from ....types.zones.settings.mirage import Mirage
|
||||
|
||||
__all__ = ["MirageResource", "AsyncMirageResource"]
|
||||
|
||||
|
||||
class MirageResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> MirageResourceWithRawResponse:
|
||||
return MirageResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> MirageResourceWithStreamingResponse:
|
||||
return MirageResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Mirage]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our
|
||||
[blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for more
|
||||
information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/mirage",
|
||||
body=maybe_transform({"value": value}, mirage_edit_params.MirageEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Mirage]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Mirage]], ResultWrapper[Mirage]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Mirage]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our
|
||||
[blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for more
|
||||
information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/mirage",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Mirage]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Mirage]], ResultWrapper[Mirage]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncMirageResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncMirageResourceWithRawResponse:
|
||||
return AsyncMirageResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncMirageResourceWithStreamingResponse:
|
||||
return AsyncMirageResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Mirage]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our
|
||||
[blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for more
|
||||
information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/mirage",
|
||||
body=await async_maybe_transform({"value": value}, mirage_edit_params.MirageEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Mirage]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Mirage]], ResultWrapper[Mirage]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Mirage]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our
|
||||
[blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for more
|
||||
information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/mirage",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Mirage]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Mirage]], ResultWrapper[Mirage]),
|
||||
)
|
||||
|
||||
|
||||
class MirageResourceWithRawResponse:
|
||||
def __init__(self, mirage: MirageResource) -> None:
|
||||
self._mirage = mirage
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
mirage.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
mirage.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMirageResourceWithRawResponse:
|
||||
def __init__(self, mirage: AsyncMirageResource) -> None:
|
||||
self._mirage = mirage
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
mirage.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
mirage.get,
|
||||
)
|
||||
|
||||
|
||||
class MirageResourceWithStreamingResponse:
|
||||
def __init__(self, mirage: MirageResource) -> None:
|
||||
self._mirage = mirage
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
mirage.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
mirage.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMirageResourceWithStreamingResponse:
|
||||
def __init__(self, mirage: AsyncMirageResource) -> None:
|
||||
self._mirage = mirage
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
mirage.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
mirage.get,
|
||||
)
|
||||
|
|
@ -1,273 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import mobile_redirect_edit_params
|
||||
from ....types.zones.settings.mobile_redirect import MobileRedirect
|
||||
|
||||
__all__ = ["MobileRedirectResource", "AsyncMobileRedirectResource"]
|
||||
|
||||
|
||||
class MobileRedirectResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> MobileRedirectResourceWithRawResponse:
|
||||
return MobileRedirectResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> MobileRedirectResourceWithStreamingResponse:
|
||||
return MobileRedirectResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: mobile_redirect_edit_params.Value,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[MobileRedirect]:
|
||||
"""
|
||||
Automatically redirect visitors on mobile devices to a mobile-optimized
|
||||
subdomain. Refer to
|
||||
[Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/mobile_redirect",
|
||||
body=maybe_transform({"value": value}, mobile_redirect_edit_params.MobileRedirectEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[MobileRedirect]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MobileRedirect]], ResultWrapper[MobileRedirect]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[MobileRedirect]:
|
||||
"""
|
||||
Automatically redirect visitors on mobile devices to a mobile-optimized
|
||||
subdomain. Refer to
|
||||
[Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/mobile_redirect",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[MobileRedirect]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MobileRedirect]], ResultWrapper[MobileRedirect]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncMobileRedirectResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncMobileRedirectResourceWithRawResponse:
|
||||
return AsyncMobileRedirectResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncMobileRedirectResourceWithStreamingResponse:
|
||||
return AsyncMobileRedirectResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: mobile_redirect_edit_params.Value,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[MobileRedirect]:
|
||||
"""
|
||||
Automatically redirect visitors on mobile devices to a mobile-optimized
|
||||
subdomain. Refer to
|
||||
[Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/mobile_redirect",
|
||||
body=await async_maybe_transform({"value": value}, mobile_redirect_edit_params.MobileRedirectEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[MobileRedirect]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MobileRedirect]], ResultWrapper[MobileRedirect]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[MobileRedirect]:
|
||||
"""
|
||||
Automatically redirect visitors on mobile devices to a mobile-optimized
|
||||
subdomain. Refer to
|
||||
[Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/mobile_redirect",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[MobileRedirect]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[MobileRedirect]], ResultWrapper[MobileRedirect]),
|
||||
)
|
||||
|
||||
|
||||
class MobileRedirectResourceWithRawResponse:
|
||||
def __init__(self, mobile_redirect: MobileRedirectResource) -> None:
|
||||
self._mobile_redirect = mobile_redirect
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
mobile_redirect.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
mobile_redirect.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMobileRedirectResourceWithRawResponse:
|
||||
def __init__(self, mobile_redirect: AsyncMobileRedirectResource) -> None:
|
||||
self._mobile_redirect = mobile_redirect
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
mobile_redirect.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
mobile_redirect.get,
|
||||
)
|
||||
|
||||
|
||||
class MobileRedirectResourceWithStreamingResponse:
|
||||
def __init__(self, mobile_redirect: MobileRedirectResource) -> None:
|
||||
self._mobile_redirect = mobile_redirect
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
mobile_redirect.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
mobile_redirect.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncMobileRedirectResourceWithStreamingResponse:
|
||||
def __init__(self, mobile_redirect: AsyncMobileRedirectResource) -> None:
|
||||
self._mobile_redirect = mobile_redirect
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
mobile_redirect.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
mobile_redirect.get,
|
||||
)
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import NEL, nel_edit_params
|
||||
from ....types.zones.settings.nel import NEL
|
||||
from ....types.zones.settings.nel_param import NELParam
|
||||
|
||||
__all__ = ["NELResource", "AsyncNELResource"]
|
||||
|
||||
|
||||
class NELResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> NELResourceWithRawResponse:
|
||||
return NELResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> NELResourceWithStreamingResponse:
|
||||
return NELResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: NELParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[NEL]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our [blog post](http://blog.cloudflare.com/nel-solving-mobile-speed)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Enable Network Error Logging reporting on your zone. (Beta)
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/nel",
|
||||
body=maybe_transform({"value": value}, nel_edit_params.NELEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[NEL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[NEL]], ResultWrapper[NEL]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[NEL]:
|
||||
"""Enable Network Error Logging reporting on your zone.
|
||||
|
||||
(Beta)
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/nel",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[NEL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[NEL]], ResultWrapper[NEL]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncNELResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncNELResourceWithRawResponse:
|
||||
return AsyncNELResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncNELResourceWithStreamingResponse:
|
||||
return AsyncNELResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: NELParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[NEL]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our [blog post](http://blog.cloudflare.com/nel-solving-mobile-speed)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Enable Network Error Logging reporting on your zone. (Beta)
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/nel",
|
||||
body=await async_maybe_transform({"value": value}, nel_edit_params.NELEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[NEL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[NEL]], ResultWrapper[NEL]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[NEL]:
|
||||
"""Enable Network Error Logging reporting on your zone.
|
||||
|
||||
(Beta)
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/nel",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[NEL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[NEL]], ResultWrapper[NEL]),
|
||||
)
|
||||
|
||||
|
||||
class NELResourceWithRawResponse:
|
||||
def __init__(self, nel: NELResource) -> None:
|
||||
self._nel = nel
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
nel.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
nel.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncNELResourceWithRawResponse:
|
||||
def __init__(self, nel: AsyncNELResource) -> None:
|
||||
self._nel = nel
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
nel.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
nel.get,
|
||||
)
|
||||
|
||||
|
||||
class NELResourceWithStreamingResponse:
|
||||
def __init__(self, nel: NELResource) -> None:
|
||||
self._nel = nel
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
nel.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
nel.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncNELResourceWithStreamingResponse:
|
||||
def __init__(self, nel: AsyncNELResource) -> None:
|
||||
self._nel = nel
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
nel.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
nel.get,
|
||||
)
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import opportunistic_encryption_edit_params
|
||||
from ....types.zones.settings.opportunistic_encryption import OpportunisticEncryption
|
||||
|
||||
__all__ = ["OpportunisticEncryptionResource", "AsyncOpportunisticEncryptionResource"]
|
||||
|
||||
|
||||
class OpportunisticEncryptionResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> OpportunisticEncryptionResourceWithRawResponse:
|
||||
return OpportunisticEncryptionResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> OpportunisticEncryptionResourceWithStreamingResponse:
|
||||
return OpportunisticEncryptionResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OpportunisticEncryption]:
|
||||
"""
|
||||
Changes Opportunistic Encryption setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/opportunistic_encryption",
|
||||
body=maybe_transform(
|
||||
{"value": value}, opportunistic_encryption_edit_params.OpportunisticEncryptionEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OpportunisticEncryption]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OpportunisticEncryption]], ResultWrapper[OpportunisticEncryption]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OpportunisticEncryption]:
|
||||
"""
|
||||
Gets Opportunistic Encryption setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/opportunistic_encryption",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OpportunisticEncryption]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OpportunisticEncryption]], ResultWrapper[OpportunisticEncryption]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncOpportunisticEncryptionResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncOpportunisticEncryptionResourceWithRawResponse:
|
||||
return AsyncOpportunisticEncryptionResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncOpportunisticEncryptionResourceWithStreamingResponse:
|
||||
return AsyncOpportunisticEncryptionResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OpportunisticEncryption]:
|
||||
"""
|
||||
Changes Opportunistic Encryption setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/opportunistic_encryption",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, opportunistic_encryption_edit_params.OpportunisticEncryptionEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OpportunisticEncryption]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OpportunisticEncryption]], ResultWrapper[OpportunisticEncryption]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OpportunisticEncryption]:
|
||||
"""
|
||||
Gets Opportunistic Encryption setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/opportunistic_encryption",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OpportunisticEncryption]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OpportunisticEncryption]], ResultWrapper[OpportunisticEncryption]),
|
||||
)
|
||||
|
||||
|
||||
class OpportunisticEncryptionResourceWithRawResponse:
|
||||
def __init__(self, opportunistic_encryption: OpportunisticEncryptionResource) -> None:
|
||||
self._opportunistic_encryption = opportunistic_encryption
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
opportunistic_encryption.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
opportunistic_encryption.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncOpportunisticEncryptionResourceWithRawResponse:
|
||||
def __init__(self, opportunistic_encryption: AsyncOpportunisticEncryptionResource) -> None:
|
||||
self._opportunistic_encryption = opportunistic_encryption
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
opportunistic_encryption.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
opportunistic_encryption.get,
|
||||
)
|
||||
|
||||
|
||||
class OpportunisticEncryptionResourceWithStreamingResponse:
|
||||
def __init__(self, opportunistic_encryption: OpportunisticEncryptionResource) -> None:
|
||||
self._opportunistic_encryption = opportunistic_encryption
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
opportunistic_encryption.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
opportunistic_encryption.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncOpportunisticEncryptionResourceWithStreamingResponse:
|
||||
def __init__(self, opportunistic_encryption: AsyncOpportunisticEncryptionResource) -> None:
|
||||
self._opportunistic_encryption = opportunistic_encryption
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
opportunistic_encryption.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
opportunistic_encryption.get,
|
||||
)
|
||||
|
|
@ -1,270 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import opportunistic_onion_edit_params
|
||||
from ....types.zones.settings.opportunistic_onion import OpportunisticOnion
|
||||
|
||||
__all__ = ["OpportunisticOnionResource", "AsyncOpportunisticOnionResource"]
|
||||
|
||||
|
||||
class OpportunisticOnionResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> OpportunisticOnionResourceWithRawResponse:
|
||||
return OpportunisticOnionResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> OpportunisticOnionResourceWithStreamingResponse:
|
||||
return OpportunisticOnionResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OpportunisticOnion]:
|
||||
"""
|
||||
Add an Alt-Svc header to all legitimate requests from Tor, allowing the
|
||||
connection to use our onion services instead of exit nodes.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/opportunistic_onion",
|
||||
body=maybe_transform({"value": value}, opportunistic_onion_edit_params.OpportunisticOnionEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OpportunisticOnion]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OpportunisticOnion]], ResultWrapper[OpportunisticOnion]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OpportunisticOnion]:
|
||||
"""
|
||||
Add an Alt-Svc header to all legitimate requests from Tor, allowing the
|
||||
connection to use our onion services instead of exit nodes.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/opportunistic_onion",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OpportunisticOnion]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OpportunisticOnion]], ResultWrapper[OpportunisticOnion]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncOpportunisticOnionResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncOpportunisticOnionResourceWithRawResponse:
|
||||
return AsyncOpportunisticOnionResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncOpportunisticOnionResourceWithStreamingResponse:
|
||||
return AsyncOpportunisticOnionResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OpportunisticOnion]:
|
||||
"""
|
||||
Add an Alt-Svc header to all legitimate requests from Tor, allowing the
|
||||
connection to use our onion services instead of exit nodes.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/opportunistic_onion",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, opportunistic_onion_edit_params.OpportunisticOnionEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OpportunisticOnion]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OpportunisticOnion]], ResultWrapper[OpportunisticOnion]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OpportunisticOnion]:
|
||||
"""
|
||||
Add an Alt-Svc header to all legitimate requests from Tor, allowing the
|
||||
connection to use our onion services instead of exit nodes.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/opportunistic_onion",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OpportunisticOnion]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OpportunisticOnion]], ResultWrapper[OpportunisticOnion]),
|
||||
)
|
||||
|
||||
|
||||
class OpportunisticOnionResourceWithRawResponse:
|
||||
def __init__(self, opportunistic_onion: OpportunisticOnionResource) -> None:
|
||||
self._opportunistic_onion = opportunistic_onion
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
opportunistic_onion.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
opportunistic_onion.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncOpportunisticOnionResourceWithRawResponse:
|
||||
def __init__(self, opportunistic_onion: AsyncOpportunisticOnionResource) -> None:
|
||||
self._opportunistic_onion = opportunistic_onion
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
opportunistic_onion.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
opportunistic_onion.get,
|
||||
)
|
||||
|
||||
|
||||
class OpportunisticOnionResourceWithStreamingResponse:
|
||||
def __init__(self, opportunistic_onion: OpportunisticOnionResource) -> None:
|
||||
self._opportunistic_onion = opportunistic_onion
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
opportunistic_onion.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
opportunistic_onion.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncOpportunisticOnionResourceWithStreamingResponse:
|
||||
def __init__(self, opportunistic_onion: AsyncOpportunisticOnionResource) -> None:
|
||||
self._opportunistic_onion = opportunistic_onion
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
opportunistic_onion.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
opportunistic_onion.get,
|
||||
)
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import OrangeToOrange, orange_to_orange_edit_params
|
||||
from ....types.zones.settings.orange_to_orange import OrangeToOrange
|
||||
from ....types.zones.settings.orange_to_orange_param import OrangeToOrangeParam
|
||||
|
||||
__all__ = ["OrangeToOrangeResource", "AsyncOrangeToOrangeResource"]
|
||||
|
||||
|
||||
class OrangeToOrangeResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> OrangeToOrangeResourceWithRawResponse:
|
||||
return OrangeToOrangeResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> OrangeToOrangeResourceWithStreamingResponse:
|
||||
return OrangeToOrangeResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: OrangeToOrangeParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OrangeToOrange]:
|
||||
"""
|
||||
Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also
|
||||
on Cloudflare.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also
|
||||
on Cloudflare.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/orange_to_orange",
|
||||
body=maybe_transform({"value": value}, orange_to_orange_edit_params.OrangeToOrangeEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OrangeToOrange]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OrangeToOrange]], ResultWrapper[OrangeToOrange]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OrangeToOrange]:
|
||||
"""
|
||||
Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also
|
||||
on Cloudflare.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/orange_to_orange",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OrangeToOrange]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OrangeToOrange]], ResultWrapper[OrangeToOrange]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncOrangeToOrangeResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncOrangeToOrangeResourceWithRawResponse:
|
||||
return AsyncOrangeToOrangeResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncOrangeToOrangeResourceWithStreamingResponse:
|
||||
return AsyncOrangeToOrangeResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: OrangeToOrangeParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OrangeToOrange]:
|
||||
"""
|
||||
Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also
|
||||
on Cloudflare.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also
|
||||
on Cloudflare.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/orange_to_orange",
|
||||
body=await async_maybe_transform({"value": value}, orange_to_orange_edit_params.OrangeToOrangeEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OrangeToOrange]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OrangeToOrange]], ResultWrapper[OrangeToOrange]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OrangeToOrange]:
|
||||
"""
|
||||
Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also
|
||||
on Cloudflare.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/orange_to_orange",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OrangeToOrange]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OrangeToOrange]], ResultWrapper[OrangeToOrange]),
|
||||
)
|
||||
|
||||
|
||||
class OrangeToOrangeResourceWithRawResponse:
|
||||
def __init__(self, orange_to_orange: OrangeToOrangeResource) -> None:
|
||||
self._orange_to_orange = orange_to_orange
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
orange_to_orange.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
orange_to_orange.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncOrangeToOrangeResourceWithRawResponse:
|
||||
def __init__(self, orange_to_orange: AsyncOrangeToOrangeResource) -> None:
|
||||
self._orange_to_orange = orange_to_orange
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
orange_to_orange.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
orange_to_orange.get,
|
||||
)
|
||||
|
||||
|
||||
class OrangeToOrangeResourceWithStreamingResponse:
|
||||
def __init__(self, orange_to_orange: OrangeToOrangeResource) -> None:
|
||||
self._orange_to_orange = orange_to_orange
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
orange_to_orange.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
orange_to_orange.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncOrangeToOrangeResourceWithStreamingResponse:
|
||||
def __init__(self, orange_to_orange: AsyncOrangeToOrangeResource) -> None:
|
||||
self._orange_to_orange = orange_to_orange
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
orange_to_orange.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
orange_to_orange.get,
|
||||
)
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import origin_error_page_pass_thru_edit_params
|
||||
from ....types.zones.settings.origin_error_page_pass_thru import OriginErrorPagePassThru
|
||||
|
||||
__all__ = ["OriginErrorPagePassThruResource", "AsyncOriginErrorPagePassThruResource"]
|
||||
|
||||
|
||||
class OriginErrorPagePassThruResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> OriginErrorPagePassThruResourceWithRawResponse:
|
||||
return OriginErrorPagePassThruResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> OriginErrorPagePassThruResourceWithStreamingResponse:
|
||||
return OriginErrorPagePassThruResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OriginErrorPagePassThru]:
|
||||
"""
|
||||
Cloudflare will proxy customer error pages on any 502,504 errors on origin
|
||||
server instead of showing a default Cloudflare error page. This does not apply
|
||||
to 522 errors and is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/origin_error_page_pass_thru",
|
||||
body=maybe_transform(
|
||||
{"value": value}, origin_error_page_pass_thru_edit_params.OriginErrorPagePassThruEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OriginErrorPagePassThru]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OriginErrorPagePassThru]], ResultWrapper[OriginErrorPagePassThru]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OriginErrorPagePassThru]:
|
||||
"""
|
||||
Cloudflare will proxy customer error pages on any 502,504 errors on origin
|
||||
server instead of showing a default Cloudflare error page. This does not apply
|
||||
to 522 errors and is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/origin_error_page_pass_thru",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OriginErrorPagePassThru]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OriginErrorPagePassThru]], ResultWrapper[OriginErrorPagePassThru]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncOriginErrorPagePassThruResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncOriginErrorPagePassThruResourceWithRawResponse:
|
||||
return AsyncOriginErrorPagePassThruResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncOriginErrorPagePassThruResourceWithStreamingResponse:
|
||||
return AsyncOriginErrorPagePassThruResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OriginErrorPagePassThru]:
|
||||
"""
|
||||
Cloudflare will proxy customer error pages on any 502,504 errors on origin
|
||||
server instead of showing a default Cloudflare error page. This does not apply
|
||||
to 522 errors and is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/origin_error_page_pass_thru",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, origin_error_page_pass_thru_edit_params.OriginErrorPagePassThruEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OriginErrorPagePassThru]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OriginErrorPagePassThru]], ResultWrapper[OriginErrorPagePassThru]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[OriginErrorPagePassThru]:
|
||||
"""
|
||||
Cloudflare will proxy customer error pages on any 502,504 errors on origin
|
||||
server instead of showing a default Cloudflare error page. This does not apply
|
||||
to 522 errors and is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/origin_error_page_pass_thru",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[OriginErrorPagePassThru]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[OriginErrorPagePassThru]], ResultWrapper[OriginErrorPagePassThru]),
|
||||
)
|
||||
|
||||
|
||||
class OriginErrorPagePassThruResourceWithRawResponse:
|
||||
def __init__(self, origin_error_page_pass_thru: OriginErrorPagePassThruResource) -> None:
|
||||
self._origin_error_page_pass_thru = origin_error_page_pass_thru
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
origin_error_page_pass_thru.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
origin_error_page_pass_thru.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncOriginErrorPagePassThruResourceWithRawResponse:
|
||||
def __init__(self, origin_error_page_pass_thru: AsyncOriginErrorPagePassThruResource) -> None:
|
||||
self._origin_error_page_pass_thru = origin_error_page_pass_thru
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
origin_error_page_pass_thru.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
origin_error_page_pass_thru.get,
|
||||
)
|
||||
|
||||
|
||||
class OriginErrorPagePassThruResourceWithStreamingResponse:
|
||||
def __init__(self, origin_error_page_pass_thru: OriginErrorPagePassThruResource) -> None:
|
||||
self._origin_error_page_pass_thru = origin_error_page_pass_thru
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
origin_error_page_pass_thru.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
origin_error_page_pass_thru.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncOriginErrorPagePassThruResourceWithStreamingResponse:
|
||||
def __init__(self, origin_error_page_pass_thru: AsyncOriginErrorPagePassThruResource) -> None:
|
||||
self._origin_error_page_pass_thru = origin_error_page_pass_thru
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
origin_error_page_pass_thru.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
origin_error_page_pass_thru.get,
|
||||
)
|
||||
|
|
@ -1,280 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import Polish, polish_edit_params
|
||||
from ....types.zones.settings.polish import Polish
|
||||
from ....types.zones.settings.polish_param import PolishParam
|
||||
|
||||
__all__ = ["PolishResource", "AsyncPolishResource"]
|
||||
|
||||
|
||||
class PolishResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> PolishResourceWithRawResponse:
|
||||
return PolishResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> PolishResourceWithStreamingResponse:
|
||||
return PolishResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: PolishParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Polish]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our [blog post](http://blog.cloudflare.com/polish-solving-mobile-speed)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Removes metadata and compresses your images for faster page load times. Basic
|
||||
(Lossless): Reduce the size of PNG, JPEG, and GIF files - no impact on visual
|
||||
quality. Basic + JPEG (Lossy): Further reduce the size of JPEG files for faster
|
||||
image loading. Larger JPEGs are converted to progressive images, loading a
|
||||
lower-resolution image first and ending in a higher-resolution version. Not
|
||||
recommended for hi-res photography sites.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/polish",
|
||||
body=maybe_transform({"value": value}, polish_edit_params.PolishEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Polish]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Polish]], ResultWrapper[Polish]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Polish]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our [blog post](http://blog.cloudflare.com/polish-solving-mobile-speed)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/polish",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Polish]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Polish]], ResultWrapper[Polish]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncPolishResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncPolishResourceWithRawResponse:
|
||||
return AsyncPolishResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncPolishResourceWithStreamingResponse:
|
||||
return AsyncPolishResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: PolishParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Polish]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our [blog post](http://blog.cloudflare.com/polish-solving-mobile-speed)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Removes metadata and compresses your images for faster page load times. Basic
|
||||
(Lossless): Reduce the size of PNG, JPEG, and GIF files - no impact on visual
|
||||
quality. Basic + JPEG (Lossy): Further reduce the size of JPEG files for faster
|
||||
image loading. Larger JPEGs are converted to progressive images, loading a
|
||||
lower-resolution image first and ending in a higher-resolution version. Not
|
||||
recommended for hi-res photography sites.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/polish",
|
||||
body=await async_maybe_transform({"value": value}, polish_edit_params.PolishEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Polish]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Polish]], ResultWrapper[Polish]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Polish]:
|
||||
"""
|
||||
Automatically optimize image loading for website visitors on mobile devices.
|
||||
Refer to our [blog post](http://blog.cloudflare.com/polish-solving-mobile-speed)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/polish",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Polish]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Polish]], ResultWrapper[Polish]),
|
||||
)
|
||||
|
||||
|
||||
class PolishResourceWithRawResponse:
|
||||
def __init__(self, polish: PolishResource) -> None:
|
||||
self._polish = polish
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
polish.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
polish.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPolishResourceWithRawResponse:
|
||||
def __init__(self, polish: AsyncPolishResource) -> None:
|
||||
self._polish = polish
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
polish.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
polish.get,
|
||||
)
|
||||
|
||||
|
||||
class PolishResourceWithStreamingResponse:
|
||||
def __init__(self, polish: PolishResource) -> None:
|
||||
self._polish = polish
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
polish.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
polish.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPolishResourceWithStreamingResponse:
|
||||
def __init__(self, polish: AsyncPolishResource) -> None:
|
||||
self._polish = polish
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
polish.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
polish.get,
|
||||
)
|
||||
|
|
@ -1,266 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import prefetch_preload_edit_params
|
||||
from ....types.zones.settings.prefetch_preload import PrefetchPreload
|
||||
|
||||
__all__ = ["PrefetchPreloadResource", "AsyncPrefetchPreloadResource"]
|
||||
|
||||
|
||||
class PrefetchPreloadResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> PrefetchPreloadResourceWithRawResponse:
|
||||
return PrefetchPreloadResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> PrefetchPreloadResourceWithStreamingResponse:
|
||||
return PrefetchPreloadResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefetchPreload]:
|
||||
"""
|
||||
Cloudflare will prefetch any URLs that are included in the response headers.
|
||||
This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/prefetch_preload",
|
||||
body=maybe_transform({"value": value}, prefetch_preload_edit_params.PrefetchPreloadEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PrefetchPreload]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PrefetchPreload]], ResultWrapper[PrefetchPreload]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefetchPreload]:
|
||||
"""
|
||||
Cloudflare will prefetch any URLs that are included in the response headers.
|
||||
This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/prefetch_preload",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PrefetchPreload]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PrefetchPreload]], ResultWrapper[PrefetchPreload]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncPrefetchPreloadResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncPrefetchPreloadResourceWithRawResponse:
|
||||
return AsyncPrefetchPreloadResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncPrefetchPreloadResourceWithStreamingResponse:
|
||||
return AsyncPrefetchPreloadResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefetchPreload]:
|
||||
"""
|
||||
Cloudflare will prefetch any URLs that are included in the response headers.
|
||||
This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/prefetch_preload",
|
||||
body=await async_maybe_transform({"value": value}, prefetch_preload_edit_params.PrefetchPreloadEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PrefetchPreload]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PrefetchPreload]], ResultWrapper[PrefetchPreload]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PrefetchPreload]:
|
||||
"""
|
||||
Cloudflare will prefetch any URLs that are included in the response headers.
|
||||
This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/prefetch_preload",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PrefetchPreload]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PrefetchPreload]], ResultWrapper[PrefetchPreload]),
|
||||
)
|
||||
|
||||
|
||||
class PrefetchPreloadResourceWithRawResponse:
|
||||
def __init__(self, prefetch_preload: PrefetchPreloadResource) -> None:
|
||||
self._prefetch_preload = prefetch_preload
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
prefetch_preload.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
prefetch_preload.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPrefetchPreloadResourceWithRawResponse:
|
||||
def __init__(self, prefetch_preload: AsyncPrefetchPreloadResource) -> None:
|
||||
self._prefetch_preload = prefetch_preload
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
prefetch_preload.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
prefetch_preload.get,
|
||||
)
|
||||
|
||||
|
||||
class PrefetchPreloadResourceWithStreamingResponse:
|
||||
def __init__(self, prefetch_preload: PrefetchPreloadResource) -> None:
|
||||
self._prefetch_preload = prefetch_preload
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
prefetch_preload.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
prefetch_preload.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPrefetchPreloadResourceWithStreamingResponse:
|
||||
def __init__(self, prefetch_preload: AsyncPrefetchPreloadResource) -> None:
|
||||
self._prefetch_preload = prefetch_preload
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
prefetch_preload.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
prefetch_preload.get,
|
||||
)
|
||||
|
|
@ -1,264 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import ProxyReadTimeout, proxy_read_timeout_edit_params
|
||||
from ....types.zones.settings.proxy_read_timeout import ProxyReadTimeout
|
||||
from ....types.zones.settings.proxy_read_timeout_param import ProxyReadTimeoutParam
|
||||
|
||||
__all__ = ["ProxyReadTimeoutResource", "AsyncProxyReadTimeoutResource"]
|
||||
|
||||
|
||||
class ProxyReadTimeoutResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ProxyReadTimeoutResourceWithRawResponse:
|
||||
return ProxyReadTimeoutResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ProxyReadTimeoutResourceWithStreamingResponse:
|
||||
return ProxyReadTimeoutResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: ProxyReadTimeoutParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ProxyReadTimeout]:
|
||||
"""
|
||||
Maximum time between two read operations from origin.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Maximum time between two read operations from origin.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/proxy_read_timeout",
|
||||
body=maybe_transform({"value": value}, proxy_read_timeout_edit_params.ProxyReadTimeoutEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ProxyReadTimeout]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ProxyReadTimeout]], ResultWrapper[ProxyReadTimeout]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ProxyReadTimeout]:
|
||||
"""
|
||||
Maximum time between two read operations from origin.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/proxy_read_timeout",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ProxyReadTimeout]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ProxyReadTimeout]], ResultWrapper[ProxyReadTimeout]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncProxyReadTimeoutResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncProxyReadTimeoutResourceWithRawResponse:
|
||||
return AsyncProxyReadTimeoutResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncProxyReadTimeoutResourceWithStreamingResponse:
|
||||
return AsyncProxyReadTimeoutResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: ProxyReadTimeoutParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ProxyReadTimeout]:
|
||||
"""
|
||||
Maximum time between two read operations from origin.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Maximum time between two read operations from origin.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/proxy_read_timeout",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, proxy_read_timeout_edit_params.ProxyReadTimeoutEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ProxyReadTimeout]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ProxyReadTimeout]], ResultWrapper[ProxyReadTimeout]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ProxyReadTimeout]:
|
||||
"""
|
||||
Maximum time between two read operations from origin.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/proxy_read_timeout",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ProxyReadTimeout]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ProxyReadTimeout]], ResultWrapper[ProxyReadTimeout]),
|
||||
)
|
||||
|
||||
|
||||
class ProxyReadTimeoutResourceWithRawResponse:
|
||||
def __init__(self, proxy_read_timeout: ProxyReadTimeoutResource) -> None:
|
||||
self._proxy_read_timeout = proxy_read_timeout
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
proxy_read_timeout.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
proxy_read_timeout.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncProxyReadTimeoutResourceWithRawResponse:
|
||||
def __init__(self, proxy_read_timeout: AsyncProxyReadTimeoutResource) -> None:
|
||||
self._proxy_read_timeout = proxy_read_timeout
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
proxy_read_timeout.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
proxy_read_timeout.get,
|
||||
)
|
||||
|
||||
|
||||
class ProxyReadTimeoutResourceWithStreamingResponse:
|
||||
def __init__(self, proxy_read_timeout: ProxyReadTimeoutResource) -> None:
|
||||
self._proxy_read_timeout = proxy_read_timeout
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
proxy_read_timeout.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
proxy_read_timeout.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncProxyReadTimeoutResourceWithStreamingResponse:
|
||||
def __init__(self, proxy_read_timeout: AsyncProxyReadTimeoutResource) -> None:
|
||||
self._proxy_read_timeout = proxy_read_timeout
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
proxy_read_timeout.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
proxy_read_timeout.get,
|
||||
)
|
||||
|
|
@ -1,262 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import pseudo_ipv4_edit_params
|
||||
from ....types.zones.settings.pseudo_ipv4 import PseudoIPV4
|
||||
|
||||
__all__ = ["PseudoIPV4Resource", "AsyncPseudoIPV4Resource"]
|
||||
|
||||
|
||||
class PseudoIPV4Resource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> PseudoIPV4ResourceWithRawResponse:
|
||||
return PseudoIPV4ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> PseudoIPV4ResourceWithStreamingResponse:
|
||||
return PseudoIPV4ResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "add_header", "overwrite_header"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PseudoIPV4]:
|
||||
"""
|
||||
Value of the Pseudo IPv4 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the Pseudo IPv4 setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/pseudo_ipv4",
|
||||
body=maybe_transform({"value": value}, pseudo_ipv4_edit_params.PseudoIPV4EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PseudoIPV4]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PseudoIPV4]], ResultWrapper[PseudoIPV4]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PseudoIPV4]:
|
||||
"""
|
||||
Value of the Pseudo IPv4 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/pseudo_ipv4",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PseudoIPV4]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PseudoIPV4]], ResultWrapper[PseudoIPV4]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncPseudoIPV4Resource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncPseudoIPV4ResourceWithRawResponse:
|
||||
return AsyncPseudoIPV4ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncPseudoIPV4ResourceWithStreamingResponse:
|
||||
return AsyncPseudoIPV4ResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "add_header", "overwrite_header"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PseudoIPV4]:
|
||||
"""
|
||||
Value of the Pseudo IPv4 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the Pseudo IPv4 setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/pseudo_ipv4",
|
||||
body=await async_maybe_transform({"value": value}, pseudo_ipv4_edit_params.PseudoIPV4EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PseudoIPV4]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PseudoIPV4]], ResultWrapper[PseudoIPV4]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PseudoIPV4]:
|
||||
"""
|
||||
Value of the Pseudo IPv4 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/pseudo_ipv4",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PseudoIPV4]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[PseudoIPV4]], ResultWrapper[PseudoIPV4]),
|
||||
)
|
||||
|
||||
|
||||
class PseudoIPV4ResourceWithRawResponse:
|
||||
def __init__(self, pseudo_ipv4: PseudoIPV4Resource) -> None:
|
||||
self._pseudo_ipv4 = pseudo_ipv4
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
pseudo_ipv4.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
pseudo_ipv4.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPseudoIPV4ResourceWithRawResponse:
|
||||
def __init__(self, pseudo_ipv4: AsyncPseudoIPV4Resource) -> None:
|
||||
self._pseudo_ipv4 = pseudo_ipv4
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
pseudo_ipv4.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
pseudo_ipv4.get,
|
||||
)
|
||||
|
||||
|
||||
class PseudoIPV4ResourceWithStreamingResponse:
|
||||
def __init__(self, pseudo_ipv4: PseudoIPV4Resource) -> None:
|
||||
self._pseudo_ipv4 = pseudo_ipv4
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
pseudo_ipv4.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
pseudo_ipv4.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncPseudoIPV4ResourceWithStreamingResponse:
|
||||
def __init__(self, pseudo_ipv4: AsyncPseudoIPV4Resource) -> None:
|
||||
self._pseudo_ipv4 = pseudo_ipv4
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
pseudo_ipv4.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
pseudo_ipv4.get,
|
||||
)
|
||||
|
|
@ -1,280 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import response_buffering_edit_params
|
||||
from ....types.zones.settings.response_buffering import ResponseBuffering
|
||||
|
||||
__all__ = ["ResponseBufferingResource", "AsyncResponseBufferingResource"]
|
||||
|
||||
|
||||
class ResponseBufferingResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ResponseBufferingResourceWithRawResponse:
|
||||
return ResponseBufferingResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ResponseBufferingResourceWithStreamingResponse:
|
||||
return ResponseBufferingResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ResponseBuffering]:
|
||||
"""Enables or disables buffering of responses from the proxied server.
|
||||
|
||||
Cloudflare
|
||||
may buffer the whole payload to deliver it at once to the client versus allowing
|
||||
it to be delivered in chunks. By default, the proxied server streams directly
|
||||
and is not buffered by Cloudflare. This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/response_buffering",
|
||||
body=maybe_transform({"value": value}, response_buffering_edit_params.ResponseBufferingEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ResponseBuffering]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ResponseBuffering]], ResultWrapper[ResponseBuffering]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ResponseBuffering]:
|
||||
"""Enables or disables buffering of responses from the proxied server.
|
||||
|
||||
Cloudflare
|
||||
may buffer the whole payload to deliver it at once to the client versus allowing
|
||||
it to be delivered in chunks. By default, the proxied server streams directly
|
||||
and is not buffered by Cloudflare. This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/response_buffering",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ResponseBuffering]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ResponseBuffering]], ResultWrapper[ResponseBuffering]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncResponseBufferingResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncResponseBufferingResourceWithRawResponse:
|
||||
return AsyncResponseBufferingResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncResponseBufferingResourceWithStreamingResponse:
|
||||
return AsyncResponseBufferingResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ResponseBuffering]:
|
||||
"""Enables or disables buffering of responses from the proxied server.
|
||||
|
||||
Cloudflare
|
||||
may buffer the whole payload to deliver it at once to the client versus allowing
|
||||
it to be delivered in chunks. By default, the proxied server streams directly
|
||||
and is not buffered by Cloudflare. This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/response_buffering",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, response_buffering_edit_params.ResponseBufferingEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ResponseBuffering]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ResponseBuffering]], ResultWrapper[ResponseBuffering]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ResponseBuffering]:
|
||||
"""Enables or disables buffering of responses from the proxied server.
|
||||
|
||||
Cloudflare
|
||||
may buffer the whole payload to deliver it at once to the client versus allowing
|
||||
it to be delivered in chunks. By default, the proxied server streams directly
|
||||
and is not buffered by Cloudflare. This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/response_buffering",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ResponseBuffering]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ResponseBuffering]], ResultWrapper[ResponseBuffering]),
|
||||
)
|
||||
|
||||
|
||||
class ResponseBufferingResourceWithRawResponse:
|
||||
def __init__(self, response_buffering: ResponseBufferingResource) -> None:
|
||||
self._response_buffering = response_buffering
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
response_buffering.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
response_buffering.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncResponseBufferingResourceWithRawResponse:
|
||||
def __init__(self, response_buffering: AsyncResponseBufferingResource) -> None:
|
||||
self._response_buffering = response_buffering
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
response_buffering.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
response_buffering.get,
|
||||
)
|
||||
|
||||
|
||||
class ResponseBufferingResourceWithStreamingResponse:
|
||||
def __init__(self, response_buffering: ResponseBufferingResource) -> None:
|
||||
self._response_buffering = response_buffering
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
response_buffering.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
response_buffering.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncResponseBufferingResourceWithStreamingResponse:
|
||||
def __init__(self, response_buffering: AsyncResponseBufferingResource) -> None:
|
||||
self._response_buffering = response_buffering
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
response_buffering.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
response_buffering.get,
|
||||
)
|
||||
|
|
@ -1,316 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import RocketLoader, rocket_loader_edit_params
|
||||
from ....types.zones.settings.rocket_loader import RocketLoader
|
||||
from ....types.zones.settings.rocket_loader_param import RocketLoaderParam
|
||||
|
||||
__all__ = ["RocketLoaderResource", "AsyncRocketLoaderResource"]
|
||||
|
||||
|
||||
class RocketLoaderResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> RocketLoaderResourceWithRawResponse:
|
||||
return RocketLoaderResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> RocketLoaderResourceWithStreamingResponse:
|
||||
return RocketLoaderResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: RocketLoaderParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RocketLoader]:
|
||||
"""
|
||||
Rocket Loader is a general-purpose asynchronous JavaScript optimisation that
|
||||
prioritises rendering your content while loading your site's Javascript
|
||||
asynchronously. Turning on Rocket Loader will immediately improve a web page's
|
||||
rendering time sometimes measured as Time to First Paint (TTFP), and also the
|
||||
`window.onload` time (assuming there is JavaScript on the page). This can have a
|
||||
positive impact on your Google search ranking. When turned on, Rocket Loader
|
||||
will automatically defer the loading of all Javascript referenced in your HTML,
|
||||
with no configuration required. Refer to
|
||||
[Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Rocket Loader is a general-purpose asynchronous JavaScript optimisation that
|
||||
prioritises rendering your content while loading your site's Javascript
|
||||
asynchronously. Turning on Rocket Loader will immediately improve a web page's
|
||||
rendering time sometimes measured as Time to First Paint (TTFP), and also the
|
||||
`window.onload` time (assuming there is JavaScript on the page). This can have a
|
||||
positive impact on your Google search ranking. When turned on, Rocket Loader
|
||||
will automatically defer the loading of all Javascript referenced in your HTML,
|
||||
with no configuration required. Refer to
|
||||
[Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056)
|
||||
for more information.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/rocket_loader",
|
||||
body=maybe_transform({"value": value}, rocket_loader_edit_params.RocketLoaderEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RocketLoader]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RocketLoader]], ResultWrapper[RocketLoader]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RocketLoader]:
|
||||
"""
|
||||
Rocket Loader is a general-purpose asynchronous JavaScript optimisation that
|
||||
prioritises rendering your content while loading your site's Javascript
|
||||
asynchronously. Turning on Rocket Loader will immediately improve a web page's
|
||||
rendering time sometimes measured as Time to First Paint (TTFP), and also the
|
||||
`window.onload` time (assuming there is JavaScript on the page). This can have a
|
||||
positive impact on your Google search ranking. When turned on, Rocket Loader
|
||||
will automatically defer the loading of all Javascript referenced in your HTML,
|
||||
with no configuration required. Refer to
|
||||
[Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/rocket_loader",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RocketLoader]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RocketLoader]], ResultWrapper[RocketLoader]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncRocketLoaderResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncRocketLoaderResourceWithRawResponse:
|
||||
return AsyncRocketLoaderResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncRocketLoaderResourceWithStreamingResponse:
|
||||
return AsyncRocketLoaderResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: RocketLoaderParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RocketLoader]:
|
||||
"""
|
||||
Rocket Loader is a general-purpose asynchronous JavaScript optimisation that
|
||||
prioritises rendering your content while loading your site's Javascript
|
||||
asynchronously. Turning on Rocket Loader will immediately improve a web page's
|
||||
rendering time sometimes measured as Time to First Paint (TTFP), and also the
|
||||
`window.onload` time (assuming there is JavaScript on the page). This can have a
|
||||
positive impact on your Google search ranking. When turned on, Rocket Loader
|
||||
will automatically defer the loading of all Javascript referenced in your HTML,
|
||||
with no configuration required. Refer to
|
||||
[Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Rocket Loader is a general-purpose asynchronous JavaScript optimisation that
|
||||
prioritises rendering your content while loading your site's Javascript
|
||||
asynchronously. Turning on Rocket Loader will immediately improve a web page's
|
||||
rendering time sometimes measured as Time to First Paint (TTFP), and also the
|
||||
`window.onload` time (assuming there is JavaScript on the page). This can have a
|
||||
positive impact on your Google search ranking. When turned on, Rocket Loader
|
||||
will automatically defer the loading of all Javascript referenced in your HTML,
|
||||
with no configuration required. Refer to
|
||||
[Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056)
|
||||
for more information.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/rocket_loader",
|
||||
body=await async_maybe_transform({"value": value}, rocket_loader_edit_params.RocketLoaderEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RocketLoader]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RocketLoader]], ResultWrapper[RocketLoader]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[RocketLoader]:
|
||||
"""
|
||||
Rocket Loader is a general-purpose asynchronous JavaScript optimisation that
|
||||
prioritises rendering your content while loading your site's Javascript
|
||||
asynchronously. Turning on Rocket Loader will immediately improve a web page's
|
||||
rendering time sometimes measured as Time to First Paint (TTFP), and also the
|
||||
`window.onload` time (assuming there is JavaScript on the page). This can have a
|
||||
positive impact on your Google search ranking. When turned on, Rocket Loader
|
||||
will automatically defer the loading of all Javascript referenced in your HTML,
|
||||
with no configuration required. Refer to
|
||||
[Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056)
|
||||
for more information.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/rocket_loader",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[RocketLoader]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[RocketLoader]], ResultWrapper[RocketLoader]),
|
||||
)
|
||||
|
||||
|
||||
class RocketLoaderResourceWithRawResponse:
|
||||
def __init__(self, rocket_loader: RocketLoaderResource) -> None:
|
||||
self._rocket_loader = rocket_loader
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
rocket_loader.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
rocket_loader.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncRocketLoaderResourceWithRawResponse:
|
||||
def __init__(self, rocket_loader: AsyncRocketLoaderResource) -> None:
|
||||
self._rocket_loader = rocket_loader
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
rocket_loader.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
rocket_loader.get,
|
||||
)
|
||||
|
||||
|
||||
class RocketLoaderResourceWithStreamingResponse:
|
||||
def __init__(self, rocket_loader: RocketLoaderResource) -> None:
|
||||
self._rocket_loader = rocket_loader
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
rocket_loader.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
rocket_loader.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncRocketLoaderResourceWithStreamingResponse:
|
||||
def __init__(self, rocket_loader: AsyncRocketLoaderResource) -> None:
|
||||
self._rocket_loader = rocket_loader
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
rocket_loader.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
rocket_loader.get,
|
||||
)
|
||||
|
|
@ -1,257 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import security_header_edit_params
|
||||
from ....types.zones.settings.security_headers import SecurityHeaders
|
||||
|
||||
__all__ = ["SecurityHeadersResource", "AsyncSecurityHeadersResource"]
|
||||
|
||||
|
||||
class SecurityHeadersResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> SecurityHeadersResourceWithRawResponse:
|
||||
return SecurityHeadersResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> SecurityHeadersResourceWithStreamingResponse:
|
||||
return SecurityHeadersResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: security_header_edit_params.Value,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SecurityHeaders]:
|
||||
"""
|
||||
Cloudflare security header for a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/security_header",
|
||||
body=maybe_transform({"value": value}, security_header_edit_params.SecurityHeaderEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SecurityHeaders]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SecurityHeaders]], ResultWrapper[SecurityHeaders]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SecurityHeaders]:
|
||||
"""
|
||||
Cloudflare security header for a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/security_header",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SecurityHeaders]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SecurityHeaders]], ResultWrapper[SecurityHeaders]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncSecurityHeadersResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncSecurityHeadersResourceWithRawResponse:
|
||||
return AsyncSecurityHeadersResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncSecurityHeadersResourceWithStreamingResponse:
|
||||
return AsyncSecurityHeadersResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: security_header_edit_params.Value,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SecurityHeaders]:
|
||||
"""
|
||||
Cloudflare security header for a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/security_header",
|
||||
body=await async_maybe_transform({"value": value}, security_header_edit_params.SecurityHeaderEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SecurityHeaders]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SecurityHeaders]], ResultWrapper[SecurityHeaders]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SecurityHeaders]:
|
||||
"""
|
||||
Cloudflare security header for a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/security_header",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SecurityHeaders]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SecurityHeaders]], ResultWrapper[SecurityHeaders]),
|
||||
)
|
||||
|
||||
|
||||
class SecurityHeadersResourceWithRawResponse:
|
||||
def __init__(self, security_headers: SecurityHeadersResource) -> None:
|
||||
self._security_headers = security_headers
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
security_headers.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
security_headers.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSecurityHeadersResourceWithRawResponse:
|
||||
def __init__(self, security_headers: AsyncSecurityHeadersResource) -> None:
|
||||
self._security_headers = security_headers
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
security_headers.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
security_headers.get,
|
||||
)
|
||||
|
||||
|
||||
class SecurityHeadersResourceWithStreamingResponse:
|
||||
def __init__(self, security_headers: SecurityHeadersResource) -> None:
|
||||
self._security_headers = security_headers
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
security_headers.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
security_headers.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSecurityHeadersResourceWithStreamingResponse:
|
||||
def __init__(self, security_headers: AsyncSecurityHeadersResource) -> None:
|
||||
self._security_headers = security_headers
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
security_headers.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
security_headers.get,
|
||||
)
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import security_level_edit_params
|
||||
from ....types.zones.settings.security_level import SecurityLevel
|
||||
|
||||
__all__ = ["SecurityLevelResource", "AsyncSecurityLevelResource"]
|
||||
|
||||
|
||||
class SecurityLevelResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> SecurityLevelResourceWithRawResponse:
|
||||
return SecurityLevelResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> SecurityLevelResourceWithStreamingResponse:
|
||||
return SecurityLevelResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SecurityLevel]:
|
||||
"""
|
||||
Choose the appropriate security profile for your website, which will
|
||||
automatically adjust each of the security settings. If you choose to customize
|
||||
an individual security setting, the profile will become Custom.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170056).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/security_level",
|
||||
body=maybe_transform({"value": value}, security_level_edit_params.SecurityLevelEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SecurityLevel]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SecurityLevel]], ResultWrapper[SecurityLevel]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SecurityLevel]:
|
||||
"""
|
||||
Choose the appropriate security profile for your website, which will
|
||||
automatically adjust each of the security settings. If you choose to customize
|
||||
an individual security setting, the profile will become Custom.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170056).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/security_level",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SecurityLevel]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SecurityLevel]], ResultWrapper[SecurityLevel]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncSecurityLevelResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncSecurityLevelResourceWithRawResponse:
|
||||
return AsyncSecurityLevelResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncSecurityLevelResourceWithStreamingResponse:
|
||||
return AsyncSecurityLevelResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SecurityLevel]:
|
||||
"""
|
||||
Choose the appropriate security profile for your website, which will
|
||||
automatically adjust each of the security settings. If you choose to customize
|
||||
an individual security setting, the profile will become Custom.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170056).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/security_level",
|
||||
body=await async_maybe_transform({"value": value}, security_level_edit_params.SecurityLevelEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SecurityLevel]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SecurityLevel]], ResultWrapper[SecurityLevel]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SecurityLevel]:
|
||||
"""
|
||||
Choose the appropriate security profile for your website, which will
|
||||
automatically adjust each of the security settings. If you choose to customize
|
||||
an individual security setting, the profile will become Custom.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170056).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/security_level",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SecurityLevel]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SecurityLevel]], ResultWrapper[SecurityLevel]),
|
||||
)
|
||||
|
||||
|
||||
class SecurityLevelResourceWithRawResponse:
|
||||
def __init__(self, security_level: SecurityLevelResource) -> None:
|
||||
self._security_level = security_level
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
security_level.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
security_level.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSecurityLevelResourceWithRawResponse:
|
||||
def __init__(self, security_level: AsyncSecurityLevelResource) -> None:
|
||||
self._security_level = security_level
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
security_level.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
security_level.get,
|
||||
)
|
||||
|
||||
|
||||
class SecurityLevelResourceWithStreamingResponse:
|
||||
def __init__(self, security_level: SecurityLevelResource) -> None:
|
||||
self._security_level = security_level
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
security_level.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
security_level.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSecurityLevelResourceWithStreamingResponse:
|
||||
def __init__(self, security_level: AsyncSecurityLevelResource) -> None:
|
||||
self._security_level = security_level
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
security_level.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
security_level.get,
|
||||
)
|
||||
|
|
@ -1,304 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import server_side_exclude_edit_params
|
||||
from ....types.zones.settings.server_side_excludes import ServerSideExcludes
|
||||
|
||||
__all__ = ["ServerSideExcludesResource", "AsyncServerSideExcludesResource"]
|
||||
|
||||
|
||||
class ServerSideExcludesResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ServerSideExcludesResourceWithRawResponse:
|
||||
return ServerSideExcludesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ServerSideExcludesResourceWithStreamingResponse:
|
||||
return ServerSideExcludesResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ServerSideExcludes]:
|
||||
"""
|
||||
If there is sensitive content on your website that you want visible to real
|
||||
visitors, but that you want to hide from suspicious visitors, all you have to do
|
||||
is wrap the content with Cloudflare SSE tags. Wrap any content that you want to
|
||||
be excluded from suspicious visitors in the following SSE tags:
|
||||
<!--sse--><!--/sse-->. For example: <!--sse--> Bad visitors won't see my phone
|
||||
number, 555-555-5555 <!--/sse-->. Note: SSE only will work with HTML. If you
|
||||
have HTML minification enabled, you won't see the SSE tags in your HTML source
|
||||
when it's served through Cloudflare. SSE will still function in this case, as
|
||||
Cloudflare's HTML minification and SSE functionality occur on-the-fly as the
|
||||
resource moves through our network to the visitor's computer.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170036).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/server_side_exclude",
|
||||
body=maybe_transform({"value": value}, server_side_exclude_edit_params.ServerSideExcludeEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ServerSideExcludes]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ServerSideExcludes]], ResultWrapper[ServerSideExcludes]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ServerSideExcludes]:
|
||||
"""
|
||||
If there is sensitive content on your website that you want visible to real
|
||||
visitors, but that you want to hide from suspicious visitors, all you have to do
|
||||
is wrap the content with Cloudflare SSE tags. Wrap any content that you want to
|
||||
be excluded from suspicious visitors in the following SSE tags:
|
||||
<!--sse--><!--/sse-->. For example: <!--sse--> Bad visitors won't see my phone
|
||||
number, 555-555-5555 <!--/sse-->. Note: SSE only will work with HTML. If you
|
||||
have HTML minification enabled, you won't see the SSE tags in your HTML source
|
||||
when it's served through Cloudflare. SSE will still function in this case, as
|
||||
Cloudflare's HTML minification and SSE functionality occur on-the-fly as the
|
||||
resource moves through our network to the visitor's computer.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170036).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/server_side_exclude",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ServerSideExcludes]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ServerSideExcludes]], ResultWrapper[ServerSideExcludes]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncServerSideExcludesResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncServerSideExcludesResourceWithRawResponse:
|
||||
return AsyncServerSideExcludesResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncServerSideExcludesResourceWithStreamingResponse:
|
||||
return AsyncServerSideExcludesResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ServerSideExcludes]:
|
||||
"""
|
||||
If there is sensitive content on your website that you want visible to real
|
||||
visitors, but that you want to hide from suspicious visitors, all you have to do
|
||||
is wrap the content with Cloudflare SSE tags. Wrap any content that you want to
|
||||
be excluded from suspicious visitors in the following SSE tags:
|
||||
<!--sse--><!--/sse-->. For example: <!--sse--> Bad visitors won't see my phone
|
||||
number, 555-555-5555 <!--/sse-->. Note: SSE only will work with HTML. If you
|
||||
have HTML minification enabled, you won't see the SSE tags in your HTML source
|
||||
when it's served through Cloudflare. SSE will still function in this case, as
|
||||
Cloudflare's HTML minification and SSE functionality occur on-the-fly as the
|
||||
resource moves through our network to the visitor's computer.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170036).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/server_side_exclude",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, server_side_exclude_edit_params.ServerSideExcludeEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ServerSideExcludes]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ServerSideExcludes]], ResultWrapper[ServerSideExcludes]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ServerSideExcludes]:
|
||||
"""
|
||||
If there is sensitive content on your website that you want visible to real
|
||||
visitors, but that you want to hide from suspicious visitors, all you have to do
|
||||
is wrap the content with Cloudflare SSE tags. Wrap any content that you want to
|
||||
be excluded from suspicious visitors in the following SSE tags:
|
||||
<!--sse--><!--/sse-->. For example: <!--sse--> Bad visitors won't see my phone
|
||||
number, 555-555-5555 <!--/sse-->. Note: SSE only will work with HTML. If you
|
||||
have HTML minification enabled, you won't see the SSE tags in your HTML source
|
||||
when it's served through Cloudflare. SSE will still function in this case, as
|
||||
Cloudflare's HTML minification and SSE functionality occur on-the-fly as the
|
||||
resource moves through our network to the visitor's computer.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200170036).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/server_side_exclude",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ServerSideExcludes]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ServerSideExcludes]], ResultWrapper[ServerSideExcludes]),
|
||||
)
|
||||
|
||||
|
||||
class ServerSideExcludesResourceWithRawResponse:
|
||||
def __init__(self, server_side_excludes: ServerSideExcludesResource) -> None:
|
||||
self._server_side_excludes = server_side_excludes
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
server_side_excludes.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
server_side_excludes.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncServerSideExcludesResourceWithRawResponse:
|
||||
def __init__(self, server_side_excludes: AsyncServerSideExcludesResource) -> None:
|
||||
self._server_side_excludes = server_side_excludes
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
server_side_excludes.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
server_side_excludes.get,
|
||||
)
|
||||
|
||||
|
||||
class ServerSideExcludesResourceWithStreamingResponse:
|
||||
def __init__(self, server_side_excludes: ServerSideExcludesResource) -> None:
|
||||
self._server_side_excludes = server_side_excludes
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
server_side_excludes.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
server_side_excludes.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncServerSideExcludesResourceWithStreamingResponse:
|
||||
def __init__(self, server_side_excludes: AsyncServerSideExcludesResource) -> None:
|
||||
self._server_side_excludes = server_side_excludes
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
server_side_excludes.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
server_side_excludes.get,
|
||||
)
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,274 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import sort_query_string_for_cache_edit_params
|
||||
from ....types.zones.settings.sort_query_string_for_cache import SortQueryStringForCache
|
||||
|
||||
__all__ = ["SortQueryStringForCacheResource", "AsyncSortQueryStringForCacheResource"]
|
||||
|
||||
|
||||
class SortQueryStringForCacheResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> SortQueryStringForCacheResourceWithRawResponse:
|
||||
return SortQueryStringForCacheResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> SortQueryStringForCacheResourceWithStreamingResponse:
|
||||
return SortQueryStringForCacheResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SortQueryStringForCache]:
|
||||
"""
|
||||
Cloudflare will treat files with the same query strings as the same file in
|
||||
cache, regardless of the order of the query strings. This is limited to
|
||||
Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/sort_query_string_for_cache",
|
||||
body=maybe_transform(
|
||||
{"value": value}, sort_query_string_for_cache_edit_params.SortQueryStringForCacheEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SortQueryStringForCache]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SortQueryStringForCache]], ResultWrapper[SortQueryStringForCache]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SortQueryStringForCache]:
|
||||
"""
|
||||
Cloudflare will treat files with the same query strings as the same file in
|
||||
cache, regardless of the order of the query strings. This is limited to
|
||||
Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/sort_query_string_for_cache",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SortQueryStringForCache]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SortQueryStringForCache]], ResultWrapper[SortQueryStringForCache]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncSortQueryStringForCacheResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncSortQueryStringForCacheResourceWithRawResponse:
|
||||
return AsyncSortQueryStringForCacheResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncSortQueryStringForCacheResourceWithStreamingResponse:
|
||||
return AsyncSortQueryStringForCacheResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SortQueryStringForCache]:
|
||||
"""
|
||||
Cloudflare will treat files with the same query strings as the same file in
|
||||
cache, regardless of the order of the query strings. This is limited to
|
||||
Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/sort_query_string_for_cache",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, sort_query_string_for_cache_edit_params.SortQueryStringForCacheEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SortQueryStringForCache]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SortQueryStringForCache]], ResultWrapper[SortQueryStringForCache]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SortQueryStringForCache]:
|
||||
"""
|
||||
Cloudflare will treat files with the same query strings as the same file in
|
||||
cache, regardless of the order of the query strings. This is limited to
|
||||
Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/sort_query_string_for_cache",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SortQueryStringForCache]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SortQueryStringForCache]], ResultWrapper[SortQueryStringForCache]),
|
||||
)
|
||||
|
||||
|
||||
class SortQueryStringForCacheResourceWithRawResponse:
|
||||
def __init__(self, sort_query_string_for_cache: SortQueryStringForCacheResource) -> None:
|
||||
self._sort_query_string_for_cache = sort_query_string_for_cache
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
sort_query_string_for_cache.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
sort_query_string_for_cache.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSortQueryStringForCacheResourceWithRawResponse:
|
||||
def __init__(self, sort_query_string_for_cache: AsyncSortQueryStringForCacheResource) -> None:
|
||||
self._sort_query_string_for_cache = sort_query_string_for_cache
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
sort_query_string_for_cache.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
sort_query_string_for_cache.get,
|
||||
)
|
||||
|
||||
|
||||
class SortQueryStringForCacheResourceWithStreamingResponse:
|
||||
def __init__(self, sort_query_string_for_cache: SortQueryStringForCacheResource) -> None:
|
||||
self._sort_query_string_for_cache = sort_query_string_for_cache
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
sort_query_string_for_cache.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
sort_query_string_for_cache.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSortQueryStringForCacheResourceWithStreamingResponse:
|
||||
def __init__(self, sort_query_string_for_cache: AsyncSortQueryStringForCacheResource) -> None:
|
||||
self._sort_query_string_for_cache = sort_query_string_for_cache
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
sort_query_string_for_cache.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
sort_query_string_for_cache.get,
|
||||
)
|
||||
|
|
@ -1,322 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import ssl_edit_params
|
||||
from ....types.zones.settings.ssl import SSL
|
||||
|
||||
__all__ = ["SSLResource", "AsyncSSLResource"]
|
||||
|
||||
|
||||
class SSLResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> SSLResourceWithRawResponse:
|
||||
return SSLResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> SSLResourceWithStreamingResponse:
|
||||
return SSLResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "flexible", "full", "strict"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SSL]:
|
||||
"""
|
||||
SSL encrypts your visitor's connection and safeguards credit card numbers and
|
||||
other personal data to and from your website. SSL can take up to 5 minutes to
|
||||
fully activate. Requires Cloudflare active on your root domain or www domain.
|
||||
Off: no SSL between the visitor and Cloudflare, and no SSL between Cloudflare
|
||||
and your web server (all HTTP traffic). Flexible: SSL between the visitor and
|
||||
Cloudflare -- visitor sees HTTPS on your site, but no SSL between Cloudflare and
|
||||
your web server. You don't need to have an SSL cert on your web server, but your
|
||||
vistors will still see the site as being HTTPS enabled. Full: SSL between the
|
||||
visitor and Cloudflare -- visitor sees HTTPS on your site, and SSL between
|
||||
Cloudflare and your web server. You'll need to have your own SSL cert or
|
||||
self-signed cert at the very least. Full (Strict): SSL between the visitor and
|
||||
Cloudflare -- visitor sees HTTPS on your site, and SSL between Cloudflare and
|
||||
your web server. You'll need to have a valid SSL certificate installed on your
|
||||
web server. This certificate must be signed by a certificate authority, have an
|
||||
expiration date in the future, and respond for the request domain name
|
||||
(hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Depends on the zone's plan level
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/ssl",
|
||||
body=maybe_transform({"value": value}, ssl_edit_params.SSLEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SSL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SSL]], ResultWrapper[SSL]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SSL]:
|
||||
"""
|
||||
SSL encrypts your visitor's connection and safeguards credit card numbers and
|
||||
other personal data to and from your website. SSL can take up to 5 minutes to
|
||||
fully activate. Requires Cloudflare active on your root domain or www domain.
|
||||
Off: no SSL between the visitor and Cloudflare, and no SSL between Cloudflare
|
||||
and your web server (all HTTP traffic). Flexible: SSL between the visitor and
|
||||
Cloudflare -- visitor sees HTTPS on your site, but no SSL between Cloudflare and
|
||||
your web server. You don't need to have an SSL cert on your web server, but your
|
||||
vistors will still see the site as being HTTPS enabled. Full: SSL between the
|
||||
visitor and Cloudflare -- visitor sees HTTPS on your site, and SSL between
|
||||
Cloudflare and your web server. You'll need to have your own SSL cert or
|
||||
self-signed cert at the very least. Full (Strict): SSL between the visitor and
|
||||
Cloudflare -- visitor sees HTTPS on your site, and SSL between Cloudflare and
|
||||
your web server. You'll need to have a valid SSL certificate installed on your
|
||||
web server. This certificate must be signed by a certificate authority, have an
|
||||
expiration date in the future, and respond for the request domain name
|
||||
(hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/ssl",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SSL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SSL]], ResultWrapper[SSL]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncSSLResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncSSLResourceWithRawResponse:
|
||||
return AsyncSSLResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncSSLResourceWithStreamingResponse:
|
||||
return AsyncSSLResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "flexible", "full", "strict"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SSL]:
|
||||
"""
|
||||
SSL encrypts your visitor's connection and safeguards credit card numbers and
|
||||
other personal data to and from your website. SSL can take up to 5 minutes to
|
||||
fully activate. Requires Cloudflare active on your root domain or www domain.
|
||||
Off: no SSL between the visitor and Cloudflare, and no SSL between Cloudflare
|
||||
and your web server (all HTTP traffic). Flexible: SSL between the visitor and
|
||||
Cloudflare -- visitor sees HTTPS on your site, but no SSL between Cloudflare and
|
||||
your web server. You don't need to have an SSL cert on your web server, but your
|
||||
vistors will still see the site as being HTTPS enabled. Full: SSL between the
|
||||
visitor and Cloudflare -- visitor sees HTTPS on your site, and SSL between
|
||||
Cloudflare and your web server. You'll need to have your own SSL cert or
|
||||
self-signed cert at the very least. Full (Strict): SSL between the visitor and
|
||||
Cloudflare -- visitor sees HTTPS on your site, and SSL between Cloudflare and
|
||||
your web server. You'll need to have a valid SSL certificate installed on your
|
||||
web server. This certificate must be signed by a certificate authority, have an
|
||||
expiration date in the future, and respond for the request domain name
|
||||
(hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Depends on the zone's plan level
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/ssl",
|
||||
body=await async_maybe_transform({"value": value}, ssl_edit_params.SSLEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SSL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SSL]], ResultWrapper[SSL]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SSL]:
|
||||
"""
|
||||
SSL encrypts your visitor's connection and safeguards credit card numbers and
|
||||
other personal data to and from your website. SSL can take up to 5 minutes to
|
||||
fully activate. Requires Cloudflare active on your root domain or www domain.
|
||||
Off: no SSL between the visitor and Cloudflare, and no SSL between Cloudflare
|
||||
and your web server (all HTTP traffic). Flexible: SSL between the visitor and
|
||||
Cloudflare -- visitor sees HTTPS on your site, but no SSL between Cloudflare and
|
||||
your web server. You don't need to have an SSL cert on your web server, but your
|
||||
vistors will still see the site as being HTTPS enabled. Full: SSL between the
|
||||
visitor and Cloudflare -- visitor sees HTTPS on your site, and SSL between
|
||||
Cloudflare and your web server. You'll need to have your own SSL cert or
|
||||
self-signed cert at the very least. Full (Strict): SSL between the visitor and
|
||||
Cloudflare -- visitor sees HTTPS on your site, and SSL between Cloudflare and
|
||||
your web server. You'll need to have a valid SSL certificate installed on your
|
||||
web server. This certificate must be signed by a certificate authority, have an
|
||||
expiration date in the future, and respond for the request domain name
|
||||
(hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/ssl",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SSL]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SSL]], ResultWrapper[SSL]),
|
||||
)
|
||||
|
||||
|
||||
class SSLResourceWithRawResponse:
|
||||
def __init__(self, ssl: SSLResource) -> None:
|
||||
self._ssl = ssl
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
ssl.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
ssl.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSSLResourceWithRawResponse:
|
||||
def __init__(self, ssl: AsyncSSLResource) -> None:
|
||||
self._ssl = ssl
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
ssl.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
ssl.get,
|
||||
)
|
||||
|
||||
|
||||
class SSLResourceWithStreamingResponse:
|
||||
def __init__(self, ssl: SSLResource) -> None:
|
||||
self._ssl = ssl
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
ssl.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
ssl.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSSLResourceWithStreamingResponse:
|
||||
def __init__(self, ssl: AsyncSSLResource) -> None:
|
||||
self._ssl = ssl
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
ssl.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
ssl.get,
|
||||
)
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import SSLRecommender, ssl_recommender_edit_params
|
||||
from ....types.zones.settings.ssl_recommender import SSLRecommender
|
||||
from ....types.zones.settings.ssl_recommender_param import SSLRecommenderParam
|
||||
|
||||
__all__ = ["SSLRecommenderResource", "AsyncSSLRecommenderResource"]
|
||||
|
||||
|
||||
class SSLRecommenderResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> SSLRecommenderResourceWithRawResponse:
|
||||
return SSLRecommenderResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> SSLRecommenderResourceWithStreamingResponse:
|
||||
return SSLRecommenderResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: SSLRecommenderParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SSLRecommender]:
|
||||
"""
|
||||
Enrollment in the SSL/TLS Recommender service which tries to detect and
|
||||
recommend (by sending periodic emails) the most secure SSL/TLS setting your
|
||||
origin servers support.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Enrollment in the SSL/TLS Recommender service which tries to detect and
|
||||
recommend (by sending periodic emails) the most secure SSL/TLS setting your
|
||||
origin servers support.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/ssl_recommender",
|
||||
body=maybe_transform({"value": value}, ssl_recommender_edit_params.SSLRecommenderEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SSLRecommender]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SSLRecommender]], ResultWrapper[SSLRecommender]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SSLRecommender]:
|
||||
"""
|
||||
Enrollment in the SSL/TLS Recommender service which tries to detect and
|
||||
recommend (by sending periodic emails) the most secure SSL/TLS setting your
|
||||
origin servers support.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/ssl_recommender",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SSLRecommender]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SSLRecommender]], ResultWrapper[SSLRecommender]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncSSLRecommenderResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncSSLRecommenderResourceWithRawResponse:
|
||||
return AsyncSSLRecommenderResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncSSLRecommenderResourceWithStreamingResponse:
|
||||
return AsyncSSLRecommenderResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: SSLRecommenderParam,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SSLRecommender]:
|
||||
"""
|
||||
Enrollment in the SSL/TLS Recommender service which tries to detect and
|
||||
recommend (by sending periodic emails) the most secure SSL/TLS setting your
|
||||
origin servers support.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Enrollment in the SSL/TLS Recommender service which tries to detect and
|
||||
recommend (by sending periodic emails) the most secure SSL/TLS setting your
|
||||
origin servers support.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/ssl_recommender",
|
||||
body=await async_maybe_transform({"value": value}, ssl_recommender_edit_params.SSLRecommenderEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SSLRecommender]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SSLRecommender]], ResultWrapper[SSLRecommender]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[SSLRecommender]:
|
||||
"""
|
||||
Enrollment in the SSL/TLS Recommender service which tries to detect and
|
||||
recommend (by sending periodic emails) the most secure SSL/TLS setting your
|
||||
origin servers support.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/ssl_recommender",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[SSLRecommender]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[SSLRecommender]], ResultWrapper[SSLRecommender]),
|
||||
)
|
||||
|
||||
|
||||
class SSLRecommenderResourceWithRawResponse:
|
||||
def __init__(self, ssl_recommender: SSLRecommenderResource) -> None:
|
||||
self._ssl_recommender = ssl_recommender
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
ssl_recommender.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
ssl_recommender.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSSLRecommenderResourceWithRawResponse:
|
||||
def __init__(self, ssl_recommender: AsyncSSLRecommenderResource) -> None:
|
||||
self._ssl_recommender = ssl_recommender
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
ssl_recommender.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
ssl_recommender.get,
|
||||
)
|
||||
|
||||
|
||||
class SSLRecommenderResourceWithStreamingResponse:
|
||||
def __init__(self, ssl_recommender: SSLRecommenderResource) -> None:
|
||||
self._ssl_recommender = ssl_recommender
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
ssl_recommender.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
ssl_recommender.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncSSLRecommenderResourceWithStreamingResponse:
|
||||
def __init__(self, ssl_recommender: AsyncSSLRecommenderResource) -> None:
|
||||
self._ssl_recommender = ssl_recommender
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
ssl_recommender.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
ssl_recommender.get,
|
||||
)
|
||||
|
|
@ -1,264 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import tls_1_3_edit_params
|
||||
from ....types.zones.settings.tls_1_3 import TLS1_3
|
||||
|
||||
__all__ = ["TLS1_3Resource", "AsyncTLS1_3Resource"]
|
||||
|
||||
|
||||
class TLS1_3Resource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> TLS1_3ResourceWithRawResponse:
|
||||
return TLS1_3ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> TLS1_3ResourceWithStreamingResponse:
|
||||
return TLS1_3ResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off", "zrt"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TLS1_3]:
|
||||
"""
|
||||
Changes TLS 1.3 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/tls_1_3",
|
||||
body=maybe_transform({"value": value}, tls_1_3_edit_params.TLS1_3EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TLS1_3]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TLS1_3]], ResultWrapper[TLS1_3]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TLS1_3]:
|
||||
"""
|
||||
Gets TLS 1.3 setting enabled for a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/tls_1_3",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TLS1_3]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TLS1_3]], ResultWrapper[TLS1_3]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncTLS1_3Resource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncTLS1_3ResourceWithRawResponse:
|
||||
return AsyncTLS1_3ResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncTLS1_3ResourceWithStreamingResponse:
|
||||
return AsyncTLS1_3ResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off", "zrt"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TLS1_3]:
|
||||
"""
|
||||
Changes TLS 1.3 setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/tls_1_3",
|
||||
body=await async_maybe_transform({"value": value}, tls_1_3_edit_params.TLS1_3EditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TLS1_3]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TLS1_3]], ResultWrapper[TLS1_3]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TLS1_3]:
|
||||
"""
|
||||
Gets TLS 1.3 setting enabled for a zone.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/tls_1_3",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TLS1_3]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TLS1_3]], ResultWrapper[TLS1_3]),
|
||||
)
|
||||
|
||||
|
||||
class TLS1_3ResourceWithRawResponse:
|
||||
def __init__(self, tls_1_3: TLS1_3Resource) -> None:
|
||||
self._tls_1_3 = tls_1_3
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
tls_1_3.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
tls_1_3.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTLS1_3ResourceWithRawResponse:
|
||||
def __init__(self, tls_1_3: AsyncTLS1_3Resource) -> None:
|
||||
self._tls_1_3 = tls_1_3
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
tls_1_3.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
tls_1_3.get,
|
||||
)
|
||||
|
||||
|
||||
class TLS1_3ResourceWithStreamingResponse:
|
||||
def __init__(self, tls_1_3: TLS1_3Resource) -> None:
|
||||
self._tls_1_3 = tls_1_3
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
tls_1_3.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
tls_1_3.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTLS1_3ResourceWithStreamingResponse:
|
||||
def __init__(self, tls_1_3: AsyncTLS1_3Resource) -> None:
|
||||
self._tls_1_3 = tls_1_3
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
tls_1_3.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
tls_1_3.get,
|
||||
)
|
||||
|
|
@ -1,266 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import tls_client_auth_edit_params
|
||||
from ....types.zones.settings.tls_client_auth import TLSClientAuth
|
||||
|
||||
__all__ = ["TLSClientAuthResource", "AsyncTLSClientAuthResource"]
|
||||
|
||||
|
||||
class TLSClientAuthResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> TLSClientAuthResourceWithRawResponse:
|
||||
return TLSClientAuthResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> TLSClientAuthResourceWithStreamingResponse:
|
||||
return TLSClientAuthResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TLSClientAuth]:
|
||||
"""
|
||||
TLS Client Auth requires Cloudflare to connect to your origin server using a
|
||||
client certificate (Enterprise Only).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/tls_client_auth",
|
||||
body=maybe_transform({"value": value}, tls_client_auth_edit_params.TLSClientAuthEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TLSClientAuth]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TLSClientAuth]], ResultWrapper[TLSClientAuth]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TLSClientAuth]:
|
||||
"""
|
||||
TLS Client Auth requires Cloudflare to connect to your origin server using a
|
||||
client certificate (Enterprise Only).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/tls_client_auth",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TLSClientAuth]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TLSClientAuth]], ResultWrapper[TLSClientAuth]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncTLSClientAuthResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncTLSClientAuthResourceWithRawResponse:
|
||||
return AsyncTLSClientAuthResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncTLSClientAuthResourceWithStreamingResponse:
|
||||
return AsyncTLSClientAuthResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TLSClientAuth]:
|
||||
"""
|
||||
TLS Client Auth requires Cloudflare to connect to your origin server using a
|
||||
client certificate (Enterprise Only).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/tls_client_auth",
|
||||
body=await async_maybe_transform({"value": value}, tls_client_auth_edit_params.TLSClientAuthEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TLSClientAuth]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TLSClientAuth]], ResultWrapper[TLSClientAuth]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TLSClientAuth]:
|
||||
"""
|
||||
TLS Client Auth requires Cloudflare to connect to your origin server using a
|
||||
client certificate (Enterprise Only).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/tls_client_auth",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TLSClientAuth]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TLSClientAuth]], ResultWrapper[TLSClientAuth]),
|
||||
)
|
||||
|
||||
|
||||
class TLSClientAuthResourceWithRawResponse:
|
||||
def __init__(self, tls_client_auth: TLSClientAuthResource) -> None:
|
||||
self._tls_client_auth = tls_client_auth
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
tls_client_auth.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
tls_client_auth.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTLSClientAuthResourceWithRawResponse:
|
||||
def __init__(self, tls_client_auth: AsyncTLSClientAuthResource) -> None:
|
||||
self._tls_client_auth = tls_client_auth
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
tls_client_auth.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
tls_client_auth.get,
|
||||
)
|
||||
|
||||
|
||||
class TLSClientAuthResourceWithStreamingResponse:
|
||||
def __init__(self, tls_client_auth: TLSClientAuthResource) -> None:
|
||||
self._tls_client_auth = tls_client_auth
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
tls_client_auth.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
tls_client_auth.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTLSClientAuthResourceWithStreamingResponse:
|
||||
def __init__(self, tls_client_auth: AsyncTLSClientAuthResource) -> None:
|
||||
self._tls_client_auth = tls_client_auth
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
tls_client_auth.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
tls_client_auth.get,
|
||||
)
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import true_client_ip_header_edit_params
|
||||
from ....types.zones.settings.true_client_ip_header import TrueClientIPHeader
|
||||
|
||||
__all__ = ["TrueClientIPHeaderResource", "AsyncTrueClientIPHeaderResource"]
|
||||
|
||||
|
||||
class TrueClientIPHeaderResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> TrueClientIPHeaderResourceWithRawResponse:
|
||||
return TrueClientIPHeaderResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> TrueClientIPHeaderResourceWithStreamingResponse:
|
||||
return TrueClientIPHeaderResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TrueClientIPHeader]:
|
||||
"""
|
||||
Allows customer to continue to use True Client IP (Akamai feature) in the
|
||||
headers we send to the origin. This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/true_client_ip_header",
|
||||
body=maybe_transform({"value": value}, true_client_ip_header_edit_params.TrueClientIPHeaderEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TrueClientIPHeader]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TrueClientIPHeader]], ResultWrapper[TrueClientIPHeader]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TrueClientIPHeader]:
|
||||
"""
|
||||
Allows customer to continue to use True Client IP (Akamai feature) in the
|
||||
headers we send to the origin. This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/true_client_ip_header",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TrueClientIPHeader]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TrueClientIPHeader]], ResultWrapper[TrueClientIPHeader]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncTrueClientIPHeaderResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncTrueClientIPHeaderResourceWithRawResponse:
|
||||
return AsyncTrueClientIPHeaderResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncTrueClientIPHeaderResourceWithStreamingResponse:
|
||||
return AsyncTrueClientIPHeaderResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TrueClientIPHeader]:
|
||||
"""
|
||||
Allows customer to continue to use True Client IP (Akamai feature) in the
|
||||
headers we send to the origin. This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/true_client_ip_header",
|
||||
body=await async_maybe_transform(
|
||||
{"value": value}, true_client_ip_header_edit_params.TrueClientIPHeaderEditParams
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TrueClientIPHeader]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TrueClientIPHeader]], ResultWrapper[TrueClientIPHeader]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[TrueClientIPHeader]:
|
||||
"""
|
||||
Allows customer to continue to use True Client IP (Akamai feature) in the
|
||||
headers we send to the origin. This is limited to Enterprise Zones.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/true_client_ip_header",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[TrueClientIPHeader]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[TrueClientIPHeader]], ResultWrapper[TrueClientIPHeader]),
|
||||
)
|
||||
|
||||
|
||||
class TrueClientIPHeaderResourceWithRawResponse:
|
||||
def __init__(self, true_client_ip_header: TrueClientIPHeaderResource) -> None:
|
||||
self._true_client_ip_header = true_client_ip_header
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
true_client_ip_header.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
true_client_ip_header.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTrueClientIPHeaderResourceWithRawResponse:
|
||||
def __init__(self, true_client_ip_header: AsyncTrueClientIPHeaderResource) -> None:
|
||||
self._true_client_ip_header = true_client_ip_header
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
true_client_ip_header.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
true_client_ip_header.get,
|
||||
)
|
||||
|
||||
|
||||
class TrueClientIPHeaderResourceWithStreamingResponse:
|
||||
def __init__(self, true_client_ip_header: TrueClientIPHeaderResource) -> None:
|
||||
self._true_client_ip_header = true_client_ip_header
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
true_client_ip_header.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
true_client_ip_header.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncTrueClientIPHeaderResourceWithStreamingResponse:
|
||||
def __init__(self, true_client_ip_header: AsyncTrueClientIPHeaderResource) -> None:
|
||||
self._true_client_ip_header = true_client_ip_header
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
true_client_ip_header.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
true_client_ip_header.get,
|
||||
)
|
||||
|
|
@ -1,302 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import waf_edit_params
|
||||
from ....types.zones.settings.waf import WAF
|
||||
|
||||
__all__ = ["WAFResource", "AsyncWAFResource"]
|
||||
|
||||
|
||||
class WAFResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> WAFResourceWithRawResponse:
|
||||
return WAFResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> WAFResourceWithStreamingResponse:
|
||||
return WAFResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WAF]:
|
||||
"""The WAF examines HTTP requests to your website.
|
||||
|
||||
It inspects both GET and POST
|
||||
requests and applies rules to help filter out illegitimate traffic from
|
||||
legitimate website visitors. The Cloudflare WAF inspects website addresses or
|
||||
URLs to detect anything out of the ordinary. If the Cloudflare WAF determines
|
||||
suspicious user behavior, then the WAF will 'challenge' the web visitor with a
|
||||
page that asks them to submit a CAPTCHA successfully to continue their action.
|
||||
If the challenge is failed, the action will be stopped. What this means is that
|
||||
Cloudflare's WAF will block any traffic identified as illegitimate before it
|
||||
reaches your origin web server.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200172016).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/waf",
|
||||
body=maybe_transform({"value": value}, waf_edit_params.WAFEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WAF]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[WAF]], ResultWrapper[WAF]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WAF]:
|
||||
"""The WAF examines HTTP requests to your website.
|
||||
|
||||
It inspects both GET and POST
|
||||
requests and applies rules to help filter out illegitimate traffic from
|
||||
legitimate website visitors. The Cloudflare WAF inspects website addresses or
|
||||
URLs to detect anything out of the ordinary. If the Cloudflare WAF determines
|
||||
suspicious user behavior, then the WAF will 'challenge' the web visitor with a
|
||||
page that asks them to submit a CAPTCHA successfully to continue their action.
|
||||
If the challenge is failed, the action will be stopped. What this means is that
|
||||
Cloudflare's WAF will block any traffic identified as illegitimate before it
|
||||
reaches your origin web server.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200172016).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/waf",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WAF]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[WAF]], ResultWrapper[WAF]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncWAFResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncWAFResourceWithRawResponse:
|
||||
return AsyncWAFResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncWAFResourceWithStreamingResponse:
|
||||
return AsyncWAFResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WAF]:
|
||||
"""The WAF examines HTTP requests to your website.
|
||||
|
||||
It inspects both GET and POST
|
||||
requests and applies rules to help filter out illegitimate traffic from
|
||||
legitimate website visitors. The Cloudflare WAF inspects website addresses or
|
||||
URLs to detect anything out of the ordinary. If the Cloudflare WAF determines
|
||||
suspicious user behavior, then the WAF will 'challenge' the web visitor with a
|
||||
page that asks them to submit a CAPTCHA successfully to continue their action.
|
||||
If the challenge is failed, the action will be stopped. What this means is that
|
||||
Cloudflare's WAF will block any traffic identified as illegitimate before it
|
||||
reaches your origin web server.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200172016).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/waf",
|
||||
body=await async_maybe_transform({"value": value}, waf_edit_params.WAFEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WAF]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[WAF]], ResultWrapper[WAF]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WAF]:
|
||||
"""The WAF examines HTTP requests to your website.
|
||||
|
||||
It inspects both GET and POST
|
||||
requests and applies rules to help filter out illegitimate traffic from
|
||||
legitimate website visitors. The Cloudflare WAF inspects website addresses or
|
||||
URLs to detect anything out of the ordinary. If the Cloudflare WAF determines
|
||||
suspicious user behavior, then the WAF will 'challenge' the web visitor with a
|
||||
page that asks them to submit a CAPTCHA successfully to continue their action.
|
||||
If the challenge is failed, the action will be stopped. What this means is that
|
||||
Cloudflare's WAF will block any traffic identified as illegitimate before it
|
||||
reaches your origin web server.
|
||||
(https://support.cloudflare.com/hc/en-us/articles/200172016).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/waf",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WAF]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[WAF]], ResultWrapper[WAF]),
|
||||
)
|
||||
|
||||
|
||||
class WAFResourceWithRawResponse:
|
||||
def __init__(self, waf: WAFResource) -> None:
|
||||
self._waf = waf
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
waf.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
waf.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncWAFResourceWithRawResponse:
|
||||
def __init__(self, waf: AsyncWAFResource) -> None:
|
||||
self._waf = waf
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
waf.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
waf.get,
|
||||
)
|
||||
|
||||
|
||||
class WAFResourceWithStreamingResponse:
|
||||
def __init__(self, waf: WAFResource) -> None:
|
||||
self._waf = waf
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
waf.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
waf.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncWAFResourceWithStreamingResponse:
|
||||
def __init__(self, waf: AsyncWAFResource) -> None:
|
||||
self._waf = waf
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
waf.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
waf.get,
|
||||
)
|
||||
|
|
@ -1,270 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import webp_edit_params
|
||||
from ....types.zones.settings.webp import WebP
|
||||
|
||||
__all__ = ["WebPResource", "AsyncWebPResource"]
|
||||
|
||||
|
||||
class WebPResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> WebPResourceWithRawResponse:
|
||||
return WebPResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> WebPResourceWithStreamingResponse:
|
||||
return WebPResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "on"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WebP]:
|
||||
"""
|
||||
When the client requesting the image supports the WebP image codec, and WebP
|
||||
offers a performance advantage over the original image format, Cloudflare will
|
||||
serve a WebP version of the original image.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/webp",
|
||||
body=maybe_transform({"value": value}, webp_edit_params.WebPEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WebP]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[WebP]], ResultWrapper[WebP]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WebP]:
|
||||
"""
|
||||
When the client requesting the image supports the WebP image codec, and WebP
|
||||
offers a performance advantage over the original image format, Cloudflare will
|
||||
serve a WebP version of the original image.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/webp",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WebP]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[WebP]], ResultWrapper[WebP]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncWebPResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncWebPResourceWithRawResponse:
|
||||
return AsyncWebPResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncWebPResourceWithStreamingResponse:
|
||||
return AsyncWebPResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "on"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WebP]:
|
||||
"""
|
||||
When the client requesting the image supports the WebP image codec, and WebP
|
||||
offers a performance advantage over the original image format, Cloudflare will
|
||||
serve a WebP version of the original image.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/webp",
|
||||
body=await async_maybe_transform({"value": value}, webp_edit_params.WebPEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WebP]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[WebP]], ResultWrapper[WebP]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WebP]:
|
||||
"""
|
||||
When the client requesting the image supports the WebP image codec, and WebP
|
||||
offers a performance advantage over the original image format, Cloudflare will
|
||||
serve a WebP version of the original image.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/webp",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WebP]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[WebP]], ResultWrapper[WebP]),
|
||||
)
|
||||
|
||||
|
||||
class WebPResourceWithRawResponse:
|
||||
def __init__(self, webp: WebPResource) -> None:
|
||||
self._webp = webp
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
webp.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
webp.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncWebPResourceWithRawResponse:
|
||||
def __init__(self, webp: AsyncWebPResource) -> None:
|
||||
self._webp = webp
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
webp.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
webp.get,
|
||||
)
|
||||
|
||||
|
||||
class WebPResourceWithStreamingResponse:
|
||||
def __init__(self, webp: WebPResource) -> None:
|
||||
self._webp = webp
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
webp.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
webp.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncWebPResourceWithStreamingResponse:
|
||||
def __init__(self, webp: AsyncWebPResource) -> None:
|
||||
self._webp = webp
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
webp.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
webp.get,
|
||||
)
|
||||
|
|
@ -1,272 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import websocket_edit_params
|
||||
from ....types.zones.settings.websocket import Websocket
|
||||
|
||||
__all__ = ["WebsocketResource", "AsyncWebsocketResource"]
|
||||
|
||||
|
||||
class WebsocketResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> WebsocketResourceWithRawResponse:
|
||||
return WebsocketResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> WebsocketResourceWithStreamingResponse:
|
||||
return WebsocketResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "on"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Websocket]:
|
||||
"""Changes Websockets setting.
|
||||
|
||||
For more information about Websockets, please refer
|
||||
to
|
||||
[Using Cloudflare with WebSockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/websockets",
|
||||
body=maybe_transform({"value": value}, websocket_edit_params.WebsocketEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Websocket]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Websocket]], ResultWrapper[Websocket]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Websocket]:
|
||||
"""Gets Websockets setting.
|
||||
|
||||
For more information about Websockets, please refer to
|
||||
[Using Cloudflare with WebSockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/websockets",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Websocket]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Websocket]], ResultWrapper[Websocket]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncWebsocketResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncWebsocketResourceWithRawResponse:
|
||||
return AsyncWebsocketResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncWebsocketResourceWithStreamingResponse:
|
||||
return AsyncWebsocketResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["off", "on"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Websocket]:
|
||||
"""Changes Websockets setting.
|
||||
|
||||
For more information about Websockets, please refer
|
||||
to
|
||||
[Using Cloudflare with WebSockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the zone setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/websockets",
|
||||
body=await async_maybe_transform({"value": value}, websocket_edit_params.WebsocketEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Websocket]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Websocket]], ResultWrapper[Websocket]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[Websocket]:
|
||||
"""Gets Websockets setting.
|
||||
|
||||
For more information about Websockets, please refer to
|
||||
[Using Cloudflare with WebSockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets).
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/websockets",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[Websocket]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[Websocket]], ResultWrapper[Websocket]),
|
||||
)
|
||||
|
||||
|
||||
class WebsocketResourceWithRawResponse:
|
||||
def __init__(self, websocket: WebsocketResource) -> None:
|
||||
self._websocket = websocket
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
websocket.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
websocket.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncWebsocketResourceWithRawResponse:
|
||||
def __init__(self, websocket: AsyncWebsocketResource) -> None:
|
||||
self._websocket = websocket
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
websocket.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
websocket.get,
|
||||
)
|
||||
|
||||
|
||||
class WebsocketResourceWithStreamingResponse:
|
||||
def __init__(self, websocket: WebsocketResource) -> None:
|
||||
self._websocket = websocket
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
websocket.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
websocket.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncWebsocketResourceWithStreamingResponse:
|
||||
def __init__(self, websocket: AsyncWebsocketResource) -> None:
|
||||
self._websocket = websocket
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
websocket.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
websocket.get,
|
||||
)
|
||||
|
|
@ -1,262 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
||||
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
||||
from ...._utils import (
|
||||
maybe_transform,
|
||||
async_maybe_transform,
|
||||
)
|
||||
from ...._compat import cached_property
|
||||
from ...._resource import SyncAPIResource, AsyncAPIResource
|
||||
from ...._response import (
|
||||
to_raw_response_wrapper,
|
||||
to_streamed_response_wrapper,
|
||||
async_to_raw_response_wrapper,
|
||||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ...._wrappers import ResultWrapper
|
||||
from ...._base_client import (
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zones.settings import zero_rtt_edit_params
|
||||
from ....types.zones.settings.zero_rtt import ZeroRTT
|
||||
|
||||
__all__ = ["ZeroRTTResource", "AsyncZeroRTTResource"]
|
||||
|
||||
|
||||
class ZeroRTTResource(SyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> ZeroRTTResourceWithRawResponse:
|
||||
return ZeroRTTResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> ZeroRTTResourceWithStreamingResponse:
|
||||
return ZeroRTTResourceWithStreamingResponse(self)
|
||||
|
||||
def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ZeroRTT]:
|
||||
"""
|
||||
Changes the 0-RTT session resumption setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the 0-RTT setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._patch(
|
||||
f"/zones/{zone_id}/settings/0rtt",
|
||||
body=maybe_transform({"value": value}, zero_rtt_edit_params.ZeroRTTEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ZeroRTT]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ZeroRTT]], ResultWrapper[ZeroRTT]),
|
||||
)
|
||||
|
||||
def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ZeroRTT]:
|
||||
"""
|
||||
Gets 0-RTT session resumption setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return self._get(
|
||||
f"/zones/{zone_id}/settings/0rtt",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ZeroRTT]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ZeroRTT]], ResultWrapper[ZeroRTT]),
|
||||
)
|
||||
|
||||
|
||||
class AsyncZeroRTTResource(AsyncAPIResource):
|
||||
@cached_property
|
||||
def with_raw_response(self) -> AsyncZeroRTTResourceWithRawResponse:
|
||||
return AsyncZeroRTTResourceWithRawResponse(self)
|
||||
|
||||
@cached_property
|
||||
def with_streaming_response(self) -> AsyncZeroRTTResourceWithStreamingResponse:
|
||||
return AsyncZeroRTTResourceWithStreamingResponse(self)
|
||||
|
||||
async def edit(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
value: Literal["on", "off"],
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ZeroRTT]:
|
||||
"""
|
||||
Changes the 0-RTT session resumption setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
value: Value of the 0-RTT setting.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._patch(
|
||||
f"/zones/{zone_id}/settings/0rtt",
|
||||
body=await async_maybe_transform({"value": value}, zero_rtt_edit_params.ZeroRTTEditParams),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ZeroRTT]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ZeroRTT]], ResultWrapper[ZeroRTT]),
|
||||
)
|
||||
|
||||
async def get(
|
||||
self,
|
||||
*,
|
||||
zone_id: str,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[ZeroRTT]:
|
||||
"""
|
||||
Gets 0-RTT session resumption setting.
|
||||
|
||||
Args:
|
||||
zone_id: Identifier
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not zone_id:
|
||||
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
|
||||
return await self._get(
|
||||
f"/zones/{zone_id}/settings/0rtt",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[ZeroRTT]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[ZeroRTT]], ResultWrapper[ZeroRTT]),
|
||||
)
|
||||
|
||||
|
||||
class ZeroRTTResourceWithRawResponse:
|
||||
def __init__(self, zero_rtt: ZeroRTTResource) -> None:
|
||||
self._zero_rtt = zero_rtt
|
||||
|
||||
self.edit = to_raw_response_wrapper(
|
||||
zero_rtt.edit,
|
||||
)
|
||||
self.get = to_raw_response_wrapper(
|
||||
zero_rtt.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncZeroRTTResourceWithRawResponse:
|
||||
def __init__(self, zero_rtt: AsyncZeroRTTResource) -> None:
|
||||
self._zero_rtt = zero_rtt
|
||||
|
||||
self.edit = async_to_raw_response_wrapper(
|
||||
zero_rtt.edit,
|
||||
)
|
||||
self.get = async_to_raw_response_wrapper(
|
||||
zero_rtt.get,
|
||||
)
|
||||
|
||||
|
||||
class ZeroRTTResourceWithStreamingResponse:
|
||||
def __init__(self, zero_rtt: ZeroRTTResource) -> None:
|
||||
self._zero_rtt = zero_rtt
|
||||
|
||||
self.edit = to_streamed_response_wrapper(
|
||||
zero_rtt.edit,
|
||||
)
|
||||
self.get = to_streamed_response_wrapper(
|
||||
zero_rtt.get,
|
||||
)
|
||||
|
||||
|
||||
class AsyncZeroRTTResourceWithStreamingResponse:
|
||||
def __init__(self, zero_rtt: AsyncZeroRTTResource) -> None:
|
||||
self._zero_rtt = zero_rtt
|
||||
|
||||
self.edit = async_to_streamed_response_wrapper(
|
||||
zero_rtt.edit,
|
||||
)
|
||||
self.get = async_to_streamed_response_wrapper(
|
||||
zero_rtt.get,
|
||||
)
|
||||
|
|
@ -2,123 +2,9 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from .nel import NEL as NEL
|
||||
from .ssl import SSL as SSL
|
||||
from .waf import WAF as WAF
|
||||
from .ipv6 import IPV6 as IPV6
|
||||
from .webp import WebP as WebP
|
||||
from .http2 import HTTP2 as HTTP2
|
||||
from .http3 import HTTP3 as HTTP3
|
||||
from .brotli import Brotli as Brotli
|
||||
from .minify import Minify as Minify
|
||||
from .mirage import Mirage as Mirage
|
||||
from .polish import Polish as Polish
|
||||
from .ciphers import Ciphers as Ciphers
|
||||
from .tls_1_3 import TLS1_3 as TLS1_3
|
||||
from .zero_rtt import ZeroRTT as ZeroRTT
|
||||
from .nel_param import NELParam as NELParam
|
||||
from .websocket import Websocket as Websocket
|
||||
from .cache_level import CacheLevel as CacheLevel
|
||||
from .early_hints import EarlyHints as EarlyHints
|
||||
from .pseudo_ipv4 import PseudoIPV4 as PseudoIPV4
|
||||
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
|
||||
from .challenge_ttl import ChallengeTTL as ChallengeTTL
|
||||
from .font_settings import FontSettings as FontSettings
|
||||
from .rocket_loader import RocketLoader as RocketLoader
|
||||
from .image_resizing import ImageResizing as ImageResizing
|
||||
from .ip_geolocation import IPGeolocation as IPGeolocation
|
||||
from .security_level import SecurityLevel as SecurityLevel
|
||||
from .min_tls_version import MinTLSVersion as MinTLSVersion
|
||||
from .mobile_redirect import MobileRedirect as MobileRedirect
|
||||
from .nel_edit_params import NELEditParams as NELEditParams
|
||||
from .ssl_edit_params import SSLEditParams as SSLEditParams
|
||||
from .ssl_recommender import SSLRecommender as SSLRecommender
|
||||
from .tls_client_auth import TLSClientAuth as TLSClientAuth
|
||||
from .waf_edit_params import WAFEditParams as WAFEditParams
|
||||
from .always_use_https import AlwaysUseHTTPS as AlwaysUseHTTPS
|
||||
from .development_mode import DevelopmentMode as DevelopmentMode
|
||||
from .ipv6_edit_params import IPV6EditParams as IPV6EditParams
|
||||
from .orange_to_orange import OrangeToOrange as OrangeToOrange
|
||||
from .prefetch_preload import PrefetchPreload as PrefetchPreload
|
||||
from .security_headers import SecurityHeaders as SecurityHeaders
|
||||
from .webp_edit_params import WebPEditParams as WebPEditParams
|
||||
from .browser_cache_ttl import BrowserCacheTTL as BrowserCacheTTL
|
||||
from .email_obfuscation import EmailObfuscation as EmailObfuscation
|
||||
from .h2_prioritization import H2Prioritization as H2Prioritization
|
||||
from .http2_edit_params import HTTP2EditParams as HTTP2EditParams
|
||||
from .http3_edit_params import HTTP3EditParams as HTTP3EditParams
|
||||
from .brotli_edit_params import BrotliEditParams as BrotliEditParams
|
||||
from .cipher_edit_params import CipherEditParams as CipherEditParams
|
||||
from .hotlink_protection import HotlinkProtection as HotlinkProtection
|
||||
from .minify_edit_params import MinifyEditParams as MinifyEditParams
|
||||
from .mirage_edit_params import MirageEditParams as MirageEditParams
|
||||
from .polish_edit_params import PolishEditParams as PolishEditParams
|
||||
from .proxy_read_timeout import ProxyReadTimeout as ProxyReadTimeout
|
||||
from .response_buffering import ResponseBuffering as ResponseBuffering
|
||||
from .opportunistic_onion import OpportunisticOnion as OpportunisticOnion
|
||||
from .rocket_loader_param import RocketLoaderParam as RocketLoaderParam
|
||||
from .tls_1_3_edit_params import TLS1_3EditParams as TLS1_3EditParams
|
||||
from .image_resizing_param import ImageResizingParam as ImageResizingParam
|
||||
from .server_side_excludes import ServerSideExcludes as ServerSideExcludes
|
||||
from .zero_rtt_edit_params import ZeroRTTEditParams as ZeroRTTEditParams
|
||||
from .ssl_recommender_param import SSLRecommenderParam as SSLRecommenderParam
|
||||
from .true_client_ip_header import TrueClientIPHeader as TrueClientIPHeader
|
||||
from .websocket_edit_params import WebsocketEditParams as WebsocketEditParams
|
||||
from .early_hint_edit_params import EarlyHintEditParams as EarlyHintEditParams
|
||||
from .orange_to_orange_param import OrangeToOrangeParam as OrangeToOrangeParam
|
||||
from .cache_level_edit_params import CacheLevelEditParams as CacheLevelEditParams
|
||||
from .h2_prioritization_param import H2PrioritizationParam as H2PrioritizationParam
|
||||
from .origin_max_http_version import OriginMaxHTTPVersion as OriginMaxHTTPVersion
|
||||
from .pseudo_ipv4_edit_params import PseudoIPV4EditParams as PseudoIPV4EditParams
|
||||
from .automatic_https_rewrites import AutomaticHTTPSRewrites as AutomaticHTTPSRewrites
|
||||
from .font_setting_edit_params import FontSettingEditParams as FontSettingEditParams
|
||||
from .opportunistic_encryption import OpportunisticEncryption as OpportunisticEncryption
|
||||
from .proxy_read_timeout_param import ProxyReadTimeoutParam as ProxyReadTimeoutParam
|
||||
from .always_online_edit_params import AlwaysOnlineEditParams as AlwaysOnlineEditParams
|
||||
from .browser_check_edit_params import BrowserCheckEditParams as BrowserCheckEditParams
|
||||
from .challenge_ttl_edit_params import ChallengeTTLEditParams as ChallengeTTLEditParams
|
||||
from .rocket_loader_edit_params import RocketLoaderEditParams as RocketLoaderEditParams
|
||||
from .image_resizing_edit_params import ImageResizingEditParams as ImageResizingEditParams
|
||||
from .ip_geolocation_edit_params import IPGeolocationEditParams as IPGeolocationEditParams
|
||||
from .security_level_edit_params import SecurityLevelEditParams as SecurityLevelEditParams
|
||||
from .min_tls_version_edit_params import MinTLSVersionEditParams as MinTLSVersionEditParams
|
||||
from .mobile_redirect_edit_params import MobileRedirectEditParams as MobileRedirectEditParams
|
||||
from .origin_error_page_pass_thru import OriginErrorPagePassThru as OriginErrorPagePassThru
|
||||
from .security_header_edit_params import SecurityHeaderEditParams as SecurityHeaderEditParams
|
||||
from .sort_query_string_for_cache import SortQueryStringForCache as SortQueryStringForCache
|
||||
from .ssl_recommender_edit_params import SSLRecommenderEditParams as SSLRecommenderEditParams
|
||||
from .tls_client_auth_edit_params import TLSClientAuthEditParams as TLSClientAuthEditParams
|
||||
from .always_use_https_edit_params import AlwaysUseHTTPSEditParams as AlwaysUseHTTPSEditParams
|
||||
from .development_mode_edit_params import DevelopmentModeEditParams as DevelopmentModeEditParams
|
||||
from .orange_to_orange_edit_params import OrangeToOrangeEditParams as OrangeToOrangeEditParams
|
||||
from .prefetch_preload_edit_params import PrefetchPreloadEditParams as PrefetchPreloadEditParams
|
||||
from .browser_cache_ttl_edit_params import BrowserCacheTTLEditParams as BrowserCacheTTLEditParams
|
||||
from .email_obfuscation_edit_params import EmailObfuscationEditParams as EmailObfuscationEditParams
|
||||
from .h2_prioritization_edit_params import H2PrioritizationEditParams as H2PrioritizationEditParams
|
||||
from .hotlink_protection_edit_params import HotlinkProtectionEditParams as HotlinkProtectionEditParams
|
||||
from .proxy_read_timeout_edit_params import ProxyReadTimeoutEditParams as ProxyReadTimeoutEditParams
|
||||
from .response_buffering_edit_params import ResponseBufferingEditParams as ResponseBufferingEditParams
|
||||
from .automatic_platform_optimization import AutomaticPlatformOptimization as AutomaticPlatformOptimization
|
||||
from .opportunistic_onion_edit_params import OpportunisticOnionEditParams as OpportunisticOnionEditParams
|
||||
from .server_side_exclude_edit_params import ServerSideExcludeEditParams as ServerSideExcludeEditParams
|
||||
from .true_client_ip_header_edit_params import TrueClientIPHeaderEditParams as TrueClientIPHeaderEditParams
|
||||
from .automatic_https_rewrite_edit_params import AutomaticHTTPSRewriteEditParams as AutomaticHTTPSRewriteEditParams
|
||||
from .origin_max_http_version_edit_params import OriginMaxHTTPVersionEditParams as OriginMaxHTTPVersionEditParams
|
||||
from .opportunistic_encryption_edit_params import OpportunisticEncryptionEditParams as OpportunisticEncryptionEditParams
|
||||
from .origin_max_http_version_get_response import OriginMaxHTTPVersionGetResponse as OriginMaxHTTPVersionGetResponse
|
||||
from .automatic_platform_optimization_param import (
|
||||
AutomaticPlatformOptimizationParam as AutomaticPlatformOptimizationParam,
|
||||
)
|
||||
from .origin_max_http_version_edit_response import OriginMaxHTTPVersionEditResponse as OriginMaxHTTPVersionEditResponse
|
||||
from .origin_error_page_pass_thru_edit_params import (
|
||||
OriginErrorPagePassThruEditParams as OriginErrorPagePassThruEditParams,
|
||||
)
|
||||
from .sort_query_string_for_cache_edit_params import (
|
||||
SortQueryStringForCacheEditParams as SortQueryStringForCacheEditParams,
|
||||
)
|
||||
from .automatic_platform_optimization_edit_params import (
|
||||
AutomaticPlatformOptimizationEditParams as AutomaticPlatformOptimizationEditParams,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["AlwaysOnlineEditParams"]
|
||||
|
||||
|
||||
class AlwaysOnlineEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["AlwaysUseHTTPSEditParams"]
|
||||
|
||||
|
||||
class AlwaysUseHTTPSEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["AutomaticHTTPSRewriteEditParams"]
|
||||
|
||||
|
||||
class AutomaticHTTPSRewriteEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""
|
||||
Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
"""
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from .automatic_platform_optimization_param import AutomaticPlatformOptimizationParam
|
||||
|
||||
__all__ = ["AutomaticPlatformOptimizationEditParams"]
|
||||
|
||||
|
||||
class AutomaticPlatformOptimizationEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[AutomaticPlatformOptimizationParam]
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["AutomaticPlatformOptimizationParam"]
|
||||
|
||||
|
||||
class AutomaticPlatformOptimizationParam(TypedDict, total=False):
|
||||
cache_by_device_type: Required[bool]
|
||||
"""
|
||||
Indicates whether or not
|
||||
[cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/)
|
||||
is enabled.
|
||||
"""
|
||||
|
||||
cf: Required[bool]
|
||||
"""Indicates whether or not Cloudflare proxy is enabled."""
|
||||
|
||||
enabled: Required[bool]
|
||||
"""Indicates whether or not Automatic Platform Optimization is enabled."""
|
||||
|
||||
hostnames: Required[List[str]]
|
||||
"""
|
||||
An array of hostnames where Automatic Platform Optimization for WordPress is
|
||||
activated.
|
||||
"""
|
||||
|
||||
wordpress: Required[bool]
|
||||
"""Indicates whether or not site is powered by WordPress."""
|
||||
|
||||
wp_plugin: Required[bool]
|
||||
"""
|
||||
Indicates whether or not
|
||||
[Cloudflare for WordPress plugin](https://wordpress.org/plugins/cloudflare/) is
|
||||
installed.
|
||||
"""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["BrotliEditParams"]
|
||||
|
||||
|
||||
class BrotliEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["off", "on"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["BrowserCacheTTLEditParams"]
|
||||
|
||||
|
||||
class BrowserCacheTTLEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[
|
||||
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,
|
||||
]
|
||||
]
|
||||
"""
|
||||
Value of the zone setting. Notes: Setting a TTL of 0 is equivalent to selecting
|
||||
`Respect Existing Headers`
|
||||
"""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["BrowserCheckEditParams"]
|
||||
|
||||
|
||||
class BrowserCheckEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["CacheLevelEditParams"]
|
||||
|
||||
|
||||
class CacheLevelEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["aggressive", "basic", "simplified"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["ChallengeTTLEditParams"]
|
||||
|
||||
|
||||
class ChallengeTTLEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[
|
||||
Literal[300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000]
|
||||
]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["CipherEditParams"]
|
||||
|
||||
|
||||
class CipherEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[List[str]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["DevelopmentModeEditParams"]
|
||||
|
||||
|
||||
class DevelopmentModeEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["EarlyHintEditParams"]
|
||||
|
||||
|
||||
class EarlyHintEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["EmailObfuscationEditParams"]
|
||||
|
||||
|
||||
class EmailObfuscationEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from .h2_prioritization_param import H2PrioritizationParam
|
||||
|
||||
__all__ = ["H2PrioritizationEditParams"]
|
||||
|
||||
|
||||
class H2PrioritizationEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[H2PrioritizationParam]
|
||||
"""
|
||||
HTTP/2 Edge Prioritization optimises the delivery of resources served through
|
||||
HTTP/2 to improve page load performance. It also supports fine control of
|
||||
content delivery when used in conjunction with Workers.
|
||||
"""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["H2PrioritizationParam"]
|
||||
|
||||
|
||||
class H2PrioritizationParam(TypedDict, total=False):
|
||||
id: Required[Literal["h2_prioritization"]]
|
||||
"""ID of the zone setting."""
|
||||
|
||||
value: Required[Literal["on", "off", "custom"]]
|
||||
"""Current value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["HotlinkProtectionEditParams"]
|
||||
|
||||
|
||||
class HotlinkProtectionEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["HTTP2EditParams"]
|
||||
|
||||
|
||||
class HTTP2EditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the HTTP2 setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["HTTP3EditParams"]
|
||||
|
||||
|
||||
class HTTP3EditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the HTTP3 setting."""
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from .image_resizing_param import ImageResizingParam
|
||||
|
||||
__all__ = ["ImageResizingEditParams"]
|
||||
|
||||
|
||||
class ImageResizingEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[ImageResizingParam]
|
||||
"""
|
||||
Image Resizing provides on-demand resizing, conversion and optimisation for
|
||||
images served through Cloudflare's network. Refer to the
|
||||
[Image Resizing documentation](https://developers.cloudflare.com/images/) for
|
||||
more information.
|
||||
"""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["ImageResizingParam"]
|
||||
|
||||
|
||||
class ImageResizingParam(TypedDict, total=False):
|
||||
id: Required[Literal["image_resizing"]]
|
||||
"""ID of the zone setting."""
|
||||
|
||||
value: Required[Literal["on", "off", "open"]]
|
||||
"""Current value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["IPGeolocationEditParams"]
|
||||
|
||||
|
||||
class IPGeolocationEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["IPV6EditParams"]
|
||||
|
||||
|
||||
class IPV6EditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["off", "on"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["MinTLSVersionEditParams"]
|
||||
|
||||
|
||||
class MinTLSVersionEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["1.0", "1.1", "1.2", "1.3"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["MinifyEditParams", "Value"]
|
||||
|
||||
|
||||
class MinifyEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Value]
|
||||
"""Value of the zone setting."""
|
||||
|
||||
|
||||
class Value(TypedDict, total=False):
|
||||
css: Literal["on", "off"]
|
||||
"""Automatically minify all CSS files for your website."""
|
||||
|
||||
html: Literal["on", "off"]
|
||||
"""Automatically minify all HTML files for your website."""
|
||||
|
||||
js: Literal["on", "off"]
|
||||
"""Automatically minify all JavaScript files for your website."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["MirageEditParams"]
|
||||
|
||||
|
||||
class MirageEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -17,7 +17,11 @@ class Value(BaseModel):
|
|||
"""
|
||||
|
||||
status: Optional[Literal["on", "off"]] = None
|
||||
"""Whether or not mobile redirect is enabled."""
|
||||
"""
|
||||
Deprecated: Use Single Redirects instead
|
||||
https://developers.cloudflare.com/rules/url-forwarding/single-redirects/examples/#perform-mobile-redirects.
|
||||
Whether or not mobile redirect is enabled.
|
||||
"""
|
||||
|
||||
strip_uri: Optional[bool] = None
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["MobileRedirectEditParams", "Value"]
|
||||
|
||||
|
||||
class MobileRedirectEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Value]
|
||||
"""Value of the zone setting."""
|
||||
|
||||
|
||||
class Value(TypedDict, total=False):
|
||||
mobile_subdomain: Optional[str]
|
||||
"""
|
||||
Which subdomain prefix you wish to redirect visitors on mobile devices to
|
||||
(subdomain must already exist).
|
||||
"""
|
||||
|
||||
status: Literal["on", "off"]
|
||||
"""Whether or not mobile redirect is enabled."""
|
||||
|
||||
strip_uri: bool
|
||||
"""
|
||||
Whether to drop the current page path and redirect to the mobile subdomain URL
|
||||
root, or keep the path and redirect to the same page on the mobile subdomain.
|
||||
"""
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from .nel_param import NELParam
|
||||
|
||||
__all__ = ["NELEditParams"]
|
||||
|
||||
|
||||
class NELEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[NELParam]
|
||||
"""Enable Network Error Logging reporting on your zone. (Beta)"""
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["NELParam", "Value"]
|
||||
|
||||
|
||||
class Value(TypedDict, total=False):
|
||||
enabled: bool
|
||||
|
||||
|
||||
class NELParam(TypedDict, total=False):
|
||||
id: Required[Literal["nel"]]
|
||||
"""Zone setting identifier."""
|
||||
|
||||
value: Required[Value]
|
||||
"""Current value of the zone setting."""
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["OpportunisticEncryptionEditParams"]
|
||||
|
||||
|
||||
class OpportunisticEncryptionEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""
|
||||
Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
"""
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["OpportunisticOnionEditParams"]
|
||||
|
||||
|
||||
class OpportunisticOnionEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""
|
||||
Value of the zone setting. Notes: Default value depends on the zone's plan
|
||||
level.
|
||||
"""
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from .orange_to_orange_param import OrangeToOrangeParam
|
||||
|
||||
__all__ = ["OrangeToOrangeEditParams"]
|
||||
|
||||
|
||||
class OrangeToOrangeEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[OrangeToOrangeParam]
|
||||
"""
|
||||
Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also
|
||||
on Cloudflare.
|
||||
"""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["OrangeToOrangeParam"]
|
||||
|
||||
|
||||
class OrangeToOrangeParam(TypedDict, total=False):
|
||||
id: Required[Literal["orange_to_orange"]]
|
||||
"""ID of the zone setting."""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Current value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["OriginErrorPagePassThruEditParams"]
|
||||
|
||||
|
||||
class OriginErrorPagePassThruEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from .polish_param import PolishParam
|
||||
|
||||
__all__ = ["PolishEditParams"]
|
||||
|
||||
|
||||
class PolishEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[PolishParam]
|
||||
"""Removes metadata and compresses your images for faster page load times.
|
||||
|
||||
Basic (Lossless): Reduce the size of PNG, JPEG, and GIF files - no impact on
|
||||
visual quality. Basic + JPEG (Lossy): Further reduce the size of JPEG files for
|
||||
faster image loading. Larger JPEGs are converted to progressive images, loading
|
||||
a lower-resolution image first and ending in a higher-resolution version. Not
|
||||
recommended for hi-res photography sites.
|
||||
"""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["PolishParam"]
|
||||
|
||||
|
||||
class PolishParam(TypedDict, total=False):
|
||||
id: Required[Literal["polish"]]
|
||||
"""ID of the zone setting."""
|
||||
|
||||
value: Required[Literal["off", "lossless", "lossy"]]
|
||||
"""Current value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["PrefetchPreloadEditParams"]
|
||||
|
||||
|
||||
class PrefetchPreloadEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from .proxy_read_timeout_param import ProxyReadTimeoutParam
|
||||
|
||||
__all__ = ["ProxyReadTimeoutEditParams"]
|
||||
|
||||
|
||||
class ProxyReadTimeoutEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[ProxyReadTimeoutParam]
|
||||
"""Maximum time between two read operations from origin."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["ProxyReadTimeoutParam"]
|
||||
|
||||
|
||||
class ProxyReadTimeoutParam(TypedDict, total=False):
|
||||
id: Required[Literal["proxy_read_timeout"]]
|
||||
"""ID of the zone setting."""
|
||||
|
||||
value: Required[float]
|
||||
"""Current value of the zone setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["PseudoIPV4EditParams"]
|
||||
|
||||
|
||||
class PseudoIPV4EditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["off", "add_header", "overwrite_header"]]
|
||||
"""Value of the Pseudo IPv4 setting."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["ResponseBufferingEditParams"]
|
||||
|
||||
|
||||
class ResponseBufferingEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Value of the zone setting."""
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
from .rocket_loader_param import RocketLoaderParam
|
||||
|
||||
__all__ = ["RocketLoaderEditParams"]
|
||||
|
||||
|
||||
class RocketLoaderEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[RocketLoaderParam]
|
||||
"""
|
||||
Rocket Loader is a general-purpose asynchronous JavaScript optimisation that
|
||||
prioritises rendering your content while loading your site's Javascript
|
||||
asynchronously. Turning on Rocket Loader will immediately improve a web page's
|
||||
rendering time sometimes measured as Time to First Paint (TTFP), and also the
|
||||
`window.onload` time (assuming there is JavaScript on the page). This can have a
|
||||
positive impact on your Google search ranking. When turned on, Rocket Loader
|
||||
will automatically defer the loading of all Javascript referenced in your HTML,
|
||||
with no configuration required. Refer to
|
||||
[Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056)
|
||||
for more information.
|
||||
"""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["RocketLoaderParam"]
|
||||
|
||||
|
||||
class RocketLoaderParam(TypedDict, total=False):
|
||||
id: Required[Literal["rocket_loader"]]
|
||||
"""ID of the zone setting."""
|
||||
|
||||
value: Required[Literal["on", "off"]]
|
||||
"""Current value of the zone setting."""
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Required, TypedDict
|
||||
|
||||
__all__ = ["SecurityHeaderEditParams", "Value", "ValueStrictTransportSecurity"]
|
||||
|
||||
|
||||
class SecurityHeaderEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Value]
|
||||
|
||||
|
||||
class ValueStrictTransportSecurity(TypedDict, total=False):
|
||||
enabled: bool
|
||||
"""Whether or not strict transport security is enabled."""
|
||||
|
||||
include_subdomains: bool
|
||||
"""Include all subdomains for strict transport security."""
|
||||
|
||||
max_age: float
|
||||
"""Max age in seconds of the strict transport security."""
|
||||
|
||||
nosniff: bool
|
||||
"""Whether or not to include 'X-Content-Type-Options: nosniff' header."""
|
||||
|
||||
|
||||
class Value(TypedDict, total=False):
|
||||
strict_transport_security: ValueStrictTransportSecurity
|
||||
"""Strict Transport Security."""
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["SecurityLevelEditParams"]
|
||||
|
||||
|
||||
class SecurityLevelEditParams(TypedDict, total=False):
|
||||
zone_id: Required[str]
|
||||
"""Identifier"""
|
||||
|
||||
value: Required[Literal["off", "essentially_off", "low", "medium", "high", "under_attack"]]
|
||||
"""Value of the zone setting."""
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue