Skip to content

Eliminate incorrect checks for providing one and one only of account_… #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions src/cloudflare/resources/rulesets/rulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down