cloudflare / cloudflare/cloudflare-python
client.rules.lists.items.delete - unexpected keyword argument 'items'
- Dominant language
- Python
- Stars
- 506
- Forks
- 148
- Avg merge
- 3h 15m
- Merged PRs (30d)
- 1
Description
### Confirm this is a Python library issue and not an underlying Cloudflare API issue.
- [x] 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
1. 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"}]
)
```
2. Return is `TypeError: ItemsResource.delete() got an unexpected keyword argument 'items'`
3. 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"}]})
)
```
4. Return is `cloudflare.BadRequestError: Error code: 400 - {'result': None, 'success': False, 'errors': [{'code': 10026, 'message': 'filters.api.invalid_json'}], 'messages': []}`
### Code snippets
```Python
```
### OS
Ubuntu
### Python version
3.12.3
### Library version
4.3.1
Contributor guide
Assessment
This issue has not been assessed yet.