From 9a5f594f4d3062e7d54af9c5c117ca045d26df53 Mon Sep 17 00:00:00 2001 From: et304383 <2693414+et304383@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:19:52 -0300 Subject: [PATCH] Eliminate incorrect checks for providing one and one only of account_id, zone_id to ruleset APIs --- src/cloudflare/resources/rulesets/rulesets.py | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/src/cloudflare/resources/rulesets/rulesets.py b/src/cloudflare/resources/rulesets/rulesets.py index f57071173b4..d32b04c92b0 100644 --- a/src/cloudflare/resources/rulesets/rulesets.py +++ b/src/cloudflare/resources/rulesets/rulesets.py @@ -145,10 +145,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: @@ -258,10 +254,6 @@ def update( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: @@ -324,10 +316,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: @@ -381,10 +369,6 @@ def delete( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: @@ -438,10 +422,6 @@ def get( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: @@ -554,10 +534,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: @@ -667,10 +643,6 @@ async def update( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: @@ -733,10 +705,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: @@ -790,10 +758,6 @@ async def delete( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: @@ -847,10 +811,6 @@ async def get( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not account_id and not zone_id: raise ValueError("You must provide either account_id or zone_id") if account_id and zone_id: