cloudflare / cloudflare/cloudflare-python
client.rules.lists.items.delete - unexpected keyword argument 'items'
- 主要语言
- Python
- 星标
- 506
- 派生
- 148
- 平均合并
- 3 小时 15 分钟
- 30 天内合并 PR
- 1
描述
### 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
贡献指南
评估
这个 Issue 还没有评估数据。