Skip to content

Commit d9937a1

Browse files
fix(api): add missing items param
`/accounts/{account_id}/rules/lists/{list_id}/items` takes a request body.
1 parent c3af2ec commit d9937a1

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1769
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-22bd279cee32addc645f421ef52b9cc207ec998f883e77e580f7be79950833b4.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a2195f6a1ef92721db6c845b4d864ab688295623c8c88d71698087a17dca4fc7.yml
33
openapi_spec_hash: 3e0f59ac2722028954566a4c850e8849
4-
config_hash: e5cc3a68b9877422f1dc315213163f6e
4+
config_hash: 6a2779d0015054eac7082cca3c4e72bf

src/resources/rules/lists/items.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ export class Items extends APIResource {
115115
params: ItemDeleteParams,
116116
options?: Core.RequestOptions,
117117
): Core.APIPromise<ItemDeleteResponse> {
118-
const { account_id } = params;
118+
const { account_id, ...body } = params;
119119
return (
120-
this._client.delete(`/accounts/${account_id}/rules/lists/${listId}/items`, options) as Core.APIPromise<{
121-
result: ItemDeleteResponse;
122-
}>
120+
this._client.delete(`/accounts/${account_id}/rules/lists/${listId}/items`, {
121+
body,
122+
...options,
123+
}) as Core.APIPromise<{ result: ItemDeleteResponse }>
123124
)._thenUnwrap((obj) => obj.result);
124125
}
125126

@@ -373,9 +374,18 @@ export interface ItemListParams extends CursorPaginationParams {
373374

374375
export interface ItemDeleteParams {
375376
/**
376-
* Defines an identifier.
377+
* Path param: Defines an identifier.
377378
*/
378379
account_id: string;
380+
381+
/**
382+
* Body param:
383+
*/
384+
items?: Array<ItemDeleteParams.Item>;
385+
}
386+
387+
export namespace ItemDeleteParams {
388+
export interface Item {}
379389
}
380390

381391
export interface ItemGetParams {

tests/api-resources/rules/lists/items.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ describe('resource items', () => {
122122
test('delete: required and optional params', async () => {
123123
const response = await client.rules.lists.items.delete('2c0fc9fa937b11eaa1b71c4d701ab86e', {
124124
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
125+
items: [{}],
125126
});
126127
});
127128

0 commit comments

Comments
 (0)