Skip to content

Commit 4050818

Browse files
feat(api): api update
1 parent d07e22f commit 4050818

File tree

3 files changed

+17
-44
lines changed

3 files changed

+17
-44
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: 1777
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9629020f23f4c564925a52c46cdf5a93581a3f6bf35bf8050b0792467f642d33.yml
3-
openapi_spec_hash: 58db5ad168eaa03ed1c9a028636c58f6
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4d577be5bc8f4a0303c10df020efdc8823f02867d8f74e414c75e747c10e8e2.yml
3+
openapi_spec_hash: 523313d2ea7487505e7913769ecd7e53
44
config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2958,7 +2958,7 @@ Types:
29582958
Methods:
29592959

29602960
- <code title="post /accounts/{account_id}/brand-protection/submit">client.brandProtection.<a href="./src/resources/brand-protection/brand-protection.ts">submit</a>({ ...params }) -> BrandProtectionSubmitResponse</code>
2961-
- <code title="get /accounts/{account_id}/brand-protection/url-info">client.brandProtection.<a href="./src/resources/brand-protection/brand-protection.ts">urlInfo</a>({ ...params }) -> BrandProtectionURLInfoResponse</code>
2961+
- <code title="get /accounts/{account_id}/brand-protection/url-info">client.brandProtection.<a href="./src/resources/brand-protection/brand-protection.ts">urlInfo</a>({ ...params }) -> BrandProtectionURLInfoResponsesSinglePage</code>
29622962

29632963
## Queries
29642964

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

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
} from './matches';
2323
import * as QueriesAPI from './queries';
2424
import { Queries, QueryCreateParams, QueryDeleteParams } from './queries';
25+
import { SinglePage } from '../../pagination';
2526

2627
export class BrandProtection extends APIResource {
2728
queries: QueriesAPI.Queries = new QueriesAPI.Queries(this._client);
@@ -46,12 +47,18 @@ export class BrandProtection extends APIResource {
4647
urlInfo(
4748
params: BrandProtectionURLInfoParams,
4849
options?: Core.RequestOptions,
49-
): Core.APIPromise<BrandProtectionURLInfoResponse> {
50+
): Core.PagePromise<BrandProtectionURLInfoResponsesSinglePage, BrandProtectionURLInfoResponse> {
5051
const { account_id } = params;
51-
return this._client.get(`/accounts/${account_id}/brand-protection/url-info`, options);
52+
return this._client.getAPIList(
53+
`/accounts/${account_id}/brand-protection/url-info`,
54+
BrandProtectionURLInfoResponsesSinglePage,
55+
options,
56+
);
5257
}
5358
}
5459

60+
export class BrandProtectionURLInfoResponsesSinglePage extends SinglePage<BrandProtectionURLInfoResponse> {}
61+
5562
export interface Info {
5663
/**
5764
* List of categorizations applied to this submission.
@@ -215,48 +222,12 @@ export namespace Submit {
215222
}
216223

217224
export interface BrandProtectionSubmitResponse {
218-
/**
219-
* Error code
220-
*/
221-
code?: number;
222-
223-
/**
224-
* Errors
225-
*/
226-
errors?: { [key: string]: unknown };
225+
skipped_urls?: Array<{ [key: string]: unknown }>;
227226

228-
/**
229-
* Error message
230-
*/
231-
message?: string;
232-
233-
/**
234-
* Error name
235-
*/
236-
status?: string;
227+
submitted_urls?: Array<{ [key: string]: unknown }>;
237228
}
238229

239-
export interface BrandProtectionURLInfoResponse {
240-
/**
241-
* Error code
242-
*/
243-
code?: number;
244-
245-
/**
246-
* Errors
247-
*/
248-
errors?: { [key: string]: unknown };
249-
250-
/**
251-
* Error message
252-
*/
253-
message?: string;
254-
255-
/**
256-
* Error name
257-
*/
258-
status?: string;
259-
}
230+
export type BrandProtectionURLInfoResponse = { [key: string]: unknown };
260231

261232
export interface BrandProtectionSubmitParams {
262233
account_id: string;
@@ -266,6 +237,7 @@ export interface BrandProtectionURLInfoParams {
266237
account_id: string;
267238
}
268239

240+
BrandProtection.BrandProtectionURLInfoResponsesSinglePage = BrandProtectionURLInfoResponsesSinglePage;
269241
BrandProtection.Queries = Queries;
270242
BrandProtection.Matches = Matches;
271243
BrandProtection.Logos = Logos;
@@ -277,6 +249,7 @@ export declare namespace BrandProtection {
277249
type Submit as Submit,
278250
type BrandProtectionSubmitResponse as BrandProtectionSubmitResponse,
279251
type BrandProtectionURLInfoResponse as BrandProtectionURLInfoResponse,
252+
BrandProtectionURLInfoResponsesSinglePage as BrandProtectionURLInfoResponsesSinglePage,
280253
type BrandProtectionSubmitParams as BrandProtectionSubmitParams,
281254
type BrandProtectionURLInfoParams as BrandProtectionURLInfoParams,
282255
};

0 commit comments

Comments
 (0)