Skip to content

Commit bfc9b67

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#982)
1 parent 72a11c5 commit bfc9b67

File tree

7 files changed

+103
-21
lines changed

7 files changed

+103
-21
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1348
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a4ad69b707d0e14c7a716a22c876ab03c40d8aefa59eec101c5c52260cb860f3.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-db421d07d58c7abf1af471a342e12789def4e83543dccea6aec34b8667646028.yml

src/resources/zero-trust/gateway/configurations.ts

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export class Configurations extends APIResource {
2525
* Patches the current Zero Trust account configuration. This endpoint can update a
2626
* single subcollection of settings such as `antivirus`, `tls_decrypt`,
2727
* `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or
28-
* `custom_certificate`, without updating the entire configuration object. Returns
29-
* an error if any collection of settings is not properly configured.
28+
* `certificate`, without updating the entire configuration object. Returns an
29+
* error if any collection of settings is not properly configured.
3030
*/
3131
edit(
3232
params: ConfigurationEditParams,
@@ -280,7 +280,8 @@ export interface BrowserIsolationSettingsParam {
280280
}
281281

282282
/**
283-
* Custom certificate settings for BYO-PKI.
283+
* @deprecated: Custom certificate settings for BYO-PKI. (deprecated and replaced
284+
* by `certificate`)
284285
*/
285286
export interface CustomCertificateSettings {
286287
/**
@@ -302,7 +303,8 @@ export interface CustomCertificateSettings {
302303
}
303304

304305
/**
305-
* Custom certificate settings for BYO-PKI.
306+
* @deprecated: Custom certificate settings for BYO-PKI. (deprecated and replaced
307+
* by `certificate`)
306308
*/
307309
export interface CustomCertificateSettingsParam {
308310
/**
@@ -388,7 +390,14 @@ export interface GatewayConfigurationSettings {
388390
browser_isolation?: BrowserIsolationSettings;
389391

390392
/**
391-
* Custom certificate settings for BYO-PKI.
393+
* Certificate settings for Gateway TLS interception. If not specified, the
394+
* Cloudflare Root CA will be used.
395+
*/
396+
certificate?: GatewayConfigurationSettings.Certificate;
397+
398+
/**
399+
* @deprecated: Custom certificate settings for BYO-PKI. (deprecated and replaced
400+
* by `certificate`)
392401
*/
393402
custom_certificate?: CustomCertificateSettings;
394403

@@ -413,6 +422,19 @@ export interface GatewayConfigurationSettings {
413422
tls_decrypt?: TLSSettings;
414423
}
415424

425+
export namespace GatewayConfigurationSettings {
426+
/**
427+
* Certificate settings for Gateway TLS interception. If not specified, the
428+
* Cloudflare Root CA will be used.
429+
*/
430+
export interface Certificate {
431+
/**
432+
* UUID of certificate to be used for interception.
433+
*/
434+
id: string;
435+
}
436+
}
437+
416438
/**
417439
* account settings.
418440
*/
@@ -443,7 +465,14 @@ export interface GatewayConfigurationSettingsParam {
443465
browser_isolation?: BrowserIsolationSettingsParam;
444466

445467
/**
446-
* Custom certificate settings for BYO-PKI.
468+
* Certificate settings for Gateway TLS interception. If not specified, the
469+
* Cloudflare Root CA will be used.
470+
*/
471+
certificate?: GatewayConfigurationSettingsParam.Certificate;
472+
473+
/**
474+
* @deprecated: Custom certificate settings for BYO-PKI. (deprecated and replaced
475+
* by `certificate`)
447476
*/
448477
custom_certificate?: CustomCertificateSettingsParam;
449478

@@ -468,6 +497,19 @@ export interface GatewayConfigurationSettingsParam {
468497
tls_decrypt?: TLSSettingsParam;
469498
}
470499

500+
export namespace GatewayConfigurationSettingsParam {
501+
/**
502+
* Certificate settings for Gateway TLS interception. If not specified, the
503+
* Cloudflare Root CA will be used.
504+
*/
505+
export interface Certificate {
506+
/**
507+
* UUID of certificate to be used for interception.
508+
*/
509+
id: string;
510+
}
511+
}
512+
471513
/**
472514
* Configure a message to display on the user's device when an antivirus search is
473515
* performed.

src/resources/zero-trust/gateway/lists/lists.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ export class Lists extends APIResource {
4545
params: ListListParams,
4646
options?: Core.RequestOptions,
4747
): Core.PagePromise<GatewayListsSinglePage, GatewayList> {
48-
const { account_id } = params;
49-
return this._client.getAPIList(`/accounts/${account_id}/gateway/lists`, GatewayListsSinglePage, options);
48+
const { account_id, ...query } = params;
49+
return this._client.getAPIList(`/accounts/${account_id}/gateway/lists`, GatewayListsSinglePage, {
50+
query,
51+
...options,
52+
});
5053
}
5154

5255
/**
@@ -103,6 +106,8 @@ export interface GatewayItem {
103106
}
104107

105108
export interface GatewayItemParam {
109+
created_at?: string;
110+
106111
/**
107112
* The value of the item in a list.
108113
*/
@@ -218,7 +223,15 @@ export interface ListUpdateParams {
218223
}
219224

220225
export interface ListListParams {
226+
/**
227+
* Path param:
228+
*/
221229
account_id: string;
230+
231+
/**
232+
* Query param: The type of list.
233+
*/
234+
type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP';
222235
}
223236

224237
export interface ListDeleteParams {

src/resources/zero-trust/gateway/rules.ts

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,13 @@ export interface RuleSetting {
335335
*/
336336
egress?: RuleSetting.Egress;
337337

338+
/**
339+
* Set to true, to ignore the category matches at CNAME domains in a response. If
340+
* unchecked, the categories in this rule will be checked against all the CNAME
341+
* domain categories in a response.
342+
*/
343+
ignore_cname_category_matches?: boolean;
344+
338345
/**
339346
* INSECURE - disable DNSSEC validation (for Allow actions).
340347
*/
@@ -407,27 +414,27 @@ export namespace RuleSetting {
407414
*/
408415
export interface BisoAdminControls {
409416
/**
410-
* Set to true to enable copy-pasting.
417+
* Set to false to enable copy-pasting.
411418
*/
412419
dcp?: boolean;
413420

414421
/**
415-
* Set to true to enable downloading.
422+
* Set to false to enable downloading.
416423
*/
417424
dd?: boolean;
418425

419426
/**
420-
* Set to true to enable keyboard usage.
427+
* Set to false to enable keyboard usage.
421428
*/
422429
dk?: boolean;
423430

424431
/**
425-
* Set to true to enable printing.
432+
* Set to false to enable printing.
426433
*/
427434
dp?: boolean;
428435

429436
/**
430-
* Set to true to enable uploading.
437+
* Set to false to enable uploading.
431438
*/
432439
du?: boolean;
433440
}
@@ -603,6 +610,13 @@ export interface RuleSettingParam {
603610
*/
604611
egress?: RuleSettingParam.Egress;
605612

613+
/**
614+
* Set to true, to ignore the category matches at CNAME domains in a response. If
615+
* unchecked, the categories in this rule will be checked against all the CNAME
616+
* domain categories in a response.
617+
*/
618+
ignore_cname_category_matches?: boolean;
619+
606620
/**
607621
* INSECURE - disable DNSSEC validation (for Allow actions).
608622
*/
@@ -675,27 +689,27 @@ export namespace RuleSettingParam {
675689
*/
676690
export interface BisoAdminControls {
677691
/**
678-
* Set to true to enable copy-pasting.
692+
* Set to false to enable copy-pasting.
679693
*/
680694
dcp?: boolean;
681695

682696
/**
683-
* Set to true to enable downloading.
697+
* Set to false to enable downloading.
684698
*/
685699
dd?: boolean;
686700

687701
/**
688-
* Set to true to enable keyboard usage.
702+
* Set to false to enable keyboard usage.
689703
*/
690704
dk?: boolean;
691705

692706
/**
693-
* Set to true to enable printing.
707+
* Set to false to enable printing.
694708
*/
695709
dp?: boolean;
696710

697711
/**
698-
* Set to true to enable uploading.
712+
* Set to false to enable uploading.
699713
*/
700714
du?: boolean;
701715
}

tests/api-resources/zero-trust/gateway/configurations.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ describe('resource configurations', () => {
4747
},
4848
body_scanning: { inspection_mode: 'deep' },
4949
browser_isolation: { non_identity_enabled: true, url_browser_isolation_enabled: true },
50+
certificate: { id: 'd1b364c5-1311-466e-a194-f0e943e0799f' },
5051
custom_certificate: { enabled: true, id: 'd1b364c5-1311-466e-a194-f0e943e0799f' },
5152
extended_email_matching: { enabled: true },
5253
fips: { tls: true },
@@ -93,6 +94,7 @@ describe('resource configurations', () => {
9394
},
9495
body_scanning: { inspection_mode: 'deep' },
9596
browser_isolation: { non_identity_enabled: true, url_browser_isolation_enabled: true },
97+
certificate: { id: 'd1b364c5-1311-466e-a194-f0e943e0799f' },
9698
custom_certificate: { enabled: true, id: 'd1b364c5-1311-466e-a194-f0e943e0799f' },
9799
extended_email_matching: { enabled: true },
98100
fips: { tls: true },

tests/api-resources/zero-trust/gateway/lists/lists.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ describe('resource lists', () => {
3131
name: 'Admin Serial Numbers',
3232
type: 'SERIAL',
3333
description: 'The serial numbers for administrators',
34-
items: [{ value: '8GE8721REF' }, { value: '8GE8721REF' }, { value: '8GE8721REF' }],
34+
items: [
35+
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
36+
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
37+
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
38+
],
3539
});
3640
});
3741

@@ -73,6 +77,7 @@ describe('resource lists', () => {
7377
test('list: required and optional params', async () => {
7478
const response = await cloudflare.zeroTrust.gateway.lists.list({
7579
account_id: '699d98642c564d2e855e9661899b7252',
80+
type: 'SERIAL',
7681
});
7782
});
7883

@@ -112,7 +117,11 @@ describe('resource lists', () => {
112117
test('edit: required and optional params', async () => {
113118
const response = await cloudflare.zeroTrust.gateway.lists.edit('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', {
114119
account_id: '699d98642c564d2e855e9661899b7252',
115-
append: [{ value: '8GE8721REF' }, { value: '8GE8721REF' }, { value: '8GE8721REF' }],
120+
append: [
121+
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
122+
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
123+
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
124+
],
116125
remove: ['8GE8721REF', '8GE8721REF', '8GE8721REF'],
117126
});
118127
});

tests/api-resources/zero-trust/gateway/rules.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ describe('resource rules', () => {
8888
],
8989
},
9090
egress: { ipv4: '192.0.2.2', ipv4_fallback: '192.0.2.3', ipv6: '2001:DB8::/64' },
91+
ignore_cname_category_matches: true,
9192
insecure_disable_dnssec_validation: false,
9293
ip_categories: true,
9394
ip_indicator_feeds: true,
@@ -191,6 +192,7 @@ describe('resource rules', () => {
191192
],
192193
},
193194
egress: { ipv4: '192.0.2.2', ipv4_fallback: '192.0.2.3', ipv6: '2001:DB8::/64' },
195+
ignore_cname_category_matches: true,
194196
insecure_disable_dnssec_validation: false,
195197
ip_categories: true,
196198
ip_indicator_feeds: true,

0 commit comments

Comments
 (0)