Skip to content

Commit

Permalink
feat: OpenAPI spec update via Stainless API (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Feb 21, 2024
1 parent 7120686 commit 1a9ffb0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 135 deletions.
24 changes: 6 additions & 18 deletions src/resources/magics/gre-tunnels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ export namespace GreTunnelCreateResponse {
* The direction of the flow of the healthcheck. Either unidirectional, where the
* probe comes to you via the tunnel and the result comes back to Cloudflare via
* the open Internet, or bidirectional where both the probe and result come and go
* via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
* in health_check is ignored as the interface_address is used to send traffic into
* the tunnel.
* via the tunnel.
*/
direction?: 'unidirectional' | 'bidirectional';

Expand All @@ -173,9 +171,7 @@ export namespace GreTunnelCreateResponse {
/**
* The destination address in a request type health check. After the healthcheck is
* decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
* to this address. This field defaults to `customer_gre_endpoint address`. This
* field is ignored for bidirectional healthchecks as the interface_address (not
* assigned to the Cloudflare side of the tunnel) is used as the target.
* to this address. This field defaults to `customer_gre_endpoint address`.
*/
target?: string;

Expand Down Expand Up @@ -262,9 +258,7 @@ export namespace GreTunnelListResponse {
* The direction of the flow of the healthcheck. Either unidirectional, where the
* probe comes to you via the tunnel and the result comes back to Cloudflare via
* the open Internet, or bidirectional where both the probe and result come and go
* via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
* in health_check is ignored as the interface_address is used to send traffic into
* the tunnel.
* via the tunnel.
*/
direction?: 'unidirectional' | 'bidirectional';

Expand All @@ -281,9 +275,7 @@ export namespace GreTunnelListResponse {
/**
* The destination address in a request type health check. After the healthcheck is
* decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
* to this address. This field defaults to `customer_gre_endpoint address`. This
* field is ignored for bidirectional healthchecks as the interface_address (not
* assigned to the Cloudflare side of the tunnel) is used as the target.
* to this address. This field defaults to `customer_gre_endpoint address`.
*/
target?: string;

Expand Down Expand Up @@ -356,9 +348,7 @@ export namespace GreTunnelUpdateParams {
* The direction of the flow of the healthcheck. Either unidirectional, where the
* probe comes to you via the tunnel and the result comes back to Cloudflare via
* the open Internet, or bidirectional where both the probe and result come and go
* via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
* in health_check is ignored as the interface_address is used to send traffic into
* the tunnel.
* via the tunnel.
*/
direction?: 'unidirectional' | 'bidirectional';

Expand All @@ -375,9 +365,7 @@ export namespace GreTunnelUpdateParams {
/**
* The destination address in a request type health check. After the healthcheck is
* decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
* to this address. This field defaults to `customer_gre_endpoint address`. This
* field is ignored for bidirectional healthchecks as the interface_address (not
* assigned to the Cloudflare side of the tunnel) is used as the target.
* to this address. This field defaults to `customer_gre_endpoint address`.
*/
target?: string;

Expand Down
80 changes: 0 additions & 80 deletions src/resources/magics/ipsec-tunnels/ipsec-tunnels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,6 @@ export interface IpsecTunnelCreateParams {
*/
description?: string;

health_check?: IpsecTunnelCreateParams.HealthCheck;

/**
* A randomly generated or provided string for use in the IPsec tunnel.
*/
Expand All @@ -359,44 +357,6 @@ export interface IpsecTunnelCreateParams {
replay_protection?: boolean;
}

export namespace IpsecTunnelCreateParams {
export interface HealthCheck {
/**
* The direction of the flow of the healthcheck. Either unidirectional, where the
* probe comes to you via the tunnel and the result comes back to Cloudflare via
* the open Internet, or bidirectional where both the probe and result come and go
* via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
* in health_check is ignored as the interface_address is used to send traffic into
* the tunnel.
*/
direction?: 'unidirectional' | 'bidirectional';

/**
* Determines whether to run healthchecks for a tunnel.
*/
enabled?: boolean;

/**
* How frequent the health check is run. The default value is `mid`.
*/
rate?: 'low' | 'mid' | 'high';

/**
* The destination address in a request type health check. After the healthcheck is
* decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
* to this address. This field defaults to `customer_gre_endpoint address`. This
* field is ignored for bidirectional healthchecks as the interface_address (not
* assigned to the Cloudflare side of the tunnel) is used as the target.
*/
target?: string;

/**
* The type of healthcheck to run, reply or request. The default value is `reply`.
*/
type?: 'reply' | 'request';
}
}

export interface IpsecTunnelUpdateParams {
/**
* The IP address assigned to the Cloudflare side of the IPsec tunnel.
Expand Down Expand Up @@ -425,8 +385,6 @@ export interface IpsecTunnelUpdateParams {
*/
description?: string;

health_check?: IpsecTunnelUpdateParams.HealthCheck;

/**
* A randomly generated or provided string for use in the IPsec tunnel.
*/
Expand All @@ -439,44 +397,6 @@ export interface IpsecTunnelUpdateParams {
replay_protection?: boolean;
}

export namespace IpsecTunnelUpdateParams {
export interface HealthCheck {
/**
* The direction of the flow of the healthcheck. Either unidirectional, where the
* probe comes to you via the tunnel and the result comes back to Cloudflare via
* the open Internet, or bidirectional where both the probe and result come and go
* via the tunnel. Note in the case of bidirecitonal healthchecks, the target field
* in health_check is ignored as the interface_address is used to send traffic into
* the tunnel.
*/
direction?: 'unidirectional' | 'bidirectional';

/**
* Determines whether to run healthchecks for a tunnel.
*/
enabled?: boolean;

/**
* How frequent the health check is run. The default value is `mid`.
*/
rate?: 'low' | 'mid' | 'high';

/**
* The destination address in a request type health check. After the healthcheck is
* decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded
* to this address. This field defaults to `customer_gre_endpoint address`. This
* field is ignored for bidirectional healthchecks as the interface_address (not
* assigned to the Cloudflare side of the tunnel) is used as the target.
*/
target?: string;

/**
* The type of healthcheck to run, reply or request. The default value is `reply`.
*/
type?: 'reply' | 'request';
}
}

export namespace IpsecTunnels {
export import IpsecTunnelCreateResponse = IpsecTunnelsAPI.IpsecTunnelCreateResponse;
export import IpsecTunnelUpdateResponse = IpsecTunnelsAPI.IpsecTunnelUpdateResponse;
Expand Down
46 changes: 23 additions & 23 deletions src/resources/pcaps/pcaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ export class Pcaps extends APIResource {
}

export type PcapCreateResponse =
| PcapCreateResponse._7WjqRy2XPcapsResponseSimple
| PcapCreateResponse._7WjqRy2XPcapsResponseFull;
| PcapCreateResponse.BvwDlDzxPcapsResponseSimple
| PcapCreateResponse.BvwDlDzxPcapsResponseFull;

export namespace PcapCreateResponse {
export interface _7WjqRy2XPcapsResponseSimple {
export interface BvwDlDzxPcapsResponseSimple {
/**
* The ID for the packet capture.
*/
Expand All @@ -66,7 +66,7 @@ export namespace PcapCreateResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: _7WjqRy2XPcapsResponseSimple.FilterV1;
filter_v1?: BvwDlDzxPcapsResponseSimple.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -103,7 +103,7 @@ export namespace PcapCreateResponse {
type?: 'simple' | 'full';
}

export namespace _7WjqRy2XPcapsResponseSimple {
export namespace BvwDlDzxPcapsResponseSimple {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -135,7 +135,7 @@ export namespace PcapCreateResponse {
}
}

export interface _7WjqRy2XPcapsResponseFull {
export interface BvwDlDzxPcapsResponseFull {
/**
* The ID for the packet capture.
*/
Expand Down Expand Up @@ -168,7 +168,7 @@ export namespace PcapCreateResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: _7WjqRy2XPcapsResponseFull.FilterV1;
filter_v1?: BvwDlDzxPcapsResponseFull.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -205,7 +205,7 @@ export namespace PcapCreateResponse {
type?: 'simple' | 'full';
}

export namespace _7WjqRy2XPcapsResponseFull {
export namespace BvwDlDzxPcapsResponseFull {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -239,11 +239,11 @@ export namespace PcapCreateResponse {
}

export type PcapListResponse = Array<
PcapListResponse._7WjqRy2XPcapsResponseSimple | PcapListResponse._7WjqRy2XPcapsResponseFull
PcapListResponse.BvwDlDzxPcapsResponseSimple | PcapListResponse.BvwDlDzxPcapsResponseFull
>;

export namespace PcapListResponse {
export interface _7WjqRy2XPcapsResponseSimple {
export interface BvwDlDzxPcapsResponseSimple {
/**
* The ID for the packet capture.
*/
Expand All @@ -252,7 +252,7 @@ export namespace PcapListResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: _7WjqRy2XPcapsResponseSimple.FilterV1;
filter_v1?: BvwDlDzxPcapsResponseSimple.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -289,7 +289,7 @@ export namespace PcapListResponse {
type?: 'simple' | 'full';
}

export namespace _7WjqRy2XPcapsResponseSimple {
export namespace BvwDlDzxPcapsResponseSimple {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -321,7 +321,7 @@ export namespace PcapListResponse {
}
}

export interface _7WjqRy2XPcapsResponseFull {
export interface BvwDlDzxPcapsResponseFull {
/**
* The ID for the packet capture.
*/
Expand Down Expand Up @@ -354,7 +354,7 @@ export namespace PcapListResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: _7WjqRy2XPcapsResponseFull.FilterV1;
filter_v1?: BvwDlDzxPcapsResponseFull.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -391,7 +391,7 @@ export namespace PcapListResponse {
type?: 'simple' | 'full';
}

export namespace _7WjqRy2XPcapsResponseFull {
export namespace BvwDlDzxPcapsResponseFull {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -425,11 +425,11 @@ export namespace PcapListResponse {
}

export type PcapGetResponse =
| PcapGetResponse._7WjqRy2XPcapsResponseSimple
| PcapGetResponse._7WjqRy2XPcapsResponseFull;
| PcapGetResponse.BvwDlDzxPcapsResponseSimple
| PcapGetResponse.BvwDlDzxPcapsResponseFull;

export namespace PcapGetResponse {
export interface _7WjqRy2XPcapsResponseSimple {
export interface BvwDlDzxPcapsResponseSimple {
/**
* The ID for the packet capture.
*/
Expand All @@ -438,7 +438,7 @@ export namespace PcapGetResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: _7WjqRy2XPcapsResponseSimple.FilterV1;
filter_v1?: BvwDlDzxPcapsResponseSimple.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -475,7 +475,7 @@ export namespace PcapGetResponse {
type?: 'simple' | 'full';
}

export namespace _7WjqRy2XPcapsResponseSimple {
export namespace BvwDlDzxPcapsResponseSimple {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down Expand Up @@ -507,7 +507,7 @@ export namespace PcapGetResponse {
}
}

export interface _7WjqRy2XPcapsResponseFull {
export interface BvwDlDzxPcapsResponseFull {
/**
* The ID for the packet capture.
*/
Expand Down Expand Up @@ -540,7 +540,7 @@ export namespace PcapGetResponse {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
filter_v1?: _7WjqRy2XPcapsResponseFull.FilterV1;
filter_v1?: BvwDlDzxPcapsResponseFull.FilterV1;

/**
* The status of the packet capture request.
Expand Down Expand Up @@ -577,7 +577,7 @@ export namespace PcapGetResponse {
type?: 'simple' | 'full';
}

export namespace _7WjqRy2XPcapsResponseFull {
export namespace BvwDlDzxPcapsResponseFull {
/**
* The packet capture filter. When this field is empty, all packets are captured.
*/
Expand Down
14 changes: 0 additions & 14 deletions tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ describe('resource ipsecTunnels', () => {
name: 'IPsec_1',
customer_endpoint: '203.0.113.1',
description: 'Tunnel for ISP X',
health_check: {
direction: 'bidirectional',
enabled: true,
rate: 'low',
target: '203.0.113.1',
type: 'request',
},
psk: 'O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy',
replay_protection: false,
});
Expand Down Expand Up @@ -76,13 +69,6 @@ describe('resource ipsecTunnels', () => {
name: 'IPsec_1',
customer_endpoint: '203.0.113.1',
description: 'Tunnel for ISP X',
health_check: {
direction: 'bidirectional',
enabled: true,
rate: 'low',
target: '203.0.113.1',
type: 'request',
},
psk: 'O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy',
replay_protection: false,
},
Expand Down

0 comments on commit 1a9ffb0

Please sign in to comment.