Skip to content

Commit 393df1d

Browse files
chore(api): upload stainless config from cloudflare-config
1 parent c2a9839 commit 393df1d

File tree

6 files changed

+55
-5
lines changed

6 files changed

+55
-5
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1793
1+
configured_endpoints: 1794
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bf6dcd562e592c1c6d992e04b39d5b372e2a7cb4d3fdcad23e483e21389bd3aa.yml
33
openapi_spec_hash: 8b8da2355d909906fe7af3bc6f507487
4-
config_hash: fbc4fd68812ca98330ce3b204d1d103b
4+
config_hash: 0057f65f1f8efd88feb20d082d893305

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2967,6 +2967,7 @@ Methods:
29672967

29682968
- <code title="post /accounts/{account_id}/brand-protection/queries">client.brandProtection.queries.<a href="./src/resources/brand-protection/queries.ts">create</a>({ ...params }) -> void</code>
29692969
- <code title="delete /accounts/{account_id}/brand-protection/queries">client.brandProtection.queries.<a href="./src/resources/brand-protection/queries.ts">delete</a>({ ...params }) -> void</code>
2970+
- <code title="post /accounts/{account_id}/brand-protection/queries/bulk">client.brandProtection.queries.<a href="./src/resources/brand-protection/queries.ts">bulk</a>({ ...params }) -> void</code>
29702971

29712972
## Matches
29722973

src/resources/brand-protection/brand-protection.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
Matches,
2222
} from './matches';
2323
import * as QueriesAPI from './queries';
24-
import { Queries, QueryCreateParams, QueryDeleteParams } from './queries';
24+
import { Queries, QueryBulkParams, QueryCreateParams, QueryDeleteParams } from './queries';
2525
import { SinglePage } from '../../pagination';
2626

2727
export class BrandProtection extends APIResource {
@@ -258,6 +258,7 @@ export declare namespace BrandProtection {
258258
Queries as Queries,
259259
type QueryCreateParams as QueryCreateParams,
260260
type QueryDeleteParams as QueryDeleteParams,
261+
type QueryBulkParams as QueryBulkParams,
261262
};
262263

263264
export {

src/resources/brand-protection/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ export {
1616
type MatchDownloadParams,
1717
type MatchGetParams,
1818
} from './matches';
19-
export { Queries, type QueryCreateParams, type QueryDeleteParams } from './queries';
19+
export { Queries, type QueryCreateParams, type QueryDeleteParams, type QueryBulkParams } from './queries';

src/resources/brand-protection/queries.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ export class Queries extends APIResource {
2828
headers: { Accept: '*/*', ...options?.headers },
2929
});
3030
}
31+
32+
/**
33+
* Return a success message after creating new saved string queries in bulk
34+
*/
35+
bulk(params: QueryBulkParams, options?: Core.RequestOptions): Core.APIPromise<void> {
36+
const { account_id, ...body } = params;
37+
return this._client.post(`/accounts/${account_id}/brand-protection/queries/bulk`, {
38+
body,
39+
...options,
40+
headers: { Accept: '*/*', ...options?.headers },
41+
});
42+
}
3143
}
3244

3345
export interface QueryCreateParams {
@@ -99,6 +111,22 @@ export interface QueryDeleteParams {
99111
tag?: string;
100112
}
101113

114+
export interface QueryBulkParams {
115+
/**
116+
* Path param:
117+
*/
118+
account_id: string;
119+
120+
/**
121+
* Body param:
122+
*/
123+
queries?: Array<{ [key: string]: unknown }>;
124+
}
125+
102126
export declare namespace Queries {
103-
export { type QueryCreateParams as QueryCreateParams, type QueryDeleteParams as QueryDeleteParams };
127+
export {
128+
type QueryCreateParams as QueryCreateParams,
129+
type QueryDeleteParams as QueryDeleteParams,
130+
type QueryBulkParams as QueryBulkParams,
131+
};
104132
}

tests/api-resources/brand-protection/queries.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,24 @@ describe('resource queries', () => {
5858
tag: 'tag',
5959
});
6060
});
61+
62+
// TODO: investigate broken test, 401 Unauthorized
63+
test.skip('bulk: only required params', async () => {
64+
const responsePromise = client.brandProtection.queries.bulk({ account_id: 'x' });
65+
const rawResponse = await responsePromise.asResponse();
66+
expect(rawResponse).toBeInstanceOf(Response);
67+
const response = await responsePromise;
68+
expect(response).not.toBeInstanceOf(Response);
69+
const dataAndResponse = await responsePromise.withResponse();
70+
expect(dataAndResponse.data).toBe(response);
71+
expect(dataAndResponse.response).toBe(rawResponse);
72+
});
73+
74+
// TODO: investigate broken test, 401 Unauthorized
75+
test.skip('bulk: required and optional params', async () => {
76+
const response = await client.brandProtection.queries.bulk({
77+
account_id: 'x',
78+
queries: [{ foo: 'bar' }],
79+
});
80+
});
6181
});

0 commit comments

Comments
 (0)