Skip to content

Commit

Permalink
feat: OpenAPI spec update via Stainless API (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Feb 16, 2024
1 parent 1a05881 commit 1df362c
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 304 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1147
configured_endpoints: 1146
8 changes: 0 additions & 8 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3415,14 +3415,6 @@ Methods:

## Traceroutes

Types:

- <code><a href="./src/resources/diagnostics/traceroutes.ts">TracerouteDiagnosticsTracerouteResponse</a></code>

Methods:

- <code title="post /accounts/{account_identifier}/diagnostics/traceroute">client.diagnostics.traceroutes.<a href="./src/resources/diagnostics/traceroutes.ts">diagnosticsTraceroute</a>(accountIdentifier, { ...params }) -> TracerouteDiagnosticsTracerouteResponse | null</code>

# DLPs

## Patterns
Expand Down
10 changes: 5 additions & 5 deletions src/resources/audit-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class AuditLogs extends APIResource {

export type AuditLogAuditLogsGetAccountAuditLogsResponse =
| AuditLogAuditLogsGetAccountAuditLogsResponse.UnionMember0
| AuditLogAuditLogsGetAccountAuditLogsResponse.L8Gbc7nLAPIResponseCommon;
| AuditLogAuditLogsGetAccountAuditLogsResponse.WWzvNeD7APIResponseCommon;

export namespace AuditLogAuditLogsGetAccountAuditLogsResponse {
export interface UnionMember0 {
Expand Down Expand Up @@ -145,10 +145,10 @@ export namespace AuditLogAuditLogsGetAccountAuditLogsResponse {
}
}

export interface L8Gbc7nLAPIResponseCommon {
errors: Array<L8Gbc7nLAPIResponseCommon.Error>;
export interface WWzvNeD7APIResponseCommon {
errors: Array<WWzvNeD7APIResponseCommon.Error>;

messages: Array<L8Gbc7nLAPIResponseCommon.Message>;
messages: Array<WWzvNeD7APIResponseCommon.Message>;

result: unknown | Array<unknown> | string;

Expand All @@ -158,7 +158,7 @@ export namespace AuditLogAuditLogsGetAccountAuditLogsResponse {
success: true;
}

export namespace L8Gbc7nLAPIResponseCommon {
export namespace WWzvNeD7APIResponseCommon {
export interface Error {
code: number;

Expand Down
2 changes: 0 additions & 2 deletions src/resources/diagnostics/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ export class Diagnostics extends APIResource {

export namespace Diagnostics {
export import Traceroutes = TraceroutesAPI.Traceroutes;
export import TracerouteDiagnosticsTracerouteResponse = TraceroutesAPI.TracerouteDiagnosticsTracerouteResponse;
export import TracerouteDiagnosticsTracerouteParams = TraceroutesAPI.TracerouteDiagnosticsTracerouteParams;
}
6 changes: 1 addition & 5 deletions src/resources/diagnostics/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
// File generated from our OpenAPI spec by Stainless.

export { Diagnostics } from './diagnostics';
export {
TracerouteDiagnosticsTracerouteResponse,
TracerouteDiagnosticsTracerouteParams,
Traceroutes,
} from './traceroutes';
export { Traceroutes } from './traceroutes';
197 changes: 1 addition & 196 deletions src/resources/diagnostics/traceroutes.ts
Original file line number Diff line number Diff line change
@@ -1,200 +1,5 @@
// File generated from our OpenAPI spec by Stainless.

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as TraceroutesAPI from 'cloudflare/resources/diagnostics/traceroutes';

export class Traceroutes extends APIResource {
/**
* Run traceroutes from Cloudflare colos.
*/
diagnosticsTraceroute(
accountIdentifier: string,
body: TracerouteDiagnosticsTracerouteParams,
options?: Core.RequestOptions,
): Core.APIPromise<TracerouteDiagnosticsTracerouteResponse | null> {
return (
this._client.post(`/accounts/${accountIdentifier}/diagnostics/traceroute`, {
body,
...options,
}) as Core.APIPromise<{ result: TracerouteDiagnosticsTracerouteResponse | null }>
)._thenUnwrap((obj) => obj.result);
}
}

export type TracerouteDiagnosticsTracerouteResponse =
Array<TracerouteDiagnosticsTracerouteResponse.TracerouteDiagnosticsTracerouteResponseItem>;

export namespace TracerouteDiagnosticsTracerouteResponse {
export interface TracerouteDiagnosticsTracerouteResponseItem {
colos?: Array<TracerouteDiagnosticsTracerouteResponseItem.Colo>;

/**
* The target hostname, IPv6, or IPv6 address.
*/
target?: string;
}

export namespace TracerouteDiagnosticsTracerouteResponseItem {
export interface Colo {
colo?: Colo.Colo;

/**
* Errors resulting from collecting traceroute from colo to target.
*/
error?:
| ''
| 'Could not gather traceroute data: Code 1'
| 'Could not gather traceroute data: Code 2'
| 'Could not gather traceroute data: Code 3'
| 'Could not gather traceroute data: Code 4';

hops?: Array<Colo.Hop>;

/**
* Aggregated statistics from all hops about the target.
*/
target_summary?: unknown;

/**
* Total time of traceroute in ms.
*/
traceroute_time_ms?: number;
}

export namespace Colo {
export interface Colo {
/**
* Source colo city.
*/
city?: string;

/**
* Source colo name.
*/
name?: string;
}

export interface Hop {
/**
* An array of node objects.
*/
nodes?: Array<Hop.Node>;

/**
* Number of packets where no response was received.
*/
packets_lost?: number;

/**
* Number of packets sent with specified TTL.
*/
packets_sent?: number;

/**
* The time to live (TTL).
*/
packets_ttl?: number;
}

export namespace Hop {
export interface Node {
/**
* AS number associated with the node object.
*/
asn?: string;

/**
* IP address of the node.
*/
ip?: string;

/**
* Field appears if there is an additional annotation printed when the probe
* returns. Field also appears when running a GRE+ICMP traceroute to denote which
* traceroute a node comes from.
*/
labels?: Array<string>;

/**
* Maximum RTT in ms.
*/
max_rtt_ms?: number;

/**
* Mean RTT in ms.
*/
mean_rtt_ms?: number;

/**
* Minimum RTT in ms.
*/
min_rtt_ms?: number;

/**
* Host name of the address, this may be the same as the IP address.
*/
name?: string;

/**
* Number of packets with a response from this node.
*/
packet_count?: number;

/**
* Standard deviation of the RTTs in ms.
*/
std_dev_rtt_ms?: number;
}
}
}
}
}

export interface TracerouteDiagnosticsTracerouteParams {
targets: Array<string>;

/**
* If no source colo names specified, all colos will be used. China colos are
* unavailable for traceroutes.
*/
colos?: Array<string>;

options?: TracerouteDiagnosticsTracerouteParams.Options;
}

export namespace TracerouteDiagnosticsTracerouteParams {
export interface Options {
/**
* Max TTL.
*/
max_ttl?: number;

/**
* Type of packet sent.
*/
packet_type?: 'icmp' | 'tcp' | 'udp' | 'gre' | 'gre+icmp';

/**
* Number of packets sent at each TTL.
*/
packets_per_ttl?: number;

/**
* For UDP and TCP, specifies the destination port. For ICMP, specifies the initial
* ICMP sequence value. Default value 0 will choose the best value to use for each
* protocol.
*/
port?: number;

/**
* Set the time (in seconds) to wait for a response to a probe.
*/
wait_time?: number;
}
}

export namespace Traceroutes {
export import TracerouteDiagnosticsTracerouteResponse = TraceroutesAPI.TracerouteDiagnosticsTracerouteResponse;
export import TracerouteDiagnosticsTracerouteParams = TraceroutesAPI.TracerouteDiagnosticsTracerouteParams;
}
export class Traceroutes extends APIResource {}
Loading

0 comments on commit 1df362c

Please sign in to comment.