Skip to content

Commit 4746f0e

Browse files
chore(api): update composite API spec
1 parent 4c862be commit 4746f0e

File tree

7 files changed

+47
-16
lines changed

7 files changed

+47
-16
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: 1889
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4ce590a31fd246bbfbb2084c7c36262b6afac87dce75d002fcd79da384ffd8b9.yml
3-
openapi_spec_hash: 30d3807cf2dea2bf8be289f6a3b2b6c9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0aa04261f7657c239259316bff4e9aa362e667a8eceac7b3725867f491ca69d8.yml
3+
openapi_spec_hash: d9fbcbf03b9e86f6f518840c9441b039
44
config_hash: f02bc3ad56bdede6c515f996ca86012c

src/resources/cloudforce-one/threat-events/attackers.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as Core from '../../../core';
55

66
export class Attackers extends APIResource {
77
/**
8-
* Lists attackers
8+
* Lists attackers across multiple datasets
99
*
1010
* @example
1111
* ```ts
@@ -16,8 +16,8 @@ export class Attackers extends APIResource {
1616
* ```
1717
*/
1818
list(params: AttackerListParams, options?: Core.RequestOptions): Core.APIPromise<AttackerListResponse> {
19-
const { account_id } = params;
20-
return this._client.get(`/accounts/${account_id}/cloudforce-one/events/attackers`, options);
19+
const { account_id, ...query } = params;
20+
return this._client.get(`/accounts/${account_id}/cloudforce-one/events/attackers`, { query, ...options });
2121
}
2222
}
2323

@@ -35,9 +35,15 @@ export namespace AttackerListResponse {
3535

3636
export interface AttackerListParams {
3737
/**
38-
* Account ID.
38+
* Path param: Account ID.
3939
*/
4040
account_id: string;
41+
42+
/**
43+
* Query param: Array of dataset IDs to query attackers from. If not provided,
44+
* returns all attackers from Event DO tables.
45+
*/
46+
datasetIds?: Array<string>;
4147
}
4248

4349
export declare namespace Attackers {

src/resources/cloudforce-one/threat-events/categories.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class Categories extends APIResource {
3131
}
3232

3333
/**
34-
* Lists categories
34+
* Lists categories across multiple datasets
3535
*
3636
* @example
3737
* ```ts
@@ -42,8 +42,11 @@ export class Categories extends APIResource {
4242
* ```
4343
*/
4444
list(params: CategoryListParams, options?: Core.RequestOptions): Core.APIPromise<CategoryListResponse> {
45-
const { account_id } = params;
46-
return this._client.get(`/accounts/${account_id}/cloudforce-one/events/categories`, options);
45+
const { account_id, ...query } = params;
46+
return this._client.get(`/accounts/${account_id}/cloudforce-one/events/categories`, {
47+
query,
48+
...options,
49+
});
4750
}
4851

4952
/**
@@ -204,9 +207,15 @@ export interface CategoryCreateParams {
204207

205208
export interface CategoryListParams {
206209
/**
207-
* Account ID.
210+
* Path param: Account ID.
208211
*/
209212
account_id: string;
213+
214+
/**
215+
* Query param: Array of dataset IDs to query categories from. If not provided,
216+
* returns all categories from D1 database.
217+
*/
218+
datasetIds?: Array<string>;
210219
}
211220

212221
export interface CategoryDeleteParams {

src/resources/cloudforce-one/threat-events/target-industries.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as Core from '../../../core';
55

66
export class TargetIndustries extends APIResource {
77
/**
8-
* Lists all target industries
8+
* Lists target industries across multiple datasets
99
*
1010
* @example
1111
* ```ts
@@ -19,8 +19,11 @@ export class TargetIndustries extends APIResource {
1919
params: TargetIndustryListParams,
2020
options?: Core.RequestOptions,
2121
): Core.APIPromise<TargetIndustryListResponse> {
22-
const { account_id } = params;
23-
return this._client.get(`/accounts/${account_id}/cloudforce-one/events/targetIndustries`, options);
22+
const { account_id, ...query } = params;
23+
return this._client.get(`/accounts/${account_id}/cloudforce-one/events/targetIndustries`, {
24+
query,
25+
...options,
26+
});
2427
}
2528
}
2629

@@ -38,9 +41,15 @@ export namespace TargetIndustryListResponse {
3841

3942
export interface TargetIndustryListParams {
4043
/**
41-
* Account ID.
44+
* Path param: Account ID.
4245
*/
4346
account_id: string;
47+
48+
/**
49+
* Query param: Array of dataset IDs to query target industries from. If not
50+
* provided, returns all target industries from D1 Event table.
51+
*/
52+
datasetIds?: Array<string>;
4453
}
4554

4655
export declare namespace TargetIndustries {

tests/api-resources/cloudforce-one/threat-events/attackers.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ describe('resource attackers', () => {
2424

2525
// TODO: HTTP 401 from prism
2626
test.skip('list: required and optional params', async () => {
27-
const response = await client.cloudforceOne.threatEvents.attackers.list({ account_id: 'account_id' });
27+
const response = await client.cloudforceOne.threatEvents.attackers.list({
28+
account_id: 'account_id',
29+
datasetIds: ['string'],
30+
});
2831
});
2932
});

tests/api-resources/cloudforce-one/threat-events/categories.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ describe('resource categories', () => {
5151

5252
// TODO: HTTP 401 from prism
5353
test.skip('list: required and optional params', async () => {
54-
const response = await client.cloudforceOne.threatEvents.categories.list({ account_id: 'account_id' });
54+
const response = await client.cloudforceOne.threatEvents.categories.list({
55+
account_id: 'account_id',
56+
datasetIds: ['string'],
57+
});
5558
});
5659

5760
// TODO: HTTP 401 from prism

tests/api-resources/cloudforce-one/threat-events/target-industries.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe('resource targetIndustries', () => {
2828
test.skip('list: required and optional params', async () => {
2929
const response = await client.cloudforceOne.threatEvents.targetIndustries.list({
3030
account_id: 'account_id',
31+
datasetIds: ['string'],
3132
});
3233
});
3334
});

0 commit comments

Comments
 (0)