Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Mar 18, 2024
1 parent 2b12235 commit 89051a6
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 237 deletions.
81 changes: 48 additions & 33 deletions src/resources/dns/records.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14426,22 +14426,11 @@ export interface RecordCreateParams {
*/
zone_id: string;

/**
* Body param:
*/
data: RecordCreateParams.Data;

/**
* Body param: DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;

/**
* Body param: Required for MX, SRV and URI records; unused by other record types.
* Records with lower priorities are preferred.
*/
priority: number;

/**
* Body param: Record type.
*/
Expand Down Expand Up @@ -14473,11 +14462,27 @@ export interface RecordCreateParams {
*/
comment?: string;

/**
* Body param: Formatted URI content. See 'data' to set URI properties.
*/
content?: unknown;

/**
* Body param:
*/
data?: RecordCreateParams.Data;

/**
* Body param:
*/
meta?: RecordCreateParams.Meta;

/**
* Body param: Required for MX, SRV and URI records; unused by other record types.
* Records with lower priorities are preferred.
*/
priority?: number;

/**
* Body param: Whether the record is receiving the performance and security
* benefits of Cloudflare.
Expand Down Expand Up @@ -14722,22 +14727,11 @@ export interface RecordUpdateParams {
*/
zone_id: string;

/**
* Body param:
*/
data: RecordUpdateParams.Data;

/**
* Body param: DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;

/**
* Body param: Required for MX, SRV and URI records; unused by other record types.
* Records with lower priorities are preferred.
*/
priority: number;

/**
* Body param: Record type.
*/
Expand Down Expand Up @@ -14769,11 +14763,27 @@ export interface RecordUpdateParams {
*/
comment?: string;

/**
* Body param: Formatted URI content. See 'data' to set URI properties.
*/
content?: unknown;

/**
* Body param:
*/
data?: RecordUpdateParams.Data;

/**
* Body param:
*/
meta?: RecordUpdateParams.Meta;

/**
* Body param: Required for MX, SRV and URI records; unused by other record types.
* Records with lower priorities are preferred.
*/
priority?: number;

/**
* Body param: Whether the record is receiving the performance and security
* benefits of Cloudflare.
Expand Down Expand Up @@ -15195,22 +15205,11 @@ export interface RecordEditParams {
*/
zone_id: string;

/**
* Body param:
*/
data: RecordEditParams.Data;

/**
* Body param: DNS record name (or @ for the zone apex) in Punycode.
*/
name: string;

/**
* Body param: Required for MX, SRV and URI records; unused by other record types.
* Records with lower priorities are preferred.
*/
priority: number;

/**
* Body param: Record type.
*/
Expand Down Expand Up @@ -15242,11 +15241,27 @@ export interface RecordEditParams {
*/
comment?: string;

/**
* Body param: Formatted URI content. See 'data' to set URI properties.
*/
content?: unknown;

/**
* Body param:
*/
data?: RecordEditParams.Data;

/**
* Body param:
*/
meta?: RecordEditParams.Meta;

/**
* Body param: Required for MX, SRV and URI records; unused by other record types.
* Records with lower priorities are preferred.
*/
priority?: number;

/**
* Body param: Whether the record is receiving the performance and security
* benefits of Cloudflare.
Expand Down
36 changes: 18 additions & 18 deletions src/resources/pcaps/pcaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,24 +615,6 @@ export interface PCAPCreateParams {
*/
account_id: string;

/**
* Body param: The name of the data center used for the packet capture. This can be
* a specific colo (ord02) or a multi-colo name (ORD). This field only applies to
* `full` packet captures.
*/
colo_name: string;

/**
* Body param: The full URI for the bucket. This field only applies to `full`
* packet captures.
*/
destination_conf: string;

/**
* Body param: The limit of packets contained in a packet capture.
*/
packet_limit: number;

/**
* Body param: The system used to collect packet captures.
*/
Expand All @@ -655,10 +637,28 @@ export interface PCAPCreateParams {
*/
byte_limit?: number;

/**
* Body param: The name of the data center used for the packet capture. This can be
* a specific colo (ord02) or a multi-colo name (ORD). This field only applies to
* `full` packet captures.
*/
colo_name?: string;

/**
* Body param: The full URI for the bucket. This field only applies to `full`
* packet captures.
*/
destination_conf?: string;

/**
* Body param:
*/
filter_v1?: PCAPCreateParams.FilterV1;

/**
* Body param: The limit of packets contained in a packet capture.
*/
packet_limit?: number;
}

export namespace PCAPCreateParams {
Expand Down
40 changes: 20 additions & 20 deletions src/resources/zero-trust/access/applications/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1229,16 +1229,6 @@ export interface ApplicationDeleteResponse {
export type ApplicationRevokeTokensResponse = unknown;

export interface ApplicationCreateParams {
/**
* Body param: The URL or domain of the bookmark.
*/
domain: unknown;

/**
* Body param: The application type.
*/
type: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso';

/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
Expand Down Expand Up @@ -1305,6 +1295,11 @@ export interface ApplicationCreateParams {
*/
custom_pages?: Array<string>;

/**
* Body param: The URL or domain of the bookmark.
*/
domain?: unknown;

/**
* Body param: Enables the binding cookie, which increases security against
* compromised authorization tokens and CSRF attacks.
Expand Down Expand Up @@ -1372,6 +1367,11 @@ export interface ApplicationCreateParams {
* filter applications in the App Launcher dashboard.
*/
tags?: Array<string>;

/**
* Body param: The application type.
*/
type?: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso';
}

export namespace ApplicationCreateParams {
Expand Down Expand Up @@ -1554,16 +1554,6 @@ export namespace ApplicationCreateParams {
}

export interface ApplicationUpdateParams {
/**
* Body param: The URL or domain of the bookmark.
*/
domain: unknown;

/**
* Body param: The application type.
*/
type: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso';

/**
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
Expand Down Expand Up @@ -1630,6 +1620,11 @@ export interface ApplicationUpdateParams {
*/
custom_pages?: Array<string>;

/**
* Body param: The URL or domain of the bookmark.
*/
domain?: unknown;

/**
* Body param: Enables the binding cookie, which increases security against
* compromised authorization tokens and CSRF attacks.
Expand Down Expand Up @@ -1697,6 +1692,11 @@ export interface ApplicationUpdateParams {
* filter applications in the App Launcher dashboard.
*/
tags?: Array<string>;

/**
* Body param: The application type.
*/
type?: 'self_hosted' | 'saas' | 'ssh' | 'vnc' | 'app_launcher' | 'warp' | 'biso' | 'bookmark' | 'dash_sso';
}

export namespace ApplicationUpdateParams {
Expand Down
33 changes: 15 additions & 18 deletions tests/api-resources/dns/records.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ describe('resource records', () => {
test.skip('create: only required params', async () => {
const responsePromise = cloudflare.dns.records.create({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
data: {},
name: 'example.com',
priority: 10,
type: 'URI',
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -32,6 +30,10 @@ describe('resource records', () => {
test.skip('create: required and optional params', async () => {
const response = await cloudflare.dns.records.create({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
name: 'example.com',
type: 'URI',
comment: 'Domain verification record',
content: {},
data: {
flags: {},
tag: 'issue',
Expand Down Expand Up @@ -73,11 +75,8 @@ describe('resource records', () => {
fingerprint: 'string',
content: 'http://example.com/example.html',
},
name: 'example.com',
priority: 10,
type: 'URI',
comment: 'Domain verification record',
meta: { auto_added: true, source: 'primary' },
priority: 10,
proxied: false,
tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'],
ttl: 3600,
Expand All @@ -88,9 +87,7 @@ describe('resource records', () => {
test.skip('update: only required params', async () => {
const responsePromise = cloudflare.dns.records.update('023e105f4ecef8ad9ca31a8372d0c353', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
data: {},
name: 'example.com',
priority: 10,
type: 'URI',
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -106,6 +103,10 @@ describe('resource records', () => {
test.skip('update: required and optional params', async () => {
const response = await cloudflare.dns.records.update('023e105f4ecef8ad9ca31a8372d0c353', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
name: 'example.com',
type: 'URI',
comment: 'Domain verification record',
content: {},
data: {
flags: {},
tag: 'issue',
Expand Down Expand Up @@ -147,11 +148,8 @@ describe('resource records', () => {
fingerprint: 'string',
content: 'http://example.com/example.html',
},
name: 'example.com',
priority: 10,
type: 'URI',
comment: 'Domain verification record',
meta: { auto_added: true, source: 'primary' },
priority: 10,
proxied: false,
tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'],
ttl: 3600,
Expand Down Expand Up @@ -229,9 +227,7 @@ describe('resource records', () => {
test.skip('edit: only required params', async () => {
const responsePromise = cloudflare.dns.records.edit('023e105f4ecef8ad9ca31a8372d0c353', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
data: {},
name: 'example.com',
priority: 10,
type: 'URI',
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -247,6 +243,10 @@ describe('resource records', () => {
test.skip('edit: required and optional params', async () => {
const response = await cloudflare.dns.records.edit('023e105f4ecef8ad9ca31a8372d0c353', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
name: 'example.com',
type: 'URI',
comment: 'Domain verification record',
content: {},
data: {
flags: {},
tag: 'issue',
Expand Down Expand Up @@ -288,11 +288,8 @@ describe('resource records', () => {
fingerprint: 'string',
content: 'http://example.com/example.html',
},
name: 'example.com',
priority: 10,
type: 'URI',
comment: 'Domain verification record',
meta: { auto_added: true, source: 'primary' },
priority: 10,
proxied: false,
tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'],
ttl: 3600,
Expand Down
Loading

0 comments on commit 89051a6

Please sign in to comment.