From 1a9ffb0cb01f229633c5648d39e3cfa0985d7b2d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:35:40 +0000 Subject: [PATCH] feat: OpenAPI spec update via Stainless API (#54) --- src/resources/magics/gre-tunnels.ts | 24 ++---- .../magics/ipsec-tunnels/ipsec-tunnels.ts | 80 ------------------- src/resources/pcaps/pcaps.ts | 46 +++++------ .../ipsec-tunnels/ipsec-tunnels.test.ts | 14 ---- 4 files changed, 29 insertions(+), 135 deletions(-) diff --git a/src/resources/magics/gre-tunnels.ts b/src/resources/magics/gre-tunnels.ts index 6baa11fe68..de3f162c45 100644 --- a/src/resources/magics/gre-tunnels.ts +++ b/src/resources/magics/gre-tunnels.ts @@ -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'; @@ -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; @@ -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'; @@ -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; @@ -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'; @@ -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; diff --git a/src/resources/magics/ipsec-tunnels/ipsec-tunnels.ts b/src/resources/magics/ipsec-tunnels/ipsec-tunnels.ts index b16fdad8be..f497c52903 100644 --- a/src/resources/magics/ipsec-tunnels/ipsec-tunnels.ts +++ b/src/resources/magics/ipsec-tunnels/ipsec-tunnels.ts @@ -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. */ @@ -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. @@ -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. */ @@ -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; diff --git a/src/resources/pcaps/pcaps.ts b/src/resources/pcaps/pcaps.ts index 8b9507eb5a..c99dfe18a7 100644 --- a/src/resources/pcaps/pcaps.ts +++ b/src/resources/pcaps/pcaps.ts @@ -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. */ @@ -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. @@ -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. */ @@ -135,7 +135,7 @@ export namespace PcapCreateResponse { } } - export interface _7WjqRy2XPcapsResponseFull { + export interface BvwDlDzxPcapsResponseFull { /** * The ID for the packet capture. */ @@ -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. @@ -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. */ @@ -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. */ @@ -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. @@ -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. */ @@ -321,7 +321,7 @@ export namespace PcapListResponse { } } - export interface _7WjqRy2XPcapsResponseFull { + export interface BvwDlDzxPcapsResponseFull { /** * The ID for the packet capture. */ @@ -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. @@ -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. */ @@ -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. */ @@ -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. @@ -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. */ @@ -507,7 +507,7 @@ export namespace PcapGetResponse { } } - export interface _7WjqRy2XPcapsResponseFull { + export interface BvwDlDzxPcapsResponseFull { /** * The ID for the packet capture. */ @@ -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. @@ -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. */ diff --git a/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts b/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts index 0d95dd643f..1a748f2460 100644 --- a/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts +++ b/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts @@ -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, }); @@ -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, },