From d2bad015a9a95405d4f770bdd579a2de821e835f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:53:35 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#194) --- .../resources/dns/firewall/firewall.py | 16 ---------------- src/cloudflare/types/dns/dns_firewall.py | 6 ------ .../types/dns/firewall_create_params.py | 6 ------ src/cloudflare/types/dns/firewall_edit_params.py | 6 ------ tests/api_resources/dns/test_firewall.py | 8 -------- 5 files changed, 42 deletions(-) diff --git a/src/cloudflare/resources/dns/firewall/firewall.py b/src/cloudflare/resources/dns/firewall/firewall.py index 009cbc6681d..c8fe6388eb0 100644 --- a/src/cloudflare/resources/dns/firewall/firewall.py +++ b/src/cloudflare/resources/dns/firewall/firewall.py @@ -70,7 +70,6 @@ def create( maximum_cache_ttl: float | NotGiven = NOT_GIVEN, minimum_cache_ttl: float | NotGiven = NOT_GIVEN, negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, - origin_ips: object | NotGiven = NOT_GIVEN, ratelimit: Optional[float] | NotGiven = NOT_GIVEN, retries: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -100,8 +99,6 @@ def create( negative_cache_ttl: Negative DNS Cache TTL. - origin_ips: Deprecated alias for "upstream_ips". - ratelimit: Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster). @@ -130,7 +127,6 @@ def create( "maximum_cache_ttl": maximum_cache_ttl, "minimum_cache_ttl": minimum_cache_ttl, "negative_cache_ttl": negative_cache_ttl, - "origin_ips": origin_ips, "ratelimit": ratelimit, "retries": retries, }, @@ -256,7 +252,6 @@ def edit( upstream_ips: List[Union[str, str]], attack_mitigation: Optional[firewall_edit_params.AttackMitigation] | NotGiven = NOT_GIVEN, negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, - origin_ips: object | NotGiven = NOT_GIVEN, ratelimit: Optional[float] | NotGiven = NOT_GIVEN, retries: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -288,8 +283,6 @@ def edit( negative_cache_ttl: Negative DNS Cache TTL. - origin_ips: Deprecated alias for "upstream_ips". - ratelimit: Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster). @@ -321,7 +314,6 @@ def edit( "upstream_ips": upstream_ips, "attack_mitigation": attack_mitigation, "negative_cache_ttl": negative_cache_ttl, - "origin_ips": origin_ips, "ratelimit": ratelimit, "retries": retries, }, @@ -407,7 +399,6 @@ async def create( maximum_cache_ttl: float | NotGiven = NOT_GIVEN, minimum_cache_ttl: float | NotGiven = NOT_GIVEN, negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, - origin_ips: object | NotGiven = NOT_GIVEN, ratelimit: Optional[float] | NotGiven = NOT_GIVEN, retries: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -437,8 +428,6 @@ async def create( negative_cache_ttl: Negative DNS Cache TTL. - origin_ips: Deprecated alias for "upstream_ips". - ratelimit: Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster). @@ -467,7 +456,6 @@ async def create( "maximum_cache_ttl": maximum_cache_ttl, "minimum_cache_ttl": minimum_cache_ttl, "negative_cache_ttl": negative_cache_ttl, - "origin_ips": origin_ips, "ratelimit": ratelimit, "retries": retries, }, @@ -593,7 +581,6 @@ async def edit( upstream_ips: List[Union[str, str]], attack_mitigation: Optional[firewall_edit_params.AttackMitigation] | NotGiven = NOT_GIVEN, negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, - origin_ips: object | NotGiven = NOT_GIVEN, ratelimit: Optional[float] | NotGiven = NOT_GIVEN, retries: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -625,8 +612,6 @@ async def edit( negative_cache_ttl: Negative DNS Cache TTL. - origin_ips: Deprecated alias for "upstream_ips". - ratelimit: Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster). @@ -658,7 +643,6 @@ async def edit( "upstream_ips": upstream_ips, "attack_mitigation": attack_mitigation, "negative_cache_ttl": negative_cache_ttl, - "origin_ips": origin_ips, "ratelimit": ratelimit, "retries": retries, }, diff --git a/src/cloudflare/types/dns/dns_firewall.py b/src/cloudflare/types/dns/dns_firewall.py index 0b537b38884..6b01c523358 100644 --- a/src/cloudflare/types/dns/dns_firewall.py +++ b/src/cloudflare/types/dns/dns_firewall.py @@ -15,9 +15,6 @@ class AttackMitigation(BaseModel): DNS servers protected. """ - only_when_origin_unhealthy: Optional[object] = None - """Deprecated alias for "only_when_upstream_unhealthy".""" - only_when_upstream_unhealthy: Optional[bool] = None """Only mitigate attacks when upstream servers seem unhealthy.""" @@ -54,9 +51,6 @@ class DNSFirewall(BaseModel): negative_cache_ttl: Optional[float] = None """Negative DNS Cache TTL.""" - origin_ips: Optional[object] = None - """Deprecated alias for "upstream_ips".""" - ratelimit: Optional[float] = None """ Ratelimit in queries per second per datacenter (applies to DNS queries sent to diff --git a/src/cloudflare/types/dns/firewall_create_params.py b/src/cloudflare/types/dns/firewall_create_params.py index 22e8d50ac02..7562374f23c 100644 --- a/src/cloudflare/types/dns/firewall_create_params.py +++ b/src/cloudflare/types/dns/firewall_create_params.py @@ -35,9 +35,6 @@ class FirewallCreateParams(TypedDict, total=False): negative_cache_ttl: Optional[float] """Negative DNS Cache TTL.""" - origin_ips: object - """Deprecated alias for "upstream_ips".""" - ratelimit: Optional[float] """ Ratelimit in queries per second per datacenter (applies to DNS queries sent to @@ -58,8 +55,5 @@ class AttackMitigation(TypedDict, total=False): DNS servers protected. """ - only_when_origin_unhealthy: object - """Deprecated alias for "only_when_upstream_unhealthy".""" - only_when_upstream_unhealthy: bool """Only mitigate attacks when upstream servers seem unhealthy.""" diff --git a/src/cloudflare/types/dns/firewall_edit_params.py b/src/cloudflare/types/dns/firewall_edit_params.py index 25e392e0519..b3e117eb015 100644 --- a/src/cloudflare/types/dns/firewall_edit_params.py +++ b/src/cloudflare/types/dns/firewall_edit_params.py @@ -37,9 +37,6 @@ class FirewallEditParams(TypedDict, total=False): negative_cache_ttl: Optional[float] """Negative DNS Cache TTL.""" - origin_ips: object - """Deprecated alias for "upstream_ips".""" - ratelimit: Optional[float] """ Ratelimit in queries per second per datacenter (applies to DNS queries sent to @@ -60,8 +57,5 @@ class AttackMitigation(TypedDict, total=False): DNS servers protected. """ - only_when_origin_unhealthy: object - """Deprecated alias for "only_when_upstream_unhealthy".""" - only_when_upstream_unhealthy: bool """Only mitigate attacks when upstream servers seem unhealthy.""" diff --git a/tests/api_resources/dns/test_firewall.py b/tests/api_resources/dns/test_firewall.py index ccf77c74206..736b3bf0e5f 100644 --- a/tests/api_resources/dns/test_firewall.py +++ b/tests/api_resources/dns/test_firewall.py @@ -40,7 +40,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], attack_mitigation={ "enabled": True, - "only_when_origin_unhealthy": {}, "only_when_upstream_unhealthy": False, }, deprecate_any_requests=True, @@ -48,7 +47,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: maximum_cache_ttl=900, minimum_cache_ttl=60, negative_cache_ttl=900, - origin_ips={}, ratelimit=600, retries=2, ) @@ -229,11 +227,9 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], attack_mitigation={ "enabled": True, - "only_when_origin_unhealthy": {}, "only_when_upstream_unhealthy": False, }, negative_cache_ttl=900, - origin_ips={}, ratelimit=600, retries=2, ) @@ -385,7 +381,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], attack_mitigation={ "enabled": True, - "only_when_origin_unhealthy": {}, "only_when_upstream_unhealthy": False, }, deprecate_any_requests=True, @@ -393,7 +388,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare maximum_cache_ttl=900, minimum_cache_ttl=60, negative_cache_ttl=900, - origin_ips={}, ratelimit=600, retries=2, ) @@ -574,11 +568,9 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], attack_mitigation={ "enabled": True, - "only_when_origin_unhealthy": {}, "only_when_upstream_unhealthy": False, }, negative_cache_ttl=900, - origin_ips={}, ratelimit=600, retries=2, )