Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 18, 2024
1 parent f60c725 commit 72a11c5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1348
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-36a9d717773ebb507fd0744af578aa64b697030857c602c77458156a911fcab9.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a4ad69b707d0e14c7a716a22c876ab03c40d8aefa59eec101c5c52260cb860f3.yml
54 changes: 6 additions & 48 deletions src/resources/zero-trust/gateway/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class Configurations extends APIResource {
* Patches the current Zero Trust account configuration. This endpoint can update a
* single subcollection of settings such as `antivirus`, `tls_decrypt`,
* `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or
* `certificate`, without updating the entire configuration object. Returns an
* error if any collection of settings is not properly configured.
* `custom_certificate`, without updating the entire configuration object. Returns
* an error if any collection of settings is not properly configured.
*/
edit(
params: ConfigurationEditParams,
Expand Down Expand Up @@ -280,8 +280,7 @@ export interface BrowserIsolationSettingsParam {
}

/**
* @deprecated: Custom certificate settings for BYO-PKI. (deprecated and replaced
* by `certificate`)
* Custom certificate settings for BYO-PKI.
*/
export interface CustomCertificateSettings {
/**
Expand All @@ -303,8 +302,7 @@ export interface CustomCertificateSettings {
}

/**
* @deprecated: Custom certificate settings for BYO-PKI. (deprecated and replaced
* by `certificate`)
* Custom certificate settings for BYO-PKI.
*/
export interface CustomCertificateSettingsParam {
/**
Expand Down Expand Up @@ -390,14 +388,7 @@ export interface GatewayConfigurationSettings {
browser_isolation?: BrowserIsolationSettings;

/**
* Certificate settings for Gateway TLS interception. If not specified, the
* Cloudflare Root CA will be used.
*/
certificate?: GatewayConfigurationSettings.Certificate;

/**
* @deprecated: Custom certificate settings for BYO-PKI. (deprecated and replaced
* by `certificate`)
* Custom certificate settings for BYO-PKI.
*/
custom_certificate?: CustomCertificateSettings;

Expand All @@ -422,19 +413,6 @@ export interface GatewayConfigurationSettings {
tls_decrypt?: TLSSettings;
}

export namespace GatewayConfigurationSettings {
/**
* Certificate settings for Gateway TLS interception. If not specified, the
* Cloudflare Root CA will be used.
*/
export interface Certificate {
/**
* UUID of certificate to be used for interception.
*/
id: string;
}
}

/**
* account settings.
*/
Expand Down Expand Up @@ -465,14 +443,7 @@ export interface GatewayConfigurationSettingsParam {
browser_isolation?: BrowserIsolationSettingsParam;

/**
* Certificate settings for Gateway TLS interception. If not specified, the
* Cloudflare Root CA will be used.
*/
certificate?: GatewayConfigurationSettingsParam.Certificate;

/**
* @deprecated: Custom certificate settings for BYO-PKI. (deprecated and replaced
* by `certificate`)
* Custom certificate settings for BYO-PKI.
*/
custom_certificate?: CustomCertificateSettingsParam;

Expand All @@ -497,19 +468,6 @@ export interface GatewayConfigurationSettingsParam {
tls_decrypt?: TLSSettingsParam;
}

export namespace GatewayConfigurationSettingsParam {
/**
* Certificate settings for Gateway TLS interception. If not specified, the
* Cloudflare Root CA will be used.
*/
export interface Certificate {
/**
* UUID of certificate to be used for interception.
*/
id: string;
}
}

/**
* Configure a message to display on the user's device when an antivirus search is
* performed.
Expand Down
17 changes: 2 additions & 15 deletions src/resources/zero-trust/gateway/lists/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@ export class Lists extends APIResource {
params: ListListParams,
options?: Core.RequestOptions,
): Core.PagePromise<GatewayListsSinglePage, GatewayList> {
const { account_id, ...query } = params;
return this._client.getAPIList(`/accounts/${account_id}/gateway/lists`, GatewayListsSinglePage, {
query,
...options,
});
const { account_id } = params;
return this._client.getAPIList(`/accounts/${account_id}/gateway/lists`, GatewayListsSinglePage, options);
}

/**
Expand Down Expand Up @@ -106,8 +103,6 @@ export interface GatewayItem {
}

export interface GatewayItemParam {
created_at?: string;

/**
* The value of the item in a list.
*/
Expand Down Expand Up @@ -223,15 +218,7 @@ export interface ListUpdateParams {
}

export interface ListListParams {
/**
* Path param:
*/
account_id: string;

/**
* Query param: The type of list.
*/
type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP';
}

export interface ListDeleteParams {
Expand Down
34 changes: 10 additions & 24 deletions src/resources/zero-trust/gateway/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,6 @@ export interface RuleSetting {
*/
egress?: RuleSetting.Egress;

/**
* Set to true, to ignore the category matches at CNAME domains in a response. If
* unchecked, the categories in this rule will be checked against all the CNAME
* domain categories in a response.
*/
ignore_cname_category_matches?: boolean;

/**
* INSECURE - disable DNSSEC validation (for Allow actions).
*/
Expand Down Expand Up @@ -414,27 +407,27 @@ export namespace RuleSetting {
*/
export interface BisoAdminControls {
/**
* Set to false to enable copy-pasting.
* Set to true to enable copy-pasting.
*/
dcp?: boolean;

/**
* Set to false to enable downloading.
* Set to true to enable downloading.
*/
dd?: boolean;

/**
* Set to false to enable keyboard usage.
* Set to true to enable keyboard usage.
*/
dk?: boolean;

/**
* Set to false to enable printing.
* Set to true to enable printing.
*/
dp?: boolean;

/**
* Set to false to enable uploading.
* Set to true to enable uploading.
*/
du?: boolean;
}
Expand Down Expand Up @@ -610,13 +603,6 @@ export interface RuleSettingParam {
*/
egress?: RuleSettingParam.Egress;

/**
* Set to true, to ignore the category matches at CNAME domains in a response. If
* unchecked, the categories in this rule will be checked against all the CNAME
* domain categories in a response.
*/
ignore_cname_category_matches?: boolean;

/**
* INSECURE - disable DNSSEC validation (for Allow actions).
*/
Expand Down Expand Up @@ -689,27 +675,27 @@ export namespace RuleSettingParam {
*/
export interface BisoAdminControls {
/**
* Set to false to enable copy-pasting.
* Set to true to enable copy-pasting.
*/
dcp?: boolean;

/**
* Set to false to enable downloading.
* Set to true to enable downloading.
*/
dd?: boolean;

/**
* Set to false to enable keyboard usage.
* Set to true to enable keyboard usage.
*/
dk?: boolean;

/**
* Set to false to enable printing.
* Set to true to enable printing.
*/
dp?: boolean;

/**
* Set to false to enable uploading.
* Set to true to enable uploading.
*/
du?: boolean;
}
Expand Down
2 changes: 0 additions & 2 deletions tests/api-resources/zero-trust/gateway/configurations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ describe('resource configurations', () => {
},
body_scanning: { inspection_mode: 'deep' },
browser_isolation: { non_identity_enabled: true, url_browser_isolation_enabled: true },
certificate: { id: 'd1b364c5-1311-466e-a194-f0e943e0799f' },
custom_certificate: { enabled: true, id: 'd1b364c5-1311-466e-a194-f0e943e0799f' },
extended_email_matching: { enabled: true },
fips: { tls: true },
Expand Down Expand Up @@ -94,7 +93,6 @@ describe('resource configurations', () => {
},
body_scanning: { inspection_mode: 'deep' },
browser_isolation: { non_identity_enabled: true, url_browser_isolation_enabled: true },
certificate: { id: 'd1b364c5-1311-466e-a194-f0e943e0799f' },
custom_certificate: { enabled: true, id: 'd1b364c5-1311-466e-a194-f0e943e0799f' },
extended_email_matching: { enabled: true },
fips: { tls: true },
Expand Down
13 changes: 2 additions & 11 deletions tests/api-resources/zero-trust/gateway/lists/lists.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ describe('resource lists', () => {
name: 'Admin Serial Numbers',
type: 'SERIAL',
description: 'The serial numbers for administrators',
items: [
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
],
items: [{ value: '8GE8721REF' }, { value: '8GE8721REF' }, { value: '8GE8721REF' }],
});
});

Expand Down Expand Up @@ -77,7 +73,6 @@ describe('resource lists', () => {
test('list: required and optional params', async () => {
const response = await cloudflare.zeroTrust.gateway.lists.list({
account_id: '699d98642c564d2e855e9661899b7252',
type: 'SERIAL',
});
});

Expand Down Expand Up @@ -117,11 +112,7 @@ describe('resource lists', () => {
test('edit: required and optional params', async () => {
const response = await cloudflare.zeroTrust.gateway.lists.edit('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', {
account_id: '699d98642c564d2e855e9661899b7252',
append: [
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
{ created_at: '2014-01-01T05:20:00.12345Z', value: '8GE8721REF' },
],
append: [{ value: '8GE8721REF' }, { value: '8GE8721REF' }, { value: '8GE8721REF' }],
remove: ['8GE8721REF', '8GE8721REF', '8GE8721REF'],
});
});
Expand Down
2 changes: 0 additions & 2 deletions tests/api-resources/zero-trust/gateway/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ describe('resource rules', () => {
],
},
egress: { ipv4: '192.0.2.2', ipv4_fallback: '192.0.2.3', ipv6: '2001:DB8::/64' },
ignore_cname_category_matches: true,
insecure_disable_dnssec_validation: false,
ip_categories: true,
ip_indicator_feeds: true,
Expand Down Expand Up @@ -192,7 +191,6 @@ describe('resource rules', () => {
],
},
egress: { ipv4: '192.0.2.2', ipv4_fallback: '192.0.2.3', ipv6: '2001:DB8::/64' },
ignore_cname_category_matches: true,
insecure_disable_dnssec_validation: false,
ip_categories: true,
ip_indicator_feeds: true,
Expand Down

0 comments on commit 72a11c5

Please sign in to comment.