-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Description
Confirm this is a Python library issue and not an underlying Cloudflare API issue.
- This is an issue with the Python library
Describe the bug
Calling the client.rules.lists.items.delete endpoint reutrns an "unexpected keyword argument 'items'" error. There is no way to pass a list of items to delete.
To Reproduce
- Call
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),
)
item = client.rules.lists.items.delete(
list_id="2c0fc9fa937b11eaa1b71c4d701ab86e",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
items=[{"id": "1234567890"}]
)
- Return is
TypeError: ItemsResource.delete() got an unexpected keyword argument 'items' - Try
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),
)
item = client.rules.lists.items.delete(
list_id="2c0fc9fa937b11eaa1b71c4d701ab86e",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
extra_body=json.dumps({"items":[{"id": "1234567890"}]})
)
- Return is
cloudflare.BadRequestError: Error code: 400 - {'result': None, 'success': False, 'errors': [{'code': 10026, 'message': 'filters.api.invalid_json'}], 'messages': []}
Code snippets
OS
Ubuntu
Python version
3.12.3
Library version
4.3.1
Metadata
Metadata
Assignees
Labels
No labels